Page 1 of 1
Poll scripts
Posted: Wed May 02, 2007 5:17 pm
by Shoup
Has anyone experimented with adding a php poll (other than the polls plugin)?
If so, were you successful, and if you were successful, would you share how you did it?
Thanks
Re: Poll scripts
Posted: Thu May 03, 2007 11:20 am
by garvinhicking
Hi!
It should be pretty easy using the "external PHP application" sidebar plugin where you can include foreign PHP scripts to include things.
I've included the Proxy2 "Advanced Poll" sidebar element successfuly like this (in commercial blogs where I can't tell you the link to, though).
Simply put the include file there. Possible "poll_booth" cookie includes I've added to my templates' config.inc.php file. One could also create an event plugin for that, but going with config.inc.php was easier.
Best regards,
Garvin
Posted: Thu May 03, 2007 10:52 pm
by Shoup
Would we use the sidebar plugin or the config.inc.php file to set the cookie?
What we'd like to do is set up a poll then include it into an entry. That way for each new poll, we have a new entry for it. This would also allow us to run several polls at once.
Posted: Fri May 04, 2007 1:06 pm
by garvinhicking
Hi!
You must use the config.inc.php file for cookie setting, because the sidebar plugin executes when headers etc. have already been issued.
The s9y poll/voting plugin does that in the event plugin portion of the two plugins, so you either need to create a custom PHP event plugin or simply put the code into config.inc.php, which is less overhead.
Regards,
Garvin
Posted: Fri May 04, 2007 11:00 pm
by Shoup
Thanks for the help!