Parte 2 de las variables
Tenga en cuenta que muchas de estas variables aunque todavía funcionan, se obsoleta en la versión 2.51 con la adición de la pestaña Avanzada en el área de páginas.
GLOBAL VARIABLES:Estas variables se pueden utilizar en cualquier lugar, trabajarán dentro de las plantillas y se aplicarán a toda una página, a menudo también trabajarán dentro de una consulta o dentro del pulgar o plantilla de enlace.
VARIABLES LOCAL:Este tipo de variables sólo funcionará dentro de una plantilla de enlace o pulgar, ya que no tienen significado fuera de los pulgares y enlaces. %descripción% por ejemplo, no significa nada en una página de plantilla, pero se refiere a la descripción dentro de cada galería.
----------------------------------------------------
GLOBAL VARIABLES(para los locales ver abajo)
Apellido
Reemplazará todas las ocurrencias de %templatename% con la primera parte del nombre de archivo fuente para la plantilla.
Así que si usted nombra su fuente 'Teen.tmpl' entonces el siguiente código colocado en una plantilla ...
| Código: |
| # Img src=%templatename# |
se traducirá en
| Código: |
| ■img src=Teen.jpg |
Esto puede ser útil para crear plantillas dinámicas para archivos, ya que también se puede aplicar a sus consultas.
Por ejemplo, la siguiente consulta buscará en todas las categorías, palabras clave, descripciones para el nombre de plantilla y galerías de al menos 1 día de edad.
| Código: |
| {{setquery-age1-" periodsshown confianza0 and (keywords like '%templatename%%%%' or description like '%%templatename%%' or category like '%%templatename%%%%') order by periodsshown,clicks/clickperods DESC"}} |
Porcentaje de fechas
Esta variable es un índice para el número de días que el sitio ha existido, aumenta por uno en cada día y es el valor real que refrescante utiliza para determinar cuándo una galería debe ser liberado por el cronogramador.
Esto puede ser útil para crear archivos para cada día, con código incrustado en plantillas personalizadas como.
| Código: |
| PhP fopen($fh,"build %updates%.html","w"); ? |
Que creará un archivo con el código índice como nombre
Otro uso de esta variable es para acceder a galerías que están programadas, puede colocar código como el siguiente en consultas en el orden por declaraciones, que ocultarán las galerías programadas hasta que se den a conocer, y NUNCA les permitirá volver como nuevas, forzándolos a ser 1 disparo. Tenga en cuenta también que este método puede destrozar el havoc en los algoritmos de rotación, recomendaría utilizar consultas estándar a menos que planee eliminar estas galerías programadas más adelante.
| Código: |
| orden por peridodsshown, if(refreshdelay made%updates%,0) |
Esta no es la forma normal de manejar galerías programadas por cierto. Normalmente usamos esta técnica, porque permite girar galerías.
| Código: |
| orden por períodoshown,refreshdelay 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>