史萊姆論壇

史萊姆論壇 (http://forum.slime.com.tw/)
-   論壇程式討論區 (http://forum.slime.com.tw/f79.html)
-   -   快速編輯 (VB3) (http://forum.slime.com.tw/thread151936.html)

貝斯特 2005-06-21 03:41 PM

快速編輯 (VB3)
 
快速編輯 (VB3) - by EvilLS1

Description: This hack will allow your users to edit their posts without having to load the editpost page..

How it works: In the bottom lefthand corner of all your posts will be a small Quick Edit icon (users will only see it in posts which belong to them).. When you click it a small text box will instantly drop down below your post allowing you to edit it instantly in the thread itself.
This will save you a lot of time when fixing those spelling mistakes, typos, or broken links.

安裝步驟簡單,需修改檔案: 編輯2個檔案 , 編輯3個模版 , 與新增1個模版.


###### Instructions ######

##### 打開 includes/functions_showthread.php 搜尋:


$show['reputationlink'] = iif($vboptions['reputationenable'] AND $bbuserinfo['userid'] AND $post['userid'], true, false);
break;
}


##### 在下面增加:

// Quick Edit hack
if ($post['userid'] == $bbuserinfo['userid'])
{
$edittext = htmlspecialchars_uni($post['pagetext']);
eval('$quickedit = "' . fetch_template('showthread_quickedit') . '";');
}
else
{
$edittext="";
$quickedit="";
}
// End Quick Edit hack



##### 打開 showthread.php 搜尋:

'showthread_quickreply',


##### 在下面增加:

'showthread_quickedit',



##### 修改模板 showthread 搜尋:

</head>


##### 在前面增加:

<script language="JavaScript">
function toggleT(_w,_h) {
if(document.getElementById) { //This for Mozilla
if (_h=='s') eval("document.getElementById(_w).style.visibility='visible';");
if (_h=='h') eval("document.getElementById(_w).style.visibility='hidden';");
}
if (document.all) { // is IE
if (_h=='s') eval("document.all."+_w+".style.visibility='visible';");
if (_h=='h') eval("document.all."+_w+".style.visibility='hidden';");
}
else { // is NS?
if (_h=='s') eval("document.layers['"+_w+"'].visibility='show';");
if (_h=='h') eval("document.layers['"+_w+"'].visibility='hide';");
}
}
</script>



##### 修改模板 postbit_legacy 搜尋:

$post[iplogged]


##### 在下面增加:

$quickedit



##### 修改模板 postbit 搜尋:

<!-- / status icon and date -->


##### 在下面增加:

$quickedit



##### 建立一個新模版 "showthread_quickedit" 下面為模板內容:


<form enctype="multipart/form-data" name="vbulletinform" style="display:inline;" action="editpost.php" method="post" onreset="vB_RESET(this);">
<a href="javascript:return false;" onClick="toggleT('e$post[postid]','s');return false;"><img src="$stylevar[imgdir_button]/quickedit_icon.gif" alt="快速編輯" border="0" /></a>
<div id="e$post[postid]" style="VISIBILITY:hidden; z-index:1; position:absolute;">
<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" />

<table cellpadding="0" cellspacing="0" border="0" bgcolor="#000000" width="67" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr>
<td class="tcat" colspan="2"><b>快速編輯</b></td>
</tr>
<tr>
<td class="$bgclass"nowrap><b> 主 題:</b></td>
<td class="$bgclass"><input type="text" class="bginput" name="title" value="$post[title]" size="63" maxlength="85" tabindex="1"></td>
</tr>
<tr>
<td class="$bgclass" valign="top" nowrap><b>訊 息:</b>
<p>
</td>
<td class="$bgclass">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td><textarea name="message" class="bginput" style="width:455px; height:85px;" wrap="virtual" tabindex="1">$edittext</textarea><br>

<input type="submit" class="button" name="sbutton" accesskey="s" value="儲存變更" tabindex="3" />
<input type="reset" class="button" value="清除內容" tabindex="4">
<input type="button" class="button" value="Hide" onClick="toggleT('e$post[postid]','h')">

<if condition="$bbuserinfo['signature']"> <label for="cb_signature"><input type="checkbox" name="signature" value="1" id="cb_signature" tabindex="5" checked="checked" />Sig</label>
</if>

</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr></table>
<br />
</div>
</form>



##### 上傳 quickedit_icon.gif 於指定資料夾 (/forums/images/buttons/)


##### 修改完成! #####

If you find this hack useful please click install. :)

http://www.slime2.com.tw/forums/mac/buttons/quickedit_icon.gif


所有時間均為台北時間。現在的時間是 08:58 PM

Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2024, Jelsoft Enterprises Ltd.

『服務條款』

* 有問題不知道該怎麼解決嗎?請聯絡本站的系統管理員 *


SEO by vBSEO 3.6.1