Poll scripts

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Shoup
Regular
Posts: 26
Joined: Mon Jul 10, 2006 9:25 pm

Poll scripts

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Poll scripts

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Shoup
Regular
Posts: 26
Joined: Mon Jul 10, 2006 9:25 pm

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Shoup
Regular
Posts: 26
Joined: Mon Jul 10, 2006 9:25 pm

Post by Shoup »

Thanks for the help!
Post Reply