Translations of this page:

New Rotation Templates

Each template consists of 2 parts: template itself and subtemplate (sometime just 'sub' to be short). Template is a regular html page with special tags, so script takes your template, replace tags with actual content (lets say replace <!–DESCRIPTION–> tag with actual description of a gallery), saves results to cache and shows it ro user.

Each template MUST have hidden image rot_in and include <!–SCJ_INCLUDE–>, if you dont have it - script will not count thumb shows

<img src="/scj/cgi/rot_in.php?crc=<!--PAGE_CRC-->" border=0 width=0 height=0 style="position: absolute; top: -100; left: -100">
<!--SCJ_INCLUDE-->

All templates (except header and footer) should have at least 1 subtemplate. Basically subtemplate is a little template to output each thumb at this page.

<a href="/gallery/<!--GALLERY_SLUG-->/index.html?<!--THUMB_LINK-->" title="<!--ALT-->">
<img src="<!--THUMB_URL-->" class="t_img" alt="" /></a> 

You can have as many templates as you want, but 99% of site uses 1 per page. Note, script uses parameter <!–THUMB_LINK–> to count clicks, so you must have it too.

Template variables


  <!--URL--> = <!--GAL_URL--> - gallery URL
  <!--THUMB_URL--> 
  <!--THUMB_LINK--> - important parameter for click counting 
  <!--DESCRIPTION-->  
  <!--DESCRIPTION_40-->  description cutted to 40 chars
  <!--SAFE_DESC--> safe description w\o special chars
  <!--ALT--> also known as title
  <!--ALT_30--> - title sutted to 40 chars
  <!--TAG1-->  first tag of gallery's tags
  <!--TAG2--> 
  <!--MAIN_GROUP-->
  <!--MAIN_GROUP_ID-->


<!--GALLERY_ID--> 
<!--GALLERY_SLUG--> 
<!--SAFE_DESC-->
<!--ACTIVATION_DATE-->
<!--ACTIVATION_DATETIME-->
<!--DURATION-->
<!--EMBED_CODE-->

<!--CUSTOM_VAR1-->
<!--CUSTOM_VAR2-->
<!--CUSTOM_VAR3-->


for flash galleries (when sponsor gives you url to flv)

<!--FLV_WIDTH-->
<!--FLV_HEIGHT-->
<!--FLV_THUMB_URL-->
<!--FLV_URL-->


With update 48 models were added

<!--MODEL_NAME-->
<!--MODEL_SLUG-->
<!--MODEL_DESCRIPTION-->
<!--MODEL_CUSTOM_VAR1-->
<!--MODEL_CUSTOM_VAR2-->
<!--MODEL_CUSTOM_VAR3-->


if gallery has more then 1 model 

<!--MODEL_1_NAME-->
<!--MODEL_1_SLUG-->

<!--MODEL_2_NAME-->
<!--MODEL_2_SLUG-->

and so on

For categories (groups) pages

<!--CATEGORY_NAME--> = <!--GROUP_NAME--> 
<!--CATEGORY_ID--> = <!--GROUP_ID--> 
<!--CATEGORY_DESCRIPTION-->
<!--CATEGORY_KEYWORDS-->
<!--TOTAL_ITEMS-->

<!--CATEGORY_CUSTOM_VAR1-->
<!--CATEGORY_CUSTOM_VAR2-->
<!--CATEGORY_CUSTOM_VAR3-->


For search 

<!--SEARCH_QUERY-->
<!--SEARCH_TYPE-->

For custom galleries

  <!--IMG_1_IMAGE-->
  <!--IMG_1_THUMB-->
  <!--IMG_1_THUMB_X-->
  <!--IMG_1_THUMB_Y-->
  

  <!--IMG_2_IMAGE-->
  <!--IMG_2_THUMB-->
  <!--IMG_2_THUMB_X-->
  <!--IMG_2_THUMB_Y-->
  
  and so on

  <!--SPONSOR_NAME-->
  <!--SPONSOR_SITE-->
  <!--SPONSOR_SITE_URL-->
  <!--SPONSOR_TRIAL_URL-->
  <!--SPONSOR_JOIN_URL-->
  <!--SPONSOR_TITLE-->
  <!--SPONSOR_DESCRIPTION-->
  <!--SPONSOR_PAYMENT_OPTIONS-->
  <!--SPONSOR_SEO_NAME-->
  <!--SPONSOR_LOGO-->  
  
  <!--SPONSOR_BANNER1-->
  <!--SPONSOR_BANNER2-->

  <!--CUSTOM_VAR1-->
  <!--CUSTOM_VAR2-->
  <!--CUSTOM_VAR3-->
  
example of IF statement

<!--IF IMG_6-->
<a href='<!--IMG_6_IMAGE-->'><img src='<!--IMG_6_THUMB-->'></a>
<!--END IF-->

You have to mark places where you want to output thumbs:

<thumb num=1></thumb>
or
<!--default_1--> - means output first thumb using subtemplate default
or
<!--default_1-5--> - means output first 5 thumbs using subtemplate default

Navigation (Pagination)

let's say you have 100 thumbs per page and 1 000 thumbs - that's why you need 10 pages , and here's code example

<navigation>
<li><a href="/category/<!--CATEGORY_ID-->/<!--CATEGORY_NAME-->/<!--SORT_ORDER-->/<!--PAGE_NUM-->/" title="<!--PAGE_NUM-->"><!--PAGE_NUM--></a></li>
</navigation>

List of categories

<category order=alphabet num=1-5>
<li><a href="/category/<!--CATEGORY_ID-->/<!--CATEGORY_NAME-->/ctr/1/"><!--CATEGORY_NAME--></a></li>
</category>

order - can be alphabet and clicks.

Include template

You can include one template into another, for example, good idea to include header and footer in other templates.

<!--INCLUDE_TEMPLATE_header-->

Also with update 48 you can include local and even remote file

<!--INCLUDE_FILE_/path/to/some/file-->
<!--INCLUDE_FILE_http://remotehost//file-->

Rows and Cols

There are settings for rows ans cols, it doesnt affect template, it's for Cell Stats

Custom Templates

You can have as many custom template as you want. For example, default template for custom image galleries - content_custom_pic, but you can create for example my_sponsor1_pic and set it as a template for selected galleries (in Import or later Massedit).

But you can do more. Basic template of index page - index (yeap, it's easy :) ) But if you want separate template for trader trd.com you can create template index_trd (any name actually) and after that you have 3 options to use it.

content of trd.php

<?php
$_GET['force_template'] = 'index_trd';
include('./scj/tube/index.php');

Developer Mode

Sometimes it's easier to edit template on FTP, not in admin. If you set Developer Mode ON - script will search in scj/tube/default_templates for file with names *.tpl and replace existing templates in DB with content of those files. For example, content_list.tpl - for template content_list, and so on. Make sure you turn OFF this option on high traffic.

Cache

Actually cache options are located under Rotation -Settings menu, but I think it worth mention here. When script processes template and replaces tags with actual data - it saves result into cache so next time, when another surfer loads the same page, script doesnt have to process it again. You can see Cache time in Rotation - Settings. It's in seconds, 900 by default. It means that if surfer visits your index page at 10:00, this pages will be saved in cache till 10:15. This saves server resources so set cache time based on server resources.

 
new_rotation_templates.txt · Last modified: 2011/11/29 19:30 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki