The Full Set of Comus Macros

Got your head around the basics? Check these threads for more ways to improve your sites.
Post Reply
longsack
Site Admin
Posts: 37
Joined: Wed Jun 04, 2025 7:13 pm

The Full Set of Comus Macros

Post by longsack »

These are the special control macros that are not documented in the code, when you place these on a template the behaviour of the script will change.

{{manual}}
This macro forces the page to only build manually, it will be ignored during normal builds. This is handy if you have a page which never changes, and you want to free some CPU during the build.
The closer you place this macro to the top of the page, the sooner the page will be aborted.

{{buildonce}}
This is similar to {{manual}} only it forces the page to be built and processed once per day. This is handy to stop archives pages which only show the galleries of 1 day or more in age, from being built constantly throughout the day. Thus freeing up your CPU to run faster.
The closer you place this macro to the top of the page, the sooner the page will be aborted.

{{setvar-NAME-VALUE}}
This allows you to set a variable name that can be used again throughout the page, it will replace all instances of %NAME% with VALUE, and it will work on all code on the template, before the template is processed. So it will work on other macros too.
For example put this inthe header:
{{setvar-CategoryType-Anal}}

And then on your page

Code: Select all

 <Title>%CategoryType% Galleries </title>
 ...
 {{%CategoryType%-thumb-1-query-new}}



Will convert to.


Code: Select all

 <Title>Anal Galleries </title>
 ...
 {{Anal-thumb-1-query-new}}
 

NOTE: You DONT want to put the % % signs inside the macro, only on the page where you want to identify your variable.

Suggestions: This is a handy macro for archives or for pages that you want to dynamically modify.

{{allowdupes}}
Allows duplicate galleries to be used again on subsequent pages during the same build. In order to do so we must allow the latest galleries to be used again from earlier page builds and resorted on a page.

{{prodbooster}} allows the latest galleries to be used again and re-sorted on a page throughout the day.

It just so happens that although the reasons for using allowdupes and prodbooster are different, functionally they turned out to be identical, because whether throughout the day or during the same build.. its still throughout the day.

The side effect of both macros is that it will honour the {{ -new}} queries where-ever it finds them, every time it finds them. That means the more times you build the page throughout the day the more galleries it will pull. So a 10 minute page refresh will pull 6x more galleries than an hourly.

Normally though, if you ommit both {{prodbooster}} and {{allowdupes}} the templates will ONLY pull galleries once per day, or upon execution of the [Build with New], when the day counters tick over.
This means that if you DONT have {{prodbooster}} or {{allowdupes}} the page will function as if it were a {{buildonce}} page.

{{noclicks}}
This macro stops the clicks from being counted on the entire page. The resulting template will have different urls if it is working.

{{notrades}}
This macro will cause the trade script to be bypassed, on the entire template. The resulting template will have different urls if it is working.

{{raw}}
This macro will cause the raw urls to be used without the trade script or the click counter. It only works on the full paid versions.

{{showqueries}}
This macro will dump a list of all queries being used in this page. You can place this at the bottom of a page to get a look at the system standard queries, or at what your script has created. Perhaps if you need to check on what the setvar or %%templatename%% variables are actually producing.

{{makefile-SOURCE_FILENAME-DESTINATION_FILENAME}} {{template- }} {{make- }} {{build- }}
The makefile has a few aliases that came from earlier versions of comus, if you have one of these older versions and after an update your comus stops working, it could be because one of the template,make, or build macros has been discontinued.
DONT USE THESE ALIASES!

{{setlinktemplate- DEFINITION }}
This changes the default definition of the standard HTML template for the text links, it applies to everything on the page. And you can only use this macro once per page.
You can use this to create different looking text links, so you can force your text links to show thumbs if you wanted, or embded javascript and mouseovers into them all. Keep in mind that although you might change the textlinks to behave like thumbs, the code will still require a link to have a valid description, or it will ignore the galleries.
You do not need to put the definition inside "" or ''.

{{setthumbtemplate- DEFINITION }}
This changes the default definition of the standard HTML template for the thumb links, it applies to everything on the page. And you can only use this macro once per page.
You can use this to create different looking thumb links. Keep in mind that although you might change the to thumbs behave like textlinks , the code will still require a thumb macro to have a valid thumb image, or it will ignore the galleries.
You do not need to put the definition inside "" or ''.
If you need to create more than one definition then you'll need to use extra pages and include them into the main document, each page can have it's own template definition.
One possible idea for this option is to create a custom RSS feed page, keep an eye out in tips n tricks for an example of how to do this.

{{tableRowStart- HTML }}
{{tableRowEnd- HTML }}
{{tableColumnStart- HTML }}
{{tableColumnEnd- HTML}}

These 4 Macros change the behviour of the plural macros, normally a plural will create the <tr><td> </td></tr> tags for you and assume that you want to create a standard table layout. Sometimes you just want a plain record dump, or you want to create a different type of page, like perhaps an RSS feed. In this case you can set these values to nothing or <channel> </channel> or whatever you like. Usually you would just blank them out.. for example

Code: Select all

 {{tableRowStart-}}
 {{tableRowEnd-}}
 {{tableColumnStart-}}
 {{tableColumnEnd-}}
{{{include-FILENAME}}
{{show-}} {{showfile-}}
The include has a few aliases that came from earlier versions of comus, if you have one of these older versions and after an update your comus stops working, it could be because one of the show or showfile macros has been discontinued. DONT USE THESE ALIASES!


{{tradein}}
Will position your default IN coming trade tracking code on the page, you can set this on the trade set up section, if you have it enabled.

{{mirrorpage}}
Will fix some problems with comus pages which are included inside other comus pages where it might start generating links like /ct/ct/cx.php.

{{archivepage}}
Comus pages are built with tracking code and build code embedded next the to <body> tag in the form, 'layout.inc.php?img=1' . When you add this code the builder code is removed, and the more comus sites links too. This allows archives, which are intended to be included into other documents , to format properly into tables without the more sites links and extra code.
It only works on the full comus version.

{{hiddenupdate}}
This removes the more comus sites links at the bottom of the pages, it only works on the full versions.

{{updatepage}}
Comus pages are built with tracking code and build code embedded next the to <body> tag in the form, 'layout.inc.php?img=1' . If it cant find the body tag, then it will try to attach to the first image. Or it just breaks.
Alternately, this macro allows you to position the code where-ever you like. You can place it at the bottom of the page say, but note the further down the HTML you place the updatepage code, the less chance it has of actaully hitting the tracker (it will load last). Also if you place it in a <head> then the code will never be executed.. it needs to be inside the body.
Hence it is better not to touch this macro and let Comus place your build code automatically.

{{reciplink}}
Wherever you place this macro, the more sites link will appear.
It only works on the full versions.

{{submitlink}}
This will generate a link to your submit page with the correct path information.

{{RSS}}
This is a special code that puts the script into RSS mode, which converts all URLS to use RSS compliant htmlspecialcodes.
the actual code executed is this, which creates a &quote; in place of quotation marks within the urls.

Code: Select all

  $url = str_replace("%url%",        htmlspecialchars($nurl,ENT_NOQUOTES),     $url);
{{setElementStyle-NAME-DEFINITION }}
This command is an extended version of the {{setthumbtemplate- and {{setlinktemplate- macros, which allow the creation
of new layout styles.
This can also change the default definition of the standard HTML template for the text and thumb links, it applies to everything on the page. And you can only need this macro once per style, per page.
You can use this to create different looking text links, so you can force your text links to show thumbs if you wanted, or embded javascript and mouseovers into them all. Keep in mind that although you might change the textlinks to behave like thumbs, the code will still require a link to have a valid description, or it will ignore the galleries.
You do not need to put the definition inside "" or ''.
for example if you wanted to make a new style for a blog, you could use.
{{setElementStyle-blog-<b>%title%</b><br>%description%<br><a href='%url%'>Read More</a>}}
and then you could use it with something like this that selects from the records in your BlogsCategory
{{BlogsCategory-blogs-5-1-query-new}}

{{setDateTemplate- DATE STRING}}
You can use this to over-ride the date styles on a per page basis, this is handy for creating datestamps for example in RSS feeds.
for example
{{setDateTemplate-r}}
see this site for information on possible date strings http://www.php.net/manual/en/function.date.php

_________________
Post Reply