Global Variables
Global Variables
By Paul
09/24/03 (Edited 05/15/15)
{AREA} - The title of the current section of the classifieds site.
{ALLVARS} - A suitable-for-URL-inclusion list of all values submitted to the current page. Example use: <a href="search.php?{ALLVARS}&refine=blah">refine by blah</a>
-- Optional parameter: a comma delimited list of vars to exclude.
{TID} - The name of the template being used on the current page.
{CURRENTURL} - The full URL of the page being viewed.
{CURRENTURLCONTAINS[something]} - Tests whether the current url contains something (for use in conditionals).
{CURRENTURLENCODED} - The full URL of the page being viewed, HTML encoded so that it can be used in a link. For example, <a href="contactform.php?returnto={CURRENTURLENCODED}"> would return the user to the current page after submitting the contact form.
{CATOPTIONS} - Gives the options data for a dropdown menu of categories, for use within a selector.
-- Optional parameter: a category number to limit results to children of.
{TOTALLINKS} - Total number of articles in the classifieds site.
{UNIQUETOTAL} - Total articles not counting aliased copies.
{TOTALCATEGORIES} - Total number of top level categories in the classifieds site.
{TOTALSUBCATS} - Total number of categories including subcategories.
{TOTALHITS} - Total hits out from the classifieds site.
{TOTALHITSIN} - Total hits in to the classifieds site.
{LASTUPDATE} - Date on which classifieds site was last updated.
{UNVALIDATEDITEMS} - The number of items pending validation.
{HITSTEMPDATE} - The date when the temporary hits was last reset.
{VISITORLANGUAGE} - The name of the language the person viewing the page has selected (for example, English).
{IMAGESURL} - The url to the images directory. Use this in showing an image, like <img src="{IMAGESURL}/myimage.png">.
{REALIP} - The IP address of the person viewing the page.
{LOADSTATS} - When any debug level is on, place this where you want the total execution time listed. If you don't use it, the info will just be appended to the bottom of your page.
{FUNC_CATEGORYSUM[categoryid <,> fieldname]} - Gets the sum of all values in the field fieldname for category number categoryid. To change the number of decimal places it rounds too, add that number as a third parameter.
{SITETITLE} - The title of the website.
{INSTALLTITLE} - The title of the specific area of the website which WSN is running, if WSN is part of a larger website.
If the online users feature is activated, you may also use the global online variables listed here.
{THISMEMBER - You can use all member variables globally as applying to the person currently viewing, by using {THISMEMBER instead of {MEMBER but otherwise using member template variables as normal.
You can display the total number of items of any type globally by using this syntax: {TOTAL + type name + LINKS/CATEGORIES/COMMENTS + }
As an example, to show the number of articles of type 'regular' you would use {TOTALREGULARLINKS}
All language can also be used anywhere with a template variable of the form , where NAME is the upcase version of the name of that language. For example, Rate an Article.
All settings work globally by using { + the name of the setting + }.
Any value sent by an HTML form can be accessed with {FORM + element name + }. For example, if there's an <input type="text" name="test"> in a form then the page displayed after the form submits can use {FORMTEST}. Also, any variable which is attached to a URL (x.php?var1=x&var2=y) can be accessed using {VARNAME}... any variable submitted by a form or contained in a cookie is available the same way. If not present it will treated as blank.
Toplists provide a way to display any other type of data in any template.
By Paul
09/24/03 (Edited 05/15/15)
{ALLVARS} - A suitable-for-URL-inclusion list of all values submitted to the current page. Example use: <a href="search.php?{ALLVARS}&refine=blah">refine by blah</a>
-- Optional parameter: a comma delimited list of vars to exclude.
{TID} - The name of the template being used on the current page.
{CURRENTURL} - The full URL of the page being viewed.
{CURRENTURLCONTAINS[something]} - Tests whether the current url contains something (for use in conditionals).
{CURRENTURLENCODED} - The full URL of the page being viewed, HTML encoded so that it can be used in a link. For example, <a href="contactform.php?returnto={CURRENTURLENCODED}"> would return the user to the current page after submitting the contact form.
{CATOPTIONS} - Gives the options data for a dropdown menu of categories, for use within a selector.
-- Optional parameter: a category number to limit results to children of.
{TOTALLINKS} - Total number of articles in the classifieds site.
{UNIQUETOTAL} - Total articles not counting aliased copies.
{TOTALCATEGORIES} - Total number of top level categories in the classifieds site.
{TOTALSUBCATS} - Total number of categories including subcategories.
{TOTALHITS} - Total hits out from the classifieds site.
{TOTALHITSIN} - Total hits in to the classifieds site.
{LASTUPDATE} - Date on which classifieds site was last updated.
{UNVALIDATEDITEMS} - The number of items pending validation.
{HITSTEMPDATE} - The date when the temporary hits was last reset.
{VISITORLANGUAGE} - The name of the language the person viewing the page has selected (for example, English).
{IMAGESURL} - The url to the images directory. Use this in showing an image, like <img src="{IMAGESURL}/myimage.png">.
{REALIP} - The IP address of the person viewing the page.
{LOADSTATS} - When any debug level is on, place this where you want the total execution time listed. If you don't use it, the info will just be appended to the bottom of your page.
{FUNC_CATEGORYSUM[categoryid <,> fieldname]} - Gets the sum of all values in the field fieldname for category number categoryid. To change the number of decimal places it rounds too, add that number as a third parameter.
{SITETITLE} - The title of the website.
{INSTALLTITLE} - The title of the specific area of the website which WSN is running, if WSN is part of a larger website.
If the online users feature is activated, you may also use the global online variables listed here.
{THISMEMBER - You can use all member variables globally as applying to the person currently viewing, by using {THISMEMBER instead of {MEMBER but otherwise using member template variables as normal.
You can display the total number of items of any type globally by using this syntax: {TOTAL + type name + LINKS/CATEGORIES/COMMENTS + }
As an example, to show the number of articles of type 'regular' you would use {TOTALREGULARLINKS}
All language can also be used anywhere with a template variable of the form , where NAME is the upcase version of the name of that language. For example, Rate an Article.
All settings work globally by using { + the name of the setting + }.
Any value sent by an HTML form can be accessed with {FORM + element name + }. For example, if there's an <input type="text" name="test"> in a form then the page displayed after the form submits can use {FORMTEST}. Also, any variable which is attached to a URL (x.php?var1=x&var2=y) can be accessed using {VARNAME}... any variable submitted by a form or contained in a cookie is available the same way. If not present it will treated as blank.
Toplists provide a way to display any other type of data in any template.
Description | Template variables that work everywhere. |
Rating | |
Views | 5084 views. Averaging 1 view per day. |
Similar Listings |