#######################################################################
#
# 編輯 ./profile.php:
#######################################################################
在這之後:
if ($_POST['do'] == 'updatesignature')
{
globalize($_POST, array('WYSIWYG_HTML', 'message' => STR, 'preview'));
加上:
// Multiple Signatures Hack by Ethan -- Start of Code Block
$signatureid = intval($_POST['signatureid']);
if ($signatureid < 1) $signatureid = 1;
$signaturetitle = htmlspecialchars_uni(trim($_POST['signaturetitle']));
if ($signaturetitle == '') $signaturetitle = "$vbphrase[signature] $signatureid";
// Multiple Signatures Hack by Ethan -- End of Code Block
#####
修改:
else
{
$DB_site->query("
UPDATE " . TABLE_PREFIX . "usertextfield
SET signature = '" . addslashes($signature) . "'
WHERE userid = $bbuserinfo[userid]
");
為:
else {
// Multiple Signatures Hack by Ethan -- Start of Code Block
$DB_site->query("
UPDATE " . TABLE_PREFIX . "usertextfield
SET signature" . $signatureid . " = '" . addslashes($signature) . "' ,
sig_title" . $signatureid . " = '" . addslashes(htmlspecialchars_uni($signaturetitle)) . "'
WHERE userid = $bbuserinfo[userid]
");
$lastsignatureid = $signatureid;
// if user removed a signature, set the last edited signature to the first available signature
if ($signature == '') {
$lastsignatureid = 0;
for ($i = 1; $lastsignatureid == 0 AND $i <= N; ++$i) {
if ($signatureid != $i AND $bbuserinfo["signature$i"] != '') {
$signature = $bbuserinfo["signature$i"];
$lastsignatureid = $i;
}
}
}
$DB_site->query("
UPDATE " . TABLE_PREFIX . "userfield
SET lastsignatureid = $lastsignatureid
WHERE userid = $bbuserinfo[userid]
");
// Multiple Signatures Hack by Ethan -- End of Code Block
$DB_site->query("
UPDATE " . TABLE_PREFIX . "usertextfield
SET signature = '" . addslashes($signature) . "'
WHERE userid = $bbuserinfo[userid]
");
######
在這之後:
$smilieson = iif($vboptions['allowsmilies'], $vbphrase['on'], $vbphrase['off']);
加上:
// Multiple Signatures Hack by Ethan -- Start of Code Block
$signatureid = intval($_POST['signatureid']);
if ($signatureid < 1) $signatureid = $bbuserinfo['lastsignatureid'];
if ($signatureid < 1) $signatureid = 1;
$signaturetitle = htmlspecialchars_uni(trim($_POST['signaturetitle']));
if ($signaturetitle == '') $signaturetitle = "$vbphrase[signature] $signatureid";
// Multiple Signatures Hack by Ethan -- End of Code Block
#######
修改:
if (!isset($preview))
{
$signature = $bbuserinfo['signature'];
}
為:
if (!isset($preview))
{
$signature = $bbuserinfo['signature'];
// Multiple Signatures Hack by Ethan -- Start of Code Block
$signature = $bbuserinfo['signature' . $signatureid];
$signaturetitle = $bbuserinfo['sig_title' . $signatureid];
unset($_POST['WYSIWYG_HTML']);
// Multiple Signatures Hack by Ethan -- End of Code Block
}
#######################################################################
#
# 編輯 ./includes/functions_showthread.php:
#######################################################################
修改:
// get signature
if ($post['showsignature'] AND $vboptions['allowsignatures'] AND trim($post['signature']) != '' AND (!$bbuserinfo['userid'] OR $bbuserinfo['showsignatures']) AND $sigperms[$post['userid']])
{
if (!isset($sigcache["$post[userid]"]))
{
$parsed_postcache['skip'] = true;
$post['signature'] = parse_bbcode($post['signature'], 'nonforum', $vboptions['allowsmilies']);
$sigcache["$post[userid]"] = $post['signature'];
}
else
{
$post['signature'] = $sigcache["$post[userid]"];
}
}
為:
// Multiple Signatures Hack by Ethan -- Start of Code Block
// choose a random signature
if ($post['showsignature'] == 127) {
$sigtries = N;
$post['showsignature'] = rand(1, N);
while (($post['signature' . $post['showsignature']] == '') AND ($sigtries> 0)) {
$post['showsignature'] = ($post['showsignature'] % N) + 1;
--$sigtries;
}
if ($sigtries == 0) $post['showsignature'] = 0;
}
$post['signature'] = $post['signature' . $post['showsignature']];
// Multiple Signatures Hack by Ethan -- End of Code Block
// get signature
if ($post['showsignature'] AND $vboptions['allowsignatures'] AND trim($post['signature']) != '' AND (!$bbuserinfo['userid'] OR $bbuserinfo['showsignatures']) AND $sigperms[$post['userid']])
{
// Modified by Multiple Signature Hack, to uninstall change $sigcache["$post[userid]_$post[showsignature]"] to $sigcache["$post[userid]"]
if (!isset($sigcache["$post[userid]_$post[showsignature]"]))
{
$parsed_postcache['skip'] = true;
$post['signature'] = parse_bbcode($post['signature' . $post[showsignature], 'nonforum', $vboptions['allowsmilies']);
// Modified by Multiple Signature Hack, to uninstall change $sigcache["$post[userid]_$post[showsignature]"] to $sigcache["$post[userid]"]
$sigcache["$post[userid]_$post[showsignature]"] = $post['signature'];
}
else
{
// Modified by Multiple Signature Hack, to uninstall change $sigcache["$post[userid]_$post[showsignature]"] to $sigcache["$post[userid]"]
$post['signature'] = $sigcache["$post[userid]_$post[showsignature]"];
}
}
#######################################################################
#
# 安裝完成!
#######################################################################
#
# 你可能希望編輯短語 'show_your_signature' 來符合您所需的
# 相關選擇簽名標題.
#######################################################################
|