Welcome to the Comus Thumbs TGP Script Demos | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Templates are the key to getting Comus Thumbs to rock n Roll, they require a basic knowledge of HTML coding.. here are some examples. Basically the template is controlled by special macros that you place on your web page, these macros tell Comus Thumbs where you want to position things, Comus then scans the page, and inserts the links and thumbs as you request. The templates and macros provide a powerful array of options, as you will soon see, allowing you to sort and split lists by almost anything imaginable, and also allowing you to lay your sites out in the most flexible and unrestricted manner possible. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Automatic Thumbed Matrix YYY Rows by XXX Columns | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to build a table of thumbs of YYY rows and XXX columns from the database. FORMAT: < table >%7b%7bcategory-type-rows-columns%7d%7d< /table > Where category is either the exact name of a particular category you have created, or is the keyword 'all'. 'type' is one of, [thumb,link,links,thumbs,archivelink,archivethumb,archivelinks,archivethumbs] more on the macro types can be found below, and where rows and columns are integer counts of the dimensions for the table. EXAMPLE: 3 rows and 1 column of thumbs taken at random from all categories
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Single Link by Category | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to create singlular links from a chosen category. FORMAT: %7b%7bcategory-type-index%7d%7d Where category is either 'all' or the case sensitive name of a chosen category, and type is one of [link or archivelink] and index is the selector of which link in thelist to use. EXAMPLE: The 1st, 3rd and 2nd link in the list, taken from only the teen category.
NOTES: You would use this type, if you wanted very specific control over your layout, maybe you want to place banners and blind links in the middle of your table, this is a perfect use for Singular links. -Singular links do not need table tags, unless you define the link template in such a way to require them. -The script gives priority to singular links over plural links. Thus you can use singular links to force your high priority galleries into specific locations on your page, such as in headers and banners. -If singular links do not find any images in a particular category, or do not have enough images to complete the list, then they will search at random throughout your gallery listings, to make up the difference. -By default images have priority over links, but once used as an image or a link the gallery will be flagged and will not be available to the other lists. -Note in this example I deliberately doubled up on the 1st teen link, the script automatically places the first occurance of the link in both locations. -Indexes start at 1 and run sequentially upwards, if you miss an index (1,2, ,4,5) then the script will drop your last images, in this case it would see there were only 4 links requested, and it would have no image avail for index 5. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Single thumbs used in a custom table of 1 category | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to create singlular thumbs from a chosen category. FORMAT: %7b%7bcategory-type-index%7d%7d Where category is either 'all' or the case sensitive name of a chosen category, and type is one of [thumb or archivethumb] and index is the selector of which link in the list to use. EXAMPLE: A custom table of 3 by 3 thumbs, taken from the teen database
-The lower the number the higher the priority of that image in your list. So index=1 is the very first thumb pulled from your list, depending on how you have ordered your list, this could be a high priority image. By default, images are sorted at random but weighted by the rank you assign to them through the approval process. Each prefered submitter can have his own default rank that you can assign, and each standard submitted gets a default vote of 7. This gives you 3 levels of downgrade and 6 levels of upgrade to play with. Each level represents approximately a 10% jump, so votes of 1 should consistently fall somewhere within the top 10%, as the votes fall more towards the extremities they become less eratic, while votes in the mid ranges will tend to bounce around a lot. This is done so votes you upgrade, will tend to get sent to the top of the list, and votes you down grade will tend to randomize at the bottom, while votes in the middle will get a fair jumbling. -archivethumb types are explained below, but basically pull from the list after all links and thumbs have been processed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Singular links in a custom table | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to use singlular links within a table. FORMAT: %7b%7bcategory-type-index%7d%7d Where category is either 'all' or the case sensitive name of a chosen category, and type is one of [link or archivelink] and index is the selector of which link in the list to use. EXAMPLE: A custom table of 3 by 3 links
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Plural links in a matrixed table YYY rows by XXX columns | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to use plural links in an auto generated table. FORMAT: %7b%7bcategory-type-rows-columns%7d%7d Where category is either 'all' or the case sensitive name of a chosen category, and type is one of [links or archivelinks] and rows and columns are the dimensions of the table. EXAMPLE: A matrixed table of 4 by 3 links | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Including files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to include another file into your page. FORMAT: %7b%7binclude-(path or url)filename%7d%7d Where 'include' is the keyword to trigger this macro, and filename is the name of the file to include. EXAMPLE: A default include file has been set up for this demo. It contains a single thumb and a short messge. The file itself is created in the next section, note that because of the forward reference that any changes to the file will not be reflected until the next refresh of the page. {{include-test_out.txt}} -This is different than the Master Template which can be found in the setup templates section. This macro allows you to create entirely independent and unique files, which can be displayed on their own, or included into other templates. -By default files are extracted from the /templates folder, but you can use ../ path modifications to reach the rest of your drive, or you can just use a direct http:// url. -Includes allow you to use special sections like 'headers' and 'footers' which are built into your pages at compile time, allowing you the benefit of shtml/php/asp includes without having to have a runtime script while in production. That means you can run the TGP side of your site entirely in HTML only mode, reducing server overhead and costs considerably. -Includes can also be used to load your archives or the results of custom template builds. (see next section for info on custom templates) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Including and Building Custom Templates | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to process and build an external template file. FORMAT: %7b%7btemplate-(path or url)template_filename_in-resulting_filename_out%7d%7d {{template-test_in.txt-test_out.txt}} Where 'template' is the keyword to trigger this macro, and template_filename_in is the name of the file to load and process and resulting_filename_out is the name of the file to save results to. EXAMPLE: Building a custom template {{template-test_in.txt-test_out.txt}} -When this macro is placed on a page, it will first check to see if a rebuild is required, if it is then it will load the desired template from your /templates directory by default, or it will search the path, or load from the http:// URL you have specified. -The template is identical to your Main Template and responds to the same macros, it will build a page and then write it to disk (into the templates folder by default), using the 'resulting_filename_out' field as the filename. You can also specifiy other locations by adding relative path information to the filename. -You might need to make sure that PHP has permissions to read/write the files. -Templates can be used to create Archive pages, by placing { category-archives } macros on them. -To reference or link to a template page you can either { include } it using the method mentioned above, or you can include it using a php or shtml include. Or if you have designed your template so that the page can stand completely alone, you can name it with a .html extension and reference it directly from your page. -Note that no links or code are created ON the page that actually invokes this macro. If you need to link to the resulting page, or if you need to view the results, then you will either have to create a link to the page, or you will need to use an include to load the results into a page. So for example, you could use an include to load the template result onto your main page. -If you use this feature it is best to try and build the template, before you try to include it. -A resulting template page can only be manipulated by the first macro which calls it, subsequent requests to write to the same file during the same session, will be ignored. -Your filenames can have any extension they like, and so your templates can be in any scripting language you like. -You have the option of loading the template file with any language you like, Comus's include method should be the fastest during run time, because it compiles the code right into the page so that it can be static. But you can load the page dynamically at load time if you like with PHP/ASP/SSI/JS or whatever you use. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Building Archive Lists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to build an archive link list. FORMAT: %7b%7bcategory-archivelink-index%7d%7d | %7b%7bcategory-archivethumb-index%7d%7d | %7b%7bcategory-archivelinks-rows-columns%7d%7d | %7b%7bcategory-archivethumbs-rows-columns%7d%7d EXAMPLE: A custom table of 3 by 3 links
-Combined with the template system described in the previous two sections, this gives you the option of creating separate pages which contain archived links and thumbs. You can also place these sections on your main page if you want to. -The idea is that you create a separate template page to your main page for holding your archived galleries, and then on this archive page you place your %7b%7bcategory-archivelink-index%7d%7d macros. -Then on your mainpage (always within the footer area) you list all the extrnal template pages [%7b%7btemplate-(path or url)template_filename_in-resulting_filename_out%7d%7d] that you want the system to update on a rebuild. Its a good idea to have these build commands in the footer section because the builder will build the templates upon reaching them and you may not have processed all of your current thumbs and links on the main page yet. -Then you either place a direct link to the {resulting_filename_out} or you can include the resulting page, using a macro/shtml/php/or the scripting language of your choice. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Available Keyword Macros within templates | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ranks Modifier - Advanced Resort Option #1. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to split and mask your lists using ranks. FORMAT: %7b%7bcategory-type-index-rank-vote%7d%7d | %7b%7bcategory-types-rows-columns-rank-vote%7d%7d Where category, type and index are standard and rank is a keyword to trigger the macro extension and vote is a value between 1 and 10 which specifies the minimum vote required to be in the list. EXAMPLE %7b%7ball-thumbs-3-3-rank-3%7d%7d NOTES: The ranks modifier was created to allow you to split the lists up by rank, this lets you create special tables which are forced to start at a certain vote and above, in this way you can force sections to prioritize a gallery of rank/vote X, thus masking your high priority listings from a particular group, which would allow you to use them only on special sections of your page. Rank works with all types. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Age Modifier - Resorting option #2. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to split your lists by the Age of the galleries with the Age modifier. FORMAT: %7b%7bcategory-type-index-age-value%7d%7d | %7b%7bcategory-types-rows-columns-age-value%7d%7d Where age is a keyword to trigger the macro extension and value represents a minmum gallery age measured in a number refresh periods that the gallery has been listed. EXAMPLE %7b%7ball-thumbs-3-3-age-3%7d%7d - This would create a list where the links are all 3 refresh periods or older. Yesterdays links - It is affected by the time period you have chosen for a refresh period. - This allows you to rotate with precision, if for example you had a 1 hourly updated site, you could create a section for each hour, for each category, and rotate your listings out. Or if you updated daily you could show a 1 months listings day by day, in different sections and lists. - Age lists everything older than a certain number of refresh periods. In this way it can fill a quota if it needs to find more galleries to fill a list. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Query Modifier - Resorting option #3. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: How to split and sort your lists in almost any way imaginable using queries. FORMAT: %7b%7bcategory-type-index-query-"string"%7d%7d | %7b%7bcategory-types-rows-columns-query-qindex%7d%7d where query is a keyword to trigger this macro extension and qindex is an index to preset query (See below) %7b%7ball-thumbs-3-3-query-"description like '%blonde%' or url like '%blonde%'"%7d%7d EXAMPLE %7b%7bsetquery-1-"description like '%blonde%' or url like '%blonde%'"%7d%7d %7b%7ball-thumbs-3-3-query-1%7d%7d This would first define a query and give an id of 1, the second macro then uses the defined query to search descriptions and urls for anything containing blonde. Note that the query is a mySQL WHERE clause and must be within double quotes "" NOTES: Advanced capability, highly flexible and powerful. Finally, as I started thinking about all the options that I could build lists with, I decided to just expose the database query string and structure to you. So whatever your imagination can think of, is available to you. You will need to know how to structure a mySQL WHERE clause - so go look up queries on mysql.org. Basically it gives you the ability to build custom lists and filters using less than, greater than, equal to, similar to, starts with, ends with,etc,etc and order them in any way you please. (If the script does not detect an ORDER BY, then it will assign its default ordering algorithm of date desc,rand()*vote.) NOTE: It is not a full query, but just a WHERE clause. You can use the 'query' capability of the post/review/search page to test the results of your queries, before you actually use them. See the next section for an advanced application and examples of this option.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Custom Queries and Reordering by Click Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
NOTES: This is an experimental feature added in Version 1.08, and is not a fully
developed feature for Comus, although it seems to be working very well. This uses a combination
of features built into Comus, and introduces the custom 'Query' capabilities of the script. To do click counting you need to employ the click counter script which is installed by default in the Comus root directory, 'cc.php'. If you have moved your target page then copy the file to the same folder as your TGP page. Note also that click tracking can be computationally expensive, we've written the code as lean as possible but to date, have no idea of the load it puts on your processor. Click tracking employs cookies, and several database calls for every outgoing click. It not only tracks the {clicks} out, but also the {timespent} on each page, and the approximate number of users who dont return {exitclicks}. The exitclicks is approximate, because if the user doesn't have cookies enabled, the script cant see them return, so it counts all users with cookies disabled as exit clicks. As you will see below you can combine these variables to derive quality ratings for your galleries, and many neat things become possible. To invoke counting set 'click counting' to Yes in the config setup page, this will modify all outgoing links on the page to re-route via cc.php. The script will keep a running count of clicks and impressions and time spent at every gallery, now you can start using it in custom queries to build lists. If you have a traffic trade script, its ok, as long as you have defined it in setup, it will still be called. To actually make use of the click counting values, create a custom query using the {setquery} macro, and then you may build tables, links and thumbs by using the -query- modifier on your macros. 1 Most frequented galleries for the day {{setquery-1-"date=%this_date% order by clicks DESC,mgdate DESC"}} 2 Most popular for the week (Assumes your refresh period is daily, otherwise adjust accordingly) {{setquery-2-"periodsshown < 7 AND periodsshown > 0 ORDER BY timespent DESC"}} 3 Random but weighted by click {{setquery-3-"periodsshown>0 ORDER BY (clicks*rand())+(clicks*rand())+(clicks*rand()) DESC"}} 4 Ordered by avg time spent {{setquery-4-"(clicks-exitclicks)>0 ORDER BY (timespent/(clicks-exitclicks)) DESC"}} 5 Above average galleries weighted by vote {{setquery-5-"clicks > sum(clicks)/count(*) ORDER BY (vote*rand())+(vote*rand())+(vote*rand())"}} 6 Multiple category selections (make sure you define as category type 'all' first) then {{setquery-multicat-"(category LIKE '%teen%' OR category LIKE '%amateur%')"}} 7 Combined queries, top ranked with random picks from the month priority votes first, clicks second {{setquery-7-"(vote=1 OR (periodsshown < 30) ORDER BY vote,clicks DESC"}} Note how you are not limited to using just numbers for the query identifier? [query-multicat] and also how you can use teh %global macros% in the queries as well. Now to actually implement one of these queries in your listing you would append -query-query_identifier}} to the end of your macro, IE: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Using Default Queries | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There is a special debugging macro which will show you the available query list, this could be handy if you're
thinking of building a custom query. We might have already defined one as a default system query,
and you can just use that instead, or perhps use it to build a custom query. To show the list of
all currently active queries you can use, %7b%7bshowqueries%7d%7d. To use the queries simply use
the [key] as your 'query_identifier' {{showqueries}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Modifying the link and thumb template on the fly | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DESCRIPTION: (Advanced) How to change the link or thumb template dynamically. FORMAT: %7b%7bsetlinktemplate-new_link_template%7d%7d | %7b%7bsetthumbtemplate-new_link_template%7d%7d where setlinktemplate and setthumbtemplate are special keywords to trigger this macro and new_link_template is whatever you would put into a link or thumb template EXAMPLE %7b%7bsetlinktemplate-< a href='%url%'>%cat%< /a>%7d%7d NOTES: This changes all the link formatting on the current template. You can use this to modify the link or table format on a section by section basis, but you need to combine the include and template building options, because this macro affects ALL links on a template. Therefore if you want to replace your link style for one section only, then you have to put the sections into different templates, activate this macro on the new template, and then return to your main page and include the result. If you use this on a template and then include another template your style will not be inherited by the included template, unless that template also has a setlinktemplate modifier on it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TIPS and TRICKS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Automatic Refresh: To get your template to automatically rebuild make sure you have set up the
refresh period within the settings/config page. Also you will need to add a refresh tag to your page %7b%7bupdatepage%7d%7d. Place this macro at the base of your page. which will automatically invoke the updater. The load on your server from this script is minimal, it doesnt do much of anything until it determines that a page refresh is required, at that point it will automatically power up, check your rules, and rebuild your site. You can also place an %7b{updatealways}%7d macro on your page, which will cause your server to constantly refresh itself, but we dont recommend it for anything but testing, in production this could put quite a strain on your server. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 Tips to Reduce File Size and save on Bandwidth Costs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
1 - You can reduce your file size dramatically by creating style sheet classes with very short names, for your links and thumbs. Look up style sheets on the search engines, you will find you can chop your main HTMl size in half. Recently I took a 240k page down to 160k with just a few minor tweaks. 2 - You can move the fancy thumb rollovers into functions with short names and call them, instead of having them embedded in each link. Or you could just drop them altogether, and try using the generic style sheet options such as hover. 3 - You can define your compression ratios a little lower for your thumbs, running at 80% instead of 90% will dramatically reduce file sizes without affecting image quality too much. Just shaving the average size from 4k to 3k can shave 25% off your bill. 4 - If you're running PHP on your server, and clock cycles are not an issue, you can try placing this code on the first line of your PHP script pages. 5 - If you're still using PHP on your main page, you can try sending cache info, modify the days value to reflect your refresh period. 7 - Avoid using PHP at all if you can, and just place your pages on a low cost HTML only server. 8 - Ask Nibbi and I about our fully managed hosted services. 75c per gig or 100gig a month at $75. We can also bundle in Comus Thumbs for an additional $25 per month. Thank you for choosing Comus Thumbs, we look forward to bringing you many many cool updates, so drop by our message board occasionally and leave us some suggestions. Regards, Tony and Nibbi - Comus Development and Support. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||