MyBB Community Forums

Full Version: link to internal post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi

some time ago i moved the forum to another url, so i realized some links to posts were broken... as i didnt find any related mycode/bbcode so i decide to write my own, it was easy ... an additional benefit will be the ease in write posts links... just write the text beetween quotes:

search = "\[post=(.*?)\](.*?)\[/post\]"
replacement = "<a href='/your/forum/url/showthread.php?pid=$1#pid$1'>$2</a>" (adjust url to your situation)

you can get the post id (pid variable) from the post url, shown in the browser when you hover the post #number in the upper right corner, with your mouse

as bbcodes are parsed when pages load, if you move your forum to another url you can easily adjust this variable to preserve links ... i could not find a way to do it automatically, y tried {$mybb->settings['bburl']} but didnt work, if you find a way please comment
(2017-07-02, 11:04 PM)atesin Wrote: [ -> ]hi

some time ago i moved the forum to another url, so i realized some links to posts were broken...


Hi,
you can do it easily from phpMyAdmin by search and replace.
but before touch anything, download clean backup from your databases!