This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
new_rotation_templates [2017/04/07 15:44] admin |
new_rotation_templates [2024/03/14 11:49] (current) admin [Search log] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== New Rotation Templates ====== | ||
+ | |||
+ | Each template consists of 2 parts: template itself and subtemplate (sometime just ' | ||
+ | |||
+ | |||
+ | All templates (except header and footer) usually have at least 1 subtemplate. Basically subtemplate is a little template to output each thumb at this page. | ||
+ | |||
+ | <a href="/ | ||
+ | <img src="< | ||
+ | |||
+ | |||
+ | Places to show thumbs: | ||
+ | |||
+ | < | ||
+ | <thumb template=default num=1></ | ||
+ | if you don't mention template - it will use default anyway so | ||
+ | <thumb template=default num=1></ | ||
+ | |||
+ | </ | ||
+ | |||
+ | a range of numbers | ||
+ | |||
+ | <thumb num=1-5></ | ||
+ | |||
+ | outputs first 5 thumbs | ||
+ | |||
+ | You can also add filters inside | ||
+ | |||
+ | <thumb num=1-10></ | ||
+ | | ||
+ | this way you have 10 best thumbs | ||
+ | |||
+ | <thumb sponsor=Myspon num=1-10></ | ||
+ | or if you have space in name | ||
+ | <thumb sponsor=" | ||
+ | or you can use id | ||
+ | <thumb sponsor_id=5 num=1-10></ | ||
+ | or a couple of ids | ||
+ | <thumb sponsor_id=5, | ||
+ | | ||
+ | Outputs first 10 thumbs limited by sponsor. The same works for cateegories | ||
+ | |||
+ | <thumb group=Mygroup num=1-10></ | ||
+ | <thumb group_id=5 num=1-10></ | ||
+ | | ||
+ | or you can exclude groups | ||
+ | <thumb skip_group=Mygroup, | ||
+ | or | ||
+ | <thumb skip_group_id=1, | ||
+ | | ||
+ | |||
+ | Sorting | ||
+ | |||
+ | <thumb order=date group=Mygroup num=1-10></ | ||
+ | |||
+ | content limit | ||
+ | |||
+ | <thumb content_type=image num=1-10></ | ||
+ | You can also use : flash, movie_only and movie - outputs both flash and movies | ||
+ | | ||
+ | |||
+ | You can also mix parameters, for example | ||
+ | |||
+ | <thumb group=Mygroup sponsor=mysponsor num=1-10></ | ||
+ | | ||
+ | You can also have a subtemplate right in main template | ||
+ | |||
+ | <thumb group=Mygroup sponsor=mysponsor num=1-10> | ||
+ | |||
+ | |||
+ | Note, that <thumb filters are added to filters we get from url, for example | ||
+ | |||
+ | < | ||
+ | / | ||
+ | |||
+ | in template we have | ||
+ | |||
+ | <thumb num=1-10></ | ||
+ | |||
+ | script will output 10 thumb from the group ' | ||
+ | |||
+ | SO if you use for example | ||
+ | |||
+ | <thumb sponsor_id=5 num=1-10></ | ||
+ | |||
+ | script will output thumbs using 2 filters: group ' | ||
+ | |||
+ | if you need another group at this page - you can override url parameters in tag like | ||
+ | |||
+ | <thumb sponsor_id=5 group=mygroup num=1-10></ | ||
+ | </ | ||
+ | |||
+ | |||
+ | **Duration limit** | ||
+ | |||
+ | < | ||
+ | |||
+ | <thumb duration_min=10 duration_max=90 num=1-10> | ||
+ | |||
+ | or use can use the same in url | ||
+ | |||
+ | domain/ | ||
+ | |||
+ | and the tag will be just | ||
+ | |||
+ | <thumb num=1-10> | ||
+ | |||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | **Group limit** | ||
+ | |||
+ | <thumb group_id=.. | ||
+ | or | ||
+ | <thumb skip_group_id=.. | ||
+ | |||
+ | **Sponsor limit** | ||
+ | |||
+ | <thumb sponsor_id=123 or sponsor=sponsor_name | ||
+ | or | ||
+ | <thumb skip_sponsor_id=123 or skip_sponsor=sponsor_name | ||
+ | |||
+ | |||
+ | **Date** | ||
+ | |||
+ | < | ||
+ | & | ||
+ | </ | ||
+ | |||
+ | |||
+ | there are some presets | ||
+ | |||
+ | < | ||
+ | & | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Template variables ===== | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | for flash galleries (when sponsor gives you url to flv) | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | With update 48 models were added | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | if gallery has more then 1 model | ||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | and so on | ||
+ | |||
+ | </ | ||
+ | |||
+ | For categories (groups) pages | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | For search | ||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | For custom galleries | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | | ||
+ | and so on | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | | ||
+ | < | ||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | | ||
+ | example of IF statement | ||
+ | |||
+ | <!--IF IMG_6--> | ||
+ | <a href='< | ||
+ | <!--END IF--> | ||
+ | |||
+ | </ | ||
+ | | ||
+ | |||
+ | | ||
+ | You have to mark places where you want to output thumbs: | ||
+ | |||
+ | <thumb num=1></ | ||
+ | or | ||
+ | < | ||
+ | or | ||
+ | < | ||
+ | | ||
+ | |||
+ | ===== 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 | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | Other parameters for pagination | ||
+ | * skip_href_deletion=true - do not delete hraf tag from current page | ||
+ | * active_link_style=act_pg and link_style=not_act_page - adds styles for current\non-current pages | ||
+ | |||
+ | |||
+ | < | ||
+ | For example you have following code | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | Let's say we are on the 2nd page of total 3 pages | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | |||
+ | w\o skip_href_deletion=true | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | Or Prev \ Next example | ||
+ | |||
+ | <?php if ('< | ||
+ | < | ||
+ | <?php } ?> | ||
+ | |||
+ | <?php if ('< | ||
+ | < | ||
+ | <?php } ?> | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== List of categories ===== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | | ||
+ | |||
+ | | ||
+ | * num - numbers like 1-5 mean from 1 to 5. | ||
+ | * order - can be alphabet and clicks. | ||
+ | * min_gallery_count | ||
+ | * set - you can you 2 sets of category thumbs | ||
+ | * first_letter=... output categories with names starting with this letter only | ||
+ | |||
+ | |||
+ | |||
+ | ===== Include template ===== | ||
+ | |||
+ | You can include one template into another, for example, good idea to include header and footer in other templates. | ||
+ | |||
+ | < | ||
+ | | ||
+ | Also with update 48 you can include local and even remote file | ||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | ===== Tag Cloud ===== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <a href="/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | You can also limit amount of tags displayed | ||
+ | |||
+ | < | ||
+ | <a href="/ | ||
+ | </ | ||
+ | |||
+ | and sort them based on amount if galleries by this tag | ||
+ | |||
+ | < | ||
+ | <a href="/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | Tag cloud is created every 30 minutes and stored into the cache. So if you clear up the cache - tag cloud will be unavailable some time. | ||
+ | |||
+ | Starting with update 49 you can create tag cloud with thumbs | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | <a href="/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | Creating of the best thumb for each tag is off by default because it adds some load, you can turn it on in Rotation - Settings. | ||
+ | |||
+ | |||
+ | |||
+ | ====== Category Thumbs ====== | ||
+ | |||
+ | The script selects the best thumb for each category (Rotation Settings - System Thumbs). You can have 2 sets of sp called category thumbs. | ||
+ | |||
+ | Here's an example how | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | Parameters: | ||
+ | * num - limit amount | ||
+ | * min_gallery_count - limit amount of galleries in a category ( for example min_gallery_count=10) | ||
+ | * set - byfault set in 1, but you cat have set=2, for example < | ||
+ | * first_letter=... , # - means any number | ||
+ | * custom_name_first_letter = ... | ||
+ | * category_custom_var1 category_custom_var2 category_custom_var3 - limit by custom vars | ||
+ | * filter_field= and filter_value - unified filter for example filter_field=custom_name filter_value=GET_somevar where GET_somevar - means & | ||
+ | * sort_field = sort by this field category_name, | ||
+ | * sort_order - asc, desc | ||
+ | * order - alphabet, clicks (same as ctr), amount of galleries (total_items) , random | ||
+ | * parent_id | ||
+ | * name=" | ||
+ | * category_id= limit by category id | ||
+ | |||
+ | There are some test vars | ||
+ | |||
+ | * < | ||
+ | |||
+ | |||
+ | |||
+ | ====== Tag prefix ====== | ||
+ | |||
+ | You can use PHP code in your templates to play with variables, let's say you want to make the first letter - uppercase | ||
+ | |||
+ | <?php ucfirst('< | ||
+ | |||
+ | If a description has a quote you'll get an error, so you have to " | ||
+ | |||
+ | <?php ucfirst('< | ||
+ | |||
+ | Here's another example | ||
+ | |||
+ | Let's say < | ||
+ | |||
+ | |||
+ | At present moment we have following prefixes | ||
+ | |||
+ | **1. Escape ** | ||
+ | |||
+ | As an example | ||
+ | |||
+ | **2. HTMLENTITY to replace special html characters like & => & | ||
+ | |||
+ | < | ||
+ | '&' | ||
+ | '"' | ||
+ | ''' | ||
+ | '<' | ||
+ | '>' | ||
+ | |||
+ | |||
+ | example: < | ||
+ | </ | ||
+ | |||
+ | **3. URLENCODE to replace URL variaиду (a space becomes +) ** | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | Basically | ||
+ | |||
+ | **4. RAWURLENCODE | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | Basically | ||
+ | |||
+ | Don't forget you can combine < | ||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | **5. STRIP_SPECIAL_CHARS_ to delete special characters like !$@ and so on ** | ||
+ | |||
+ | Exactly it's : trim(preg_replace(' | ||
+ | |||
+ | |||
+ | Example: < | ||
+ | ===== < | ||
+ | |||
+ | Outputs all the data for the current gallery. An example shows it better then a thousand words | ||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | and for groups | ||
+ | |||
+ | < | ||
+ | |||
+ | and models | ||
+ | |||
+ | < | ||
+ | |||
+ | </ | ||
+ | |||
+ | Note that if you have something like this | ||
+ | |||
+ | < | ||
+ | |||
+ | you'll get a result like this " | ||
+ | |||
+ | That;' | ||
+ | |||
+ | < | ||
+ | |||
+ | which gives you better result like this " | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== Search log ====== | ||
+ | |||
+ | if you have a search form like (domain/? | ||
+ | |||
+ | Default rewrite - http:// | ||
+ | |||
+ | You can also output that list at any page | ||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | order=hits - also can be : alphabet, date | ||
+ | |||
+ | date_limit=today - yesterday, this_week, this_month | ||
+ | |||
+ | date_start= date_end= | ||
+ | |||
+ | min_results= | ||
+ | |||
+ | min_hits= surfers looked up this term at least X times | ||
+ | |||
+ | search= filter results by this keyword | ||
+ | |||
+ | </ | ||
+ | |||
+ | so called " | ||
+ | |||
+ | search= CURRENT_CATEGORY_NAME or CURRENT_TAG_NAME | ||
+ | |||
+ | basicaly the same as search=GET_category_name and search=GET_tag_name (ie take the keyword from URL (GET parameters) | ||
+ | |||
+ | exclude_search_query= exclude from search results | ||
+ | | ||
+ | |||
+ | most likely it's gonna be exclude_search_query=GET_search - ie exclude current search keyword | ||
+ | |||
+ | We log every search request with the best gallery ID found, for example, a surfer looks for ' | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | Best gallery: < | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | If you don't want to log search request at some pages you can do | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | **separator** | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== 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 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. | ||
+ | |||
+ | * ask trader to send traffic to http:// | ||
+ | * create rewrite for link1 | ||
+ | * create file trd.php and set it as personal page for this trader | ||
+ | |||
+ | content of trd.php | ||
+ | |||
+ | < | ||
+ | <?php | ||
+ | $_GET[' | ||
+ | include(' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== 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/ | ||
+ | |||
+ | |||
+ | ====== 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: | ||
+ | |||
+ | |||
+ | |||
+ | ====== Version 1.X Notes ====== | ||
+ | |||
+ | |||
+ | - For version 1.X you have to add some special tags ((Each template MUST have < | ||
+ | - Links should be like <a href="/ | ||
+ | - You can use old style formatting | ||
+ | |||
+ | format: < | ||
+ | for example | ||
+ | < | ||
+ | |||
+ | |||
+ | < | ||