i have a scroll that show the last posts on my forum.
i installed and tested the advanced rewrite mod on localhost and it shows that normal URL like viewtopic.php?f=3
so i want to change it to be compatible with advanced rewrite mod:
- Code: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
a:link {
color: #004477;
text-decoration: none;
}
a:visited {
color: #990000;
text-decoration: none;
}
a:hover {
color: #FF0000;
text-decoration: none;
}
a:active {
color: #666666;
text-decoration: none;
}
-->
</style>
</head>
<body bgcolor="#F4F6FB">
<?php
$lang['ENCODING'] = 'UTF-8';
$lang['DIRECTION'] = "rtl";
$lang['LEFT'] = "right";
$lang['RIGHT'] = "left";
//Developed & Fixed By Mahdi1944
// Basic Configuration
// How Many Topics you want to display?پيمان
$topicnumber = 40;
// Scrolling towards up or down?
$scroll = "up";
// Change this to your phpBB path
$urlPath = "http://127.0.0.1/phpBB3-SEO-Premod_V_3-0-2/";
// Database Configuration (Where your phpBB config.php file is located
include 'config.php';
// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");
mysql_query("SET NAMES 'utf8'", $link);
mysql_query("SET character_set_connection = 'utf8'", $link);
// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_views, t.topic_replies, t.topic_title, f.forum_name, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.topic_status <> 2 AND
t.forum_id <> 30 AND
t.forum_id <> 41 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");
print "<marquee dir=\"rtl\" align=\"center\" id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"150\" width=\"100%\" scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">";
print "<div align=\"center\">";
print "<table cellpadding='3' cellSpacing='2' >";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if ($row["forum_id"] <> 700)
{
echo
"<tr valign='top'>
<td><font face=\"Tahoma\" size=\"1\"><font color=\"#FFCC00\"><b> </b><font color=\"#978981\"> موضوع :
<a target =\"_blank\" a href=\"./viewtopic.php?p=$row[topic_last_post_id]#$row[topic_last_post_id]\">
<span style=\"text-decoration: none\">" . $row["topic_title"] .
"</span></a></td></font></b><td><font face=\"Tahoma\" size=\"1\"><font color=\"#978981\"> انجمن :
<font color=\"#978981\">
<$urlPath/viewtopic.php?p=$row[topic_last_post_id]#$row[topic_last_post_id]>" . $row["forum_name"] .
"</td><td><font face=\"Tahoma\" size=\"1\"><font color=\"#C0C0C0\">" .
"</span></a></td></font></b><td><font face=\"Tahoma\" size=\"1\"><font color=\"#978981\"> بازديدها :
<font color=\"#978981\">
<$urlPath/viewtopic.php?p=$row[topic_last_post_id]#$row[topic_last_post_id]>" . $row["topic_views"] .
"</td><td><font face=\"Tahoma\" size=\"1\"><font color=\"#C0C0C0\">" .
"</span></a></td></font></b><td><font face=\"Tahoma\" size=\"1\"><font color=\"#978981\"> پاسخ ها :
<font color=\"#978981\">
<$urlPath/viewtopic.php?p=$row[topic_last_post_id]#$row[topic_last_post_id]>" . $row["topic_replies"] .
"</td><td><font face=\"Tahoma\" size=\"1\"><font color=\"#C0C0C0\">" .
"</span></a></td></font></b><td><font face=\"Tahoma\" size=\"1\"><font color=\"#978981\"> آخرين ارسال :
<a target =\"_blank\" a href=\"./memberlist.php?mode=viewprofile&u=$row[user_id]\">" . $row["username"] .
"</td><td><font face=\"Tahoma\" size=\"1\"><font color=\"#C0C0C0\">" .
"</td></tr></font>";
}
}
print "</table></div></marquee>";
// Free Result
mysql_free_result($result);
// Close the Connection
mysql_close($link);
?>
</body>
</html>
and also i can exclude some forum id to be show .
after this:
- Code: Select all
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if i add some lines like this:
- Code: Select all
if ($row["forum_id"] <> X)
that X is forum id.
can u plz help me?

English |
French


