XF 2.2 Building a Xenforo hyperlink with only the thread or post number

A previous site admin migrated us from Vb to Xf last spring. As a result, we have thousands of broken links from earlier years in the site. For the most part, these links DO contain the post number, and sometimes the thread number.

Is there a Xf URL format which will work using ONLY the thread and/or post numbers, without the forum and thread verbiage? The forum and thread verbiage were formatted incorrectly in the conversion ... for all the broken links. Why that didn't happen on every link in the site, I don't know, but it only applies to a subset, of which there are many thousands.

So I'd like to be able to run a procedure to repair the hyperlinks, replacing the verbiage portion of the link with only the essential thread or post numbers.
 
Solution
xenforo does have links for threads and posts.

this thread:
https://xenforo.com/community/threads/201657/

this post:
https://xenforo.com/community/posts/1554155
xenforo does have links for threads and posts.

this thread:
https://xenforo.com/community/threads/201657/

this post:
https://xenforo.com/community/posts/1554155
Beautiful! That's EXACTLY what I needed. On our implementation, I have to exclude "/community", but once I do that it correctly grabs the post record exactly like I need it to. That should give me what I need to search out the bad links, parse the post number, and replace the bad links in the database with a new simplified URL that works. :)

Disclaimer: People reading this thread in the future ... this is not something you want to do without solid experience doing table-wide updates in a database, nor does ANYONE want to do it without a successful, verified implementation in a test version of your system.
 
Last edited:
Back
Top Bottom