Closed (won't fix)
Project:
Advanced Forum
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
29 Mar 2008 at 17:08 UTC
Updated:
14 May 2015 at 22:30 UTC
Jump to comment: Most recent
Comments
Comment #1
michelleChanging settings a bit because this is on my to do list.
Michelle
Comment #2
maulwuff commentedI did a workaround for this in D5 + advanced forum alpha12 by hacking the node.module:
my new node_show function looks like this. all changes are between #mod start and #mod end
there may be other ways to do this, too. I found some other topics on this, too.
Comment #3
minesota commentedSubscribed
Comment #4
michelleThanks, but hacking core is not an option.
Michelle
Comment #5
batbug2 commentedYeah, I have the same request. In the mean time, I edited the comment.module (bad)
at around line 1040
Comment #6
michelle@batbug2 - Again, hacking core is not an option.
@all - There has to be some way of doing this without hacking core or it's not going to get done. I can't control what people do on their own sites but I will not add something to this module that requires hacking core nor will I advise others to do it. Hacking core is a bad practice that will lead to headaches.
If someone can come up with a non hacking core fix for this, great. Otherwise it will have to wait until I can figure out how to do it.
Thanks,
Michelle
Comment #7
michelleJust got a clue from IRC. I don't have the time to work on this issue right now but recording it here so it doesn't get lost.
[14:49]
Michelle: Add a advanced_forum_preprocess_node() function, $vars['pager'] = theme('pager', ...); in there, and your users can probably output $pager anywhere in their node template. Alternatively, the same goes for preprocess_page().
Michelle
Comment #8
batbug2 commenteditresting, gotta look into it
Comment #9
neyoung commentedSubscribed
Comment #10
LasseP commentedHere is my solution.
Put this code into advanced_forum.module (function name: advanced_forum_preprocess_node)
add this into your advf-comment-wrapper.tpl.php (before print $content);
add this into your advf-forum-post.tpl.php (right after if ($top_post) { )
This is my solution.
The SQL string used for pager_query is just a simple one and can maybe be even more simpler. I just couldn't imagine of a more simpler one which can work with LIMIT #,#.
This should not be seen as a final soultion. But it works and maybe someone can find a better way to implement this completly into advf.
This has been developed with alpha13 D6. Tests with alpha15 D6 didn't work, because advf-comment-wrapper.tpl.php wasn't called.
Comment #11
michelleThanks for your work here. I'm going to hold it over for version 2 but it will be one of the first things that I look at.
Michelle
Comment #12
michelleShould note here that the bug with comment wrapper has now been fixed so this should work with the latest dev.
Michelle
Comment #13
LasseP commentedworks here. D6 & alpha16 advf
Comment #14
AppleBag commentedIs it ok to add this code (lassep's #10 comment) to the latest version of advf for my d5?
Comment #15
DjC4 commentedAll I did was put this in my code and it worked great. I'm a php noob though and this seemed too easy so I thought I'd check here.
Also when i pasted it into the page.tpl above the content it pushes down everything. I want it in line with my "post new reply" etc at the top. Do I need to create a new .php file to edit forums?
Comment #16
michelleComment #17
PetrL commentedHi, I am trying to implement LasseP's fix noted in comment #10, but I have problem with advf-comment-wrapper.tpl.php part. It seems to me (I did some tests with print) that code in advf-comment-wrapper.tpl.php is not processed at all. I use default garland theme so I did not copy the *.tpl.php to theme directroy but I am changing it advanced_forum/styles/naked directory (others tpl.php changed in this directory works fine). Could you pls. help me if you see any hint.
Comment #18
michelleThere's a bug in Garland that keeps the preprocess from running. You need to delete the phptemplate_comment_wrapper() (off the top of my head... might not be the right function name)
Michelle
Comment #19
PetrL commentedThanks Michelle for the info. It is realy problem of Garland. I did not want to change core so I just little bit modified the LasseP's fix noted in comment #10. Here it is for someone who would like to use it in Garland. (It is more less copy of LasseP's fix, but I put it here whole not just modified parts to avoid confusion)
in file advanced_forum.module add at the end of function advanced_forum_preprocess_node() following
in file advanced_forum.module add at the end of function advanced_forum_preprocess_comment()
at the begining of file advf-forum-post.tpl.php add following:
Comment #20
AppleBag commentedthanks lebloch, I just tired it and I see no effect, still no pagination at th etop of the forums, but I see the original at the bottom. Any idea what I might be missing?
Comment #21
PetrL commentedHi AppleBag, Just one hint - this code shows pager on first page just bellow the first forum post (i.e. just above first comment of this forum post). So do not expect it at the top of the page. If it still not there, I have no idea what it can cause. It would require some reserch. For example if you add following code:
print "JUST TESTING";
at the begining of file advf-forum-post.tpl.php
Can you see the text "JUST TESTING" above each comment?
Comment #22
AppleBag commentedAhh ok, I win the "Duh" award for the day. lol
There it is, I was looking a the very top of the threads. Works great, thanks!
Comment #23
michelleAnother perspective...
Though if we know the # of replies we could create a fake pager.
You just have to set the right values in $pager_total and er, whatever else it is.
Just wanted to get it recorded for now.
Michelle
Comment #24
ltwinner commentedHere's what I did to get pagination on top of topics - I put it in advanced_forum_topic_header
Add this code to advanced_forum_preprocess_advanced_forum_topic_header(&$variables)
Then I just used
print $pagerat the very start of the advanced_forum_topic_header.tpl.php fileComment #25
sandino commentedsubscribe
Comment #26
michellePostponing for 3.x / D7.
Michelle
Comment #27
sandino commentedJust would like to add that advanced_forum_preprocess_advanced_forum_topic_header(&$variables) in #24 is located in file modules/contrib/advanced_forum/includes/theme.inc for Advanced Forum 6.x-2.x
Comment #28
RikiB commented#24 works great
Comment #29
Steel Rat commentedSandino #27, that path (modules\contrib\advanced_forum\includes\) doesn't exist anywhere I can find. Can you elaborate?
Thanks
Comment #30
Steel Rat commentedI used LasseP's code successfully, but, it only applies to forum topics, and not to comments on all content types (I'm using the AF feature of using AF styles on all comments.) So it doesn't look like AF is really treating all comments the same as comments on forum topics.
Also, on LasseP's code, with comments not on the first page, the top pager is getting placed to the right of the top comment instead of above it, causing the first comment on the page to be squished to the left.
Any ideas?
Comment #31
sandino commented@Steel Rat
Your location my vary, because I split my 'modules' directory into 'contrib' and 'custom' subdirectories. Thus your theme.inc may be located in 'sites/all/modules/advanced_forum/includes' directory.
Comment #32
Steel Rat commentedNope. There's no 'includes' folder under the advanced_forum installation. And no 'theme.inc' anywhere in there.
Comment #33
michelle@Steel Rat: Then your install is messed up and I suggest you get a new copy.
Michelle
Comment #34
michelleThere really isn't any good way of doing this in D6. #24 works (in theory; I haven't tried it) but requires an extra query. This will be easy enough to do once we move to entities for posts in 7.x-3.x so I plan on doing it there. However, I'm not going to keep this issue because it's getting long and none of it will be relevant to this in D7.
Michelle
Comment #35
dunx commentedI know this isn't being fixed just yet, but for those willing to hack AF and are using node comments, then you'll need to change the query in #24 to:
$query = 'SELECT COUNT(*) FROM {node_comments} c WHERE c.nid = ' . $node->nid;Comment #36
polluxmr2 commentedsorry to bring an issue back from the dead but i am trying to figure out how to get what was posted in #24 to work.
I have no advanced_forum_topic_header.tpl.php to speak of. i downloaded the latest version of AF and there isn't one in there either. where should this file exist or where should i create it if it doesn't exist as part of a normal install?
Comment #37
DrCord commentedDid this happen in the drupal 7 version? I cannot find it as a setting...
Comment #38
DrCord commentedSo this is somewhat included in the Drupal 7 version...
I went to make the change in #24 and realized from reading the function in question
advanced_forum_preprocess_advanced_forum_topic_headerthat there was already a pager being added to the available variables it just need to be used in the template file.I them went and copied the template file from advanced_forum in the style folder
nakedcalledadvanced_forum.naked.topic-header.tpl.phpto my theme'stemplatesdirectory. I then added the pager to the template file like so:saved the file and cleared the cache and now I have a pager on the top of long topics, absolutely great! Thanks to all above who contributed pieces of this solution, hopefully the next person who needs to do this can now do it easily instead of with luck and magic :D