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."); ?> |
#2
|
||||
|
||||
It's in the showthread template...
Look for this... Code:
<a href="#goto_threadtools">$vbphrase[thread_tools]</a> |
#3
|
|||
|
|||
Code:
<td class="vbmenu_control" id="threadtools"> <a href="#goto_threadtools"<if condition="is_browser('ie')"> accesskey="3"</if>>$vbphrase[thread_tools]</a> <if condition="$show['popups']"><script type="text/javascript"> vbmenu_register("threadtools"); </script></if> </td> Thanks for replying, further help is greatly appreciated. Sincerely, Brett |
#4
|
||||
|
||||
Sorry mate it seems I led you to the wrong part of the template, my mistake, I should have checked and not gone from memory.
Find... Code:
<!-- thread tools menu --> <div class="vbmenu_popup" id="threadtools_menu" style="display:none"> <form action="postings.php" method="post" name="threadadminform"> <table cellpadding="4" cellspacing="1" border="0"> Code:
<tr> <td class="vbmenu_option"> YOUR HTML, EG HYPERLINK OR FORM ELEMENT GOES HERE! </td> </tr> |
#5
|
|||
|
|||
THANKS!!!! It worked perfectly, you are awesome. I'm going to finish beta testing it on my forum, I'll probably bring it back over here when I am totally finished with it on my board, and I have some extra time to actually make it into an official "mod" packet.
Brett |
#6
|
||||
|
||||
No problem at all.
I'd love to use this on my site, I'd be happy to help with testing. |
#7
|
|||
|
|||
Hey, got caught up with some other things. I'm not fully done with my own testing. But I'll definitally message you when I'm ready to great it tested and use your help.
Glad you would like to use it on your site. :nervous: I'll let you know. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|