ComusThumbz Documentation
Admin Login

Proměnné část 2

Všimněte si, že mnoho z těchto proměnných, i když stále pracují, se stal zastaralý ve verzi 2.51 s přidáním karty Advanced v oblasti stránek.

GLOBAL VARIABLES:Tyto proměnné mohou být použity kdekoliv, budou fungovat v šablonách a aplikují se na celou stránku, často budou pracovat i uvnitř dotazu nebo uvnitř šablony palce nebo odkazu.
LOCAL VARIABLES:Tento typ proměnných bude fungovat pouze uvnitř šablony odkaz nebo palec, protože nemají žádný význam mimo palce a odkazy.% popis% například neznamená nic na stránce šablony, ale odkazuje na popis v každé galerii.

--------------------------------------------------
GLOBÁLNÍ VARIABLES(pro místní obyvatele viz níže)

% templatename%
Všechny možnosti% templatename% nahradí první částí zdrojového souboru pro šablonu.

Takže pokud jste pojmenovali svůj zdroj 'Teen.tmpl' pak následující kód umístěný na šabloně...

Kód:
< img src =% templatename% .jpg >



by přeložit do

Kód:
< img src = Teen.jpg >



To může být užitečné pro vytvoření dynamických šablon pro archivy, protože to může být také aplikován na vaše dotazy.

Například následující dotaz bude vypadat ve všech kategoriích, klíčová slova, popisy pro templatenname a galerie, které jsou nejméně 1 den staré.

Kód:
{setquery- age1- "periods show > 0 a (klíčová slova jako '%% templatename%%' nebo popis jako '%% templatename%%' nebo kategorie jako '%% templatename%%%') pořadí podle časových řad, kliknutí / kliknutí DESC"



% aktualizace%
Tato proměnná je indexem pro počet dnů, kdy web existoval, každý den se zvyšuje o jednu a je skutečnou hodnotou, kterou se aktualizací určuje, kdy má být galerie vydána plánovačem.
To může být užitečné vytvořit soubory pro každý den, s vloženým kódem na vlastní šablony jako.

Kód:


Který vytvoří soubor s indexem kódu jako název
Další použití této proměnné je pro přístup k galeriím, které jsou naplánovány, můžete umístit kód jako následující do dotazů v pořadí podle výkazů, které budou skrýt plánované galerie, dokud jsou splatné k propuštění, a nikdy jim nedovolí vrátit se jako nové znovu, což je nutí být 1 výstřel. Všimněte si také, že tato metoda může zničit zmatek na algoritmy rotace, Doporučil bych použít standardní dotazy, pokud plánujete odstranit tyto plánované galerie později.

Kód:
Objednávka podle časových řad, pokud (občerstvení <% aktualizace%, 1,0)


Tohle není normální způsob, jak řešit plánované galerie. Normálně používáme tuto techniku, protože umožňuje střídání galerií.

Kód:
Objednávka podle časových úseků, občerstvení DESC



%backdate% a date related to the holdperiod setting that tells us when galleries become too old.
%newbuild% A code that tells us if this page was built as new or built as part of an incremental daily build. 1=new.
%total_galleries% Tells us how many approved galleries are in the database.
%proxy% operates on macros and will place a 'p' if proxy traffic is detected. Although mo9st trade scripts today have strategies in place to manage proxy traffic, if your trade script doesnt then with a little thought of it's application, you can manage proxy traffic using this code.
%today% shows todays date.
%this_date% shows todays date, using the settings date formating.
%this_date-0% shows todays date, using the settings date formating.
%this_date-1% shows yesterdays date, using the settings date formating.
b]%this_date-2%[/b] shows date from 2 days ago, using the date formating taken from the settings page.
b]%this_date-3%[/b] shows date from 3 days ago, using the date formating taken from the settings page.
b]%this_date-4%[/b] shows date from 4 days ago, using the date formating taken from the settings page.
b]%this_date-5%[/b] shows date from 5 days ago, using the date formating taken from the settings page.
b]%this_date-6%[/b] shows date from 6 days ago, using the date formating taken from the settings page.
%this_date-7% shows date from 7 days ago, using the date formating taken from the settings page.

%this_date-8% Does not exist, it only goes up to 7.

%this_day% Shows todays day of month 01-31 with leading zeros.
%this_minute% Minutes with leading zeros.
%this_month% 01-12 month with leading zeros.
%this_MONTH% 'January -December'
%this_HOUR% 01-24, 24 hour format with leading zero.
%this_hour% 01-12,12 hour format with leading zero
%this_YEAR% This year in YYYY format.
%this_year% This year in YY format.
%TODAYS_DATE% 0-31 todays day of month NO leading zeros.


%this_weekday% 'Mon - Sun' Todays weekday.
%this_weekday-0% 'Mon - Sun' Todays weekday.
%this_weekday-1% 'Mon - Sun' weekday from 1 day ago.
%this_weekday-2% 'Mon - Sun' weekday from 2 days ago.
%this_weekday-3% 'Mon - Sun' weekday from 3 days ago.
%this_weekday-4% 'Mon - Sun' weekday from 4 days ago.
%this_weekday-5% 'Mon - Sun' weekday from 5 days ago.
%this_weekday-6% 'Mon - Sun' weekday from 6 days ago.
%this_weekday-7% 'Mon - Sun' weekday from 7 days ago.

Upper case works slightly differently...
%THIS_WEEKDAY% 'Monday - Sunday' Todays weekday.
%THIS_WEEKDAY-0% 'Monday - Sunday' Todays weekday.
%THIS_WEEKDAY-1% 'Monday - Sunday' weekday from 1 day ago.
%THIS_WEEKDAY-2% 'Monday - Sunday' weekday from 2 days ago.
%THIS_WEEKDAY-3% 'Monday - Sunday' weekday from 3 days ago.
%THIS_WEEKDAY-4% 'Monday - Sunday' weekday from 4 days ago.
%THIS_WEEKDAY-5% 'Monday - Sunday' weekday from 5 days ago.
%THIS_WEEKDAY-6% 'Monday - Sunday' weekday from 6 days ago.
%THIS_WEEKDAY-7% 'Monday - Sunday' weekday from 7 days ago.

%sitepath% gets converted into the site path and is used on various templates to create full paths to comus.

{{setvar-NAME-VALUE}}
Although not really a variable the setvar macro allows you to create your own variable which will be accessable throughout the page via %NAME% this can be handy for creating custom archive pages where you dont want to use the %templatename% variable. You can also combine this with javascript and PHP to create more dynamic listings.

Other conversions that take place.
"[BR]" gets converted to "<BR>" within links and urls.
"[square bracket]B[square bracket]" gets converted to "<B>" within links and urls.
""[square bracket]/B"[square bracket]" gets converted to "</B>" within links and urls.
"%7b%7b" and "%7d%7d" Will be replaced by {{ and }}, which might mess with some templates
"%25" will be converted to a %.

The standard globals as taken from the [Examples] pages.

%this_date% formatted date of today
%this_HOUR% 00-24 hour of today
%this_hour% 00-12 hour of today
%this_day% 01-31 day of today
%this_month% 01-12 month of today
%this_YEAR% xxxx year of today
%this_year% xx year of today
%sitename% The domain name of your site without http://
%siteowner% The name you chose for yourself in setup
%tgpemail% your registered email address
%recip% Your recip link with http:// info
%refreshperiod% The current refresh period
%this_period% The current refresh period
%totalposts% Total number of posts made
%logins% Total number of webmaster logins
%hits% Total hits on the page
%total_galleries% Total approved galleries in the system
%updates% Number of days passed since the site was new, the actual age of your site.


********************************************************
LOCAL VARIABLES (variables you can use inside the text and thumb templates and the trade script prefix settings and error urls)

%sourceurl%
When you use the gallery spider, the source url will be saved in the database. You can use this to give kudos to whoever referred the gallery. This variable will replace all %sourceurl% within the actual link or thumb template with the gallery source url collected at the time of scanning.
%sourcename%
When using the URL spider, you can assign a name to the source of the scanned gallery.

----------------------------------------------------------------------------
Displaying reports and tracking cheaters via surfer reports

%report_images% (creates a url to 1 of 5 images determined by the warning level, see below for image names, and how you can change them)
%report_messages% (dumps one of 5 warning messages determined by the warning level, see below for messages and how to change them)
%report_main_image% (Creates a url to the default reporting icon, note: you still need to add the img tag.)
%report_info_image% (Creates a url to the icon image for more info, you still need to create theimg tag, see below for examples)
%reports% A number between 0 and 5 indicating the warning level of this gallery.
%report% Creates a complete reporting icon linked to the main report icon
%r% Creates a complete reporting link with an image icon that reflects the current reporting level. Not the same as %report%.
%i% Creates a complete info link with an info image icon.

----------------------------------------------------------------------
%url% Creates a comus link to your url, you can place this in the text and thumb templates or the trade script urls, or in settings for proxy,clickflood,fusker error, db error, etc.

---------------------
Categories, there are actually several different types of category variables.
%cat% Shows the category field of the macro, and will truncate it down removing white spaces, this is not always the actual category and will display 'all' if the macro looked like {{all-thumb-1}}.
%category% Displays the category of the gallery itself and will strip out the white space also, so if you display a Teen gallery using {{all-thumb-1}} then the script will actually display 'Teen' and not 'All'.
%rawcategory% this will display the category without stripping the white space.
%rawcat% this will display the category part of the macro without stripping the white space.
%altcat% Displays the alternate category name as defined in the categories section. Handy if you want to display something different other than the category, some people have used this to link to images instead, by placing something like Teen.jpg in the alt cat field and creating links like <img src=%altcat%>
%group% This is an alternate for category, it will default to %category% however if you define a value for the group part of the macro, then it will be fed through. IE: {{TEEN##all-thumb-1}} would send the code 'TEEN' through to the %group% variable, no matter what the actual group or category was of the gallery. This can be handy for group trading where you might want all traffic from certain pages to travel through a specific group. You can then attach the %group% variable to your trade script suffix with something like ?g=%group% and feed your trades.

%type% Will show 'thumb' for a thumb type of macro or 'link' for a text link type of macro.

%gallerytype% Will show 'Vids' for galleries that have video and 'Pics' for those that do not. This can be handy if you want to create an image for your links like 'Vids.jpg' and 'Pics.jpg' and then link to them with <img src=%gallerytype% border=0>

%domain% Will show the domain of the gallery.

%desc% Shows an abbreviated version of the description as determined by the settings where you can set the length of descriptions.
%description% Shows the full description as it appears in the database without any formatting.

%avgclicks% An alias for %ctr%. The clicks/clickperiods or the average clicks per build.
%ctr% An alias for %avgclicks%. The clicks/clickperiods or the average clicks per build.
%rating% The rating is collected for the first 24 hours of a thumb's life. It is based upon clicks*10000/exposure. Once a gallery ages beyond this, it's rating does not change.

%keywords% will display the keywords field taken from the gallery database (not the categories database)
%used% The number of times a gallery has been rotated.


Dates and Times
%TODAYS_DATE% Non formatted day of the month, with no leading 0's

Gallery Submit dates.
%dis_date% Custom formatted date of submittal
%submit_date% Custom formatted date of submittal
%submit_hour% 00-24 hour of submittal
%submit_day% 01-31 day of submittal
%submit_month% 01-12 month of submittal
%submit_MONTH% 'January-December' month of submittal (full text)
%submit_year% xxxx year of submittal
%submit_weekday% day 'Mon ... Sun' of submittal

Gallery Accepted Dates.
%accept_date% formatted date of approval
%accept_hour% 00-24 hour of approval
%accept_day% 01-31 day of approval
%accept_month% 01-12 month of approval
%accept_MONTH% 'January-December' month of acceptance
%accept_year% xxxx year of approval
%submit_weekday% day 'Mon ... Sun' of submittal

Date that Gallery was Listed on Site.
%listed% formatted date of first listing
%lstd% unformatted date of first listing
%listed_date% formatted date of first listing
%listed_day% 01-31 day of listing
%listed_month% 01-12 month of listing
%listed_MONTH% 'January-December' month of listing
%listed_hour% 00-24 hour of listing
%listed_minute% 00-59 minute of listing
%listed_year% xxxx year of listing

The standard local variables. .. taken from examples.
%onpage% The number of times the gallery has been displayed on a page, or actually used in a build, this ONLY increases when the gallery is actually used.
%clickperiods% The number of times galleries have been built since this gallery was listed as new, note that this increments regardless of whether the gallery was actually used on a page.
%periodsshown% The number of DAYs passed since the gallery was newly used on the site.
%clicks% The number of clicks on the gallery.
%ctr% The Click Through Ratio for this gallery, a score defined as clicks/clickperiods.
%cat% The condensed category taken from the database as entered in the [Category] section.
%category% The category taken from the macro - IE shows 'all' for all.
%rawcategory% The category taken from the database without condensing (no removed spaces).
%url% The target url.
%overurl% The target url, used for mouse overs (without trade script).
%domain% The domain only of the target URL
%desc% The truncated description, (max length set by you)
%description% The full description
%uid% The unique id assigned to the gallery
%id% The true id for the gallery
%nick% Submitters name
%email% Submitters email
%thumbname% The actual file name to the thumb
%thumbheight% The thumb image width
%thumbwidth% The thumb image height
%thumbsize% For compatibility, width of square thumbs
%numpic% Number of pics in the gallery (always 2 chars, ie 00...08,09,10,11)
%piccnt% A running count of the total links and thumbs displayed
%numlist% A running count of the links and thumbs in this set only
%thumbsize% For compatibility, width of square thumbs
%vote% The ranking score (1-10) assigned to the gallery
%rank% The ranking score assigned by you
%clicks% The number of times the gallery has been clicked
%dis_date% Custom formatted date of submittal
%TODAYS_DATE% Non formatted day of the month, with no leading 0's
%submit_date% Custom formatted date of submittal
%submit_hour% 00-24 hour of submittal
%submit_day% 01-31 day of submittal
%submit_month% 01-12 month of submittal
%submit_year% xxxx year of submittal
%accept_date% formatted date of approval
%accept_hour% 00-24 hour of approval
%accept_day% 01-31 day of approval
%accept_month% 01-12 month of approval
%accept_year% xxxx year of approval
%listed% formatted date of first listing
%listed_date% formatted date of first listing
%listed_hour% 00-24 hour of listing
%listed_day% 01-31 day of listing
%listed_month% 01-12 month of listing
%listed_year% xxxx year of listing

NEW addition in version 2.51
%altthumb%
This variable allows you to have a single master server where you create the thumbs, and then sub domains that are able to display the thumbs, without needing to actually export the thumbs to your other domains.

When you bulk import now, the thumb will be collected as normal however additionally the actual filename of the thumb will be recorded also in %altthumb%. NOTE that the path information is stripped and only the thumb name is recorded.

The reason for stripping the path is to allow you the flexibility to either use the original domain, or you can use the domain of your remote thumb server that you may have set up.

You need to modify your master thumb template style to have img src's like.

<img src='http://yourMasterDomain.com/ct/thumbs/%altthumb%' border=0>

or if you have a remote thumb server..
<img src='http://yourRemoteThumbServer/PATH/%altthumb%' border=0>