PDA

View Full Version : mod/admin Hide Reason for Editing


teksigns
09-22-2004, 10:00 PM
ok i made a hack myself for this and it seems to work ok ....

all this does is make a option available to mods , and administrators
to be able to hide the reason for editing from everyone except
the mods and administrators .

mod is provided as-is to anyone that wants it .....


run this query :

ALTER TABLE `editlog` ADD `reason_hide` INT(1) DEFAULT '0' NOT NULL;



///////////////////////////////////


in template "postbit"

find:

<if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if>


replace with :


<if condition="(($post['edit_reason'] AND $post['reason_hide'] != 1) OR (($post['edit_reason']) AND (in_array($bbuserinfo[usergroupid], array (7,6,5)))))"><b>$vbphrase[reason]: $post[edit_reason]</b></if>



////////////////////////////////////

in template "editpost"

find :

<div><input type="text" class="bginput" name="reason" value="$newpost[reason]" size="50" maxlength="200" tabindex="1" title="$vbphrase[optional]" /><input type="hidden" name="reason_exists" value="$edit[reason_exists]" /></div>
</div>



add after :


<if condition="(in_array($bbuserinfo[usergroupid], array (7,6,5)))">
<div>Hide Reason From Everyone Except Moderators and Administrators ? <input type="checkbox" name="reason_hide" value="1"></div></if>

///////////////////////////////////


in file : "editpost.php"


find :

$edit['reason'] = htmlspecialchars_uni(fetch_censored_text(trim($_PO ST['reason'])));


add after:

$edit['reason_hide'] = intval($_POST['reason_hide']);

------------------------------------


find:

$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "editlog (postid, userid, username, dateline, reason)
VALUES ($postid, $bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", '" . addslashes($edit['reason']) . "')
");



change to :



$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "editlog (postid, userid, username, dateline, reason, reason_hide)
VALUES ($postid, $bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", '" . addslashes($edit['reason']) . "', '" . addslashes($edit['reason_hide']) . "')
");



/////////////////////////////////////


in "shothread.php"

find :


editlog.reason AS edit_reason,


replace all with :


editlog.reason AS edit_reason, editlog.reason_hide AS reason_hide,


/////////////////////////////////////




thats it !


now you can hide the reason from all except : moderators - supermods - and admins.


i hope this helps someone else.....

???`S?LV?R???`
09-23-2004, 06:27 PM
nice one

Boofo
09-24-2004, 02:59 AM
Could you please put this in a text file for easier download? ;)