![]() |
Closed Poll thread title
A user requested that if a poll is closed the thread be preceeded by Closed Poll: instead of just Poll:.
Here's a few lines of code that did it for us. (see attachment ) All you have to do is insert a few lines of code to forumdisplay.php. Good luck, hope it helps. History:
|
Here's a preview.
|
Nice
|
Good idea - i'm going to use this :)
- miSt |
nice idea
|
Nice :D
|
good idea
|
...doesn't seem to do anything....strange.....
EDIT: Nevermind. It doesn't work when locking a poll (locking the entire thread, that is). |
Does this add a query for every poll in the forum? Or just the closed ones?
|
Quote:
The guys that wrote vB are sharp, we're not dealing with "ALL" the posts in the forum when we do a display. We get the number of threads that is set in the admin panel displayed. So, if I'm reading this code correctly, a forum display of 15 threads occuring would yield - worst case senario if all 15 threads have polls - 15 additional queries per forumdisplay. This is usually about 3 or 4 from what I've seen. Boards with more polls may want to be aware of the over head though. Thanks. That help? Regards |
Quote:
Regards |
Quote:
|
Quote:
Thanks for the reply. Regards |
Your idea here might be a good thing to add to my Polls Start Date and Time hack. I could have it automatically do a Poll Closed when the poll is over. Could I save some queries doing it that way?
|
Unfortunatly I'm not familiar with the code you refer to, but I'd be glad to look at it. Perhaps we can create a tighter piece of code for the Poll closed hack.
Got a link? Can ya post the code snippet for the hack and where it goes in what form? Thanks |
It's in my signature in this message. ;)
|
Quote:
Anyone else having this problem? Locking the poll works, but not the thread. |
Does it say Closed Poll: before you close the thread?
|
If the poll is closed yes, they are seperate functions.
|
Here is the link to my poll hack. Let me know if you think we can combine the two. ;)
https://vborg.vbsupport.ru/attachmen...&postid=372862 |
Cool addition, small, yet very useful. *clicks install*
Nice idea. :) |
Quote:
|
Quote:
Thanks for the feedback. Regards |
Quote:
|
Quote:
|
OK to this line you need to add the active column name.
PHP Code:
PHP Code:
Regards |
I almost have it. I am working on a small problem. How do I go about get the total votes on a poll. I can pull them out but they look like this:
3|||2|||3|||2|||4||| Like that. How do I get them into a total? |
You can use a foreach loop with an explode statement .
PHP Code:
EDIT: repaired code |
Just tried it. It gives me 0 as the total votes and there are 10. ;)
|
Does $votesstring exist for you? If not did you substitute you var name that contains the ||| delimited string?
|
Here's my query:
$polldatetime = $DB_site->query_first("SELECT dateline,timeout,active,votes,voters from poll where pollid = $thread[pollid];"); |
Change $votesstring to $polldatetime['votes'] as below...
PHP Code:
repaired code |
I tried that just before you wrote this and now the count reads 1 vote. ;)
|
try
PHP Code:
EDIT: repaired code |
Still only shows 1. ;)
|
Dammit man, it's my fault!!! I left the $ off of the var...
Here ya go. PHP Code:
|
I put the $ on the variable when I tried it. It gave me an error until I did. ;)
|
Quote:
$polldatetime['votes'] and $totalvotes |
Oh, ok. Now it works. You meant the $totalvotes variable. You also left it off of the polldatetime['votes'] the first time. LOL Great! Now it work fantastic. Do you want to look over everything now that I have it working to give me your honest opinion? I can pm it to you. ;)
|
If it's based on your existing code, from what I saw you should be fine.
I guess it's time to post an update to your hack. I'd be glad to review it. |
All times are GMT. The time now is 01:36 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|