View Single Post
  #313  
Old 05-28-2005, 02:30 PM
zetetic's Avatar
zetetic zetetic is offline
 
Join Date: Apr 2004
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Snitz
I thought this hack will allow also the mods and admins to use it on all the posts, but I was wrong.....
anyway update it to make it work for mods and admins ?
All your answers can be found in this thread, Snitz. But if you don't want to read it...

I have it configured so that mods and admins can edit all posts, and with a 'preview' button that opens the advanced editor. I also fixed the subscription bug.

Here's what I have in functions_showthread.php
PHP Code:
    // Quick Edit hack 
        
if (($bbuserinfo['usergroupid'] == 6) or (can_moderate($foruminfo['forumid'])) or ($post['userid'] == $bbuserinfo['userid'])) 
        { 
                
$edittext htmlspecialchars_uni($post['pagetext']); 
                eval(
'$quickedit = "' fetch_template('showthread_quickedit') . '";'); 
        } 
        else 
        { 
                
$edittext=""
                
$quickedit=""
        } 
    
// End Quick Edit hack 
And my showthread_quickedit template:

HTML Code:
<span id="quickedit_$post[postid]">
				<img src="$stylevar[imgdir_button]/quickedit.gif" alt="Quick Edit" border="0" />
				<script type="text/javascript"> vbmenu_register("quickedit_$post[postid]", true); </script>
			</span>
<div class="vbmenu_popup" id="quickedit_$post[postid]_menu" style="display:none">
<form enctype="multipart/form-data" name="vbulletinform" style="display:inline;" action="editpost.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="do" value="updatepost" />
<input type="hidden" name="p" value="$post[postid]" />
<input type="hidden" name="posthash" value="$posthash" />
<input type="hidden" name="poststarttime" value="$poststarttime" />
<input type="hidden" name="disablesmilies" value="0" />
<input type="hidden" name="parseurl" value="1" id="cb_parseurl" />
<input type="hidden" name="iconid" value="$post[iconid]" />
<input type="hidden" name="emailupdate" value="9999" />	
<table class="tborder" cellpadding="6" cellspacing="1" width="100%" border="0" align="left">
<tr>
<td class="tcat" align="left">
<strong>$vbphrase[edit_post]</strong>
</td>
</tr>
<tbody> 
<tr valign="top">
<td class="panelsurround" align="center">
<div class="panel">
<div align="left">
	<div class="smallfont" style="margin-bottom:$stylevar[formspacer]px">
	 <div>$vbphrase[reason_for_editing]:</div>
	 <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>
	<div class="smallfont" style="margin-bottom:$stylevar[formspacer]px">
	 <div>$vbphrase[title]:</div>
	 <div><input type="text" class="bginput" name="title" value="$post[title]" size="60" maxlength="85" tabindex="1" /></div>
	</div>
	<div class="smallfont" style="margin-bottom:$stylevar[formspacer]px">
	 <div>$vbphrase[message]:</div>
	 <div><textarea name="message" class="bginput" style="width:433px; height:125px;" wrap="virtual" tabindex="1">$edittext</textarea></div>
	</div>
	<fieldset class="fieldset">
	 <legend>$vbphrase[miscellaneous_options]</legend>
	 <div style="padding:3px">
	 <if condition="$bbuserinfo['signature'] != ''"><div><label for="cb_signature"><input type="checkbox" name="signature" value="1" id="cb_signature" tabindex="1" checked />$vbphrase[show_your_signature]</label></div></if>
	 <div><label for="cb_parseurl"><input type="checkbox" name="parseurl" value="1" id="cb_parseurl" tabindex="1" checked />$vbphrase[automatically_parse_links_in_text]</label></div>
	 <div><label for="cb_disablesmilies"><input type="checkbox" name="disablesmilies" value="1" id="cb_disablesmilies" tabindex="1" />$vbphrase[disable_smilies_in_text]</label></div>
	 </div>
	</fieldset>
</div>
</div>
<div style="margin-top:6px">
	<input type="submit" class="button" name="sbutton" value="Save Changes" accesskey="s" tabindex="1" />
	<input type="submit" class="button" name="preview" value="Preview Changes" accesskey="p" tabindex="1" />
<input type="checkbox" name="emailupdate" value="1" checked /><span class="smallfont">Subscribe</span>
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
You might have to tweak it some for your style... can't remember if I did.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01113 seconds
  • Memory Usage 1,839KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete