R. U. Serious wrote: [cut] Wait, not a good idea. Let me think about this some more...
If it is getting no session at all (which was my idea at first), it will not index some pages, e.g. those with votes in it and if you have a vote on your index it won't see anything). It might have other side effects, too.
So I am thinking about another way...
TC wrote: hi all -
ok, so it seems we have two or three people who have worked this out since this thread started. can any/all of you come up with some definitive documentation for this? PM me.
Code: Select all
#################################################################
## MOD Title: GoogleSingleSession (Add-On to enhance-google-indexing )
## MOD Author: - R. U. Serious
## MOD Description: This MOD will give all 'guests' where the useragent
## contains 'Googlebot' one session (static session_id)
## Hence it will only appear as a single guest.
##
## MOD Version: 0.9
##
## Installation Level: (easy)
## Installation Time: 5 Minutes
## Files To Edit: includes/sessions.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Notes: This is only an Add-ON. You will not notice anything with only this mod
## installed. Please consider installing another MOD to enhance Google-indexing
## http://www.phpbb.com/phpBB/viewtopic.php?p=193214#193214
## ( enhance-google-indexing )
##############################################################
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------
#
$session_id = md5(uniqid($user_ip));
#
#-----[ REPLACE WITH ]------------------------------------------
#
# Note: d8ef2eab is one of the googlecrawlbots ips
#
//$session_id = md5(uniqid($user_ip));
global $HTTP_SERVER_VARS;
$session_id = ( !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ? md5(uniqid($user_ip)) : md5(d8ef2eab);
#
#-----[ FIND ]------------------------------------------
#
else
{
$sessiondata = '';
$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 = '';
$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