• Resolved julesmd

    (@julesmd)


    Hi Michael,

    This is a follow on question regarding the help you gave me searching between 2 dates (start_end_wrapper shortcode). Thank you for adding the code to retain the search values on submit. It works really well and with the datepicker too.
    Using ‘filter’ I can search on, and display, the other fields I need in addition to the start and end dates which is just what I needed. However, I cannot get any of the data to display using cfdb-html, only with cfdb-table. I need to use html in order to display images and use ‘submit-time’.
    I cannot find any reason why this should be so, unless the shortcode=”” constraint only works for cfdb-table. Here is the code using cfdb-table:

    <title>jQuery UI Datepicker - Default functionality</title>
      <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
      <script src="//code.jquery.com/jquery-1.10.2.js"></script>
      <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
      <link rel="stylesheet" href="/resources/demos/style.css">
    
    <script>
      $(function() {
        $('input.datepicker').datepicker({ dateFormat: 'dd-mm-yy' });
      });
      </script>
    
    <form action="" method="POST">
    Start: <input class="datepicker" name="start" type="text" value="[echo_post_var var='start']"/>
    End: <input class="datepicker" name="end" type="text" value="[echo_post_var var='end']"/>
    Country: <input name="country" type="text" />
    <input type="submit" /></form>
    
    [start_end_wrapper shortcode="cfdb-table" form="Sign Up" show="Country,start,end" filter="Country~~/.*$_POST(country).*/i"]'
    
    Here's the code using cfdb-html:

    [start_end_wrapper shortcode=”cfdb-html” form=”Sign Up” show=”Country,City,AccommType,start,end,Event,Interests,MainImage,submit_time” filelinks=”url” role=”Anyone” filter=”Country~~/.*$_POST(country).*/i&&City~~/.*$_POST(city).*/i&&AccommType~~/.*$_POST(accommtype).*/i&&Event~~/.*$_POST(event).*/i&&Interests~~/.*$_POST(interests).*/i”]
    <table>
    <tbody>
    <thead>
    <th></th>
    <th>Country</th>
    <th>City</th>
    <th>Accommodation</th>
    <th>Available</th>
    <th>Specific Event</th>
    <th>Interests</th>
    <th></th>
    </tr>
    <tr><td><img style=”width: 100px; height: 100px; border: 0;” src=”${MainImage}” alt=”” /></td>
    <td>${Country}</td>
    <td>${City}</td>
    <td>${AccommType}</td>
    <td>From: ${start}
    To: ${end}</td>
    <td>${Event}</td>
    <td>${Interests}</td>
    <td><img src=”http://freestayexchange.com/wp-content/uploads/2014/12/details_button.png&#8221; alt=”” /></td>
    </tr>
    </thead>
    </tbody>
    </table>
    <hr />`
    Please can you tell me if the code you wrote for the date search will only work with cfdb-table, and if not where am I going wrong.
    Many thanks
    Julie

    https://ww.wp.xz.cn/plugins/contact-form-7-to-database-extension/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter julesmd

    (@julesmd)

    Sorry, that was a mess. Here’s the html code again:

    [start_end_wrapper shortcode="cfdb-html" form="Sign Up" show="Country,City,AccommType,start,end,Event,Interests,MainImage,submit_time" filelinks="url" role="Anyone" filter="Country~~/.*$_POST(country).*/i&&City~~/.*$_POST(city).*/i&&AccommType~~/.*$_POST(accommtype).*/i&&Event~~/.*$_POST(event).*/i&&Interests~~/.*$_POST(interests).*/i"]
    <table>
    <tbody>
    <thead>
    <th></th>
    <th>Country</th>
    <th>City</th>
    <th>Accommodation</th>
    <th>Available</th>
    <th>Specific Event</th>
    <th>Interests</th>
    <th></th>
    </tr>
    <tr><td><img style="width: 100px; height: 100px; border: 0;" src="${MainImage}" alt="" /></td>
    <td>${Country}</td>
    <td>${City}</td>
    <td>${AccommType}</td>
    <td>From: ${start}
    To: ${end}</td>
    <td>${Event}</td>
    <td>${Interests}</td>
    <td><img src="http://freestayexchange.com/wp-content/uploads/2014/12/details_button.png" alt="" /></td>
    </tr>
    </thead>
    </tbody>
    </table>
    <hr />

    Please can you tell me if the code you wrote for the date search will only work with cfdb-table, and if not where am I going wrong.
    Many thanks
    Julie

    Plugin Author Michael Simpson

    (@msimpson)

    You need [/start_end_wrapper] at the end and your table HTML is messed up (can’t have thead inside tbody plus mismatched tags….). And use {{BEFORE}} and {{AFTER}} in cfdb-html to make it one table instead of repeating the table.

    Try this:

    [start_end_wrapper shortcode="cfdb-html" form="Sign Up" show="Country,City,AccommType,start,end,Event,Interests,MainImage,submit_time" filelinks="url" role="Anyone" filter="Country~~/.*$_POST(country).*/i&&City~~/.*$_POST(city).*/i&&AccommType~~/.*$_POST(accommtype).*/i&&Event~~/.*$_POST(event).*/i&&Interests~~/.*$_POST(interests).*/i"]
    {{BEFORE}}
    <table>
        <thead>
        <tr>
            <th></th>
            <th>Country</th>
            <th>City</th>
            <th>Accommodation</th>
            <th>Available</th>
            <th>Specific Event</th>
            <th>Interests</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
    {{/BEFORE}}
        <tr>
            <td><img style="width: 100px; height: 100px; border: 0;" src="${MainImage}" alt=""/></td>
            <td>${Country}</td>
            <td>${City}</td>
            <td>${AccommType}</td>
            <td>From: ${start} To: ${end}
            </td>
            <td>${Event}</td>
            <td>${Interests}</td>
            <td><img src="http://freestayexchange.com/wp-content/uploads/2014/12/details_button.png" alt=""/></td>
        </tr>
    {{AFTER}}
        </tbody>
    </table>
    {{/AFTER}}
    [/start_end_wrapper]

    Thread Starter julesmd

    (@julesmd)

    Michael,
    It works a treat! Means it can go out to testers now and with a few minor tweaks hopefully go live very soon. Thank you for all your time and a wonderful plugin. Will give you a credit on the website and donation once pennies start rolling in.
    Have a good weekend
    Julie

    Thread Starter julesmd

    (@julesmd)

    Sorry! Marked as resolved

    Dear Sir,

    I write following code in my wordpress page but its display only code not result from Contact from 7 DB. Could you please help me its kind of urgent.

    [start_end_wrapper shortcode=”cfdb-html” form=”Add Details” show=”your-name,FatherName,surname” role=”Anyone”]
    {{BEFORE}}
    <table>
    <thead>
    <tr>
    <th></th>
    <th>Name</th>
    <th>Father Name</th>
    <th>Surname</th>
    <th></th>
    </tr>
    </thead>
    <tbody>
    {{/BEFORE}}
    <tr>
    <td></td>
    <td>${your-name}</td>
    <td>${FatherName}</td>
    <td>${surname}</td>
    <td>From: ${start} To: ${end}
    </td>
    <td>${Event}</td>
    <td>${Interests}</td>
    <td><img src=”http://freestayexchange.com/wp-content/uploads/2014/12/details_button.png&#8221; alt=””/></td>
    </tr>
    {{AFTER}}
    </tbody>
    </table>
    {{/AFTER}}
    [/start_end_wrapper]

    Plugin Author Michael Simpson

    (@msimpson)

    Be sure that your WordPress editor is in text mode instead of Visual mode, then paste

    http://abotibrahaman.templefinder.in/member-detail

    Its shows coding in this page instead of record from contact form 7 db, I want to show it on page but it also I add same to same code.

    Actually I want to display record on front page in wordpress from contact form 7 DB.

    I also tried this,

    [cfdb-table form=”Add Details” show=”your-name,FatherName,surname” role=”everyone” permissionmsg=”true”]

    But front side it show I need to have permission to get the records.

    I have already past it in Text mode still same problem.. 🙁

    Plugin Author Michael Simpson

    (@msimpson)

    I don’t know. Be sure the plugin is activated.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘cfdb-html or cfdb-table with custom shortcode?’ is closed to new replies.