vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   mod/admin Hide Reason for Editing (https://vborg.vbsupport.ru/showthread.php?t=69775)

teksigns 09-22-2004 10:00 PM

mod/admin Hide Reason for Editing
 
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 :

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.....

???`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? ;)


All times are GMT. The time now is 08:24 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01208 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete