ComusThumbz 文档
管理员登录

第2部分变量

请注意,许多这些变量虽然仍然有效,但在2.51版本中随着页面区域中添加了"高级"标签而变得过时.

全球变量:这些变量可以在任何地方使用,它们将在模板内工作并适用于一整页,它们往往也会在查询或拇指或链接模板内工作.
当地人:这些类型的变量只会在一个链接或拇指模板内工作,因为它们在拇指和链接之外没有意义. %description% 例如,在模板页面上没有任何意义,但指的是每个画廊内的描述.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
全球变量(关于当地人,见下文)

模板名称 %
将替换% templatename% 的所有事件, 替换为模板的源文件名的第一部分 。

所以,如果你给源命名了"Teen.tmpl", 那么下面的代码放在模板上...

代码 :
(中文(简体) ).



翻译为

代码 :
[img src=TEEN.jpg] (中文(简体) ).



这对于创建用于档案的动态模板是有用的,因为它也可用于您的查询。

例如,以下查询将查看所有类别、关键词、模板名称说明以及至少已有1天历史的画廊。

代码 :
QQSetquery- age1 -" diesshown > 0 和 (关键词如 “'templatename' 或 描述 “'templatename' 或 type 如 “'templatename' ” ) 顺序按 tiesshown 、 点击/ 点击 DESC ” 排序 。



% 更新数据 %
这个变量是网站存在天数的索引,它每天递增1个,是刷新延迟用于确定排程器应何时放出画廊的实际值.
这可以方便地为每天创建文件,在自定义模板上嵌入了代码等.

代码 :


这将创建一个以索引代码为名称的文件
这个变量的另一个用法是用于访问预定的画廊,您可以按语句顺序将如下代码放入查询中,这些语句会隐藏预定的画廊,直到它们到期释放为止,并且永远不会允许它们再次作为新作品返回,从而迫使它们成为一发. 请注意,这种方法会破坏旋转算法上的破坏,我建议使用标准查询,除非你计划稍后删除这些预定的画廊。

代码 :
由 peridodsshown 命令,如果( 重新延迟% 1 0)


顺便说一句,这不是处理陈列画廊的正常方式. 通常我们使用这种技术,因为它允许画廊被旋转.

代码 :
按周期shown、 更新延迟 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>