Support Forum
There was in V4 but not in V5 as we no longer use that internally.
I don't know where you are getting your data from but out main urkl builder nbowe uses the slugs instead of the id. Th call is:
sp_build_url($forumslug, $topicslug, $pageid);
which takes the two slugs and a page ID. If you just want the first page just pass a 1.
If you donlt have the slugs available come back and we can discuss other options but let me kbnow where you wnat to make this call from.
YELLOW
SWORDFISH
|
^ Great, this works, tnx. Yes, i have slug available, 'couse i query database (wp_sftopics) for some other needs. Btw, i am making this call from template file spHead.php - making some sort of latest-topic thing that will show some "teaser" from VIP part of forum (but for all memebers, no mather usergroup). This url-thing is needed so that users from VIP usergroup can click on that "teaser" and go to VIP part of forum (and specified thread), and all others to be redirected to some other page.
I almost finished it, but i have new question... how can i get current user id in this head template file (spHead.php)?
Extensive details on the current user can be found in the global $spThisUser - for their ID use:
$spThisUser->ID
if you need any other information on the user then use the forum admin > toolbox > data inspector - turn on the $spThisUser item and load any forum page - you will see all the elements of the data object that are available for use.
Hope it works out...
YELLOW
SWORDFISH
|
Cool tool, i didnt know it exists 😀 Ok, i made mistake in my previous post, i already knew how i can get current user id, what i really need is current user membership id (or name of usergroup, whatever). Yes, i tried to get it with data inspector but i get only empty array (or i made mistake somewhere).
EDIT:
I found it (i was little confused, it is array inside of array), here it is:
$spThisUser->memberships[0]['usergroup_id']
1 Guest(s)