Home  ›  Template Tags  ›  Links Template Tags

Links Template Tags

The following template tags are used to output links to other Simple:Press Forum elements.

Before using any of these template tags, go to Forum ☛ Configuration ☛ Code and Query Optimisation and turn on the support for ‘Links’ Template tags

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:

ParameterDescriptionTypeDefault
$group_id ID of the Group to display.Integer-
$linktextText for link (leave as empty string to use Group name).String-
$listtagsWrap output in <ul> tags.Booleantrue

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:

ParameterDescriptionTypeDefault
$forum_id ID of the Forum to display.Integer-
$linktextText for link (leave as empty string to use Forum name).String-
$listtagsWrap output in <ul> tags.Booleantrue

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:

ParameterDescriptionTypeDefault
$topic_id ID of the Topic to display Integer-
$linktext Text for link (leave as empty string to use Forum name).String-
$listtagsWrap output in <ul> tags.Booleantrue

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:

ParameterDescriptionTypeDefault
$forum_idsID's of the forums to display links to (comma delimited in quotes).StringRequired

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:

ParameterDescriptionTypeDefault
$forumidID of the forum for the new topic.Integer-
$linktextText to display in link. Use %FORUMNAME% as a place holder.StringAdd new topic in the %FORUMNAME% forum.
$beforelinkText / HTML before the link.String-
$afterlinkText / HTML before the link.String-
$beforetextText / HTML before the link.String-
$aftertextText / 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:

ParameterDescriptionTypeDefault
$linktextText for the profile linkText / HTMLUser 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"); ?>

Article written by steve on January 24, 2010 and last modified by Yellow Swordfish on February 26, 2010