New "f" tag for viewtopic?

Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here.
Forum rules
Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here. Feature requests are closed.
User avatar
the_dan
Registered User
Posts: 700
Joined: Thu Apr 01, 2004 7:36 pm

Re: New "f" tag for viewtopic?

Post by the_dan »

If you get rid of the 'f', you loose the 'First unread post' link, and you aren't logged as currently reading the forum the topic is in.

User avatar
VinDuv
Registered User
Posts: 73
Joined: Wed May 03, 2006 8:10 pm
Location: France

Re: New "f" tag for viewtopic?

Post by VinDuv »

Maybe could it be activated only for normal users, and not for bots ?

ascensions
Registered User
Posts: 7
Joined: Sat Jan 06, 2007 2:01 am

Re: New "f" tag for viewtopic?

Post by ascensions »

It's odd that no one thought of this when developing 3.0...

PHPBB2 points to viewtopic.php?t=100.... then another website links to viewtopic.php?t=100... Google says great, this page get's 2 points.

Then you convert to PHPBB3, and suddenly viewtopic.php?t=100 is now viewtopic.php?f=1&t=100 but the external link is still pointing to the viewtopic.php?t=100....


Google comes along and see's two pages, gives each 1 point and drops one from the listing. To compound the issue, if Google maintains the PHPBB2 standard url format, it will continue to gain PR.

Enough of this duplicate content could cause Google to mark a penalty against a site.

Unfortunately I'm not very technically inclined when it comes to PHP, but the simpliest thing to do would be, rather then showing the page when the phpbb2 url is accessed to actually redirect it via a 301 redirect in the header of the software. (like we used to do with deleted posts on PHPBB2). Then Google would come along and see the 301, realize the page has a new URL and everybody is happy.

User avatar
Nicholas the Italian
Registered User
Posts: 659
Joined: Mon Nov 20, 2006 11:19 pm
Location: 46°8' N, 12°13' E
Contact:

Re: New "f" tag for viewtopic?

Post by Nicholas the Italian »

If you think it's that important, let them know: bug tracker.

ascensions
Registered User
Posts: 7
Joined: Sat Jan 06, 2007 2:01 am

Re: New "f" tag for viewtopic?

Post by ascensions »

I don't know if there's a truly "great" workaround without initiating alot more code. From what I can tell (I'm no programmer), viewtopic doesn't have the ability to distinguish what forum it's in? It would need to be able to do that in order to redirect to the correct url. (tell me if I'm wrong).

I got this code to work I took from the old deleted phpbb topic mod... it wouldn't be a good idea to initiate this on immediate conversion from phpbb2 to phpbb3 but after a month or so, and Google has come along and re-indexed everything... it should work, as it will point all old page rank to the front page.

Code: Select all

// We overwrite $_REQUEST['f'] if there is no forum specified
// to be able to display the correct online list.
// One downside is that the user currently viewing this topic/post is not taken into account.


if (empty($_REQUEST['f']) && empty($_REQUEST['p']))
{
         header("Status: 301 Moved Permanently", false, 301);
      header("Location: http://yourforumindex.com/");
   exit();
   } 
Last edited by ascensions on Mon Jul 02, 2007 6:14 pm, edited 1 time in total.

User avatar
the_dan
Registered User
Posts: 700
Joined: Thu Apr 01, 2004 7:36 pm

Re: New "f" tag for viewtopic?

Post by the_dan »

Or, indeed, you could run a query to find out the forum ID, and then redirect to the *correct* url, meaning that search engines and users don't get thrown back to the index for no apparent reason.

ascensions
Registered User
Posts: 7
Joined: Sat Jan 06, 2007 2:01 am

Re: New "f" tag for viewtopic?

Post by ascensions »

If I was only smart enough to do that!

friendly-art
Registered User
Posts: 40
Joined: Fri Jan 30, 2004 2:43 pm
Location: Kiev, Ukraine
Contact:

Re: New "f" tag for viewtopic?

Post by friendly-art »

the_dan wrote:Or, indeed, you could run a query to find out the forum ID, and then redirect to the *correct* url, meaning that search engines and users don't get thrown back to the index for no apparent reason.
That's a really smart way on handling things. Another idea for this mod is redirecting ?p= requests to appropriate ?f&t requests.

ascensions
Registered User
Posts: 7
Joined: Sat Jan 06, 2007 2:01 am

Re: New "f" tag for viewtopic?

Post by ascensions »

Well I've been using this mod for a few weeks, and it works beautifully. The old URLs are disappearing and the news ones are showing up in index....

I did have to have one aggregator modify their code because of the 2 variables on the end... and I think that's going to be a problem for alot of PHPBB'ers... they should have left it just one variable. Now if someone passes the URL unencoded, as often lazy webmasters do, you'll lose the second variable, and of course that will cause nothing to work.

Not that it will make an difference, but I'd certainly like to voice my opinion that PHPBB should lose the second variable by the time it's "fully" released. Certainly the forum could be configured without the passing of the variable....

Until then, this looks like the next best option.

ascensions
Registered User
Posts: 7
Joined: Sat Jan 06, 2007 2:01 am

Re: New "f" tag for viewtopic?

Post by ascensions »

I worked on it a bit longer, and indeed viewtopic already does pull the forum id..... we just need to redirect it... I thought I'd post it here for others. Thanks for listening to me! (again not a programmer, so syntax might be off, but it works)

Code: Select all

// 301 Redirect PHPBB  2 posts to PHPBB 3

$bb2url=$phpbb_root_path.'viewtopic.php?f=' . $forum_id. '&t=' . $topic_id;


if (empty($_REQUEST['f']) && empty($_REQUEST['p']))
{  header("Status: 301 Moved Permanently", false, 301);
      header("Location: $bb2url ");
   exit();

}

Post Reply