Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
TOTW: Thread of the Week Poll - Version 1.16 Details »»
TOTW: Thread of the Week Poll - Version 1.16
Version: 1.16, by Marco van Herwaarden Marco van Herwaarden is offline
Developer Last Online: Dec 2010 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 01-19-2005 Last Update: 04-12-2005 Installs: 39
DB Changes
 
No support by the author.

Thread of the Week Poll - Version 1.16

Description
With this hack it is possible to setup an automated system for electing a "Thread of the Week". Based on 1 or more rules you define it will select a number of threads from your board and will post a poll to let your members select their favourite thread.

This hack was written based on a requestion made here previously: https://vborg.vbsupport.ru/showthread.php?t=63969

Tested on
- vB 3.0.7
- vB 3.0.6
- vB 3.0.5
- vB 3.0.3 (Will probably also work on earlier versions)

Install Information
Installation using HIS installer included (HIS by Link14716 https://vborg.vbsupport.ru/showthrea...staller+system)
Uninstaller included
Install time: 2 minutes, easy
File edits: 0
Template edits: 0
Database modifications: 2 new tables

Features
  • Can run 1 or more Rules for selecting threads to include in Poll
  • Forums to be scanned for candidate threads can be selected.
  • Selection of candidate threads is done based on views and replies. The 'weight' of these selection criteria is settable for every rule.
  • Poll's are fully configurable (Posted as user, Thread title, Poll question, number of options)
  • Polls are automatic closed when a new poll is started
  • Polls can be generated on a settable interval. Interval can be given in days or weeks. Alternativle a new poll can also be generated on a fixed day every month.
  • uCash Integration. Activate in ACP Settings if you have uCash installed
  • Setable uCash price money for place 1, 2 and 3.
  • Date selection based on Thread Start Date or Last Reply Date. Selection can be made for every Rule.
  • Optional result post on closing of Poll, user configurable text.
  • Thread title with replacement variables. See Admin help!!
  • Poll title with replacement variables. See Admin help!!
  • Result post with replacement variables. See Admin help!!
  • Help added to the Admin screen.
  • .......
To be included in future releases
If enough request i am think of the following to add in a future release. More suggestions are welcome
- Integration with more existing Award system, already rewards possible using uCash
- More selection criteria

Support
Support will be given in this thread.

If you have problems, please first check the following:
- Did you set the uCash/uShop correct in ACP->vB Options->Thread of the Week (On/Off)
- Turn on logging in the Scheduled Taks for Thread of the Week. Check the Scheduled Task Log for any messages.

If you still have problems, please post the following information, so i can quickly try to help you:
- vBulletin version
- PHP and MySQL Version
- Version of this hack
- The schedule options you have set in the Rule Manager
- Selection Options
- When is it scheduled to run in the Scheduled Task Manager
- Any other relevant information

Thanks to
A big thanks to link14716 for the installer and to trafix for letting me use a script as a starting point for the admin settings, saved me a lot of time.

Also a huge thanks to sabret00th for testing (now i got someone to blame if there are still any errors left ).


Donations
I will not charge for this hack. But if you like it and are looking for a way to spend your money, paypal donations are always welcome (marcoh64@msn.com)

Please click Install if you are using this hack

Change log:
Version 1.16:
- Fixed bugs in updating Username/Userid/Thread Title in posted thread and forum info
- Removed 2 unneeded queries
- Added replacement variables for Thread Title:
- {date} - Current date formatted according to vB settings
- {beginofweek} - Date (formatted) of the start of the current week (sunday is start)
- {endofweek} - Date (formatted) of the end of the current week (saturday is end)
- {beginofweekmon} - Date (formatted) of the start of the current week (monday is start)
- {endofweekmon} - Date (formatted) of the end of the current week (sunday is end)
- Added {date} replacement variable to Poll Title
- Made all replacement variables case-insensitive
- Admin Help pages updated accordingly

Version 1.15:
- Add the option to override the default calculation for the cutoff date when selecting candidates. Now possible to enter a number of days to go back when selecting candidates.

Version 1.14:
- Bug that would make the cronjob crash if the current poll thread was deleted.
- Fixed version number in Manager script

Version 1.13:
- uCash Integration. Activate in ACP Settings to show them.
- Setable uCash price money for place 1, 2 and 3.
- Date selection can now be based on Thread Start Date or Last Reply Date. Selection can be made for every Rule.
- Optional result post on closing of Poll, user configurable text.
- Thread title with replacement variables. See Admin help!!
- Poll title with replacement variables. See Admin help!!
- Result post with replacement variables. See Admin help!!
- Help added to the Admin screen.
- Some minor modifications and bug fixes
- Removed debugging lines
- Scheduled task will now log information on the processing of the Rules in the Scheduled Task Log
- INSTALLER WILL ALSO UPGRADE FROM PREVIOUS VERSIONS, SEE UPGRADE NOTES.

Version 1.12:
- Fixed bug where threadoftheweek.php would not run correct (or even generate a database error) when running through the scheduler (as oppsed to running it with "Run Now")
- Added loads of debug information. To activate debugging, change includes/cron/threadoftheweek.php and uncomment the line "// $TOTW_DEBUG = TRUE;". Debug lines will go to the Scheduler log.
- Forum counters will now be updated when a new poll is posted.
- Fixed bug where "Run on day x of month" didn't work.
- Some minor changes
- The first time the rule is run, only threads with a last postdate in the time interval which is set for the rule will be selected as Candidates. In the older versions all threads where considered on the first run.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #92  
Old 03-06-2005, 10:59 AM
MikaK's Avatar
MikaK MikaK is offline
 
Join Date: Nov 2004
Location: Helsinki, Finland
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
Please tell me which version you're running, also php and MySQL versions.

scll is your uCash points table? Do you have uCash installed? How is the uCash integration set in the vB settings for Thread of the Week?
scll is the data table prefix in my vBulletin database.



I have ToW 1.13 installed on vB 3.0.3. I tried to install ucash but rolled back to a previous backup since I had trouble with it.

uCash setting in your script for this poll are the default ones: first three fields as 0 and the fourth empty.


PHP version 4.3.10

MySQL version 4.0.23-standard.



Regs,

-Mika
Reply With Quote
  #93  
Old 03-06-2005, 12:01 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ACP->vBulletin Settings-->Thread of the Week-->uCah integration: No

That should solve your problem.
Reply With Quote
  #94  
Old 03-06-2005, 12:13 PM
MikaK's Avatar
MikaK MikaK is offline
 
Join Date: Nov 2004
Location: Helsinki, Finland
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
ACP->vBulletin Settings-->Thread of the Week-->uCah integration: No

That should solve your problem.
Thanks Marco,

The message changed shape a tad: Warning: Invalid argument supplied for foreach() in /home/soundchi/public_html/loud_lounge/includes/cron/threadoftheweek.php on line 358

my file looks from row 358 like:
PHP Code:
foreach ($svotes AS $key=>$values)
{
if (
$count != 0)
{
--
$count;
++
$position;
continue 
1;
}
if (
$values['votes'] == 0)     // No more winners
break;
 
++
$position;
$winners[$position] = $values['polloption'];
 
// More sharing the same number of votes?
$count 0;
while (++
$count)
{
if (
$svotes[$key $count]['votes'] == $values['votes'])
{
    
$winners[$position] .= "," $svotes[$key $count]['polloption'];
}
else
{
    --
$count;
    break 
1;
}
 
}

How critical is this? The cron was executed ok and the poll apeaed at the wanted forum.

Regs,
-Mika
Reply With Quote
  #95  
Old 03-10-2005, 01:06 AM
jzewatsky jzewatsky is offline
 
Join Date: Nov 2004
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What a great hack! I'm sure my thread count will increase by installing this. Thank you!

Side note.

Does anyone know how to give ucash for responding to polls?

Thanks again!!!!!
Reply With Quote
  #96  
Old 03-11-2005, 02:35 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I was wondering if the thread title could be automated to say "thread of the week for week of xxx to xxx" ?

This way, while being specific, it will change the monotomy of title.
Reply With Quote
  #97  
Old 03-11-2005, 03:47 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lionel
Hi,

I was wondering if the thread title could be automated to say "thread of the week for week of xxx to xxx" ?

This way, while being specific, it will change the monotomy of title.
Hmm sounds like a good suggestion, will try to implement in a next version.
Reply With Quote
  #98  
Old 03-11-2005, 04:20 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
Hmm sounds like a good suggestion, will try to implement in a next version.
Thanks for considering it. Real nice hack! Couldn't that be achieved now by doing something like:

Best thread for week ending $lastrundate (something to that extent using that parameter)
Reply With Quote
  #99  
Old 03-11-2005, 05:51 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well that parameter is not implemented, only start weeknumber and i think start date if i remember correct.
Reply With Quote
  #100  
Old 03-15-2005, 03:55 AM
Kru's Avatar
Kru Kru is offline
 
Join Date: Nov 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am getting the following error message, too: Warning: Invalid argument supplied for foreach() in /includes/cron/threadoftheweek.php on line 358 if I run it in the Scheduled Task Manager. I am using vBulletin. 3.0.7
Reply With Quote
  #101  
Old 03-15-2005, 05:53 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit your includes/cron/threadoftheweek.php.

Find:
PHP Code:
if ($pollid
Add above:
PHP Code:
        $svotes = array(); 
Please report back if this is solving anything.

1 Question, did the current poll maybe never get any votes?
Reply With Quote
  #102  
Old 03-15-2005, 02:07 PM
Kru's Avatar
Kru Kru is offline
 
Join Date: Nov 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
Edit your includes/cron/threadoftheweek.php.

Find:
PHP Code:
if ($pollid
Add above:
PHP Code:
        $svotes = array(); 
Please report back if this is solving anything.

1 Question, did the current poll maybe never get any votes?
Made the change but still same error message.

I installed the hack last week. Told it that the poll should happen every 1 week.

Because I wanted to start with the poll directly after I installed the hack I run it in the Scheduled Task Manager but nothing happened. It still said poll never run.

Because I was busy with other stuff I didn't check any longer at it but then on saturday the poll started automatically but instead to show 3 poll options it just showed 2. I thought I made something wrong and deleted the thread. I reset date last run and reset previous polled threads.

Again I tried to run it in the Scheduled Task Manager but this time I got the error message mentioned above.
Reply With Quote
  #103  
Old 03-15-2005, 02:17 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kru
Made the change but still same error message.

I installed the hack last week. Told it that the poll should happen every 1 week.

Because I wanted to start with the poll directly after I installed the hack I run it in the Scheduled Task Manager but nothing happened. It still said poll never run.

Because I was busy with other stuff I didn't check any longer at it but then on saturday the poll started automatically but instead to show 3 poll options it just showed 2. I thought I made something wrong and deleted the thread. I reset date last run and reset previous polled threads.

Again I tried to run it in the Scheduled Task Manager but this time I got the error message mentioned above.
Thank you very much for this description. Think i finally got an old bug out now. The reason for the error is that the cron job is trying to close a thread that don't exist anymore (you deleted it).

I will post an update in an hour.
Reply With Quote
  #104  
Old 03-15-2005, 03:14 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kru
Made the change but still same error message.

I installed the hack last week. Told it that the poll should happen every 1 week.

Because I wanted to start with the poll directly after I installed the hack I run it in the Scheduled Task Manager but nothing happened. It still said poll never run.

Because I was busy with other stuff I didn't check any longer at it but then on saturday the poll started automatically but instead to show 3 poll options it just showed 2. I thought I made something wrong and deleted the thread. I reset date last run and reset previous polled threads.

Again I tried to run it in the Scheduled Task Manager but this time I got the error message mentioned above.
Updated version posted. Just upload all files, no upgrade scripts to be run.
Reply With Quote
  #105  
Old 03-15-2005, 03:15 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

About only selecting 2 options, maybe there where not enough posts to select from based on the criteria.

Please test again, if your problems continue send me a PM and we will look at it.
Reply With Quote
  #106  
Old 03-16-2005, 04:34 AM
Kru's Avatar
Kru Kru is offline
 
Join Date: Nov 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
About only selecting 2 options, maybe there where not enough posts to select from based on the criteria.

Please test again, if your problems continue send me a PM and we will look at it.
The error message is gone. Thank you.

But if I run the Scheduled Task Manager manually nothing is happening. Well it says DONE but in the Thread of the Weeks option it says that the poll is never run and it doesn't make any new poll at the forum.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:01 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05797 seconds
  • Memory Usage 2,391KB
  • Queries Executed 30 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete