Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2008, 05:03 PM
gopherhockey's Avatar
gopherhockey gopherhockey is offline
 
Join Date: Jul 2002
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Linking to the very last post in a thread

I need to be able to link to the last post in a thread. Not the last unread post, but the last item posted... the link needs to work regardless of how a user has their post order sorted, or if the user is not logged in.

Currently I use something like showthread.php?t=9180#post3107513

where post = larger number than the number of posts in a thread.

However, this link goes to the first post for some users and non-logged in users.

This is a link from a non php page. If there is a way to do it via php I am willing.

THanks.
Reply With Quote
  #2  
Old 09-10-2008, 05:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didn't you already post this? I know I've seen it before and even read a discussion about it just today or yesterday.
Reply With Quote
  #3  
Old 09-10-2008, 05:15 PM
gopherhockey's Avatar
gopherhockey gopherhockey is offline
 
Join Date: Jul 2002
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Didn't you already post this? I know I've seen it before and even read a discussion about it just today or yesterday.
I posted this question on vbulletin.com but have not gotten an answer so I thought to try here. So far nobody has come up with the answer...

If someone else posted this I apologize but I haven't been able to find the answer in all my searches thus far.

I see for forums (forumdisplay.php) you have sorting like &sort=lastpost &order=desc & daysprune= etc. Would be nice to know what options there are for showthread.php

Thanks.
Reply With Quote
  #4  
Old 09-10-2008, 05:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know that there is a static way of linking to the last thread. I think you have to use some variables in the link. Don't you do a query to grab the thread id? In the thread table is also the column "lastpost". Why can't you grab that at the same time you get the threadids?
Reply With Quote
  #5  
Old 09-10-2008, 05:20 PM
gopherhockey's Avatar
gopherhockey gopherhockey is offline
 
Join Date: Jul 2002
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
I don't know that there is a static way of linking to the last thread. I think you have to use some variables in the link. Don't you do a query to grab the thread id? In the thread table is also the column "lastpost". Why can't you grab that at the same time you get the threadids?
I was afraid of that. I may have to add php code to the page and then try detect if a person is logged in or not, sending them a different way if they are not or depending on how they have their sort order.

At that point its not really worth it. Hmmm....

--------------- Added 10 Sep 2008 at 18:44 ---------------

Quote:
Originally Posted by gopherhockey View Post

Currently I use something like showthread.php?t=9180#post3107513
I tried showthread.php?t=9180&goto=newpost

THis might be working.
Reply With Quote
  #6  
Old 09-10-2008, 07:52 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the postbit_wrapper template try adding the bit in green:
Code:
<!-- post #$post[postid] -->
<if condition="$post['islastshown']"><a id="lastpostbit" name="lastpostbit"></a></if>
<if condition="$show['spacer']">
    $spacer_open
    <div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px">
    <if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if>
</if>

$postbit

<if condition="$show['spacer']">
    </div>
    $spacer_close
</if>
<!-- / post #$post[postid] -->
Then try the URL like:
Code:
showthread.php?t=9180#lastpostbit
Haven't tested it but it should work.
Reply With Quote
  #7  
Old 09-10-2008, 09:08 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like how you think outside the lines, Opserty!
Reply With Quote
  #8  
Old 09-12-2008, 11:40 AM
gopherhockey's Avatar
gopherhockey gopherhockey is offline
 
Join Date: Jul 2002
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
In the postbit_wrapper template try adding the bit in green:
Code:
<!-- post #$post[postid] -->
<if condition="$post['islastshown']"><a id="lastpostbit" name="lastpostbit"></a></if>
<if condition="$show['spacer']">
    $spacer_open
    <div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px">
    <if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if>
</if>
 
$postbit
 
<if condition="$show['spacer']">
    </div>
    $spacer_close
</if>
<!-- / post #$post[postid] -->
Then try the URL like:
Code:
showthread.php?t=9180#lastpostbit
Haven't tested it but it should work.
Good thinking. What this seems to do is send a person to the last post on a page... in other words, if you have it set to oldest post first you are sent to the 15th post in the thread (must have it set to show 15 posts per page).

Is there a way to also get it to jump to the last page, then the last post?

Another possibility - is there a way to force a sort order based on a thread?
Reply With Quote
  #9  
Old 09-12-2008, 12:31 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh sorry I misunderstood your question.
Reply With Quote
  #10  
Old 09-12-2008, 02:03 PM
gopherhockey's Avatar
gopherhockey gopherhockey is offline
 
Join Date: Jul 2002
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
Oh sorry I misunderstood your question.
Well, I was still able to use your suggestion.

What I did was edited the first post in the threads in question. I put a notice that they were looking at an old post and inserted a link with page=99999#lastpostbit which shoots them to the last post.

I wish there was a better way but for now this might do.

Note: in case anyone is curious, what we have are threads where people post up trail conditions for mountain bike trails we have in the area. Then we have a page that lists all our trails with links to the most recent trail condition. Eventually we'd like to get fancy and have a page that could pull that information in, or build a better trail conditions sytem... but for now this lets us update it in one place and hope people are able to get to the latest information quickly. The whole sort order thing just got in our way, unfortunately.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:14 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04019 seconds
  • Memory Usage 2,258KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete