phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Joomla show recent threads phpbb module

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite
::  
Author Message
Rick_M71



Joined: 12 Nov 2007
Posts: 16

Joomla show recent threads phpbb modulePosted: Wed Jan 16, 2008 5:33 am    Post subject: Re: Joomla show recent threads phpbb module

I'm going to go ahead wit Joomla. I found a module for Joomla to show recent threads on the front page.

Here's the code:

Code:

<?php
/**
* @version      $Id: mod_phpbb3_latest_topics.php 8813 2007-Dec-14 1:32:56 iapostolov $
* @packages   Joomla / phpBB3 / Protos Extensions
* @copyright   Copyright (C)  2007 Protos Extensions. All rights reserved.
* @author      Ivo Apostolov @ Protos Extensions
* @website      http://www.ivoapostolov.eu
* @e-mail      me@ivoapostolov.eu
* @license      GNU/GPL v2.0
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

// get global mainframe stuff
      global $mainframe;

// load the module parameters      
      $phpbb3_address            = $params->get('phpbb3_address');
      $phpbb3_post_count         = $params->get('phpbb3_post_count', 10);
      $phpbb3_target            = $params->get('phpbb3_target', '_blank');
      $phpbb3_show_replies      = $params->get('phpbb3_show_replies', 1);
      $phpbb3_show_last_poster   = $params->get('phpbb3_show_last_poster', 1);
      $phpbb3_show_profile      = $params->get('phpbb3_show_profile', 1);
      $phpbb3_show_date         = $params->get('phpbb3_show_date', 1);

// Load the database settings frot he phpBB configuration
      include_once "".$phpbb3_address."/config.php";

// Connect to the database
      $link = $link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd");
      if (!$link)
      {
// Exit, if can not connect to the database      
      die('Not connected : ' . mysql_error());
      }
// Select the database
      $db_selected = mysql_select_db("$dbname", $link);
      if (!$db_selected)
      {
// Exit, if can not select the database
      die ('Can\'t use foo : ' . mysql_error());
      }
// Set Query to UTF-8
      mysql_query("SET NAMES UTF8");

// Load the script directory (if any)
      $get_folder = "SELECT config_name, config_value FROM $table_prefix".config." WHERE config_name = 'script_path' LIMIT 0,1";
      $folder = mysql_query($get_folder);
      $folder = mysql_fetch_array($folder);
      extract($folder);      
      $folder2 = $config_value;   

// Load the script domain
      $get_url = "SELECT config_name, config_value FROM $table_prefix".config." WHERE config_name = 'server_name' LIMIT 0,1";
      $url = mysql_query($get_url);
      $url = mysql_fetch_array($url);
      extract($url);
      $url2 = $config_value;   

// starting the module output      
      echo "<ul class='forum_topics'>";
            
// Load the last topics
      $latest_topics = "SELECT * FROM $table_prefix".topics." WHERE topic_approved = '1' ORDER BY topic_last_post_time DESC LIMIT 0,$phpbb3_post_count";
      $topics = mysql_query($latest_topics);
      while($row = mysql_fetch_array($topics))
      {
      $date = date("d.m.Y", $topic_last_post_time);
      extract($row);

// Check if to show the number of replies      
      if ($phpbb3_show_replies != 0) {
      $show_replies =  " (".$topic_replies.")";
      }
      else {
      $show_replies = "";
      }

// Check if to show the last poster name
      if ($phpbb3_show_last_poster != 0) {
      $last_poster =  " ".JText::_('last reply by')." ".$topic_last_poster_name."";
      }
      else {
      $last_poster = "";
      }

// Check if to link the last poster name to his profile
      if ($phpbb3_show_profile != 0 and $last_poster != "") {
      $show_profile =  " ".JText::_('last reply by')." <a class='forum_autor' href='http://".$url2."".$folder2."/memberlist.php?mode=viewprofile&u=".$topic_last_poster_id."' target='".$phpbb3_target."' >".$topic_last_poster_name."</a>";
      }
      else {
      $show_profile = $last_poster;
      }

// Check if to show the date
      if ($phpbb3_show_date != 0) {
      $show_date =  " ".JText::_('at')." ".$date."";
      }
      else {
      $show_date = "";
      }

// Start showing the latest posts      
      echo "<li class='forum_topic'><a class='topic_link' href='http://".$url2."".$folder2."/viewtopic.php?f=".$forum_id."&t=".$topic_id."' target='".$phpbb3_target."'>".$topic_title."</a>".$show_replies."".$show_profile."".$show_date."</li>";
      }

// Ending the output
      echo "</ul>";
?>


I know that the last section is where it displays the url, but I'm not sure how to get it to load the proper URL information.

Thanks for your help.
Back to top
Rick_M71



Joined: 12 Nov 2007
Posts: 16

Joomla show recent threads phpbb modulePosted: Wed Jan 16, 2008 5:52 am    Post subject: Re: Joomla show recent threads phpbb module

It looks like with the help of zero duplicate mod that the long URLs get properly redirected via 301 redirect to the SEO urls. Obviously it would be better to have them directly coded rather than having the bots go through the 301 redirects.

Also, it appears that the member profiles get redirected properly, but it first gives a 200 header response code rather than a 301. Is there any reason for that?

Thanks much!
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14279

Joomla show recent threads phpbb modulePosted: Wed Jan 16, 2008 2:05 pm    Post subject: Re: Joomla show recent threads phpbb module

The problem is this module won't check for phpBB auth, so topic titles and link from private forum could show up even if visitors will have to have enough right to read their content.

Then, since it's not sharing phpBB sessions, it will require more work than usual, but it's doable to add url rewriting. I'll see what I can do when I get more free time Wink

Until then, it's no big deal since these are redirected and they should anyway be disallowed by the robots.txt, so, SEO wise it's safe, it would just ab a bit better to have SEO usable links there, but your users still can have the functionality.

About the 200 header, it depends, are the profiles public on your forum ?
The tool checking header is not logged in, could be a reason.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
pashmaki



Joined: 12 Jan 2008
Posts: 11

Joomla show recent threads phpbb modulePosted: Wed Jan 16, 2008 3:36 pm    Post subject: Re: Joomla show recent threads phpbb module

For this , i can recommend this module: http://smartshitter.com/ (phpbb_activity)

Works fine for me Smile
Back to top
Rick_M71



Joined: 12 Nov 2007
Posts: 16

Joomla show recent threads phpbb modulePosted: Thu Jan 17, 2008 3:53 am    Post subject: Re: Joomla show recent threads phpbb module

Like the majority of users, I'm not planning on having any private forums. That would be a huge problem if I did have private forums, but no problem for me.

The problem with disallowing the standard URL's with my robots.txt file at this point is that Google will not follow the threads then and find the new threads with the SEO url's. I'm wondering if it is better to let the bots find the new threads via the 301 redirect, or just block the non-seo'd urls and let Google find the new threads just from the forum? Obviously it'd be great to spread page rank from the front page to get the new threads jump-started. I guess I can't have everything though!

You are exactly correct about profiles - they are not public. You have really done an amazing job with this pre-mod.

Just glancing at the site, it doesn't look like smartshitter works with phpbb3, and it doesn't use SEO'd url's either. I'm not sure what that would gain for me over the module I'm now using.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: