Remove forum topic navigation from your posts

rszrama - February 2, 2007 - 19:49
Project:flatforum
Version:HEAD
Component:Code
Category:task
Priority:normal
Assigned:rszrama
Status:closed
Description

To make our forums at http://www.ubercart.org look more "forumish", I made a few changes and am happy to share if anyone is looking for similar results.

This post is about removing the forum topic navigation that is added to the bottom of the first post in any thread. It's just pretty messy and can't imagine how it would be useful like it is. I'm sure a better replacement could be dreamed up (where the links were at the bottom of the whole thread instead of inside the first post), but for now I've just removed it by modifying flatforum_nodeapi:

<?php
function flatforum_nodeapi($node, $op) {
  if (isset(
$node->content['forum_navigation'])) {
    unset(
$node->content['forum_navigation']);
  }
 
_flatforum_act($op, is_object($node) ? $node->uid : $node['uid']);
}
?>

Hope that helps someone else!

#1

airblaster - February 10, 2007 - 22:03

I basically achieved the same by using

[...]
    case 'node':   
[...]
        $vars['content'] = $vars['node']->content['body']['#value'];
[...]

in template.php.

Don't know for sure if this has any side-effects, though.

#2

rkn - February 24, 2007 - 00:25

What file is flatforum_nodeapi ?!

#3

azote - February 25, 2007 - 05:42

hey rszrama, your way didn't work for me...

hey airblaster, if you do it that way you lose the Attachments on the post
you need to add this to your template.php inside the template folder:
to only remove that:

function phptemplate_forum_topic_navigation($node){
        return _phptemplate_callback('forum_topic_navigation', array('node' => $node));
}

#4

rkn - March 23, 2007 - 19:42

Azote - thanks that worked for me, though it puts this line in:
<!-- PHPTemplate was instructed to override the  forum_topic_navigation theme function, but no valid template file was found. -->
Not that it matters.

#5

Michelle - March 26, 2007 - 01:40

Thanks, azote. That's exactly what I was looking for. And thanks, rszrama for starting this. :)

Michelle

#6

Michelle - March 26, 2007 - 02:38

I just found a problem with azote's method. It interferes with pathauto's bulk update. Evidentally, pathauto uses that link to navigate the posts. To fix it (and get rid of that error method in general), just create an empty text file called forum_topic_navigation.tpl.php in your theme directory.

Michelle

#7

rkn - March 27, 2007 - 16:51

Thanks michelle

#8

peashooter - September 8, 2007 - 22:26

Hi,

What do the [...]s in airblaster's first post correspond to? I'm assuming it means use parts of rszrama's first code? It would really help if we could have the complete version to copy and paste for us php rookies.

Cheers

#9

Michelle - September 9, 2007 - 00:54

That's referring to the rest of the function _phptemplate_variables in template.php. Don't worry about trying to use that method, though. By far the simplest method is to add this to template.php:

function phptemplate_forum_topic_navigation($node){
return ;
}

Michelle

#10

samtemp07 - May 14, 2008 - 18:44

None of those solutions work for v6.2.

Has anyone found a solution update?

#11

Michelle - May 14, 2008 - 19:01
Status:active» fixed

Yes, but it's not as easy because of the way the new preprocesses work. You need to stop the preprocess from running. It's in the advforum module code if you want to see how to do it.

No sense in leaving this open... flatforum is dead.

Michelle

#12

Anonymous (not verified) - May 28, 2008 - 19:01
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.