Here’s a quick way to run a petition in WordPress
October 3rd, 2007
I’ve written a short and simple plugin that embeds a web based petition into your WordPress page or post. Signatures are confirmed by e-mail and the administrative interface allows for customization along with deletion and exporting of signatures. Learn more now.
Great software! Simple and easy to install. Thanks! Two questions:
How can I format my text in the petition? Bold, underline, paragraphs, indent?
In the export file I do not get written comments? They are extremely important. How can I retrieve them.
Thanks again…great that you contribute this to everyone! Bravo!
b
I tried installing it, and initially ran into some difficulties. I received a sql error saying comment was too large, (300). I changed fcpetition.php where the sql lines are from 300 to 255 and everything worked great! Might want to make the change to the textarea so nothing gets cut off. Thanks for the plugin.
P.S. I used it here http://blog.johnebradle.com/petition
Hi!
I’m sorry if this is a newbie thing but I’m getting this error and I don’t know what to do about it. I’m just setting up wordpress for the first time because I want to use your petition.
Any help is appreciated.
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), time DATETIME, UNIQUE KEY email (email) )' at line 5]
CREATE TABLE wp_petition ( email VARCHAR(100), name VARCHAR(100), confirm VARCHAR(100), comment VARCHAR(), time DATETIME, UNIQUE KEY email (email) )
Same problem of steve.
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), time DATETIME, UNIQUE KEY email (email) )' at line 5]
CREATE TABLE wp_petition ( email VARCHAR(100), name VARCHAR(100), confirm VARCHAR(100), comment VARCHAR(), time DATETIME, UNIQUE KEY email (email) )
NO ANSWER?
Problem solved.
Thanks to James.
Just replace that you can find at
http://svn.wp-plugins.org/wordpress-petition-plugin/trunk/fcpetition.php
Bye
Hi
Trying to use Petition plug-in. The confirmation email is not showing the name of the petition or the confirmation email.
What could I be doing wrong?
I have inserted the placeholder [[petition-1]] into my page. Is this the right way to do it?
Cheers
Matthew
Matthew, sorry about this. It appears that due to issues beyond my control, my development code is being distributed as the stable version by wp-plugins.org.
The stable version is available at http://svn.wp-plugins.org/wordpress-petition-plugin/tags/1.0.1/
I just wanted to drop this note to thanks James for all his help!
Much appreciated James.
Regards
Leigh
Hi James,
Thanks for the work on the plugin – it looks like just what I’m after but I’m having a bit of trouble getting the plugin to work.
I am developing a WordPress 2.3.1 blog on a Windows server
with IIS, MySQL & PHP.
I have modified my ABSPATH definition in the config file to cope with the Windows server.
When I add the latest files within the plugins folder and within a folder called wordpress-petition-plugin, activation in the admin is fine, but when I go to Options > Petition, check Enable Petition, I get the following error message:
Fatal error: Cannot redeclare fcpetition_upgrade() (previously declared in D:\Websites\HolidayTravelWatch\Website\wp-content\plugins\wordpress-petition-plugin\fcpetition.php:38) in D:\Websites\HolidayTravelWatch\Website\wp-content\plugins\wordpress-petition-plugin\fcpetition.php on line 49
I guess that tells me that that the page is running twice but I cannot find out why? I don’t suppose you have any ideas?
Thanks in advance,
Pete
This is a great little plugin, and freecharity is a great initiative too! You should get in touch with the good folks at MySociety.org (the people behind sites like PledgeBank.com) for ideas and tools that could come in handy for cash-strapped UK charities.
Best wishes,
Eoin
WordPress 2.3.3, Keep getting “Sorry, someone has already attempted to sign the petition using this e-mail address” even though there are no successful petition submissions yet.
Using the petition page as the home page – is that effecting this? I’ve tried multiple permutations of URLs, to no avail.
(Incidentally, even though the readme file says version 1.0.1, WP plugin page insists it is 1.0 and prompts to download the new one again.)
Hi if others are interested in language variants may be we can help
Hi, whenever anybody types the following: ‘
it shows up as a: \
not sure why.
so ‘hello dolly’ shows up as \hello dolly\ for some reason. any help would be much appreciated.
jason
also the ability to edit the comments made on the petition would be great, i.e. to take out swear words etc.
I’m getting an error
mysqldb.wp_petition_signatures’ doesn’t exist]
select petition_confirmation,petition_from,petition_title,confirm from wp_petition_signatures,wp_petitions where wp_petitions.petition = wp_petition_signatures.petition and email = ‘spacemanmkd@gmail.com’ and wp_petitions.petition = ’2′;
it works with the new file.
thanks. great scrript.
im having similar problems to jason, not showing the characters correclty shows ‘/////’ instead of quotes.
also when results are exported to csv, can the results be ordered into columns for excel, i.e. one column for emails relieved, one for names, it all seems to throw it all in together in one big line of info. Which means you have to manually sort through the results to arrange i.e. all the emails addresses together etc. I want to just be able to see a column of emails and names in excel but it doesnt arrange it like this when I click export to csv.
thanks, brilliant script.
TG
I’m getting an error
mysqldb.wp_petition_signatures’ doesn’t exist]
select petition_confirmation,petition_from,petition_title,confirm from wp_petition_signatures,wp_petitions where wp_petitions.petition = wp_petition_signatures.petition and email = ’spacemanmkd@gmail.com’ and wp_petitions.petition = ‘2′;
?
im having similar problems to jason, not showing the characters correclty shows
Nicely implemented plugin. It works great – thankyou.
I do have a suggestion, add a postal code entry or perhaps a city and state/province field.
The database error probably indicates that you’re running an older version of the plugin. Please download the latest version and let me know if you still have the same problem.
As for post code/city/state/province fields, this is something I’ve been thinking of adding but I’m waiting until I can come up with a solution to fit all locacles before releasing any changes.
Great plugin! Clear code.
One thing: There should be created an index in petition_signatures table on filed time, there is a lot of sorting on it.
I ran into some problems during installation, namely the signatures weren’t being registered at all. Basically what Dave ran into.
The reason was that in the SQL syntax, ‘confirm’ and ‘fields’ are MySQL keywords, and weren’t being treated as strings. Therefore the solution was to wrap them with quotes (`). Now it works like a charm!
James, I suggest you implement this into the next release, as it could affect quite a few users.
Many thanks for the plugin!
Dave’s problem was fixed some time ago, you shouldn’t be seeing the same one. What version of the plugin have you downloaded?
Can someone post a link to a site that uses this plug-in, or to a demo site?
Version 2.1 on wp-2.5.1 Plugin appeasr to be working correctly, except for a warning invalid argument in the management page. see as follows:
Warning: Invalid argument supplied for foreach() in /home/removed/public_html/demos/test1/wp-content/plugins/wordpress-petition-plugin/fcpetition.php on line 885
In addition, it’s not clear how to add custom fields and it appears that this error maybe connected.
Thanks for your help.
Nicely implemented plugin. It works great – thankyou.
I do have a suggestion, add a postal code entry or perhaps a city and state/province field.
This page:
http://www.freecharity.org.uk/wordpress-petition-plugin/
says “The latest version of the plugin now allows you to add custom fields to your petition.”
Well, I can’t find any instructions telling how this is done.
Please advise.
Thanks,
Joe Testing
It’s not very clearly indicated but it’s at the top of the petition options page. The latest release of the plugin has fixed this lack of clarity.
I love the plug-in! Thank you for the hard work.
I have an unusual problem – the confirmation email that goes out to the person signing the petition never gets to AOL or Bellsouth email addresses. Is there anything simple I can do? I have run into this before and had to use smtp through a google apps gmail set up, but was hoping to avoid that this time.
Anyone else run into this?
Hi, whenever anybody types the following: ‘
it shows up as a: \
not sure why.
Just installed version 2.2.1 and I’m getting this error:
Call to undefined method wpdb::has_cap() in /customers/leverpark.co.uk/leverpark.co.uk/httpd.www/wp-content/plugins/wordpress-petition-plugin/fcpetition.php on line 175
Any ideas?
Hi, this looks like a great pulgin, but for whatever reason, it isn’t sending the confirmation email. Is anyone having a similar issue?
Error :
mysqldb.wp_petition_signatures’ doesn’t exist]
select petition_confirmation,petition_from,petition_title,confirm from wp_petition_signatures,wp_petitions where wp_petitions.petition = wp_petition_signatures.petition and email = ’spacemanmkd@gmail.com’ and wp_petitions.petition = ‘2′;
?
Please help me…
Is there a way to put the petition form on the sidebar?
Hello, I would like to use this plugin for my website. Would like to publish a “petition blog”.
One thing is missing in your script. I really need a numeration for the petition. And why is there no function to list all petition entries?
I can only list the last xxx entries but not all. This new function should contain pagination. Would be crazy to list 500 entries on one page.
If you might could add those function, I would use it for my next project.
LIMIT THE COMMENT SIZE: Instructions found in the code say “Define the maximum comment size. You can’t simply just change this for an existing install, you must modify the database table too.” Question: How do I “modify the database table”?? What part to I change?
Ignore that comment in the code, you shouldn’t need to change the database tables to alter this line any more. The database can store comments of any size, although the code limits them so that they can be easily displayed.
Helloo and Thank U for the great plugin .
Is there a way to stylize the boxes where the user inputs his name/email/website?
I have placed the petition on a white page, the boxes never appear ! I had to randomly click on the white space under the “name” etc till I detetcted the input fields when I say the blinking writing pointer.
http://www.al-rasid.com/blog/what-is-my-blog-about/petition-to-hp/
Also, the boxes came aligned to the right. Is there a way I can align them to the left ?
Another thing I wish you to consider. When I was setting my first petition, I added the information and came to the “custom fields”. I added a field and hit “Add” and it added it, and automatically refreshed the page where all the texts I added above in the petition text were deleted because I didnt yet save the changes, and I had to fill them in once again, but this time saving, then adding a custom field.
So, the option to add a custom field should load inline not refreshing the page, or that it should be shown only after all the fields have been created..
When trying to use this plugin, some people were able to sign it a few weeks ago, but now people just get this error when clicking the confirmation link:
“The confirmation code you supplied was invalid. Either it was incorrect or it has already been used. ”
Any ideas?
@Mouad
The problems sound as if they’re related to your theme – the plugin doesn’t really do anything fancy in it’s output other than wrap some parts in div’s so you can style them with CSS. You can alter the output by editing the plugin – there isn’t an easier way at the moment.
As for the second problem. I know about that one
@Ryan Thompson
That’s an odd one. Are you able to look directly at your MySQL tables?
Thanx James, but I think the problem lies in that my theme’s BG color is white, and the text fields of the petition are white too (I suppose), that is why the fields’ borders do not appear (Please consider looking here : http://www.al-rasid.com/blog/what-is-my-blog-about/petition-to-hp/).
As regarding stylyzing the css and change the direction/align of the text, as well as other things, I dont know where to do that. I never found .css file to customize .. and I am not qutie an expert in PHP
I basically want fix the view, it is corrupted as you can see in the link above.
Another thing, how exactl can I convert the plugin into other languageo f the langs packed with it ?
Thanx very much
@Mouad
I’m fairly sure that the white background of your fields, is due to your theme. I imagine that it may be placing borders around fields in particular sections of the page, but not in the post content (perhaps the author didn’t expect to find them here?). I’m afraid I can’t help you with this, try contacting the theme’s author.
There’s a program called poedit which you can download from http://www.poedit.net/. Use it to load the .pot file included with the plugin and it will allow you to create po and mo files for your language.
Hey James and thanx for replying.
I wish you answer my question on how to stylize the plugin with CSS .. as I said before, I found no css file to modify, nor found I css properties inside the plugin’s php files. If I find it, I might stylize the text fields to have a different color than white (light yellow for instance), but I coudnt find the css properties to edit !
For the language thing, I understood that I can create new files, but how can I apply those new po and mo files to be actually active in the plugin instead of English ?
I am really needing your quick response.. Thanx !
@Mouad
That is because there is no CSS, the plugin leaves this to your theme. You need to alter your theme so that it shows the form correctly. I cannot help you with this.
Once you have generated a .po/.mo file, place them in the same directory as the plugin. Alter your wp-config.php to set the language. For example define (‘WPLANG’, ‘nb_NO’); to use fcpetition-nb_NO.m.
@Mouad
The alignment of fields in the petition’s form is decided upon by the theme you are using (if you switch to the default theme, you should find that the fields are aligned centrally).
Great plugin!
There is a JS-injection security problem, though. Try input >’>alert(123)<’ for the name or any custom field and you will see then the jscript will execute on both the post page and in the admin panel. This can be used by malicious users to redirect all visitors to other sites, for example.
The fix is pretty simple – use htmlspecialchars(field,ENT_QUOTES) when displaying html.
Hi,
I am using your petition plugin on my website. I wanted to use the petition on a facebook app and on a standalone website. I want to use the e-mail verification option on the website, but not on the app. How can I do that?
I’m afraid that I don’t know anything about programming facebook applications.