| :: |
| Author |
Message |
divinemanwah

Joined: 01 Apr 2008 Posts: 28
|
Posted: Tue Jul 01, 2008 2:10 am Post subject: Need REALLY Good Coding Skills |
|
|
hello, so far i've been using phpbb seo premod for quite a long time now.
and now i've read about this topic of placing the last 5 topics here:
http://www.phpbb.com/community/viewtopic.php?f=72&t=952855
my only problem is that the links that it can generate are php queries like ...forums/viewtopic.php?f=3455
how can i transform it to links like those of PHPBB SEO? (...forums/FORUM_NAME/TOPIC_TITLE/TILE.html)
here are the codes that i used:
connect.php
| Code: | <?
require_once("forums/config.php");
$connection = mysql_connect('MY_SQL_HOST', $dbuser, $dbpasswd) or die(mysql_error());
mysql_select_db($dbname, $connection) or die(mysql_error());
?>
|
test.php
| Code: | <?
require_once("connect.php");
$forumQ=mysql_query("SELECT topic_id, forum_id, topic_title, topic_last_post_time FROM phpbb_topics WHERE topic_approved=1 ORDER BY topic_last_post_time DESC LIMIT 10");
while($forumRow = mysql_fetch_row($forumQ)){
$date=date('D M d, Y g:i a', $forumRow[3]);
echo $number."<a href=forums/viewtopic.php?f=".$forumRow[1]."&t=".$forumRow[0].">".$forumRow[2]."</a><br>".$date."<br><br>";
}
?> |
if you want to look, here is my url to the test file:
www.itspot.co.cc/testest.php |
|
|
| Back to top |
|
 |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3477
|
|
| Back to top |
|
 |
divinemanwah

Joined: 01 Apr 2008 Posts: 28
|
Posted: Fri Jul 04, 2008 11:23 am Post subject: Re: Need REALLY Good Coding Skills |
|
|
yes, i know that using the easy way is very convenient, but can someone please help me here so i can understand PHP much better?
i saw this post and i think it was successful in rewriting it's URLs.
http://www.phpbb-seo.com/boards/phpbb-seo-premod/discussions-vt2784.html
codes anyone? |
|
|
| Back to top |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 808
|
Posted: Fri Jul 04, 2008 1:20 pm Post subject: Re: Need REALLY Good Coding Skills |
|
|
It's the same code here with $topic_data substituted for the variables in your query (topic id, topic type, topic title, forum id, forum title). In other words, fill in these values:
| Code: | $topic_data['forum_id'] = ...;
$topic_data['forum_name'] = ...;
$topic_data['topic_id'] = ...;
$topic_data['topic_title'] = ...;
$topic_data['topic_type'] = ...; |
And copy the rest of the code from the post cited above. Your query has most of the values you need already. Add the necessary columns from phpbb_topics and probably a join (SELECT t.topic_id... f.forum FROM phpbb_topics t, phpbb_forums f WHERE t.forum_id = f.forum_id AND ...).
BTW, I recommend reading the phpBB code and copying where possible. There are many code excerpts that are very similar to what you want to do (probably in viewtopics.php). For example, the global $db is already initialized and connected, the table names are predefined as constants, etc. |
_________________ Dan Kehn |
|
| Back to top |
|
 |
divinemanwah

Joined: 01 Apr 2008 Posts: 28
|
Posted: Fri Jul 04, 2008 1:44 pm Post subject: Re: Need REALLY Good Coding Skills |
|
|
ok, sorry but i'm really confused now..
i don't know if i can use this code on a static page like on my site...
please take a look at www.itspot.co.cc
in my index page, there is a "Latest News" box with the first code (but it contains links without SEO)...
any help?
thanks! |
|
|
| Back to top |
|
 |
divinemanwah

Joined: 01 Apr 2008 Posts: 28
|
Posted: Thu Jul 24, 2008 1:54 pm Post subject: Re: Need REALLY Good Coding Skills |
|
|
anyone?  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14131
|
|
| Back to top |
|
 |
divinemanwah

Joined: 01 Apr 2008 Posts: 28
|
Posted: Fri Jul 25, 2008 4:33 am Post subject: Re: Need REALLY Good Coding Skills |
|
|
| yes, but i think that inculdes also the latest replies too. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14131
|
|
| Back to top |
|
 |
Professional PR1


Joined: 07 Apr 2008 Posts: 194 Location: 1/2 of the World
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14131
|
|
| Back to top |
|
 |
Professional PR1


Joined: 07 Apr 2008 Posts: 194 Location: 1/2 of the World
|
|
| Back to top |
|
 |
divinemanwah

Joined: 01 Apr 2008 Posts: 28
|
Posted: Thu Aug 14, 2008 3:03 am Post subject: Re: Need REALLY Good Coding Skills |
|
|
| SeO wrote: | The easiest way to do so will be to parse GYM Sitemaps RSS Feeds, otherwise you'll have to share more than just the db connect to do the rewriting with all options.
GYM 2.0.B1 is going to be released soon  |
well, GYM is out now....
can i get help with this code now?
thanks!  |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3477
|
|
| Back to top |
|
 |
|
|