Links Template Tags
The following template tags are used to output links to other Simple:Press Forum elements.
Home Link
This template tag displays a link to main forum page.
sf_home_link();
There are no arguments or user specified styles for this template tag.
Group Link
This template tag displays a link to a specific forum group if the current user has access privileges.
sf_group_link($group_id, $linktext, $listtags=true);
Possible arguments to the template tag are:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $group_id | ID of the Group to display. | Integer | - |
| $linktext | Text for link (leave as empty string to use Group name). | String | - |
| $listtags | Wrap output in <ul> tags. | Boolean | true |
There are no user specified styles for this template tag.
An example usage of the template tag is:
<?php sf_group_link(5, '', true); ?>
Forum Link
This template tag displays a link to a specific forum topic listing if the current user has access privileges.
sf_forum_link($forum_id, $linktext, $listtags=true);
Possible arguments to the template tag are:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $forum_id | ID of the Forum to display. | Integer | - |
| $linktext | Text for link (leave as empty string to use Forum name). | String | - |
| $listtags | Wrap output in <ul> tags. | Boolean | true |
There are no user specified styles for this template tag.
An example usage of the template tag is:
<?php sf_forum_link(5, '', true); ?>
Topic Link
This template tag displays a link to a specific topic post listing if the current user has access privileges.
sf_topic_link($topic_id, $linktext, $listtags=true);
Possible arguments to the template tag are:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $topic_id | ID of the Topic to display | Integer | - |
| $linktext | Text for link (leave as empty string to use Forum name). | String | - |
| $listtags | Wrap output in <ul> tags. | Boolean | true |
There are no user specified styles for this template tag.
An example usage of the template tag is:
<?php sf_topic_link(5, '', true); ?>
Forum List Dropdown
This template tag displays a dropdown list of accessible forums.
sf_forum_dropdown($forum_ids);
Possible arguments to the template tag are:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $forum_ids | ID's of the forums to display links to (comma delimited in quotes). | String | Required |
There are no user specified styles for this template tag.
An example usage of the template tag is:
<?php sf_forum_dropdown("13,18,19,24"); ?>
Add New Topic
This template tag displays a link for a user to go directly to a designated forum (set in tag options) and to an open Add Topic form in that Forum.
sf_add_new_topic_tag($forumid, $linktext, $beforelink, $afterlink, $beforetext, $aftertext);
Possible arguments to the template tag are:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $forumid | ID of the forum for the new topic. | Integer | - |
| $linktext | Text to display in link. Use %FORUMNAME% as a place holder. | String | Add new topic in the %FORUMNAME% forum. |
| $beforelink | Text / HTML before the link. | String | - |
| $afterlink | Text / HTML before the link. | String | - |
| $beforetext | Text / HTML before the link. | String | - |
| $aftertext | Text / HTML before the link. | String | - |
There are no user specified styles for this template tag.
An example usage of the template tag is:
<?php sf_add_new_topic_tag(6, "Create new topic in the %FORUMNAME% forum", '', '', '<h4>', '</h4>'); ?>
Profile Link
This template tag displays a link to the currently logged in user. If its not a logged in user, nothing is displayed.
sf_profile_link($linktext);
Possible arguments to the template tag are:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $linktext | Text for the profile link | Text / HTML | User Profile |
There are no user specified styles for this template tag.
An example usage of the template tag is:
<?php sf_profile_link("My Profile"); ?>
