helping to change codes for being compatibe with advance

phpBB2 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting categories, forums and topic titles in their URLs.

Moderator: Moderators

helping to change codes for being compatibe with advance

Postby Professional » Mon Aug 04, 2008 2:29 pm

hi.
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? :oops:
User avatar
Professional
PR5
PR5
 
Posts: 543
Joined: Mon Apr 07, 2008 5:41 am
Location: 1/2 of the World

Advertisement

Postby dcz » Wed Aug 06, 2008 8:02 am

Well since the code does not use phpBB's code and functions, it won't be this easy.

You may want to wait until GYM B3 to be able to use the feed parser :
http://phpbb3.phpbb-seo.net/demo/rss-links.php
http://phpbb3.phpbb-seo.net/demo/rss-messages.php

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby Professional » Wed Aug 06, 2008 11:33 am

tnx so for installing it what shoud we do?
just copy the template code or shoud do some thing else?
User avatar
Professional
PR5
PR5
 
Posts: 543
Joined: Mon Apr 07, 2008 5:41 am
Location: 1/2 of the World

Postby SeO » Wed Aug 06, 2008 12:23 pm

You'll need GYM 2.0.B3 (not released yet).
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby Professional » Thu Aug 07, 2008 1:30 pm

SeO wrote:You'll need GYM 2.0.B3 (not released yet).


now it eleased :oops:
User avatar
Professional
PR5
PR5
 
Posts: 543
Joined: Mon Apr 07, 2008 5:41 am
Location: 1/2 of the World


Return to phpBB2 Advanced mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests