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.