######################################################## ## ## Hack Title: Only one Reply Notice for each thread ## Hack Version: 1.0.1 ## Author: Christoph "Toxic" Hellings (toxic@freenet.de) ## Date Created: 08-31-02 ## Date Updated: 09-03-02 ## Thread Location: http://www.tforumhacks.com/tforum/viewtopic.php?TopicID=1078 ## Working Example: ## Description: The title says all ;) ## ## ## Installation Level: Intermediate ## Installation Time: 5 Minutes ## Files To Edit: 2 ## Edit Database: yes ## Included Files: none ## ######################################################## ## ## Installation/Author Notes: ## ## I think it works but no warranty... ## UPGRADING INSTRUCTIONS 1.0.0 -> 1.0.1: ## open viewtopic.php and find the following two lines: ## $query = "UPDATE t_messages SET GotReplyNotice = 'no' WHERE TopicID = '$TopicID' AND Poster = '$CurrentUserInfo[UserName]'"; ## mysql_query($query); ## move these lines under the following line: ## fHeader(); ## END OF UPGRADING INSTRUCTIONS ## ######################################################## # #-----[ ACTION: BACKUP ]------------------------------------------ # Every time you edit your files, you should always back them up first. Although all of these hacks have been tested on various systems, they may not work with your configuration or you may not like what it does. Backing up protects yourself and your users from downtime. # #-----[ ACTION: EDIT DATABASE ]---------------------------------- # ALTER TABLE t_messages ADD GotReplyNotice TINYTEXT NOT NULL AFTER ReplyNotice; # #-----[ ACTION: OPEN ]------------------------------------------- # viewtopic.php # #-----[ ACTION: FIND ]------------------------------------------- # fHeader(); # #-----[ ACTION: ADD AFTER ]-------------------------------------- # $query = "UPDATE t_messages SET GotReplyNotice = 'no' WHERE TopicID = '$TopicID' AND Poster = '$CurrentUserInfo[UserName]'"; mysql_query($query); # #-----[ ACTION: OPEN ]------------------------------------------- # message.php # #-----[ ACTION: FIND ]------------------------------------------- # if ($firstmessage == "no") { $query = "SELECT Poster FROM t_messages WHERE ReplyNotice = 'yes' AND TopicID = '$TopicID' GROUP BY Poster"; $result = mysql_query($query); if (list($Poster) = mysql_fetch_row($result)) { do { if (strcmp($username,$Poster)!=0) MailReplyNotice($Poster,$TopicID); } while (list($Poster) = mysql_fetch_row($result)); } } # #-----[ ACTION: REPLACE ]----------------------------------------- # if ($firstmessage == "no") { $query = "SELECT Poster FROM t_messages WHERE ReplyNotice = 'yes' AND GotReplyNotice != 'yes' AND TopicID = '$TopicID' GROUP BY Poster"; $result = mysql_query($query); if (list($Poster) = mysql_fetch_row($result)) { do { if (strcmp($username,$Poster)!=0) { MailReplyNotice($Poster,$TopicID); $query = "UPDATE t_messages SET GotReplyNotice = 'yes' WHERE TopicID = '$TopicID' AND Poster = '$Poster'"; mysql_query($query); } } while (list($Poster) = mysql_fetch_row($result)); } } # #-----[ ACTION: SAVE & UPLOAD ]----------------------------------- # viewtopic.php message.php # #----------------------------------------------------------------- # EOF