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:
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!
Comments
Comment #1
airblaster commentedI basically achieved the same by using
in template.php.
Don't know for sure if this has any side-effects, though.
Comment #2
rkn-dupe commentedWhat file is flatforum_nodeapi ?!
Comment #3
azote commentedhey 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:
Comment #4
rkn-dupe commentedAzote - 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.
Comment #5
michelleThanks, azote. That's exactly what I was looking for. And thanks, rszrama for starting this. :)
Michelle
Comment #6
michelleI 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
Comment #7
rkn-dupe commentedThanks michelle
Comment #8
halfiranian commentedHi,
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
Comment #9
michelleThat'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
Comment #10
samtemp07 commentedNone of those solutions work for v6.2.
Has anyone found a solution update?
Comment #11
michelleYes, 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
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #13
doublejosh commentedYups. This seems to work like a charm. (Just wanted to post the full function example.)
Comment #14
michelleNot sure why you're posting on this ancient issue on a dead module but I should point out to any future searchers that stumble on it that doing it this way means the poor performing query is still run so you're getting that performance hit for nothing. It also assumes that you want nothing else but what's in the body and you'll lose any other things that have been added to $content.
Michelle
Comment #15
doublejosh commentedCripes. Quite right!
Just always like to post simple cut and pastable code when I might help someone.
Didn't notice it was an issue queue, just a general approach for forum posts.
Would love to find the technique that would kill this query before it's performed and added to content.
Comment #16
michelleYou need to bypass the whole preprocess with a registry alter. AF does it if you want to see the code.
Michelle
Comment #17
doublejosh commentedAh, perfect information.
I'm planning to add AF within three months, so I can afford the performance hit by hiding it in theme or CSS until then.