Last 10 topics on web

Discussions and support about the different URL Rewriting techniques for phpBB2.

Moderator: Moderators

Last 10 topics on web

Postby JanoF » Sun Sep 10, 2006 11:34 am

This use on the Web, outside phpbb

Code: Select all
<?php
$topicnumber = 10;
$urlPath = "http://www.phpbb.sk";
include 'config.php';
$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");
$query = "SELECT t.topic_id, t.topic_title, 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
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 "<table class='bodyline' width='180' border='0' cellspacing='1' cellpadding='4'><tr><td class='cat' align='center'><span class='cattitle'>Posledné témy</span></td></tr>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo  "<tr><td class='row1'><span class='siteTextMed'>&bull; " . date('d M Y', $row["post_time"]) . "</span><br /><span class='siteTextSmall'><a href=\"$urlPath/viewtopic.php?t=$row[topic_id]\">" . $row["topic_title"] . "</a></span></td></tr>";
}
print "</table>";
mysql_free_result($result);
?>


He knew could this somebody adjust like this that it will be screen seo addresses et non viewtopic.php?t=1

thx
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Advertisement

Postby dcz » Sun Sep 10, 2006 12:11 pm

Maybe you could start working from this script, as it's already checking censoring and such.

It should be easy to adapt the output to what you like.

++
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Postby JanoF » Sun Sep 10, 2006 12:26 pm

thx
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby JanoF » Sun Sep 10, 2006 8:32 pm

dcz wrote:Maybe you could start working from this script, as it's already checking censoring and such.

It should be easy to adapt the output to what you like.

++

I was trying this and doesn't work this repair me this this www.phpbb.sk/viewtopic.php?t= et non rewrite record
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Sun Sep 10, 2006 9:54 pm

Try quoting my post and grab the code from there, there is a problem (it's adding spaces in the text breaking the code) with the wrapping function I never have time to fix ;)
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Postby JanoF » Mon Sep 11, 2006 1:06 pm

dcz wrote:Try quoting my post and grab the code from there, there is a problem (it's adding spaces in the text breaking the code) with the wrapping function I never have time to fix ;)
ok, thx
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby JanoF » Tue Sep 12, 2006 8:26 am

Try I am this and doesn't work this.
http://www.phpbb.sk/features.php
he knew ought me repair the kod like this that functioned on 100% ?
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Tue Sep 12, 2006 11:10 am

Please post the code you are using ;)
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Postby JanoF » Tue Sep 12, 2006 12:00 pm

Code: Select all
<?php
$topicnumber = 10;
$urlPath = "http://www.phpbb.sk";
include 'config.php';
$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");
$query = "SELECT t.topic_id, t.topic_title, 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
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 "<table class='bodyline' width='180' border='0' cellspacing='1' cellpadding='4'><tr><td class='cat' align='center'><span class='cattitle'>Posledné témy</span></td></tr>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo  "<tr><td class='row1'><span class='siteTextMed'>&bull; " . date('d M Y', $row["post_time"]) . "</span><br /><span class='siteTextSmall'><a href=\"$urlPath/viewtopic.php?t=$row[topic_id]\">" . $row["topic_title"] . "</a></span></td></tr>";
}
print "</table>";
mysql_free_result($result);
?>

And non-he shows me references to last contribution but only on a given subject
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Tue Sep 12, 2006 4:09 pm

I meant, the other one, as it is working, so I though I could see the mistake fast.

Your code is not checking censor nor it is able to use the format_url function, as it not in phpBB session.

So I think, starting from the other one would be better.

++
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB2 mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 13 guests