Forum Replies Created
-
In reply to: Nicer permalinks plugin messes up the forum sitemap
I made a workaround. Not ideal and not performant, but it works for me…
function discover_topics() {
global $bbdb, $frequency, $priority, $bb, $topic;
$topic_query = "SELECT t.topic_id AS tid, t.forum_id as fid, p.post_time AS tim, t.topic_posts AS nposts FROM $bbdb->posts p, $bbdb->topics t WHERE p.topic_id = t.topic_id AND post_status = 0 GROUP BY t.topic_id ORDER BY p.post_time";
$matches = $bbdb->get_results($topic_query);
if ($matches) {
foreach($matches as $match) {
$url = get_topic_link($match->tid);
if ($match->fid!=5) {
$topic = bb_get_topic_from_uri( $url );
$url = str_replace( $bb->uri . ‘faq’, $bb->uri . get_forum( $topic->forum_id )->forum_slug, $url );
}
Note: set
$match->fid!=5
the forum_id of the corresponding forum and replace'faq'
with the slug of the corresponding forum.In reply to: Nicer permalinks plugin messes up the forum sitemapHello I have the same problem with the sitemap plugins as OreilleMalade.
As far as I understand the code, the problem lies in the function:
function discover_topics() {
global $bbdb, $frequency, $priority;
$topic_query = "SELECT t.topic_id AS tid, p.post_time AS tim, t.topic_posts AS nposts FROM $bbdb->posts p, $bbdb->topics t WHERE p.topic_id = t.topic_id AND post_status = 0 GROUP BY t.topic_id ORDER BY p.post_time";
$matches = $bbdb->get_results($topic_query);
if ($matches) {
foreach($matches as $match) {
$url = get_topic_link($match->tid);
Here is the url generated every time like this:
domain/topic/topic-name
If we use nicerpermalinks than we have not the topic-directory in our url and the function
get_topic_link
gives us the url with the name of the first forum or a random forumname (didnĀ“t figured it out yet).domain/first_forum_name/topic-name
but we have different forum_names now. If I understand the code right, we have to use now
get_topic_nicer_link
instead of get_topic_link.How to make it??