查看單個文章
舊 2005-06-21, 03:40 PM   #6 (permalink)
貝斯特 帥哥
長老會員
 
貝斯特 的頭像
榮譽勳章
UID - 90669
在線等級: 級別:1 | 在線時長:11小時 | 升級還需:1小時
註冊日期: 2003-08-06
住址: The Gates of Hell
文章: 1758
現金: 15064 金幣
資產: 5185909 金幣
預設

搜索:
$getthreadids = $DB_site->query("
SELECT " . iif($sortfield == 'voteavg', $votequery) . " threadid
FROM " . TABLE_PREFIX . "thread AS thread
$deljoin
WHERE forumid = $foruminfo[forumid]
AND sticky = 0
AND visible = 1
$globalignore
$datecut
$limitothers
$delthreadlimit
ORDER BY sticky DESC, $sqlsortfield $sqlsortorder
LIMIT $limitlower, $perpage
");
替換為:
// newvbb 修改開始 精華區
$getthreadids = $DB_site->query("
SELECT " . iif($sortfield == 'voteavg', $votequery) . " threadid
FROM " . TABLE_PREFIX . "thread AS thread
$deljoin
WHERE forumid = $foruminfo[forumid]
AND sticky = 0
AND visible = 1
$globalignore
$datecut
$limitothers
$delthreadlimit
$viewgoodnees
ORDER BY sticky DESC, $sqlsortfield $sqlsortorder
LIMIT $limitlower, $perpage
");
// newvbb 修改結束

搜索:
$pagenav = construct_page_nav($totalthreads, "forumdisplay.php?$session[sessionurl]f=$forumid", "&sort=$sortfield&order=$sortorder&pp=$perpage&daysprune=$daysprune");
替換為:
// newvbb 修改開始
// 精華區
if ($_REQUEST['do']=='viewgoodnees') {
$dogoodnees = '&do=viewgoodnees';
}

$pagenav = construct_page_nav($totalthreads, "forumdisplay.php?$session[sessionurl]f=$forumid$dogoodnees", "&sort=$sortfield&order=$sortorder&pp=$perpage&daysprune=$daysprune");
// newvbb 修改結束
postings.php
搜索:
case 'stick':
在後面添加:
// newvbb 修改開始
case 'goodnees':
// newvbb 修改結束
搜索:
unset($newthreadinfo['vote'], $newthreadinfo['threadid'], $newthreadinfo['sticky'], $newthreadinfo['votenum'], $newthreadinfo['votetotal'], $newthreadinfo['isdeleted'], $newthreadinfo['del_userid'], $newthreadinfo['del_username'], $newthreadinfo['del_reason'], $newthreadinfo['issubscribed'], $newthreadinfo['emailupdate'], $newthreadinfo['folderid']);
替換為:
// newvbb 修改開始
// 精華主題推薦-非凡豬0113-此處複製主題增加重設精華
unset($newthreadinfo['vote'], $newthreadinfo['threadid'], $newthreadinfo['sticky'], $newthreadinfo['goodnees'], $newthreadinfo['votenum'], $newthreadinfo['votetotal'], $newthreadinfo['isdeleted'], $newthreadinfo['del_userid'], $newthreadinfo['del_username'], $newthreadinfo['del_reason'], $newthreadinfo['issubscribed'], $newthreadinfo['emailupdate'], $newthreadinfo['folderid']);
// newvbb 修改結束
搜索:
$_REQUEST['forceredirect'] = 1;
$url = "showthread.php?$session[sessionurl]t=$threadid";
eval(print_standard_redirect('redirect_sticky'));
}
在後面添加:
// newvbb 修改開始
// 精華主題推薦-非凡豬
// ############################### start goodnees / ungoodnees thread ###############################
if ($_POST['do'] == 'goodnees')
{
if (!$threadinfo['visible'] OR $threadinfo['isdeleted'])
{
eval(print_standard_error('error_invalidid'));
}

if (!can_moderate($threadinfo['forumid'], 'canmanagethreads'))
{
print_no_permission();
}

//取主題鏈結bb代碼。
$threadlink = "[thread=$threadinfo[threadid]]".$threadinfo['title']."[/thread]";

if ($threadinfo['goodnees'])
{
$threadinfo['goodnees'] = 0;
$notes = construct_phrase($vbphrase['thread_ungoodnees_by_x_on_y_at_z'], $bbuserinfo['username'], vbdate($vboptions['dateformat'], TIMENOW), vbdate($vboptions['timeformat'], TIMENOW));
$logaction = construct_phrase($vbphrase['ungoodnees_thread_x'], $threadinfo['title']);
$action = $vbphrase['ungoodnees'];
global $vboptions;
// 金錢-取消精華減少金錢
if ($vboptions['goodneesmoney'])
{
$domoney = '';
$domoney = "money=money-".$vboptions['goodneesmoney'].",";
}
else
{
$domoney = "";
}
// 寫入到用戶悄悄話
if ($vboptions['goodpm'])
{
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature, allowsmilie)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '" . addslashes($vbphrase['pm_thread_isnot_goodnees']) . "', '" . addslashes($vbphrase['pm_thread_isnot_goodnees_c'].$threadlink) . "', '" . addslashes(serialize(array($threadinfo['postusername']))) . "', '', " . TIMENOW . ", 1, 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid) VALUES ($pmtextid, $threadinfo[postuserid])");
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, folderid, messageread) VALUES ($pmtextid, $bbuserinfo[userid], -1, 1)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1 WHERE userid=$bbuserinfo[userid]");
$pmsend = "pmtotal=pmtotal+1, pmunread=pmunread+1,";
}
else
{
$pmsend = "";
}
//更新金錢、未讀悄悄話、用戶精華文章數
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET $domoney $pmsend goodnees=goodnees-1 WHERE userid=$threadinfo[postuserid]");
}
else
{
$threadinfo['goodnees'] = 1;
$notes = construct_phrase($vbphrase['thread_goodnees_by_x_on_y_at_z'], $bbuserinfo['username'], vbdate($vboptions['dateformat'], TIMENOW), vbdate($vboptions['timeformat'], TIMENOW));
$logaction = construct_phrase($vbphrase['goodnees_thread_x'], $threadinfo['title']);
$action = $vbphrase['goodnees'];
global $vboptions;
//金錢-推薦精華增加金錢
if ($vboptions['goodneesmoney'])
{
$domoney = "money=money+".$vboptions['goodneesmoney'].",";
}
else
{
$domoney = "";
}
// 寫入到用戶悄悄話
if ($vboptions['goodpm'])
{
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature, allowsmilie)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '" . addslashes($vbphrase['pm_thread_is_goodnees']) . "', '" . addslashes($vbphrase['pm_thread_is_goodnees_c'].$threadlink) . "', '" . addslashes(serialize(array($threadinfo['postusername']))) . "', '', " . TIMENOW . ", 1, 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid) VALUES ($pmtextid, $threadinfo[postuserid])");
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, folderid, messageread) VALUES ($pmtextid, $bbuserinfo[userid], -1, 1)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1 WHERE userid=$bbuserinfo[userid]");
$pmsend = "pmtotal=pmtotal+1, pmunread=pmunread+1,";
}
else
{
$pmsend = "";
}
//更新金錢、未讀悄悄話、用戶精華文章數
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET $domoney $pmsend goodnees=goodnees+1 WHERE userid=$threadinfo[postuserid]");
}
log_moderator_action($threadinfo, $logaction);

$notes .= ' ' . $threadinfo['notes'];

$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET goodnees = $threadinfo[goodnees], notes = '" . addslashes($notes) . "' WHERE threadid = $threadid");

$_REQUEST['forceredirect'] = 1;
$url = "showthread.php?$session[sessionurl]t=$threadid";
eval(print_standard_redirect('redirect_goodnees'));
}
// newvbb 修改結束

搜索:
$openchecked = iif($threadinfo['open'], HTML_CHECKED);
$stickychecked = iif($threadinfo['sticky'], HTML_CHECKED);
在後面添加:
// newvbb 修改開始
$goodneeschecked = iif($threadinfo['goodnees'], HTML_CHECKED);
// newvbb 修改結束
搜索:
'sticky' => STR,
在後面添加:
// newvbb 修改開始
'goodnees' => STR,
// newvbb 修改結束
__________________

給自己看也給所有需要這些話鼓勵的人看!

認真不一定會得到美好的結果,但是不認真就一定沒有

想要有什麼結果,就秉持你的雙手
放手去做
總比什麼都沒付出最後失敗了才嘆氣來的好吧
沒努力的人.沒有資格說放棄
努力過的人.更要有勇氣繼續努力下去
貝斯特 目前離線  
送花文章: 1, 收花文章: 38 篇, 收花: 123 次
回覆時引用此帖
向 貝斯特 送花的會員:
kobmmgyzsi (2014-06-15)
感謝您發表一篇好文章