PortalParts.com Site

 Forum Index > Geeklog > Forum Plugin Support New Topic Post Reply
 Last Post Centerblock problem
 |  Printable Version
marco
 January 23 2008 06:43 AM (Read 1422 times)  
Forum Big Cheese
Big Cheese

Status: offline

Registered: 03/12/04
Posts: 79

Hi Blaine,

I'm having a weird problem with the centerblock for the forum on our index page.

When a person clicks on the last post it will only take them to the last page, but it will never scroll down to last post on the page. Let's say I go to gllabs.org and I put the mouse over the last post on the centerblock - it will look like this:

PHP Formatted Code

http://www.gllabs.org/forum/viewtopic.php?showtopic=7717&lastpost=true#7717
 


But on our page the link looks like this:

PHP Formatted Code

http://www.heavenlysanctuary.com/forum/viewtopic.php?showtopic=25283&lastpost=true#
 


As you can see the number at the end is missing. I tried changing this line in forum/layout/blocks/centerblock_displayline.thtml

PHP Formatted Code

<a class="tooltip" style="text-decoration:none;" href="{site_url}/forum/viewtopic.php?showtopic={topic_id}&amp;lastpost=true#{lastpostid}" rel="nofollow">
 


to

PHP Formatted Code

<a class="tooltip" style="text-decoration:none;" href="{site_url}/forum/viewtopic.php?showtopic={topic_id}&amp;lastpost=true#{topic_id}" rel="nofollow">
 


Which actually gave me the right link I think, and the number showed up - but the link still had the same effect - it just went to the last page but never scrolled down to the last post on the page.

Any ideas? Man, I can't wait for Forum 3.0!

- Marco


 
Profile Email Website PM
Quote
Blaine
 January 23 2008 08:10 AM  
Forum Admin
Admin

Status: offline

Registered: 03/01/02
Posts: 3576

Marco,

I'm traveling on business this week and will not have much time available to look into this but will as soon as I can.


Please consider contributing to support my efforts ..
 
Profile Email Website PM
Quote
mevans
 January 23 2008 11:57 AM  
Forum Full Poster
Full Poster

Status: offline

Registered: 11/27/06
Posts: 17

Marco, Blaine,

I noticed this a few weeks ago and here is the fix I implemented at gllabs.org:

Edit functions.inc (plugins/forum/ directory), around line 1262 you'll see:

PHP Formatted Code

                $qlreply = DB_query("SELECT uid,name,comment FROM {$_TABLES['gf_topic']} WHERE id={$A['last_reply_rec']}");
                $B = DB_fetchArray($qlreply);
 


modify this to look like this:

PHP Formatted Code

                $qlreply = DB_query("SELECT id,uid,name,comment FROM {$_TABLES['gf_topic']} WHERE id={$A['last_reply_rec']}");
                $B = DB_fetchArray($qlreply);
                $lastid = $B['id'];
 


That should solve the problem. What was happening is on topics that did have replies, it was not properly setting the lastid value which is what is used to populate the template variable lastpostid.

Thanks!
mark


 
Profile Email PM
Quote
marco
 January 23 2008 14:57 PM  
Forum Big Cheese
Big Cheese

Status: offline

Registered: 03/12/04
Posts: 79

Hey Blaine,

No worries my friend - and how cool - Mark's solution worked like a charm!

Thanks guys!

- Marco

PS: This is weird - I must be starting to understand a little of this php code stuff - because when I went to make the edits in Vim to the functions.inc file it opened up to around the line you told me to change, Mark ;-) Which means I was at least starting to look in the right area even though I wasn't completely sure of what I was looking at or what to fix ;-)


 
Profile Email Website PM
Quote
Content generated in: 0.37 seconds
New Topic Post Reply



 All times are CST. The time is now 11:32 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content