######################################################## ## ## Hack Title: Delete Link next to Edit ## Hack Version: 1.0.1 ## Author: Christoph "Toxic" Hellings (toxic@freenet.de) ## Date Created: 09-09-02 ## Date Updated: 09-12-02 ## Thread Location: http://www.tforumhacks.com/tforum/viewtopic.php?TopicID=1110 ## Working Example: ## Description: Adds to the viewtopic page a delete link next to each edit link. ## ## ## Installation Level: Easy ## Installation Time: 5 Minutes ## Files To Edit: 4 ## Edit Database: no ## Included Files: none ## ######################################################## ## ## Installation/Author Notes: ## ## I think it works but no warranty... ## UPDATING INSTRUCTIONS 1.0.0 -> 1.0.1 ## check your viewtopic.php to get it like prsented in this version ## END OF UPDATING 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: OPEN ]------------------------------------------- # viewtopic.php # #-----[ ACTION: FIND ]------------------------------------------- # if (($CurrentUserInfo["UserName"] == $UserInfo["UserName"]) || $CurrentUserIsMod) $ent["MsgOptions"] = "$txt[Edit] | "; # #-----[ ACTION: REPLACE ]---------------------------------------- # if (($CurrentUserInfo["UserName"] == $UserInfo["UserName"]) || $CurrentUserIsMod) { $ent["MsgOptions"] = "$txt[Edit] | "; $ent["MsgOptions"] .= "$txt[Delete] | "; } # #-----[ ACTION: OPEN ]------------------------------------------- # message.php # #-----[ ACTION: FIND ]------------------------------------------- # case "Edit Message": $Action = "PostEditMessage"; break; # #-----[ ACTION: ADD AFTER ]-------------------------------------- # case "Yes, delete it!": $Action = "PostEditMessage"; break; # #-----[ ACTION: FIND ]------------------------------------------- # case "edit": $pagetitle = "Edit Message"; fHeader(); PrintEditPostForm(); fFooter(); break; # #-----[ ACTION: ADD AFTER ]-------------------------------------- # case "delete": $pagetitle = "Delete Message"; fHeader(); PrintDeletePostForm(); fFooter(); break; # #-----[ ACTION: OPEN ]------------------------------------------- # forum_template.php # #-----[ ACTION: ADD ]-------------------------------------------- # function PrintDeletePostForm() { global $MessageID,$fSettings,$txt; $UserPass = GrabUserPass(); $msgInfo = GrabMessageInfo($MessageID); ?>
">
"> ">
" align="left"> ">