Creating a link to a single post
Moderators: IMOC Moderators, IMOC Committee Members
-
- Posts: 4789
- Joined: Thu Nov 24, 2011 1:01 pm
- Contact:
Creating a link to a single post
Is there a way to create a link to a single post, as opposed to the whole page it's on? I'm sure there is however my codes kung fu is pretty weak
-
- Posts: 6213
- Joined: Tue Dec 14, 2004 7:14 pm
- Location: glasgow
- Contact:
Re: Creating a link to a single post
there is yes, but it's not practical. If you post the link to the thread, then add &start=<insert post number-1 here> then it starts the page at that post
for instance
link to this thread is http://www.imoc.co.uk/forums/viewtopic.php?t=173099
but if you add the extra code http://www.imoc.co.uk/forums/viewtopic. ... 99&start=1 it goes direct to my post, missing yours completely. bare in mind the first post is 0 (ZERO) so the 1st reply is 1 second is 2 etc 20 is start of new page also 40 60 etc
for instance
link to this thread is http://www.imoc.co.uk/forums/viewtopic.php?t=173099
but if you add the extra code http://www.imoc.co.uk/forums/viewtopic. ... 99&start=1 it goes direct to my post, missing yours completely. bare in mind the first post is 0 (ZERO) so the 1st reply is 1 second is 2 etc 20 is start of new page also 40 60 etc
-
- Posts: 4789
- Joined: Thu Nov 24, 2011 1:01 pm
- Contact:
Re: Creating a link to a single post
Perfect, thanks
-
- IMOC Committee
- Posts: 11345
- Joined: Tue May 30, 2006 5:41 pm
- Location: The Toast Aisle
- Contact:
Re: Creating a link to a single post
There's a better way The way described above links to a topic (or thread) (t= parameter in the URL) and then counts forward a number of posts (start= parameter). However you can link to a post ID using p= parameter. The trick is finding out the post number. If you hover over the quote or report buttons and look at the URL they go to, you will find they have a p= parameter which is the post id. You can do viewtopic.php?p=thisID and it will work. BUT you will find it doesn't automatically jump down the page to it - to do that you have to append #id as well
So, this post is post ID 1516139 on topic ID 173099. You can link to viewtopic.php?t=173099 or viewtopic.php?p=1516139 and they'll both take you to the page with that post on (which doesn't work too well in this thread as there is only one page). However if you link to viewtopic.php?p=1516139#1516139 it will jump down the page to the correct post.
So, this post is post ID 1516139 on topic ID 173099. You can link to viewtopic.php?t=173099 or viewtopic.php?p=1516139 and they'll both take you to the page with that post on (which doesn't work too well in this thread as there is only one page). However if you link to viewtopic.php?p=1516139#1516139 it will jump down the page to the correct post.
IMOC-UK - the only club to win 'Best Club Stand' at JAE more than once, and twice in a row!