بلوك آخر عشرة مواضيع
يظهر مواضيع المشرفين هل من حل؟
علما أن هذا الكود هو ماوضعته في النيوك
كود:
<?
if (eregi("block-Sample_Block.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$dbname="sos4all_com1"; // اسم القاعدة
$dbnukename="sos4all_com5"; // اسم قاعدة بيانات النيوك
$url="http://www.sos4all.com/vb"; //عنوان المنتدى بدون الخط المائل (/)
$topics = "10"; //عدد المواضيع التي ترغب في عرضها
// $db=mysql_connect($servername,$dbusername,$dbpassword); الغ هذا السطر
mysql_select_db($dbname);
$forumquery = "select * from forum where allowposting=1";
$forumresult = mysql_query($forumquery);
$forumcount = mysql_numrows($forumresult);
$threadquery = "select * from thread order by lastpost desc limit 0,$topics";
$threadresult = mysql_query($threadquery);
$threadcount=mysql_numrows($threadresult);
if ($threadcount == "0") {
$content .= "لا توجد أي مشاركات";
}
else {
while($row = mysql_fetch_object($threadresult)) {
$replays="$row->replycount";
$postusername=$row->postusername;
$lastposter=$row->lastposter;
$suumary="حررت بواسطة: $postusername - آخر مشاركة: $lastposter - عدد الردود: $replays";
$content .=" » <acronym title=\"$suumary\"><a href=\"$url/showthread.php?threadid=$row->threadid\">$row->title</a></acronym><br>";
}
}
// mysql_close(); الغ هذا السطر
mysql_select_db($dbnukename);
?>