MyBB Community Forums

Full Version: URLs help?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a page in:
./test
with these codes:

threadurl = get_thread_link($posts['tid']);
$postlink = get_post_link($posts['id'], $posts['tid']);
$postforumlink = "<a target=\"_blank\" href=\"".get_forum_link($posts['fid'])."\">".$posts['name']."</a>";
$userlink = "<a href=\"".get_profile_link($posts['uid'])."\">{$posts['username']}</a>";

The problem is it adds /test to the link how to fix that.

How to make these URLs?

showthread.php
forumdisplay.php
member.php
All the links are relative to the current folder, so just put your board URL in front of them.

$postforumlink = "<a target=\"_blank\" href=\"http://my.board.url/".get_forum_link($posts['fid'])."\">".$posts['name']."</a>";

or even something like

$postforumlink = "<a target=\"_blank\" href=\"{$mybb->settings['bburl']}".get_forum_link($posts['fid'])."\">".$posts['name']."</a>";
Thanks buddy very much will definitely remember this trick.
You can add urls with different criteria but alleays you can use mybb setting url to make your path with that data taking mybb vars declarated by global and take this values by default xD as cameron says there are many ways to get values but finally you have to set some args to this for securitty or only to make it work as have to do.