The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
My post of the day mod...
Hi,
I started designing a post of the day mod where members vote for their favorite post/thread, and then at midnight, it will show that post on the front page for the next whole day, and the votig will begin again at 0 for the NEXT day. (As if that made any sense. lol) I have it all completed except the button in the "Thread Tools" drop down menu, and I can't seem to find the right part of the template, nor the right code to impliment. I have the following PHP code (beta code) for the page that the button you click SENDS you to, all I need it help with the Thread Tools drop down menu. Thanks for the help in advance. Brett PLEASE NOTE: I haven't been able to Beta or even Alpha test this code since I haven't gotten the Thread Tools button created. I'm sure most coders will see alot of errors there, I know there were alot of errors in my page that actually shows the favorite post of the day. But all those errors were cleared up within minutes or so, so I'm not really concerned about any errors in the code. just getting the Thread Tools button designed. Code:
<?php //Set month/day/year $date_m = date("m"); $date_d = date("d"); $date_y = date("y"); //Create Next Day $date_d = $date_d + 1; //Checkdate while (isset($date)) { $status = checkdate($date_m, $date_d, $date_y); if $status == true { $date = $date_m$date_d$date_y; } else { $date_d = 1; $date_m = $date_m + 1; $status = checkdate($date_m, $date_d, $date_y); if $status == true { $date = $date_m$date_d$date_y; } else { $date_m = 1; $date_y = $date_y + 1; $status = checkdate($date_m, $date_d, $date_y); if $status == true { $date = $date_m$date_d$date_y; } else { print ("Error: Please click the back button, and re-vote."); exit; } } } } //Seeing if thread has been voted for $sql_find_vote = "SELECT votes FROM pod WHERE threadid = '$threadid',date = '$date'"; $result_find_vote = mysql_query($sql_find_vote,$conn) or die (mysql_error()); $did_it_find_vote = mysql_num_rows($result_find_vote); if (isset($did_it_find_vote)) { //Insert New Vote $sql_insert_vote = "INSERT INTO pod VALUES ('','$date','$threadid', '$thread['title']','1')"; $result_insert_vote = mysql_query($sql_insert_vote,$conn) or die (mysql_error()); } else { //Update votes $votes = $sql_find_vote['votes']; $newvotes = $votes + 1; $sql_update_vote = "UPDATE pod SET votes = '$newvotes' WHERE threadid = '$threadid', date = '$date' "; $result_update_vote = mysql_query($sql_update_vote,$conn) or die (mysql_error()); } print ("Thank you for voting."); ?> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|