All pastes #232595 Raw Edit

Stuff

public text v1 · immutable
·published 2006-11-01 12:40 UTC
rendered paste body
##############################################################
## MOD Title: Moderator Tools on Viewforum
## MOD Author: eviL3 < evil@phpbbmodders.org > (Igor Wiedler) http://phpbbmodders.org
## MOD Author: Afterlife(69) < afterlife_69.hotmail.com > (Dean Newman) http://www.ugboards.com/
## MOD Description: This will add the standard moderator tools to authorized users on the right of the topic title as a floating div.
## MOD Version: 1.2.0
## 
## Installation Level: Easy
## Installation Time: 3 minutes
## Files To Edit:	viewforum.php,
##					templates/subSilver/viewforum_body.tpl
##
## Included Files:	N/A
##
## License: http://opensource.org/licenses/gpl-license.php GNU Public License v2 
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: 
##		This was an old mod that i recovered out of boredom. (Afterlife)
## 
##############################################################
## MOD History:
## 
##   2006-07-28 - Version 1.0.0
##		-	Released.
## 
##   2006-10-10 - Version 1.1.0
##		-	Overtaken by eviL
##		-	Added an modcp extension addon
## 
##   2006-10-12 - Version 1.2.0
##		-	Added some nice js stuff ;P
## 
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
viewforum.php

#
#-----[ FIND ]------------------------------------------
#
#
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
		/**
		 *	Moderator Tools on Viewforum
		 *	@ Author	: (1) Dean Newman
		 *	@ Author	: (2) eviL3
		 */
		/* --- ADD --- */
		$topic_mod = '';
		if ( $is_auth['auth_mod'] )
		{
			$topic_mod .= '<div style="float:right">';
			$topic_mod .= '<span class="topicmod" id="' . $topic_id . '">';
			$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=delete&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_delete'] . '" alt="' . $lang['Delete_topic'] . '" title="' . $lang['Delete_topic'] . '" border="0" /></a>&nbsp;';
			$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=move&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_move'] . '" alt="' . $lang['Move_topic'] . '" title="' . $lang['Move_topic'] . '" border="0" /></a>&nbsp;';
			$topic_mod .= ( $topic_rowset[$i]['topic_status'] == TOPIC_UNLOCKED ) ? "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=lock&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_lock'] . '" alt="' . $lang['Lock_topic'] . '" title="' . $lang['Lock_topic'] . '" border="0" /></a>&nbsp;' : "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=unlock&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_unlock'] . '" alt="' . $lang['Unlock_topic'] . '" title="' . $lang['Unlock_topic'] . '" border="0" /></a>&nbsp;';
			$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=split&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_split'] . '" alt="' . $lang['Split_topic'] . '" title="' . $lang['Split_topic'] . '" border="0" /></a>&nbsp;';
			$topic_mod .= '</span>';
			$topic_mod .= '<a href="javascript: show_topicmod(\'' . $topic_id . '\');">&laquo;</a>';
			$topic_mod .= '</div>';
		}
		/* --- END --- */

#
#-----[ FIND ]------------------------------------------
#
			'LAST_POST_IMG' => $last_post_url,

#
#-----[ AFTER, ADD ]------------------------------------------
#
			/**
			 *	Moderator Tools on Viewforum
			 *	@ Author	: (1) Dean Newman
			 *	@ Author	: (2) eviL3
			 */
			/* --- ADD --- */
			'TOPIC_MOD' => $topic_mod,
			/* --- END --- */

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewforum_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<form method="post"

#
#-----[ BEFORE, ADD ]------------------------------------------
#
<script language="Javascript" type="text/javascript">
<!--
window.onload = function ()
{
	elements = document.getElementsByTagName('span');
	for ( var i = 0 ; i < elements.length ; i++ )
	{
		if ( elements[i].className == 'topicmod' )
		{
			elements[i].style.display = 'none';
		}
	}
}

function show_topicmod( id )
{
	document.getElementById( id ).style.display = ( document.getElementById( id ).style.display == 'none' ) ? 'inline' : 'none';
}
//-->
</script>

#
#-----[ FIND ]------------------------------------------
#
<td class="row1" width="100%"><span class="topictitle">

#
#-----[ IN-LINE FIND ]------------------------------------------
#
<span class="topictitle">

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
{topicrow.TOPIC_MOD}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM