VIP
05-11-2005, 10:58 PM
طريقة تسريع تصفخ المنتدى
يرجى أخذ نسخة إحتياطية من الملف قبل التعديل به
******************************************
1- إفتح ملف
FORUMDISPLAY.PHP
إبحث عن هذا الكود
********************************
$dotuserid='';
$dotjoin='';
$votequery='';
if ($showdots and $bbuserinfo[userid] >= 1) {
$dotuserid = 'DISTINCT post.userid,';
$dotjoin = "LEFT JOIN post ON (thread.threadid = post.threadid AND post.userid = '$bbuserinfo[userid]' AND post.visible = 1)";
}
إستبدله بهذا الكود
***************************************
$votequery='';
*************************************
إبحث عن هذا الكود
********************************
$threads=$DB_site->query("
SELECT $dotuserid $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postus erid,
lastposter,thread.dateline,views,thread.iconid,not es,thread.visible,sticky,votetotal,attach
FROM thread
".iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
$dotjoin
WHERE $threadids
ORDER BY sticky DESC, $sortfield $sqlsortorder
");
******************************
إستبدله بهذا الكود
**********************************
$threads=$DB_site->query("
SELECT $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postus erid,
lastposter,thread.dateline,views,thread.iconid,not es,thread.visible,sticky,votetotal,attach
FROM thread
".iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
WHERE $threadids
ORDER BY sticky DESC, $sortfield $sqlsortorder
");
if ($showdots and $bbuserinfo[userid] >= 1) {
$dotthreads = array();
$dottedthreads = $DB_site->query("SELECT DISTINCT threadid FROM post WHERE userid = '$bbuserinfo[userid]' AND visible = 1 AND ".substr($threadids,7));
while ($dottedthread = $DB_site->fetch_array($dottedthreads)) {
$dotthreads[] = $dottedthread['threadid'];
}
}
*************************************
إبحث عن هذا الكود
*************************************
if ($showdots and $bbuserinfo[userid] >= 1 an $bbuserinfo[userid] == $thread[userid]) {
d$thread[newoldhot] = 'dot_' . $thread[newoldhot];
}
*************************************
إستبدله بهذا الكود
**************************************
if ($showdots and $bbuserinfo[userid] >= 1 and in_array($thread['threadid'],$dotthreads)) {
$thread[newoldhot] = 'dot_' . $thread[newoldhot];
}
*********************************
إنتهى
يرجى أخذ نسخة إحتياطية من الملف قبل التعديل به
******************************************
1- إفتح ملف
FORUMDISPLAY.PHP
إبحث عن هذا الكود
********************************
$dotuserid='';
$dotjoin='';
$votequery='';
if ($showdots and $bbuserinfo[userid] >= 1) {
$dotuserid = 'DISTINCT post.userid,';
$dotjoin = "LEFT JOIN post ON (thread.threadid = post.threadid AND post.userid = '$bbuserinfo[userid]' AND post.visible = 1)";
}
إستبدله بهذا الكود
***************************************
$votequery='';
*************************************
إبحث عن هذا الكود
********************************
$threads=$DB_site->query("
SELECT $dotuserid $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postus erid,
lastposter,thread.dateline,views,thread.iconid,not es,thread.visible,sticky,votetotal,attach
FROM thread
".iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
$dotjoin
WHERE $threadids
ORDER BY sticky DESC, $sortfield $sqlsortorder
");
******************************
إستبدله بهذا الكود
**********************************
$threads=$DB_site->query("
SELECT $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postus erid,
lastposter,thread.dateline,views,thread.iconid,not es,thread.visible,sticky,votetotal,attach
FROM thread
".iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
WHERE $threadids
ORDER BY sticky DESC, $sortfield $sqlsortorder
");
if ($showdots and $bbuserinfo[userid] >= 1) {
$dotthreads = array();
$dottedthreads = $DB_site->query("SELECT DISTINCT threadid FROM post WHERE userid = '$bbuserinfo[userid]' AND visible = 1 AND ".substr($threadids,7));
while ($dottedthread = $DB_site->fetch_array($dottedthreads)) {
$dotthreads[] = $dottedthread['threadid'];
}
}
*************************************
إبحث عن هذا الكود
*************************************
if ($showdots and $bbuserinfo[userid] >= 1 an $bbuserinfo[userid] == $thread[userid]) {
d$thread[newoldhot] = 'dot_' . $thread[newoldhot];
}
*************************************
إستبدله بهذا الكود
**************************************
if ($showdots and $bbuserinfo[userid] >= 1 and in_array($thread['threadid'],$dotthreads)) {
$thread[newoldhot] = 'dot_' . $thread[newoldhot];
}
*********************************
إنتهى