Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-22-2004, 11:33 PM
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 ?
Reply With Quote
  #2  
Old 09-23-2004, 12:03 AM
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did a quick search
https://vborg.vbsupport.ru/showthrea...006#post554006

Reply With Quote
  #3  
Old 09-23-2004, 12:08 AM
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Johnny

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 .....
Reply With Quote
  #4  
Old 09-23-2004, 01:25 AM
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 09-23-2004, 01:37 AM
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Johnny
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

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.....
Reply With Quote
  #6  
Old 09-23-2004, 02:47 AM
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
<if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if> 
replace with
PHP Code:
<if condition="$post[usergroupid]==7">$vbphrase[reason]: $post[edit_reason]</if>
<if 
condition="$post[usergroupid]==6">$vbphrase[reason]: $post[edit_reason]</if>
<if 
condition="$post[usergroupid]==5">$vbphrase[reason]: $post[edit_reason]</if> 
i added 3conditionals for each group u have u can replase 7,6,5 with whatever group u have ur moderators in or whatever group u want the ability to see the edit reason.


6= administrators
7= moderators
5= super moderators

someone correct me if their is an alternative.
Reply With Quote
  #7  
Old 09-23-2004, 03:17 AM
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
however using something like this would require a template edit or something
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......
Reply With Quote
  #8  
Old 09-23-2004, 04:32 AM
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.....
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:40 PM.


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.08160 seconds
  • Memory Usage 2,249KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (13)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete