اقتباس
التعديل سيكون في ثلاثة أماكن :
تحرير ملف :
forumdisplay.php
اضافة قالب جديد:
forumdisplay_quickstats
تعديل في قالب :
forumdisplay
الخطوة الأولى افتح ملف :
if ($forumstats['lastupdate'] == 0 OR ($forumstats['lastupdate'] + ($updatetime * 60)) < TIMENOW)
{
$numcount=$DB_site->query_first("
SELECT COUNT(threadid) AS threads, SUM(replycount) AS replies, SUM(views) AS views
FROM " . TABLE_PREFIX . "thread
WHERE forumid=$forumid
");
$forumid = intval($forumid);
$threadavg = $DB_site->query_first("
SELECT AVG(votetotal / votenum) AS avgrating
FROM " . TABLE_PREFIX . "thread
WHERE forumid=$forumid
AND votenum <> 0
");
$topthreads = $DB_site->query_first("
SELECT COUNT(threadid) as threads, postusername, postuserid
FROM " . TABLE_PREFIX . "thread
WHERE forumid=$forumid
GROUP BY postuserid
ORDER BY threads DESC, dateline ASC
LIMIT 1
");
$topposter = $DB_site->query_first("
SELECT user.userid, user.username, COUNT(post.postid) AS postcount
FROM " . TABLE_PREFIX . "post
LEFT JOIN " . TABLE_PREFIX . "thread ON (post.threadid = thread.threadid)
LEFT JOIN " . TABLE_PREFIX . "user ON (post.userid = user.userid)
WHERE thread.forumid=$forumid
GROUP BY post.userid
ORDER BY postcount DESC
LIMIT 1
");
$attachs=$DB_site->query_first("
SELECT forum.title AS forum, COUNT(attachment.attachmentid) AS count, SUM(IF(thumbnail = '', 0, 1)) AS thumbs, SUM(IF(thumbnail = '', 1, 0)) AS files, SUM(attachment.filesize) AS bytes
FROM " . TABLE_PREFIX . "attachment, " . TABLE_PREFIX . "post, " . TABLE_PREFIX . "thread, " . TABLE_PREFIX . "forum
WHERE attachment.postid = post.postid
AND post.threadid=thread.threadid
AND forum.forumid=thread.forumid
AND forum.forumid=$forumid
GROUP BY thread.forumid
ORDER BY count DESC
");
*****************************
لا زلنا في forumdisplay.php
في السطر 281 (تقريبا) ابحث عن
*****************************
// ### BUILD FORUMS LIST #################################################
*****************************
في أعلاه ضع الكود التالي:
*****************************
// Logician Last Post Minute Hack
if ($forumcache[$forumid]['lastpost'] AND $forumcache[$forumid]['lastpost']>0)
{
$lastpostdateline=(time()-$forumcache[$forumid]['lastpost'])/60;
if ($lastpostdateline<1) {
if (($lastpostdateline*60)<1) {$lastpostmin=" Now!";}
elseif (($lastpostdateline*60)<2) {$lastpostmin=(int)($lastpostdateline*60)." second ago!";}
else {$lastpostmin=(int)($lastpostdateline*60)." seconds ago!";}
}
elseif ($lastpostdateline<2) {$lastpostmin=(int)($lastpostdateline)." minute ago";}
elseif ($lastpostdateline<60) {$lastpostmin=(int)($lastpostdateline)." minutes ago";}
elseif ($lastpostdateline<(120)) {$lastpostmin=(int)($lastpostdateline/60)." hour ago";}
elseif ($lastpostdateline<(60*24)) {$lastpostmin=(int)($lastpostdateline/60)." hours ago";}
elseif ($lastpostdateline<(60*48)) {$lastpostmin=" Yesterday";}
else {$lastpostmin=((int)($lastpostdateline/(60*24)))." days ago";}
$lastthreadid = $forumcache[$forumid]['lastthreadid'];
$lastposter = $forumcache[$forumid]['lastposter'];
}
// Logician Last Post Minute Hack
*****************************
انتهينا من تحرير ملف forumdisplay.php
*****************************
الآن أضف قالب جديد بإسم " forumdisplay_quickstats " وضع الكود التالي بداخله :
*****************************
الساعة معتمدة بتوقيت جرينتش +3 . الساعة الآن : 20:27.
المعهد غير مسؤول عن أي اتفاق تجاري أو تعاوني بين الأعضاء
فعلى كل شخص تحمل مسئولية نفسه إتجاه مايقوم به من بيع وشراء وإتفاق وأعطاء معلومات موقعه
التعليقات المنشورة لا تعبر عن رأي معهد ترايدنت ولا نتحمل أي مسؤولية قانونية حيال ذلك (ويتحمل كاتبها مسؤولية النشر)