Let Users Watch Poll Results Without Voting

Share your CuteNews.RU skins and code snippets.

Let Users Watch Poll Results Without Voting

Postby DarkSlim » Mon Jul 19, 2010 4:38 pm

Anyone that uses the poll plugin, here is another tweak the I made,
it adds a link under the poll submit button that lets you view the current
poll results from any page without the need to vote first! :)

Open plugins/poll.php

Find:
Code: Select all
                     $answers = explode("|", $answers_arr);
                     $count = sizeof($answers);
                     $votes = explode("|", $votes_arr);

                     include $cutepath.'/plugins/poll/form.tpl'; //  Template of the poll form
}


After Add:
Code: Select all

if ($act == "res") {
     pollres($echo);
}




Save and close

Open plugins/poll/form.tpl

Find:
Code: Select all
<input type="submit"........


After that line, when the submit button ends, Add:
Code: Select all
<br>
<a href="?act=res">Show Results</a>


Save, close and upload the files :)

That's it! you can style it and play with it however you want!

DarkSlim
User avatar
DarkSlim
 
Posts: 296
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL

Postby Hawk » Tue Jul 20, 2010 7:57 am

Nice one there :D
Will have to install the poll plugin to see how it works, tbh I never had a need to do it, but I'm really interested about it.
User avatar
Hawk
 
Posts: 248
Joined: Tue Aug 29, 2006 9:00 pm

Postby DarkSlim » Tue Jul 20, 2010 3:54 pm

Thanks! It is a very useful plugin, works great :)
User avatar
DarkSlim
 
Posts: 296
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL


Return to Skins and snippets



Who is online

Users browsing this forum: No registered users and 0 guests

cron