Free Charity – Petition Plug-in CSV File
-
One of the feature of this petition file is the creation of a CSV file so you can print the results of your petition and send it to the Government.
In my case, this feature does nothing – As you can see in the code, it should do nothing if I’m not logged in as an Admin, which I always am.
Any ideas to get this feature to work would be much appreciated. (Already tried the plug-in creator – no response)
* Export the specified petition in CSV format */ function fcpetition_export(){ global $wpdb; global $signature_table; #we ought to check for admin access too if ($_GET['petition_export'] && current_user_can('manage_options')){ $po = $wpdb->escape($_GET['petition_export']); header('Content-Type: text/plain'); foreach ($wpdb->get_results("SELECT <code>name</code>,<code>email</code>,<code>comment</code>,<code>time</code>,<code>fields</code> from $signature_table WHERE <code>confirm</code>='' and <code>petition</code> = '$po' ORDER BY <code>time</code> DESC") as $row) { ?> "<?php echo stripslashes($row->name); ?>","<?php echo stripslashes($row->email); ?>","<?php echo stripslashes($row->comment); ?>","<?php echo stripslashes($row->time); ?>"<?php fcpetition_csvfields(unserialize(base64_decode($row->fields))); ?> <?php } // Important that we stop WordPress here. No further output after the CSV data has been displayed. exit; } else { // Simply do nothing if the user has no rights return; } } /*
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Free Charity – Petition Plug-in CSV File’ is closed to new replies.