Be my guestmegablastadmin wrote: anyone can update it please ??
Be my guestmegablastadmin wrote: anyone can update it please ??
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.
++
Something like this?dcz wrote: and also, if it could output a forum url list, it would be perfect.
kulinar wrote:Something like this?dcz wrote:and also, if it could output a forum url list, it would be perfect.
I don't know how to do that. It is part of another similar mod.dcz wrote: Exactly, but the best would be to integrate it in the same file, with the same syntax.
License statement is missing sodcz wrote: Could you shatre this code so that we could start to try to integrate it in this mod?
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>';
?>