Page 1 of 1
Link to last post within a thread
Posted: Wed Mar 30, 2005 3:24 pm
by Jim_Bo
Hi,
Is it posible to link to a thread .. but have it go straight to the last post within the thread ..
something like:
<a href=\"/forum/showthread.php?t=$threadid&$postid\">$postername</a>
When I follow the link it takes me to the beginig of the thread even tho the $postid is pointing to the last post within the thread ..?
Thanks ..
Posted: Wed Mar 30, 2005 3:28 pm
by feyd
using anchors, yes.
Anchors appear after the hash mark (#). Notice how when you post here and click to see your message there's a # followed by your post id. An anchor is the following:
going to a page with that in the code, page.php#1234 will jump you to that location, or as close as the browser can get you to it.
Posted: Wed Mar 30, 2005 3:39 pm
by Jim_Bo
Hi,
Is the # put in manually like
<a href=\"/forum/showthread.php?t=$threadid?#$postid\">$postername</a>
<a href=\"/forum/showthread.php?t=$threadid&$postid#$postid\">$postername</a>
In which none of the above work ..
If i try:
<a href=\"/forum/showthread.php?p=$postid#$postid\">$postername</a>
it shows:
http://www.bla.com/forum/showthread.php?p=3156#3156
in the address bar .. but still takes me to the first post in the thread ..
Thanks
Posted: Wed Mar 30, 2005 3:46 pm
by feyd
all posts have an anchor associated with them in the output.
Posted: Wed Mar 30, 2005 3:53 pm
by Jim_Bo
Hi,
I guess this is correct:
<a href=\"/forum/showthread.php?p=$postid#\">$postername</a>
?
It seems to work ..
Thanks
Posted: Wed Mar 30, 2005 10:42 pm
by nickvd
Just before each post (or just the last post if you prefer), make sure that there is an anchor tag, such as what feyd suggested. without that tag, appending it to the url (page.php?post=12331#12331) wont do anything...