Welcome to Geeklog, Anonymous Sunday, November 24 2024 @ 11:41 am EST

Geeklog Forums

Quick Hack for Polls


Status: offline

amckay

Forum User
Full Member
Registered: 03/23/02
Posts: 180
Here's a really quick little hack for polls. I found that polls could only be voted upon if they showed up in one of the left or right blocks. So if you want to maintain a bunch of polls active at one time, you have to take up all that real-estate.

There are two simple changes to make.

In /pathtogeeklog/public_html/layout/your-template/pollbooth/polllist.thtml

I cannot get this to come out properly within GL so check this link for details.

This of course defines how your new lines will look like in the list of polls one sees when you click the "polls" button in the top bar. All you are doing is adding something extra to the end of each line.

See that I've added my own variable definitions "vote_url" adnd "vote_text", along with assocaited HTML code. YOu can add them where you like but I put it at the end of the line before the "ending_br".

And then in /pathtogeeklog/public_html/pollbooth.php

Go to line 84 and copy it so you have two copies. This is the line with "poll_url" on it. Change your new line to

I think this comes out OK but check the same link above just in case

$pollitem->set_var('vote_url', $_CONF['site_url'].'/pollbooth.php?qid=' . $Q['qid'] );

Here you are telling the geeklog engine that you have a couple of new template variables that you want it to know about on this page.

And then after that add another line :

$pollitem->set_var('vote_text', 'Cast Your Ballot' );

Here you are adding the second variable. Yes, I should be using the languages file but I haven't figured that out yet. Once I do I'll post an update. In the meantime this will do.

That's it. You are done. Now, all of your polls are constantly active and people can vote on them, even if you do not have them in one of the left or right bars.

Let me know if you have any problems with it.

cheers, -Alan

 Quote

damental

Anonymous
The link you referenced is returning a 404 page. I would like to make my polls all constantly active also, or maybe make them rotate in the front page. Can you post this file again.
 Quote

Status: offline

amckay

Forum User
Full Member
Registered: 03/23/02
Posts: 180
I've put the details here now :

https://secure.quay.net/community/viewtopic.php?p=8361
 Quote

kkiely (AT) aol.com

Anonymous
Could anyone follow up on this work and get it so you can have:
1. The ability to have multiple polls on 1 page (not just a list).
2. A "Show all results" link for a page with multiple polls.

This page is an example: (not my page)
http://www.wptfan.com/pollbooth.php?offset=30&show=0
 Quote

Status: offline

kevinolean

Forum User
Newbie
Registered: 05/10/05
Posts: 6
Location:Cheshire, CT
Could anyone follow up on this work and get it so you can have:
1. The ability to have multiple polls on 1 page (not just a list).
2. A "Show all results" link for a page with multiple polls.

This page is an example: (not my page)
http://www.wptfan.com/pollbooth.php?offset=30&show=0


This is exactly what I am looking for as well...does anyone have a link as to how to accomplish this?
 Quote

Status: offline

lgriffin

Forum User
Junior
Registered: 12/01/04
Posts: 24
cheerful
Ok I have followed the instructions on the page:

https://secure.quay.net/community/viewtopic.php?p=8361

Works great, now I have "Vote Now" after each poll list. What tells the pollbooth.php page that a poll has been voted on or not?

I would like to put in the polllist.thtml a condition statement that tests for if poll has been taken to print already voted ELSE Vote Now (with the link as above).

Thanks

 Quote

Status: offline

kreative

Forum User
Chatty
Registered: 08/15/04
Posts: 53
Location:Verona, Italy
Hello friends,
any news about this thread?
I'm looking for something similar, but... i checked the link I read here ( http://www.wptfan.com/pollbooth.php?offset=30&show=0 ) but I would like to have only 1 "vote" button, at the end of ALL polls.... Is is possible to make this hack?

You can read my topic here:
http://www.geeklog.net/forum/viewtopic.php?forum=3&showtopic=66380

Thanks!
 Quote

All times are EST. The time is now 11:41 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content