Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • UP!
    I still get a lot of Javascript errors in the console due to the bad behavior of the Facebook Like button.

    Example

    Unsafe JavaScript attempt to access frame with URL
    http://www.yoursite.com/
    from frame with URL
    http://www.facebook.com/plugins/like.php?channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D11%23cb%3Df51707e84%26origin%3Dhttp%253A%252F%252Fwww.yoursite.com%252Ff3f60f759c%26domain%3Dwww.yoursite.com%26relation%3Dparent.parent&extended_social_context=false&href=http%3A%2F%2Fwww.yoursite.com%2Fexample-page%2F&layout=button_count&locale=en_US&node_type=link&sdk=joey&send=false&show_faces=false&width=90.
    Domains, protocols and ports must match.

    Any other possible solution???

    Forum: Plugins
    In reply to: cformsII php mysql help!
    Thread Starter nihil.core

    (@nihilcore)

    hi mediatory,

    sorry my late reply…
    i’m confident you solved the problem on your own, anyway to answer your question you just have to dump the ‘wp_cformsdata’ table and then look at the sub_id value of the form you are interested to get the value from.

    if your DB runs on phpmyadmin you can find an “Export” icon in the menu on top!
    i hope this could help 🙂

    bye

    Forum: Plugins
    In reply to: cformsII php mysql help!
    Thread Starter nihil.core

    (@nihilcore)

    in the end i did it myself!
    i’ll post the code just in case it can be helpful for someone else:

    <?php
    if ( is_single('240')) {
    
    $max = $wpdb->get_var( "SELECT field_val FROM $wpdb->cformsdata WHERE field_name = 'Indica un numero massimo di studenti' AND sub_id = '12' " );
    echo '<span style="float:left;">Maximum number of submissions:<b> ' . $max . '</b></span>';
    
    $registrations = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->cformssubmissions WHERE form_id = '3' " );
    
    $seats = $max - $registrations;
    echo '<br><span style="float:left;">Seats left:<b> ' . $seats . '</b></span>';
    } ?>

    where:
    is_single(‘240’) is the ID of the post
    ‘Indica un numero massimo di studenti’ (in english = Set the maximum number of students) is the field name of the field in the form that the teachers use to propose lessons to select how many students can register to the lesson
    sub_id = ’12’ is the ID where the data of the “teacher’s form” has been stored in the DB (to find this number you have to enter your phpmyadmin, go to the ‘wp_cformsdata’ table and then print or export your ‘sub_id’ – DO THIS ONLY IF YOU KNOW WHAT YOU’RE DOING!)
    form_id = ‘3’ is the ID of the form that the students are using to register to the lesson (you can find this one by entering your phpmyadmin, going to the ‘wp_cformssubmissions’ table and then to form_id – DO THIS ONLY IF YOU KNOW WHAT YOU’RE DOING!)
    › in the end there is the easy math and the printing of the value of the variable!

    i’ve put everything into an if construct because i have a different form for each post, so in my case i’ve had to duplicate the code for each post ID with different values of tables’ ID.
    this code is in the single.php file.

    i know it’s not very automatic but i need it to work in a very short time and i will try to improve it later. For the moment it works!
    You can watch it here http://milano.tradeschool.it

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