Hi,
I will be adding some "features" to my forum, such as rss feeds and extra page types..
I would like to know how I can easily "translate" urls into the right SEO modded one....
Forums and Topics only....
Thanks!
Moderator: Moderators
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( empty($phpbb_seo->seo_url['forum'][$forum_data['forum_id']]) ) {
$phpbb_seo->seo_url['forum'][$forum_data['forum_id']] = $phpbb_seo->set_url($forum_data['forum_name'], $forum_data['forum_id'], $phpbb_seo->seo_static['forum']);
}
// www.phpBB-SEO.com SEO TOOLKIT END // www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( empty($phpbb_seo->seo_url['topic'][$row['topic_id']]) ) {
$phpbb_seo->seo_censored[$row['topic_id']] = censor_text($row['topic_title']);
$phpbb_seo->seo_url['topic'][$row['topic_id']] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$row['topic_id']]);
}
// www.phpBB-SEO.com SEO TOOLKIT END

$forum_url = "{$phpbb_root_path}viewtopic.$phpEx?f=$forum_id";
$topic_url = "{$phpbb_root_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id";// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
$phpbb_seo->seo_censored[$topic_id] = censor_text($topic_title);
$phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$topic_id]);
}
if ( empty($phpbb_seo->seo_url['forum'][$forum_id]) ) {
$phpbb_seo->seo_url['forum'][$forum_id] = $phpbb_seo->set_url($forum_name,$topic_data['forum_id'], $phpbb_seo->seo_static['forum']);
}
// www.phpBB-SEO.com SEO TOOLKIT END$forum_url = "{$phpbb_root_path}viewtopic.$phpEx?f=$forum_id";
$topic_url = "{$phpbb_root_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id";// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$forum_url = $phpbb_seo->seo_path['phpbb_urlR'] . $phpbb_seo->seo_url['forum'][$forum_id] . $phpbb_seo->seo_ext['forum'];
$topic_url = $phpbb_seo->seo_url['topic'][$topic_id] . $phpbb_seo->seo_delim['topic'] . $topic_id . $phpbb_seo->seo_ext['topic'];
if ($topic_type == POST_GLOBAL) {
$topic_url = $phpbb_seo->seo_static['global_announce'] . $phpbb_seo->seo_ext['global_announce'] . $topic_url;
} else {
$topic_url = $forum_url . $topic_url;
}
// www.phpBB-SEO.com SEO TOOLKIT END

<?php
header('Content-type: application/xml');
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'language/en/common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$base_url = "http://swisspod.com/";
$rss_result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">
<channel>
<title>swiss Expat Forum Recent Posts</title>
<link>http://swisspod.com/</link>
<description>".$config['site_desc']."</description>
<language>".$config['default_lang']."</language>
<copyright>Copyright by ".$config['sitename']."</copyright>
<managingEditor>".$config['board_email']." (Forum Admin)</managingEditor>
<generator>swissPod RSS</generator>
<atom:link href=\"http://swisspod.com/rss.php\" rel=\"self\" type=\"application/rss+xml\" />
";
//
// This SQL query selects the latest topics of all forum
//
$sql = 'SELECT f.forum_id,f.forum_name, f.forum_desc_options, t.topic_title, t.topic_id,t.topic_last_post_id,t.topic_last_poster_name, p.post_time, p.post_text, p.bbcode_uid, p.bbcode_bitfield, u.username, u.user_id
FROM '. FORUMS_TABLE .' f,'.TOPICS_TABLE.' t, '.POSTS_TABLE.' p,'.USERS_TABLE.' u
WHERE t.forum_id = f.forum_id
AND t.topic_status != 1
AND p.post_id = t.topic_last_post_id
AND u.user_id = p.poster_id
ORDER BY t.topic_last_post_id DESC
LIMIT 30 ';
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Could not get Latest topics", '', __LINE__, __FILE__, $sql);
}
while($row = $db->sql_fetchrow($result))
{
$forumid=$row['forum_id'];
if($auth->acl_get('f_read',$forumid)) //getting authentication
{
$post_link = 'viewtopic.php?f='.$row['forum_id'].'&t='.$row['topic_id'].'#p'.$row['topic_last_post_id'];
$//post_link = append_sid($post_link);
$topic_link = 'viewtopic.php?f='.$row['forum_id'].'&t='.$row['topic_id'];
//$topic_link = append_sid($topic_link);
$description = $lang['POST_BY_AUTHOR']." ".$row['topic_last_poster_name']." - ".$lang['POSTED']." ".$user->format_date($row['post_time'])."<br /><br /><a href=\"$base_url$topic_link\">Read ".$row['topic_title']."</a><br /><br /><a href=\"http://swisspod.com/\">swiss Expat Forum swiss Pod</a>"."<hr />";
$rss_result .= "
<item>
<title>".$row['topic_title']."</title>
<link>".$base_url.$post_link."</link>
<description><![CDATA[". $description . "]]></description>
<pubDate>".date("r",$row['post_time'])."</pubDate>
<guid isPermaLink=\"true\">".$base_url.$post_link."</guid>
</item>";
}
}
$rss_result .= "</channel>
</rss>";
echo $rss_result;
$db->sql_freeresult($result);
?>
Users browsing this forum: No registered users and 2 guests