![]() |
Build Post URL from PostID
Hi all!
I'm working on a FORUMDISPLAY modification. I want to add an icon to every threadbit with a link to a post that is on another thread (which is maybe on another forum also). How can I achieve that if I can only use PostID? Is "showthread.php?p=PostID" enough even if the post is located in another thread/forum? How can I build such a link using fetch_seo_url function or "vb:link thread" without specifying a threadinfo? I'm just trying to avoid adding a very loud query like fetch_threadinfo of fetch_postinfo to just recover external threadid/title for every threadbit I have to process... :confused: Thanks! |
showthread.php?p=PostID works, but it seems to scroll you to the given post instead of showing the top of the thread. But if you want the seo url then I suppose there's no way to avoid having to get the thread title.
|
Uh ok! So I'll put something like:
showthread.php?p={vb:raw myvar.mypostid} in my template right? |
If myvar.mypostid gives you the post id, then it look OK to me. Of course you can always see if it works the way you want by entering a url in your browser.
|
Mhhhh... do you also know how to check if a post still exists from PostID?
I was just thinking about what can happen if the linked post is being deleted... |
You could call fetch_postinfo(postid), check if the return is an array, then check 'isdeleted' to see if it has been deleted. But of course that requires a query (you can see the code for fetch_postinfo() in includes/functions.php).
|
Thank you!
|
All times are GMT. The time now is 07:51 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|