where are forum_urls stored?

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

Moderator: Moderators

where are forum_urls stored?

Postby TheKog » Sat Feb 06, 2010 1:58 pm

I have a "recent topics" script that pulls recent topics for my home page and I would like to be able to construct links with the dressed up forum urls. However I cannot find where they are stored in the phpbb tables. Are they stored in memory? For the moment I created an array mapping forum id to the names I manually used in the forum_url admin page but it would be nice to get it from the DB.

Also I enabled the virtual folder for forum names to be displayed 'forum-name/topic' instead of just 'topic' - I am noticing some weirdness - when I enter a forum and look over the topic links only some of the topics show the forumname/topic format - Why is this? I have cleared my caches and restarted apache too.

Finally if I change a forums url name why do some links show the new name and some show the old name? for example some topics say "topicxxxx.html, some say "general"/topicxxxxx.html" (general was the original forum url name), and some say "gen"/topicxxxxx.html" where gen is the most recent name. WHy are they all not one or the other? I am quite confused.

I am running the premod 3.06 in mixed mode, no dup is enabled, and zero dup is enabled - but strict mode is not enabled in zero dup. post redirections is set to Guest - we are still allowing post urls.


Thanks in advance!
TheKog
 
Posts: 30
Joined: Fri Aug 28, 2009 11:21 pm

Advertisement

Re: where are forum_urls stored?

Postby dcz » Sat Feb 06, 2010 4:15 pm

So first, you should search in this forum, there are many mods patched to display recent topic list with rewritten urls : display topics on external page

Knowing the forum urls or setup is in such case not needed since we do the things properly (eg in the phpbb_seo class).
FYI, the forum urls are stored in phpbb_seo/cache/phpbb_cache.php, and are stored in phpbb_seo::seo_url['forum'], being an array linking forum_id to the forum_url bit to use.

One thing to notice, and it is stated in the install files, if you edit a forum url without id, there will be no redirection by the zero duplicate, all other cases are handled :
Code: Select all
example.com/phpBB/forum-url.html will not be redirected automatically to example.com/phpBB/forum-new-url.html, it will be a 404 (same for forum-url/)

but :
Code: Select all
example.com/phpBB/forum-url-fxx.html will be redirected automatically to example.com/phpBB/forum-new-url-fxx.html (same for forum-url-fxx/)

And topics will always be properly redirected, since they always hold the id bit.
It's because we would need to keep track of all edits to be able to redirect automatically forum url without id, but since it's not supposed to occur too often in a forum's life, it's not really a problem.
If you occasionally need to, there are many ways to activate the redirections manually, and you can still change the forum title when you want since it's separated form the url. And, if you will have to update a particular forum url despite the fact it would not really be and seo friendly behaviour (seo is all about lasting), you could just keep the id for the forums needing to be updated.

Then, about the topic urls. When the hold the forum url bit and when SQL rewriting is activated, their url is stored in db (topic_table) with the forum url bit. If you change the forum url, or if you move the topic in a new forum, the forum url bit will only be updated in the topic url when the topic will be visited. And topic urls are always automatically redirected with the zero dupe, so there is no seo issue with that.

Another "edge" case is if you go from simple or mixed to advanced mode, the topic url stored in db before this will not have the topic title in their urls, only the topic created after the config change that will by default. Things are done this way to make sure you won't do massive redirect by mistake. And if you want to automatically re process all topic urls with their title, you can use phpbb_seo/sync_url.php to do it (and of course again, redirections will be handled in all cases by the zero dupe).

Hopes this clarifies the matter a bit ;)

++
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

Re: where are forum_urls stored?

Postby TheKog » Sat Feb 06, 2010 5:20 pm

Thanks - I know how to write recent topics and have done many - I just wanted to generate links that are pretty on the recent topic page - they are getting redirected properly already. My recent topics code grabs them directly from the DB so as not to have to include all of phpBB which causes conflicts with a lot of other phpbb code that is included on my page (multiple independent php things such as coppermine and other packages do not coexist well when I include them all onto a single php page). So I grab the recent topics directly from the phpBB database myself and construct the links accordingly.

Also was wondering why the weirdness with some links getting virtual folder (for example when in a forum looking at the topics by LINK) and some did not etc. I noticed hjow they changed after they were visited ;)

I cleared the cache manually and that cleared up the weirdness.
TheKog
 
Posts: 30
Joined: Fri Aug 28, 2009 11:21 pm

Re: where are forum_urls stored?

Postby dcz » Sat Feb 06, 2010 5:36 pm

In the topic I linked, I posted a patch to url rewrite the urls produced by the recent topic script. It illustrate the way it can be done and can be adapted to other mods, but first try to search for your mod's name here, it could already have been patched.

Then, for the topic urls, it could still be the SQL rewriting, if you did not activated the virtual folder before you first synchronized your topic urls, topic urls created at that time would not include the forum url bit at first (requires a visit).

+
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

Re: where are forum_urls stored?

Postby TheKog » Sat Feb 06, 2010 5:42 pm

ah so if I want to enable the virtual folder I should redo the sync ala when SQL rewrite is enabled?
TheKog
 
Posts: 30
Joined: Fri Aug 28, 2009 11:21 pm

Re: where are forum_urls stored?

Postby dcz » Fri Mar 12, 2010 12:46 pm

Would be better yes, but the url will still be updated upon each visit automatically.

++
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


Return to phpBB mod Rewrite

Who is online

Users browsing this forum: No registered users and 3 guests