کد PHP:
<?php
print '
<html dir="rtl">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>www.vbskin.ir Last Posts</title>
<style>
.style { font-family: Tahoma ;font-size: 8pt;}
a:link{ text-decoration: none;}
a:visited{ text-decoration: none;}
a:hover, a:active{ text-decoration: underline;}
</style>
';
## CUSTOMIZE SETTINGS FOR YOUR SITE ##
$db_host = "localhost"; // Change this if your MySQL database host is different.
$db_name = ""; // Change this to the name of your database.
$db_user = ""; // Change this to your database username.
$db_pw = ""; // Change this to your database password.
$forum_url = "."; // Change this to reflect to your forum's URL.
$forum_id = "";
$limit = "20"; // Number of posts displayed.
$titlecolor = "#000066"; // This is the color of the title.
$postedcolor = "000000"; // This is the color of the bottom text.
$txtlimit = "200"; // This is the character limit.
#######################################
// Connecting to your database
mysql_connect($db_host, $db_user, $db_pw)
OR die ("Cannot connect to your database");
mysql_select_db($db_name) OR die("Cannot connect to your database");
// Below is the beginning of a table. If you feel you don't need it, you may remove it.
echo"<marquee onmouseover=this.stop() onmouseout=this.start() dir=\"rtl\" direction=\"up\" scrollAmount=\"1\" scrolldelay=\"1\">";
echo "<table dir=\"rtl\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";
if ($forum_id) {
$forumid = "AND forumid=$forum_id";
}
if ($limit) {
$limited = "LIMIT $limit";
}
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter,replycount,views FROM thread WHERE visible=1 AND open=1 $forumid ORDER BY lastpost DESC $limited");
while($thread_get=mysql_fetch_array($thread_sql))
{
$replycount = $thread_get['replycount'];
$views = $thread_get['views'];
$lastpost = $thread_get['lastpost'];
$poster = $thread_get['lastposter'];
$tid = $thread_get['threadid'];
$psql = mysql_query("SELECT postid FROM post WHERE threadid=$tid ORDER BY postid DESC");
$getp=mysql_fetch_array($psql);
$pid = $getp['postid'];
$date2 = date ("m/d/y h:i A" ,$lastpost);
$title = $thread_get['title'];
$title = substr($title,0,$txtlimit);
echo "<font face=\"Tahoma\"><span style=\"font-size: 8pt\"><tr dir=\"rtl\"><td dir=\"rtl\"></span></font><font face=\"Tahoma\" style=\"font-size: 9px\"><table border=\"0\" width=\"100%\" id=\"table1\" cellspacing=\"0\" cellpadding=\"0\"><tr> <td width=\"400\"><a target=_blank href=\"$forum_url/showthread.php?t=$tid&p=$pid\">\n";
echo " <span style=\"font-size: 8pt; text-decoration:none\"><font color=\"#000066\">$title</font></span></a></td> </font>\n";
echo " <td width=\"51\"><span style=\"font-size: 8pt\"><font face=\"Tahoma\">نويسنده :</span></td> \n";
echo " <td width=\"100\" align=\"center\">\n";
echo " <font face=\"Tahoma\" style=\"font-size: 8pt\" color=\"#003399\">$poster</td> \n";
echo " <td width=\"72\"><font face=\"Tahoma\" style=\"font-size: 8pt\">| مشاهده ها :</td> \n";
echo " <td width=\"25\" align=\"center\"><center> \n";
echo " <font face=\"Tahoma\" style=\"font-size: 8pt\" color=\"#003399\">$views </center></td><td width=\"59\"> <font face=\"Tahoma\" style=\"font-size: 8pt\">| پاسخ ها :</td> <td> \n";
echo " <font face=\"Tahoma\" style=\"font-size: 8pt\" color=\"#003399\">$replycount</td> </tr></table><font face=\"Tahoma\" style=\"font-size: 8pt\"></td></tr>";
}
echo "</table>";
echo"</marquee>";
?>
علاقه مندی ها (Bookmarks)