The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
req: moderator edit reason hack
i need a hack that will show a extra field to moderators and administrators
when editing a post.... this field would allow them to enter a staff note as to the reason why the post was edited .... the reason for editing would then appear at the bottom of the postbit and only be visable to administrators and moderators . anyone have any idea if something like this is around ? |
#2
|
||||
|
||||
|
#3
|
||||
|
||||
Quote:
that is only for closing a thread .... i dont want to close a thread .... and i dont want the reason to be thread based .... i need the the reason to be post based and not to close the thread ..... |
#4
|
||||
|
||||
omg, im sorry i miss read the post i thought u were asking for reason for closing.
the edit reason is already default in vb, you can just go to edit anyones post and right below the title of the post should have a field for edit reason and it should display in the postbit |
#5
|
||||
|
||||
Quote:
i realize this , however if i use the default edit reason then it shows the reason to everyone .... i dont want the reason visable to anyone except moderator and administrators . and i dont want to get rid of the edit reason for members eather .... so therefor i need a seperate edit reason field for admin or a checkbox beside the reason field to hide the reason from members..... |
#6
|
||||
|
||||
well im not really sure how to have multiple group ids under one condition but you can do this
in your postbit template search for this PHP Code:
PHP Code:
6= administrators 7= moderators 5= super moderators someone correct me if their is an alternative. |
#7
|
||||
|
||||
yes i realize i could do :
Code:
<if condition="(in_array($post[usergroupid], array (7,6,5)))"> but this would defeat the purpose of having the reson for editing box for regular users..... i want to keep the one for them ...... not restrict it completly ..... what it needs is a check box next to the reason field that only appears to admin and moderators that when checked hides the reason from all others except mods and admin ...... guess it would check using something like this: Code:
<if condition="$post['edit_reason'] AND !$post['reason_allow']">$vbphrase[reason]: $post[edit_reason]</if> to get the checkbox working and another field added to the post table called "reason_allow". basicly if you checked the box to hide the reason message for a post it would set the default bit in "reason_allow" from 0 to 1. however i have no idea what part of the php files to edit to get the new database field updated when a user checks the box...... |
#8
|
||||
|
||||
ok i made a hack myself for this and it seems to work ok ....
run this query : Code:
ALTER TABLE `editlog` ADD `reason_hide` INT(1) DEFAULT '0' NOT NULL; /////////////////////////////////// in template "postbit" find: Code:
<if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if> replace with : Code:
<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 : Code:
<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 : Code:
<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 : Code:
$edit['reason'] = htmlspecialchars_uni(fetch_censored_text(trim($_POST['reason']))); add after: Code:
$edit['reason_hide'] = intval($_POST['reason_hide']); find: Code:
$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 : Code:
$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 : Code:
editlog.reason AS edit_reason, replace all with : Code:
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..... |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|