[INFO] How gogle PHPBB!

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
webmedic
Registered User
Posts: 323
Joined: Tue May 28, 2002 2:37 am
Contact:

Post by webmedic » Wed Jul 13, 2005 12:38 pm

many others have asked this also but it's still the same. Give it some time google needs to find out you changed things first and then after that it will start spidering things. Another good thing is to use the google sitemap mod. And submit it to google it will help to make sure google finds your threads.

User avatar
EverettB
Registered User
Posts: 326
Joined: Fri Aug 01, 2003 7:11 pm
Location: North America

Post by EverettB » Sun Jul 24, 2005 4:43 pm

Khurram wrote: In the original GoogleSingleSession mod appearing on page 3, this does not exist anymore:

Code: Select all

   else 
   { 
      $sessiondata = ''; 
      $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : ''; 
      $sessionmethod = SESSION_METHOD_GET; 
   } 
However, this is found occuring two times in sessions.php:

Code: Select all

   else 
   { 
      $sessiondata = array(); 
      $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : ''; 
      $sessionmethod = SESSION_METHOD_GET; 
   } 
so should this from the original GoogleSingleSession mod:

Code: Select all

# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
   global $HTTP_SERVER_VARS; 
   if ( empty($session_id)  && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) 
   { 
      $sessiondata = ''; 
      $session_id = md5(d8ef2eab); 
      $sessionmethod = SESSION_METHOD_GET; 
   } 
be changed to:
#
#-----[ AFTER ADD ]------------------------------------------
#
global $HTTP_SERVER_VARS;
if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') )
{
$sessiondata = array();
$session_id = md5(d8ef2eab);
$sessionmethod = SESSION_METHOD_GET;
}


would that make this original mod still work ? and should above be changed for both occurrences or just one ? is the Googlebot ip above still has any value in the code or should any new googlebot ip address(es) needs to be added to the above..

would be great if someone can write a quick re-write on this or update the tutorial with the latest code..


Yes, you are basically correct but there is more.

Try the code below instead

I modified the GoogleSingleSession code from this thread:
http://www.phpbb.com/kb/article.php?article_id=29

Code: Select all

#-----[ OPEN ]------------------------------------------
#
includes/sessions.php

#
#-----[ FIND ]------------------------------------------
#
	else
	{
		$sessiondata = array();
		$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
		$sessionmethod = SESSION_METHOD_GET;
	}

#
#-----[ AFTER ADD ]------------------------------------------
#
	global $HTTP_SERVER_VARS;
	if ( empty($session_id)  && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') )
	{
		$sessiondata = array();
		$session_id = md5(d8ef2eab);
		$sessionmethod = SESSION_METHOD_GET;
	}

#
#-----[ FIND ]------------------------------------------
#
		$session_id = md5(uniqid(mt_rand(), true));

#
#-----[ REPLACE WITH ]------------------------------------------
#
# Note: d8ef2eab is one of the googlecrawlbots ips
#
		//$session_id = md5(uniqid(mt_rand(), true));
		global $HTTP_SERVER_VARS;
		$session_id = ( !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ? md5(uniqid(mt_rand(), true)) : md5(d8ef2eab);

#
#-----[ FIND ]------------------------------------------
# Yes, find it again, we do 2 replaces of the same code
#
	else
	{
		$sessiondata = array();
		$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
		$sessionmethod = SESSION_METHOD_GET;
	}

#
#-----[ AFTER ADD ]------------------------------------------
#
	global $HTTP_SERVER_VARS;
	if ( empty($session_id)  && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') )
	{
		$sessiondata = array();
		$session_id = md5(d8ef2eab);
		$sessionmethod = SESSION_METHOD_GET;
	}

#
#-----[ FIND ]------------------------------------------
#

			if ($ip_check_s == $ip_check_u)

#
#-----[ REPLACE WITH ]------------------------------------------
#

			//if ($ip_check_s == $ip_check_u)
			if (($ip_check_s == $ip_check_u) || ($session_id == md5(d8ef2eab)&&(strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot')))) 

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
The IP no longer matters because they are no longer using IP to create the session_id.

I just added it to my site, I will see if it works and report back.

User avatar
EverettB
Registered User
Posts: 326
Joined: Fri Aug 01, 2003 7:11 pm
Location: North America

Post by EverettB » Tue Jul 26, 2005 11:16 pm

I ended up using the Bot Indexing MOD instead so I cannot report on the changes made above.

4ux
Registered User
Posts: 13
Joined: Wed Jul 13, 2005 6:42 am
Contact:

Post by 4ux » Mon Aug 01, 2005 7:51 am

It works now !!

Thanks to you all.

Greets, 4ux.nl
Image

ebizbuys
Registered User
Posts: 3
Joined: Mon Feb 09, 2004 9:58 am

Post by ebizbuys » Tue Aug 02, 2005 1:57 am

I have installed these mods and double checked everthing and it all looks ok.

Everthing is running smoothly and the only thing that is wrong (probably the most important though)

is that in googles cache their is an error message

SQL Error : 1062 Duplicate entry

At the time I cleared out all sessions from the database so not sure what the problem is. I have tried to search PHPbb but I just get a blank page when searching and no results.

I think I have pretty much gone through this whole thread and cant see any reference to this.

I repeat though everthing else works a treat. Really happy but google is just getting stuck with the session ids still by the looks.


Anyone else seen this problem.

RogueFive
Registered User
Posts: 4
Joined: Sat Aug 06, 2005 11:43 am

Post by RogueFive » Tue Aug 16, 2005 9:04 pm

I installed the single session mod and google was still "botting" away with 10+ sessions. Looking at the server-stats, I found out that the useragent is not "Googlebot" but "Mediapartners-Google/2.1"!

Changed the code and it worked. Anybody else notice this? And does somebody have an explanation?

User avatar
EverettB
Registered User
Posts: 326
Joined: Fri Aug 01, 2003 7:11 pm
Location: North America

Post by EverettB » Tue Aug 16, 2005 9:22 pm

Mediapartners-Google is the AdSense robot for Google.

ebizbuys
Registered User
Posts: 3
Joined: Mon Feb 09, 2004 9:58 am

Post by ebizbuys » Wed Aug 17, 2005 10:20 am

ebizbuys wrote: I have installed these mods and double checked everthing and it all looks ok.

Everthing is running smoothly and the only thing that is wrong (probably the most important though)

is that in googles cache their is an error message

SQL Error : 1062 Duplicate entry

At the time I cleared out all sessions from the database so not sure what the problem is. I have tried to search PHPbb but I just get a blank page when searching and no results.

I think I have pretty much gone through this whole thread and cant see any reference to this.

I repeat though everthing else works a treat. Really happy but google is just getting stuck with the session ids still by the looks.


Anyone else seen this problem.


Anyone around??

skolima
Registered User
Posts: 5
Joined: Wed May 11, 2005 3:44 pm
Location: Poland
Contact:

Post by skolima » Sun Sep 04, 2005 7:32 pm

Hi.

I'm using a auto meta tags mod on my board, and it has nicely upgraded my page rank in google.
The problem is, it pulls the keywords with the following sql query:

Code: Select all

        $sql = "SELECT w.word_text
                FROM " . TOPICS_TABLE . " t, " . SEARCH_MATCH_TABLE . " m, " . SEARCH_WORD_TABLE . " w
                WHERE t.topic_first_post_id = m.post_id
                AND m.word_id = w.word_id
                AND t.topic_id = $topic_id
                LIMIT 20";
(I've added the LIMIT 20, since some robots down rate sites with over 20 keywords.)

Problem is, the words are pulled randomly from the post. It would be much better if they were being sorted by number of appearances in the post.
While I'm quite comfortable with SQL, I have no idea whatsoever about the phpBB's table layout. How can I - preferably, without killing my server ;-) - get the number of times a word appears in a post?

User avatar
Gools
Registered User
Posts: 6
Joined: Tue Jan 18, 2005 3:50 am
Contact:

Post by Gools » Tue Sep 06, 2005 8:02 pm

ok ok ok!!
I totally messed up!!!!!!!!!! :roll:
Which code I have to use?ha? :?:
Log on to my web site http://www.z-boyz.com
My forum http://www.z-boyz.com/forum

skolima
Registered User
Posts: 5
Joined: Wed May 11, 2005 3:44 pm
Location: Poland
Contact:

Post by skolima » Wed Sep 07, 2005 8:14 am

After some tinkering, I came up with the following code:

Code: Select all

	$sql = "SELECT ps.post_id AS _id
			FROM " . POSTS_TABLE . " ps
			WHERE ps.topic_id = $topic_id";
	if( ($result = $db->sql_query($sql)) )
        {
			$cached_set = '';
            while ( $meta_row = $db->sql_fetchrow($result) )
            {
                $cached_set .= ($cached_set=='') ? $meta_row['_id'] : ', ' . $meta_row['_id'];
            }
		$sql = "SELECT DISTINCT w.word_text
                FROM " . TOPICS_TABLE . " t, " . SEARCH_MATCH_TABLE . " m, " . SEARCH_WORD_TABLE . " w
                WHERE m.post_id IN
				($cached_set)
                AND m.word_id = w.word_id
                AND t.topic_id = $topic_id
				AND w.word_common =0
				ORDER BY
				(
					SELECT COUNT(*)
					FROM " . SEARCH_MATCH_TABLE . " wm
					WHERE wm.post_id IN
					($cached_set)
					AND wm.word_id = w.word_id
				) DESC
				LIMIT 20";
        if( ($result = $db->sql_query($sql)) )
        {
            $meta_keywords = '';
            while ( $meta_row = $db->sql_fetchrow($result) )
            {
                $meta_keywords .= ($meta_keywords=='') ? $meta_row['word_text'] : ', ' . $meta_row['word_text'];
            }
            $meta_keywords = '<meta name=keywords content="' . $meta_keywords . '">';
        }  
And I DO realise I can pretty well kill my server with it, I'm going to cache the keywords in the database, since they only need to be recreated when new posts are made.

visionquest99
Registered User
Posts: 440
Joined: Wed Sep 29, 2004 3:20 am
Location: Toronto

Post by visionquest99 » Wed Sep 14, 2005 5:13 am

Okay, how many people who have posted on this thread have a google friendly message board now?

Tayman
Registered User
Posts: 15
Joined: Thu Jun 27, 2002 2:27 pm

Post by Tayman » Wed Sep 14, 2005 8:02 am

Ok, I have a strange problem.

My forums have been indexed, but the title for the pages = the url (with .html seo friendly mod) and the listings don't have a description.

Suggestions?

I have a hardcoded meta description tag that is the same for all posts...should I just remove it entirely? How do I code in a dynamic description tag?

scubakevin
Registered User
Posts: 38
Joined: Fri Apr 05, 2002 1:17 pm
Location: Mexico City / Playa del Carmen
Contact:

Where to put?

Post by scubakevin » Tue Sep 20, 2005 6:42 pm

skolima wrote: After some tinkering, I came up with the following code:

Code: Select all

	$sql = "SELECT ps.post_id AS _id
			FROM " . POSTS_TABLE . " ps
			WHERE ps.topic_id = $topic_id";
	if( ($result = $db->sql_query($sql)) )
        {
			$cached_set = '';
            while ( $meta_row = $db->sql_fetchrow($result) )
            {
                $cached_set .= ($cached_set=='') ? $meta_row['_id'] : ', ' . $meta_row['_id'];
            }
		$sql = "SELECT DISTINCT w.word_text
                FROM " . TOPICS_TABLE . " t, " . SEARCH_MATCH_TABLE . " m, " . SEARCH_WORD_TABLE . " w
                WHERE m.post_id IN
				($cached_set)
                AND m.word_id = w.word_id
                AND t.topic_id = $topic_id
				AND w.word_common =0
				ORDER BY
				(
					SELECT COUNT(*)
					FROM " . SEARCH_MATCH_TABLE . " wm
					WHERE wm.post_id IN
					($cached_set)
					AND wm.word_id = w.word_id
				) DESC
				LIMIT 20";
        if( ($result = $db->sql_query($sql)) )
        {
            $meta_keywords = '';
            while ( $meta_row = $db->sql_fetchrow($result) )
            {
                $meta_keywords .= ($meta_keywords=='') ? $meta_row['word_text'] : ', ' . $meta_row['word_text'];
            }
            $meta_keywords = '<meta name=keywords content="' . $meta_keywords . '">';
        }  
And I DO realise I can pretty well kill my server with it, I'm going to cache the keywords in the database, since they only need to be recreated when new posts are made.

Amigo, I am interested to know where you have placed this code exactly, you know find and replace type deal. I am relatively new to MySql and PHP but I am getting better. I like the concept for sure and want to give it a try on one of my forums. One I am using the SEO Mod and I am being indexed by Google and I have #1 position for the index page but I am not seeing the posts themselves indexed using the post title and creativing a description and keywords and would like to give your mod a chance on a mirror forum.

Regards

scubakevin
Registered User
Posts: 38
Joined: Fri Apr 05, 2002 1:17 pm
Location: Mexico City / Playa del Carmen
Contact:

I DO, I DO

Post by scubakevin » Tue Sep 20, 2005 6:59 pm

soulstice99 wrote: Okay, how many people who have posted on this thread have a google friendly message board now?


I have a Google #1 Position for Cancun Forums as well as on all of the other search engines as well.

Regards

Locked

Return to “[2.0.x] MODs in Development”