[ABD] Google sitemap mod

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.
kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

megablastadmin wrote: anyone can update it please ??
Be my guest
megablastadmin
Registered User
Posts: 193
Joined: Tue Aug 31, 2004 9:53 am
Contact:

Post by megablastadmin »

thanks mate for the download link
megablastadmin
Registered User
Posts: 193
Joined: Tue Aug 31, 2004 9:53 am
Contact:

Post by megablastadmin »

got a typo error

Maximum number of topics to fetch with a single datbase query

shud be

Maximum number of topics to fetch with a single database query


u mistyped database to datbase :D

never mind
SysChat.Com
Registered User
Posts: 204
Joined: Mon Jan 24, 2005 4:51 am
Contact:

Post by SysChat.Com »

<delete>
Last edited by SysChat.Com on Sun Sep 18, 2005 6:04 am, edited 1 time in total.
SysChat.Com
Registered User
Posts: 204
Joined: Mon Jan 24, 2005 4:51 am
Contact:

Post by SysChat.Com »

Anyone know how to get the sitemap to show the url for each forum and for the knowledge base mod?

Thanks,
Chris
dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

just a thing

Post by dcz »

Hello,

I use this mod and I find it very usefull for phpbb deep indexing.

But, ther is one small thing that could be enhanced, the <LASTMOD> tag is now showing the date when the topic was posted, but does not change if the first post was edited, wich can be a better date to show in order to suggest to google that the page was updated.
This could be done I think, using post_edit_time instead of post_time, but as post_edit_time is set on null if the topic was never edited, we need some if to switch between post_edit_time if not null and post_time.

I am not sure about how to do it right, but I am pretty sure this could be a good thing to add to this mod.

++

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS
dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

Re: just a thing

Post by dcz »

dcz wrote: Hello,

I use this mod and I find it very usefull for phpbb deep indexing.

But, ther is one small thing that could be enhanced, the <LASTMOD> tag is now showing the date when the topic was posted, but does not change if the first post was edited, wich can be a better date to show in order to suggest to google that the page was updated.
This could be done I think, using post_edit_time instead of post_time, but as post_edit_time is set on null if the topic was never edited, we need some if to switch between post_edit_time if not null and post_time.

I am not sure about how to do it right, but I am pretty sure this could be a good thing to add to this mod.

++


noone on this one?

++

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS
dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

forum url in sitemap

Post by dcz »

and also, if it could output a forum url list, it would be perfect.

++

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS
kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Re: forum url in sitemap

Post by kulinar »

dcz wrote: and also, if it could output a forum url list, it would be perfect.
Something like this?
dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

Re: forum url in sitemap

Post by dcz »

kulinar wrote:
dcz wrote:and also, if it could output a forum url list, it would be perfect.
Something like this?


Exactly, but the best would be to integrate it in the same file, with the same syntax.

Could you shatre this code so that we could start to try to integrate it in this mod?

And for the post date, I really think it would be better to have the last edited date (if not NULL).

++

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS
kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Re: forum url in sitemap

Post by kulinar »

dcz wrote: Exactly, but the best would be to integrate it in the same file, with the same syntax.
I don't know how to do that. It is part of another similar mod.
dcz wrote: Could you shatre this code so that we could start to try to integrate it in this mod?
License statement is missing so :oops: :

Code: Select all

<?php
/***************************************************************************
 *                            sitemap_forums.php
 *                           --------------------
 *		Version			: 1.0.0
 *		Email			: austin[at]phpbb-amod.com
 *		Site			: http://phpbb-tweaks.com
 *		Copyright		: aUsTiN-Inc 2003/5
 *
 ***************************************************************************/
 
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

	$script_path 		= $board_config['script_path'];
	$script_path_len 	= strlen($board_config['script_path']);
	
		if ($script_path[0] != '/')
			$fixed_script_path = '/'. $board_config['script_path'];
			
		if (!$fixed_script_path)
			$fixed_script_path = $board_config['script_path'];
			
		if ($script_path[$script_path_len] != '/')
			$fixed_script_path = $fixed_script_path .'/';
		
define('F_URL', 'http://'. $board_config['server_name'] . str_replace('//', '/', $fixed_script_path)); 

#==== Grab all forum information
	switch(SQL_LAYER)
		{
	case 'postgresql':
		$q = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id 
				AND u.user_id = p.poster_id  
				UNION (
					SELECT f.*, NULL, NULL, NULL, NULL
					FROM " . FORUMS_TABLE . " f
					WHERE NOT EXISTS (
						SELECT p.post_time
						FROM " . POSTS_TABLE . " p
						WHERE p.post_id = f.forum_last_post_id  
									)
						)
				ORDER BY cat_id, forum_order";
		break;

	case 'oracle':
		$q = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id(+)
				AND u.user_id = p.poster_id(+)
				ORDER BY f.cat_id, f.forum_order";
		break;

	default:
		$q = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
				FROM (( " . FORUMS_TABLE . " f
				LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
				LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
				ORDER BY f.cat_id, f.forum_order";
		break;
		}

	$r 		= $db->sql_query($q);
	$forums = $db->sql_fetchrowset($r);
	
#==== Print the map
	echo '<?xml version=\'1.0\' encoding=\'UTF-8\'?>';
	echo '	<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
			http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">';	
	echo '   <url>';
	echo '      <loc>'. F_URL .'</loc>';
	echo '      <lastmod>'. date('Y-m-d') .'</lastmod>';
	echo '      <changefreq>daily</changefreq>';
	echo '   </url>';					
		
	for ($x = 0; $x < count($forums); $x++)
		{
	unset($allowed);
	
		if ( ($forums[$x]['auth_view'] == '0') && ($forums[$x]['auth_read'] == '0') )
			$allowed = TRUE;
			
		if ($allowed)
			{
		echo '   <url>';
		echo '      <loc>'. F_URL .'viewforum.'. $forums[$x]['forum_id'] .'.html','</loc>';
		echo '      <changefreq>daily</changefreq>';				
		echo '   </url>';		
			}
		}
	
	echo '</urlset>';
?>
dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

Post by dcz »

thx ;)

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS
Rusty105
Registered User
Posts: 179
Joined: Fri Mar 19, 2004 4:43 pm

Post by Rusty105 »

OK, I downloaded the mod a few days ago, set it up, ran sitemap.php, and I got a list of urls in my browser window. I copied and pasted these urls into my sitemap.html file for google. Is there a way to automate this so that the file is generated automatically??

Thanks
Rusty
kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

Rusty105 wrote: I copied and pasted these urls into my sitemap.html file for google. Is there a way to automate this so that the file is generated automatically??
This is not necessary. Tou can submit sitemap.php file to google.
Rusty105
Registered User
Posts: 179
Joined: Fri Mar 19, 2004 4:43 pm

Post by Rusty105 »

So... I submit my sitemap as sitemap.php, and when google come my way, it will run sitemap.php, and get what it needs?? Cool :D But what about my static pages??
Locked

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