View Single Post
  #900  
Old 07 Oct 2008, 02:41
vbboarder's Avatar
vbboarder vbboarder is offline
 
Join Date: Jun 2008
Arrow Bug fixes for: starting new contest, PM subject error, wrong month thread title

IMPORTANT: UPGRADE TO VERSION 1.63 BEFORE DOING BUG FIXES.

Bug Fix – close old & start new contest thread: The current contest thread will not close and a new contest thread will not begin if your computer/ server was down or you had the nominate topic cron task disabled when the cron task is scheduled to run. As Data noted in his script: ./includes/cron/nominate_topic_cron.php in line #247 (in v1.63), you can uncomment a line to get the current contest thread to close and a new one to begin. Basically, you change “// $createNewThread = 1;” to “$createNewThread = 1;” then run the nominate topic cron task manually, then put the “// “ back into “$createNewThread = 1;” To run the cron task manually, on the AdminCP left side column, go to Scheduled Tasks > Scheduled Task Manager > find Nominate Topic Mod and click “Run Now” (make sure it’s enabled first – should have a check mark next to the title).

Bug Fix – ‘can’t find phrase’ error in PM subject: There are some missing code in ./includes/cron/nominate_topic_cron.php file:
FIND:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

.
ADD ABOVE THAT:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

.
FIND:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

.
ADD ABOVE THAT:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

.
The PM subject should now be phrased to whatever you set for the nominate_topic_awardwinner_pm phrase, which defaults to “Award Winner Topic Nomination Contest!” Note that this setting will not take effect till the current contest thread is over.

Bug Fix – correctly displaying contest thread title:
For monthly nominations, this code is written so that a new thread is only created on the last day of the month. If you set “Display Next Cycle Time On Contest Header” to ‘Yes’ which is the default, this is not a good condition to test for since the # of days varies every month and the month phrases for the thread title & posts are created by adding 1 to the current month. Thus, when users had new monthly threads created on Sept. 30, adding 1 month would result in Oct. 30, so users got a new thread titled “Topic of the Month October, 2008” which is incorrect IF the above setting is enabled since the contest running now in Oct. should have posts in the “Topic of the Month November, 2008” thread. There’s 2 fixes for this problem:

Quick fix for current threads:
For the October, 2008 thread title, you need to wait till Oct. 1 or later to do this fix. On the AdminCP left side column, click Nominate Topic > Refresh Poll Thread. Click on or refresh the nomination forum and you should see the new month November, 2008 in the thread title, which should be saved.

Permanent fix for new threads: This fix requires editing ./includes/cron/nominate_topic_cron.php. FIND 2 occurrences of:
if ($day == $days_in_month){
.
REPLACE BOTH WITH:
if ($day == 1){
.
This fix will require the mod to create new threads on the first day on the month to fix the thread titles bug. . Note that this setting will not take effect till the next new contest thread is created.

Note: If you do not want the thread title & posts to be named for the next month, then set “Display Next Cycle Time On Contest Header” to ‘No’ in Nominate Topic settings. If set to ‘No’, then the contest running now in Oct. will have posts in the “Topic of the Month October, 2008” thread. This makes more sense, similar to how vbulletin.org runs their nomination contest. Note that this setting will not take effect till the next new contest thread is created.

Data, hope this relieves some debugging strain for you ‘cause you have an excellent mod!
Reply With Quote