Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Polls in posts
Goto page 1, 2, 3, 4  Next
 
Reply to topic    Forum Index » Additional Downloads View previous topic
View next topic
Polls in posts
Author Message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Polls in posts Reply with quote
This plugin lets you add a poll to the short story and/or full story.

If you are showing the short story and the full story at the same time (having {short-story} in the full story template) you can only have one poll.



Example: http://english.cutenews.ru/cuteru/example/index.php/2005/12/15/first-news.html



The vote is submitted using AJAX so there's no page reload.



Cookies prevent the user from multiple votes. After voting the user will see the poll results.



Installation:

1. Copy everything to the plugins folder.



2. Put this between the <head></head> tags of your page:

Code:
<?=run_actions('additional_head_data'); ?>


3. To style the form or results open plugins/polls-in-posts.php and add your styling to the first function.



4. To add a poll to your post simply put something like this to your short and/or full story:

Code:
[poll]
Yes
No
Maybe
[/poll]
(One option per line)

5. If you want to close a poll simply change it to
Code:
[endpoll]
Yes ==> 45
No ==> 40
Maybe ==> 26
[/endpoll]




polls-in-posts.zip
 Description:
Polls in posts

Download
 Filename:  polls-in-posts.zip
 Filesize:  3.63 KB
 Downloaded:  454 Time(s)



Last edited by FI-DD on Fri Nov 16, 2007 12:09 pm; edited 2 times in total
Wed Apr 25, 2007 7:31 pm View user's profile Send private message
Guest








Please login to hide the ads.

Heya Im Me



Joined: 01 Feb 2006
Posts: 189

Post Reply with quote
Oh man, no way!! Thanks so much FI-DD! Fantastic job Very Happy Very Happy Very Happy Very Happy Very Happy



I love how its AJAX, really great work



-HIM
Wed Apr 25, 2007 8:14 pm View user's profile Send private message
PJR



Joined: 17 Oct 2005
Posts: 161
Location: Czech republic

Post Reply with quote
Very cool!! Thank you FI-DD!
Wed Apr 25, 2007 10:05 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
I pooped a little. Yes, thank you more than words.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Thu Apr 26, 2007 1:15 am View user's profile Send private message Visit poster's website AIM Address
Saszoo



Joined: 07 Jun 2006
Posts: 410
Location: Norway

Post Reply with quote
Three words:

AWSOME Very Happy

_________________
My cute.ru site
Thu Apr 26, 2007 6:49 am View user's profile Send private message Visit poster's website
gauss



Joined: 06 Sep 2006
Posts: 23

Post Very nice. Reply with quote
thx
Thu Apr 26, 2007 9:32 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
I have a few small issues that I wondered about. Nothing that needs immediate attention or anything.. just some small things I noticed and tried to change myself but failed.



Okay first, I changed the style from 'grey' to a hex code color and it just WILL NOT change the color from grey. Here's where I changed it (and cleared cache afterwards just in case):



plugins/polls-in-posts.php

Code:
$output .= ".poll_result_short {padding:1px; border:1px solid black; background-color: #848284}\n";

$output .= ".poll_result_full {padding:1px; border:1px solid black; background-color: #848284}\n";




You can see that I added the hex. Should that do it or am I missing something somewhere else? I couldn't find any instance of colors anywhere in any of the code.



Also, sometimes the font will get switched to Times New Roman (or default browser font) so is there a way to set a permanent font on this? Would I do it in the same area that I'm working with these colors?



And lastly, I noticed after I save a poll that when I go edit it again it shows me how many votes had been added to each option.. but these don't display on my site to my visitors. Is it supposed to? It would be really nice if it did. I can't figure out how something can be written in my {short-story} but it won't show up on the site. You can see it here http://www.scottdizzle.com



Well.. sorry for writing a book. That's just my experience with this. I'm so excited about this thing you have no idea.



edit: Uhoh.. when I use search and it pulls up a poll it gives errors like this:



http://www.scottdizzle.com/search.php?do=search&search=poll&category=



or



http://www.scottdizzle.com/search.php?do=search&search=the&category=



I've been trying to figure out what's wrong.. but I can't seem to nail it. I have a feeling it's to do with one of the filters in search.php.. maybe highlight?



Edit again:



Yep.. I changed line 77 of search.php to:



Code:
//add_filter('news-entry-content', 'Highlight_Search', 999);




and now all errors are gone and polls display properly.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Apr 27, 2007 7:00 am View user's profile Send private message Visit poster's website AIM Address
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
scottdallas wrote:
Okay first, I changed the style from 'grey' to a hex code color and it just WILL NOT change the color from grey.


Are you sure that #848284 is a valid color?

Btw, I successfully changed the example to #c0c0c0:

http://english.cutenews.ru/cuteru/example/index.php/2005/12/15/first-news.html



Quote:
Also, sometimes the font will get switched to Times New Roman (or default browser font) so is there a way to set a permanent font on this? Would I do it in the same area that I'm working with these colors?


Yep, same place, simple CSS - "font-family:myfont" should do it.



Quote:
And lastly, I noticed after I save a poll that when I go edit it again it shows me how many votes had been added to each option.. but these don't display on my site to my visitors. Is it supposed to? It would be really nice if it did.


Yeah, I noticed that too when voting on your page. Just the percentages is not very usefull.

How and where do you want to show votes per option and total votes? A simple screenshot would be helpfull.
Fri Apr 27, 2007 11:06 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
You're right.. bad hex color lol. I tried again and it worked. Stupid me. I must have been working with not enough sleep or something. Font fix works too. Thanks man.



As for the the screenshot to show the votes.. I was thinking something like this:







or anything you could think of that would look better, nicer, or cooler.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Apr 27, 2007 11:20 am View user's profile Send private message Visit poster's website AIM Address
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Updated.



(I didn't add the number of votes to the poll form because I think it would influence the user's choice.)
Fri Apr 27, 2007 12:51 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
Mmmmmm very true! Good thinking. Thanks man, I'll redownload. Very Happy

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Apr 27, 2007 6:23 pm View user's profile Send private message Visit poster's website AIM Address
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
Hey FI-DD I hate to be a pest.. but I wondered if you had any trouble with polls in posts getting stuck in 'Saving vote' mode. Sometimes I can't vote (sometimes it's 50/50 if it will work) and Ramon said he tried to vote on www.tastypolls.com and it would just hang there. Could I have maybe forgot to add something in the code? Perhaps a server issue? I use PHP 4 and MySQL 4.1 on Linux servers.



I'm gonna see if your example page gives me any troubles.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Sun Apr 29, 2007 7:54 am View user's profile Send private message Visit poster's website AIM Address
Heya Im Me



Joined: 01 Feb 2006
Posts: 189

Post Reply with quote
Hey Scott,



I checked with my error console and it seems to be a security issue that I had trouble with on the AJAX comments pagination:

Error: uncaught exception: Permission denied to call method XMLHttpRequest.open



I fooled around with the javascript file a bit and I got it to work. I'll post what I did later today since I'm about to head to bed.



-HIM
Tue May 01, 2007 7:32 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
Thanks Heya Im Me! I would've never figured that out. I'll be waiting to hear what you came up with. I don't seem to have this problem with ajax comment pagination but maybe I do and just didn't notice it yet.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Tue May 01, 2007 4:11 pm View user's profile Send private message Visit poster's website AIM Address
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Heya Im Me wrote:
Error: uncaught exception: Permission denied to call method XMLHttpRequest.open


Yes, that's the error I get when voting on tastypolls.com. No idea what's wrong. Confused
Tue May 01, 2007 5:45 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Additional Downloads All times are GMT + 1 Hour
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.