new_rotation_hints
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| new_rotation_hints [2023/01/09 09:46] – [Suggestions Based on logged searches] admin | new_rotation_hints [2026/04/20 13:55] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== New Rotation Hints ====== | + | ====== New Rotation Hints ====== |
| ===== Setting GET parameters | ===== Setting GET parameters | ||
| - | This is one the most important | + | This is one of the important |
| + | As already | ||
| - | In this example / | + | In this example / |
| - | What you are supposed | + | The main thing to understand |
| **Option 1** | **Option 1** | ||
| - | Direct | + | Direct |
| + | The only detail here is how query parameters are written: after the file name comes a ? (question mark), and parameters are separated by & (ampersand). | ||
| - | **2 - rewrites** | + | **Option |
| - | Lets say we want to output group 'phones' using template | + | For example |
| - | + | ||
| - | Rewrite | + | |
| RewriteRule ^super_phones\.html$ / | RewriteRule ^super_phones\.html$ / | ||
| - | and you get an URL like this - http:// | + | and the URL will be beautiful |
| - | **3 - file ** | + | **Option |
| - | The same task for / | + | The rewrite option is good, but it has 2 problems: there are sites without Apache, i.e. purely on nginx for example, which doesn' |
| - | Create file super_phone.php | + | |
| + | Besides, it's harder to make flexible conditions in rewrites, so there is option 3. | ||
| + | |||
| + | Same task: a beautiful link for / | ||
| < | < | ||
| Line 36: | Line 38: | ||
| </ | </ | ||
| - | and you get URL like | + | and we get a beautiful |
| - | ===== Different titles ===== | + | Another advantage of this option is that parameters can be adjusted directly in PHP for conditions not covered by the script, for example: |
| - | + | ||
| - | There are some tricks to get different titles | + | |
| - | + | ||
| - | For example | + | |
| < | < | ||
| - | <? | + | <?php |
| + | $_GET[' | ||
| - | < | + | // here we change the template depending on the referrer |
| + | if ($_SERVER[' | ||
| + | | ||
| + | } else { | ||
| + | | ||
| + | } | ||
| - | <?php } elseif | + | include('./ |
| + | </code> | ||
| - | < | ||
| - | <?php } else { ?> | ||
| - | < | ||
| - | <?php } ?> | + | ===== How to sort by date by default, effectively with no homepage rotation, like a regular tube ===== |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | ===== Rating | + | |
| - | + | ||
| - | Add styles | + | |
| + | * Create a main.php file on the domain root that looks like | ||
| < | < | ||
| - | <style> | + | <?php |
| - | div.rating-cancel, | + | $_GET[' |
| - | div.rating-cancel, | + | include('./scj/tube/index.php'); |
| - | div.star-rating, | + | |
| - | div.rating-cancel a, | + | |
| - | div.star-rating-on a{background-position: | + | |
| - | div.star-rating-hover a{background-position: | + | |
| - | /* Read Only CSS */ | + | |
| - | div.star-rating-readonly a{cursor: | + | |
| - | /* Partial Star CSS */ | + | |
| - | div.star-rating{background: | + | |
| - | /* END jQuery.Rating Plugin CSS */ | + | |
| - | </ | + | |
| </ | </ | ||
| + | * Write the PATH (NOT URL!!!) to this file in Settings - CJPages (before this, you probably had the path to scj/ | ||
| + | * That's all. | ||
| - | Add JS script | + | ===== How to organize a trade in groups using the new rotation (rewrite) ===== |
| - | < | + | First, how traffic gets from the trader to you: |
| - | <script src='/ | + | |
| - | <script src='/ | + | |
| - | < | + | |
| - | $(function(){ | + | |
| - | $(' | + | |
| - | callback: function(value, link){ | + | |
| - | $('# | + | |
| - | $.get('/ | + | **The trader has a multi-niche website:** |
| - | { | + | * The easiest way is to set up a redirect to the desired niche using a referrer |
| - | ' | + | * There you can also configure custom words if the names of the trader’s niches do not coincide strongly with yours |
| - | ' | + | |
| - | ' | + | |
| - | }, | + | |
| - | function(data) { | + | |
| - | | + | |
| - | } | + | |
| - | ); | + | |
| - | } | + | |
| - | }); | + | |
| - | }); | + | |
| - | </ | + | |
| - | </ | + | |
| + | **The trader has a single-niche website** | ||
| + | * or his domain contains a niche keyword, which is a fairly common situation and he will be redirected to the desired niche anyway | ||
| + | * or add its domain to custom niche redirects | ||
| + | All. You don't need to do anything else for simple options. | ||
| - | adding stars .. | + | **If for some unknown reason auto-redirect does not suit you and you want the old-style with setting up each trader separately, then the options are as follows: |
| + | - create rewrite for example | ||
| + | RewriteRule ^niche\.php$ /? | ||
| + | and ask the trader to send http:// | ||
| + | - option 2 is to create a file for example niche.php like | ||
| < | < | ||
| - | <h4>Rate this movie:</ | + | <?php |
| - | < | + | $_GET['group_id'] = 21; // this is the id of the rotation niche |
| - | <input class=" | + | include('./scj/ |
| - | < | + | |
| - | <input class=" | + | |
| - | <input class=" | + | |
| - | </ | + | |
| </ | </ | ||
| + | and then either the trader immediately sends to http:// | ||
| + | If you use any of the complex options, please describe why. We need to add an example of why this might be necessary. | ||
| - | That's it. | ||
| + | **Now sending traffic out by groups.** | ||
| - | PS To output rating use < | ||
| - | for example | + | **Option 1** |
| + | * Create groups for the trade, the name of the trade group must match the name of the rotation groups. In Update 45, a special button even appeared in rotation - groups, which copied the names of groups. | ||
| + | * add rewrite. As you can see, the group is taken into account in the link to the out | ||
| < | < | ||
| - | <? if(< | + | RewriteRule ^gal/(.*)/(.*)/ |
| - | <? if(< | + | </code> |
| - | <? if(<!--RATING--> | + | |
| - | <? if(<!--RATING--> | + | <code> |
| - | <? if(<!--RATING--> | + | a href='/ |
| </ | </ | ||
| + | It’s not difficult to notice that the group name is transmitted via rewrite. | ||
| - | ===== Rating +1\-1 like\dislike ===== | + | **Option 2** |
| - | and other 2-options rating systems | + | Update 48 introduced the Trade by groups feature |
| - | Actually the trick is simple: | + | We have a classic multi-niche CJ site, we want to trade in groups. To do this, you need to add &group=... to the URL, however, for tube site with rewrites this is not as convenient |
| - | What to do: | + | If you use default rewrite, it means that your category pages have a URL like / |
| - | Add JS script | + | To use this feature, you need to: |
| - | < | + | |
| - | <script src='/ | + | - If you have not created them yet, then create trade groups with names as rotation categories. By the way, you can do this with one click in Rotation - Groups (Copy To Trade Groups) |
| + | - Distribute traders into groups | ||
| + | - Rotation - CMS - Tube settings enable Niche trade option | ||
| + | - that's it :) | ||
| - | < | ||
| - | function post_rating(value) { | ||
| - | $.get('/ | ||
| - | { | ||
| - | ' | ||
| - | ' | ||
| - | ' | ||
| - | }, | ||
| - | function(data) { | ||
| - | | ||
| - | } | ||
| - | ); | ||
| - | } | + | **Option 3** |
| - | </ | + | Usually there are quite a few niches on a multi-niche CJ site, more than the number of niches in which I would like to distribute traders, for example, 500 niches in rotation, but I would like to distribute traders into only 15 groups. |
| - | </ | + | |
| - | + | ||
| - | Adding vote buttons | + | |
| + | * Create groups for trade, let’s say the same 15 pieces, the names may or may not coincide with the names of the rotation groups - it doesn’t matter. | ||
| + | * in the rotation groups, find the custom var1 field and for each rotation group, enter the name of the trade group that will be used | ||
| + | * add rewrite. As you can see, the group is taken into account in the link to the out | ||
| < | < | ||
| - | + | RewriteRule ^gal/ | |
| - | <div id=' | + | </code> |
| - | current rating = <?=(<!--RATING--> | + | * and change the subtemplate used to display thumbs, so that the links would be something like this |
| - | rate it: | + | <code> |
| - | + | a href='/gal/<!--GROUP_CUSTOM_VAR1-->/<!--GALLERY_SLUG-->/index.html?<!--THUMB_LINK-->' | |
| - | <span onclick='post_rating(2)' | + | |
| - | <span onclick=' | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | +1 and -1 can be replaced with whatever you want. | + | |
| </ | </ | ||
| - | That's it ) | + | ===== Thumbs' |
| - | + | ||
| - | + | ||
| - | ===== Rotating thumbs of a gallery | + | |
| - | Thumbs | + | Thumb rolling |
| - | How to do it | + | It's very easy to do: |
| - | * add JS code into your template , it rotates thumbs | + | * we add JS code to the template, |
| < | < | ||
| Line 256: | Line 212: | ||
| </ | </ | ||
| - | | + | * here is a role for thumb whose ID starts with ' |
| < | < | ||
| <a href="/ | <a href="/ | ||
| - | <img id=' | + | <img id=' |
| </ | </ | ||
| </ | </ | ||
| - | notice 2 points here | + | Rolling is based on two things: |
| < | < | ||
| - | id=' | + | id=' |
| - | rel="< | + | rel="< |
| </ | </ | ||
| - | ===== Internationalization ( i18 ) ===== | + | ===== Custom pagination |
| - | it's pretty easy to translate site's menu (links like Most popular, Longest Videos | + | In mysql there are 2 options for sampling from the database: when the total number of results for a query is counted and when not. The second option is faster. Accordingly, |
| - | 1. Create custom template ' | + | Therefore, if you need your own navigation and the exact number |
| < | < | ||
| - | <? | ||
| - | $my_keywords[' | ||
| - | ' | ||
| - | ' | ||
| - | and so on | ||
| - | ); | ||
| - | $my_keywords[' | + | <!-- |
| - | ' | + | < |
| - | ' | + | . |
| - | and so on | + | </ |
| - | ); | + | --> |
| + | </ | ||
| - | $my_keywords[' | + | There is still a pagination macro, but it is inside an HTML comment, so the script will still calculate < |
| - | ' | + | |
| - | ' | + | |
| - | | + | |
| - | ); | + | |
| - | and so on as many languages as you want. | + | You can make any one to your taste. For example |
| - | Now you have 2 options to setup language for each user | + | < |
| - | using browser language | + | $total_pages = ceil(< |
| + | for ($i = 1; $i <= $total_pages; | ||
| + | echo "<a href='/? | ||
| + | } | ||
| + | </ | ||
| - | if (strstr($_SERVER[' | + | where 100 is the number of thumbs you have on your page (you will add it, since you build the template yourself). This is a simple example, of course you can diversify it as you need for a specific page. |
| - | $lang = $my_keywords[' | + | |
| - | } elseif (strstr($_SERVER[' | + | |
| - | $lang = $my_keywords[' | + | |
| - | } else $lang = $my_keywords[' | + | |
| - | or geo_ip | ||
| - | if ($_SERVER[' | + | **Option 2** |
| - | $lang = $my_keywords[' | + | |
| - | } elseif ($_SERVER[' | + | |
| - | $lang = $my_keywords[' | + | |
| - | } else $lang = $my_keywords[' | + | |
| + | In most cases, surfers don’t need the 25th page at all and people don’t go there in most cases, so it makes sense to limit them to, for example, 5 or 10 pages and just fit them into the template as is | ||
| - | Hopefully those examples are pretty self explaining | + | < |
| + | <ul class=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ul> | ||
| - | at the ens of template | + | For beauty, |
| - | if ($_GET[' | + | < |
| - | setcookie('force_lng', $_GET['set_lng'], time() + 86400); | + | add the code and it turns out |
| - | $lang = $my_keywords[' | + | < |
| - | } elseif ($_COOKIE[' | + | and the same for the remaining pages. |
| - | $lang = $my_keywords[$_COOKIE[' | + | |
| - | } | + | |
| - | That's it for this template | ||
| </ | </ | ||
| - | 2. Now you have to include this template into each template where you are going to use those words | ||
| + | |||
| + | ===== Separate page for a list of categories ===== | ||
| + | **Option 2 | ||
| + | |||
| + | First | ||
| + | ** | ||
| + | |||
| + | 1. Create a custom template, for example cat_template, | ||
| < | < | ||
| - | <!--INCLUDE_TEMPLATE_languages--> | + | < |
| + | <a href="/ | ||
| + | </ | ||
| </ | </ | ||
| - | 3. and replace words in templates with variables | + | 2. this page will be visible via the link / |
| + | |||
| + | 3. to get a beautiful link, add rewrite | ||
| < | < | ||
| - | Most popular -> <?=$lang[' | + | RewriteRule ^categories$ /?force_template=cat_template |
| - | Order By Date -> <?=$lang[' | + | |
| - | and so on | + | |
| </ | </ | ||
| - | From this point it should work as it supposed to. | + | and the page will open at the link domain.com/ |
| - | 4. Now we want to add an ability for user to force switch to a selected language | ||
| - | < | + | **Option 2** |
| - | add a link like | + | |
| - | http://domain/?force_lng=de (and so on any language based on your language array $my_keywords[' | + | 1. Create a custom template, for example cat_template, |
| + | < | ||
| + | < | ||
| + | <a href="/category/< | ||
| + | </ | ||
| + | </ | ||
| + | 2. create a file categories.php at the root of the domain in which | ||
| + | < | ||
| + | <?php | ||
| + | $_GET[' | ||
| + | include(' | ||
| </ | </ | ||
| - | That's it. | + | 3. The page is available at the link domain.com/ |
| - | ===== Comments | + | ===== Sitemap |
| - | Adding AJAX code to add comments | + | By default, you have a sitemap in scj/ |
| + | 1. Create a sitemap template (starting from update 46 it is included in the default templates) with content like | ||
| < | < | ||
| + | < | ||
| + | </ | ||
| - | <script src='/ | + | and subtemplate in accordance with the sitemap format. |
| - | <script> | + | 2. create a sitemap.php file on the domain root |
| - | function post_comment() { | + | <code> |
| + | <?php | ||
| - | $.post( | + | define('CACHE_TIME', |
| - | '/scj/tube/', | + | $_GET['force_template'] = 'sitemap'; |
| - | { | + | $_GET['skip_cell_settings'] = true; // skips cell K calculation - saves a bit of CPU time |
| - | ' | + | // $_GET['custom_galleries'] = true; // uncomment this line if you need only custom galleries in site map |
| - | ' | + | header('Content-Type: |
| - | ' | + | include('./ |
| - | 'username': $('# | + | </ |
| - | ' | + | |
| - | }, | + | |
| - | function(data) { | + | |
| - | if (data != ' | + | |
| - | $('# | + | |
| - | } else { | + | |
| - | | + | |
| - | $('# | + | |
| - | } | + | |
| - | } | ||
| - | ); | ||
| - | } | ||
| - | </ | ||
| - | </ | + | Please note that if you use descriptions that contain special characters, for example & (ampersand), |
| + | __Considering that this point in the docs could have been written quite a long time ago relative to the time you read it, it makes sense to check Google docs again regarding the sitemap rules.__ | ||
| + | In addition, Google’s rules say that the sitemap size should not be more than a certain amount, so if you have more than 1-2-3k gallery, then in any case you need to divide it into pages by ?page=1 ?page=2, etc. (see [[New Rotation Hints# | ||
| - | Add html form | + | ===== How to make RSS ===== |
| + | 1. Create an rss template (starting from update 47 it is in the default templates) with content like | ||
| < | < | ||
| + | <thumb num=1-100> | ||
| + | </ | ||
| - | <div id=' | + | and subtemplate in accordance with the rss format. |
| - | <div id=' | + | |
| - | <div class=" | + | |
| - | < | + | |
| - | <FORM name=" | + | 2. create a file rss.php on the root of the domain |
| + | <code> | ||
| + | <?php | ||
| - | <div class=" | + | define(' |
| - | < | + | $_GET['force_template'] = 'rss'; |
| - | </div> | + | $_GET['skip_cell_settings' |
| - | <div class=" | + | include(' |
| - | < | + | </code> |
| - | </div> | + | |
| - | <? if ($rot_settings[' | ||
| - | <div class=" | ||
| - | < | ||
| - | <input id=' | ||
| - | </ | ||
| - | <div class=" | ||
| - | <input type=' | ||
| - | </ | ||
| - | <? } ?> | ||
| - | </ | ||
| - | </ | ||
| - | </ | + | ===== Custom title for each template ===== |
| + | For example, you include the header template in all templates, so if you want different titles for different pages, you have the following options: | ||
| - | and output existing comments | + | Option depending on template |
| < | < | ||
| - | <!--TOTAL_COMMENTS--> | + | <?php |
| + | if ('<!--TEMPLATE_NAME-->' == ' | ||
| + | This is index | ||
| + | <? } elseif ('< | ||
| + | This is category | ||
| + | <? } elseif ('< | ||
| + | this is search | ||
| + | <? } else { ?> | ||
| + | some other page | ||
| + | <? } ?> | ||
| - | < | ||
| - | < | ||
| - | </ | ||
| </ | </ | ||
| + | Depending on the variables passed to the URL | ||
| - | That's it. | + | < |
| - | Note that comment moderation available | + | < |
| + | <?php if ($_GET['gallery_id' | ||
| + | < | ||
| + | <?php } elseif ($_GET[' | ||
| + | < | ||
| + | <?php } else { ?> | ||
| + | < | ||
| + | <?php } ?> | ||
| + | </ | ||
| - | ===== Thumb rolling ===== | ||
| - | Let's say you have 5 thumbs for each gallery, usually rotation engine tries to find the best one among them, but you can also " | ||
| - | How to do it | + | ===== How to separate content by type ===== |
| - | * Add some JS some that add rolling for all thumbs with швы starting with ' | + | |
| + | For example, we need to display only movies on some page. To do this, you need to add content_type=movie to the parameters | ||
| < | < | ||
| + | http:// | ||
| + | http:// | ||
| - | <script src='/scj/ | + | You can also use image and flash |
| + | </code> | ||
| - | < | + | All this also works through the file |
| - | $(document).ready(function() { | + | |
| - | + | ||
| - | $(" | + | |
| - | $(this).attr(' | + | |
| - | StartSlide($(this).attr(' | + | |
| - | }).mouseleave(function() { | + | |
| - | $(this).attr(' | + | |
| - | if ($(this).attr(' | + | |
| - | }); | + | |
| - | }); | + | < |
| + | <?php | ||
| + | $_GET[' | ||
| + | $_GET[' | ||
| + | include(' | ||
| + | </ | ||
| - | function StartSlide(id) { | + | ===== Separate template for a specific category ===== |
| - | if (!$('#' | + | |
| - | if (!$('#' | + | Before making a separate template, think about it: maybe you don’t need a separate template, but just use custom vars for categories and thus solve this issue. However, if you are sure that you need a completely different page, then you can do it as follows: |
| - | var images = $('#' | + | - Rotation - CMS pages - create a new template for example cat_new.tpl |
| - | images | + | - in common.php we write the following |
| - | var cur = $('#' | + | < |
| + | if ($_GET['group_id'] == '1' | ||
| + | where 1 and group_name are the corresponding ID and name of the category you need | ||
| + | </ | ||
| - | cur = parseInt(cur); | + | ===== Blog on a subdomain ===== |
| - | cur = (!cur || cur == 0) ? 1 : (cur+1); | + | |
| - | cur = (!images[cur]) ? 0 : cur; | + | - Create a subdomain, copy common.php, index.php, as well as 2 directories scj/cgi and scj/tube to the root + create |
| - | $('#' | + | - In the basic admin panel we create templates, for example blog_index, blog_content_list, |
| + | - We got 3 komons, so as not to get confused, we’ll do the same in all 3 | ||
| + | < | ||
| + | After <? add | ||
| - | var preload | + | if ($_SERVER[' |
| + | $_GET[' | ||
| + | } elseif | ||
| + | $_GET[' | ||
| + | } | ||
| + | </ | ||
| - | if (cur == 0) { | ||
| - | preload.src = $('#' | ||
| - | } else { | ||
| - | preload.src = images[cur]; | ||
| - | } | ||
| - | if ($('#' | + | ===== Skimming on custom galleries ===== |
| - | } | + | In version 46, a new option has been added - skimming to gallery. |
| - | function ChangeSRC(id, | + | Rotation - CMS - Tube Settings can be set **custom gallery skimming** for example in the form |
| - | if (!$('#' | + | < |
| - | $('#' | + | 100%, |
| - | StartSlide(id); | + | |
| - | } | + | |
| - | </ | + | |
| + | first click on the content (100 and 100% are the same, you can write it as you wish) | ||
| + | second: 70% content, rest acc. 30% - / | ||
| + | 3rd: 70% content 30% sponsor (on the URL that is registered with the sponsor in the site url) | ||
| + | 4th: 50% content 50% sponsor (URL - join url), | ||
| + | 5 and onwards - 100% content | ||
| </ | </ | ||
| - | * add id=' | + | Please note that this only works if you link not directly to the content, but through a script, |
| < | < | ||
| + | <a href='/ | ||
| + | </ | ||
| - | <a href="/ | + | |
| - | <img id=' | + | ===== Niche traffic selling |
| - | </a> | + | |
| + | Many people sell traffic on exchanges. When purchasing, the exchange only takes into account the domain and for multi-niche domains the price of traffic is usually lower than for niche ones, however, it is possible to send traffic indicating a niche and in this case the exchange can give a higher bid. | ||
| + | |||
| + | <code> | ||
| + | For example, usually everyone sells traffic using the link http:// | ||
| + | In this case, if you have a multi-niche, | ||
| + | But the exchange provides the opportunity to send traffic like http:// | ||
| </ | </ | ||
| + | To do this, we add the {GROUP} parameter to the sales URL; the URL looks like http:// | ||
| - | That's it. | + | tube_asian=Japanese, |
| + | |||
| + | where tube_asian is the broker’s niche, and Japanese, | ||
| - | Note. there are 2 points | + | |
| + | |||
| + | ===== PHP in navigation ===== | ||
| + | |||
| + | As you know, you can use PHP in template. And of course, it can be used in navigation | ||
| < | < | ||
| - | id='rot<!--ID-->' | + | |
| - | rel="< | + | by default it looks something like this |
| + | < | ||
| + | <a href="/ | ||
| + | </ | ||
| + | |||
| + | Let's say we need to highlight the girls category with color | ||
| + | |||
| + | < | ||
| + | <? if ('< | ||
| + | <a href="/ | ||
| + | <? } else { ?> | ||
| + | <a href="/category/<!--CATEGORY_NAME-->/" | ||
| + | <? } ?> | ||
| + | </ | ||
| + | |||
| + | |||
| + | Let's say we need to skip the girls category in this list | ||
| + | |||
| + | < | ||
| + | <? if ('< | ||
| + | <a href="/ | ||
| + | <? } ?> | ||
| + | </ | ||
| </ | </ | ||
| + | ===== Extra Thumb ===== | ||
| - | PS feel free to modify this code | + | For design, it is sometimes convenient |
| + | To make the script create larger images for the index, create a crop profile with larger dimensions in Rotation - Settings - Crop Profile, and specify that profile in the Extra Thumb field during grabbing. In that case the script creates two thumbs: one regular thumb, for example / | ||
| - | ===== Hide rotation parameter ===== | + | You can use this in a template like this: usually we display thumb as |
| - | A regular link looks like | + | <img src='< |
| + | |||
| + | If you made an extra thumb, then you can display it as follows: | ||
| + | |||
| + | <img src='< | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== How to make a personal template for a trader in the new rotation ===== | ||
| + | - Create a template in Rotation - CMS pages, for example trd_tpl | ||
| + | - Create a file for example trd_tpl.php at the root of the domain with the following content | ||
| + | |||
| + | < | ||
| + | <?php | ||
| + | $_GET[' | ||
| + | include(' | ||
| + | </ | ||
| + | |||
| + | and write the PATH (!NOT URL!!!) to this file in the trader edit. | ||
| + | |||
| + | ===== How to remove the rotation parameter from links (1x23x456) ===== | ||
| + | |||
| + | Relevant only for script version 1.x | ||
| + | |||
| + | In version 2.x there is a magic rotation parameter, when nothing is needed in the links | ||
| + | |||
| + | Typically links look like this: | ||
| / | / | ||
| - | where | + | 12x34x56 |
| + | |||
| + | You can do it like this: | ||
| - | 1. In subtemplate you have something like | + | 1. In the sub, your links look something like this: |
| < | < | ||
| <a href="/ | <a href="/ | ||
| - | replace | + | replace |
| <a href="/ | <a href="/ | ||
| Line 554: | Line 590: | ||
| </ | </ | ||
| - | not that < | + | no matter how difficult it is to notice, we put < |
| - | 2. add some JS code to < | + | 2. add to < |
| < | < | ||
| Line 574: | Line 610: | ||
| - | And that's it. it will add the parameter on click only, so surfer won't see it on ' | + | ===== I don't like links like / |
| - | ===== How to change | + | |
| - | **For version 1.X only** | + | There are 2 types of “dislikes” here - the /gallery view itself, etc. - this changes in rewrite. |
| + | 2nd option - I don’t like that 123x45x678 is right after the URL, it changes there, etc. | ||
| - | If you'd like to change links like /gallery to let's say /video - edit rewrites and templates. | + | Here are the options: |
| - | if you' | + | 1. If you don’t |
| + | 2. For CE - http:// | ||
| - | 1. Если не нравится, | + | 3. For CE there is also another option - to make links like |
| - | + | ||
| - | 2. For SEO purposes - http:// | + | |
| - | + | ||
| - | 3. For google (another option) - make likes like | + | |
| / | / | ||
| - | and in Google webmaster' | + | and in GWT declare that link is an insignificant |
| + | To do this, in .htaccess we replace places like | ||
| - | In this case you should also change .htaccess | + | out.php? |
| - | + | | |
| - | | + | |
| - | | + | |
| out.php? | out.php? | ||
| - | | + | |
| - | + | ||
| - | and template | + | |
| http:// | http:// | ||
| - | **Options 2 for rotation parameter** | ||
| - | if you'd like to have something not '& | + | **Option 2 of changing the end of links** |
| - | in rewrites | + | In rewrite we change |
| < | < | ||
| Line 619: | Line 648: | ||
| </ | </ | ||
| - | to | + | on |
| < | < | ||
| Line 626: | Line 655: | ||
| </ | </ | ||
| - | You can see 'param' | + | As you can see, param has been added here, which can be disabled in GWT |
| - | Don't forget about links | + | Accordingly, |
| href="/ | href="/ | ||
| Line 634: | Line 663: | ||
| - | **Option 3 if you want completely | + | **Option 3 if you want a completely |
| - | + | ||
| - | Tag < | + | |
| - | Here's an example: | + | At the moment, the < |
| < | < | ||
| - | subtemplate | + | you do it in saba |
| $my_var = explode(' | $my_var = explode(' | ||
| - | in $my_var | + | you get an array |
| Array | Array | ||
| Line 657: | Line 684: | ||
| </ | </ | ||
| - | now you can create 'your style' | + | and you can form a link from it as you wish |
| - | an example with acb | + | for example |
| < | < | ||
| Line 665: | Line 692: | ||
| out.php? | out.php? | ||
| - | then in common.php | + | and in common.php |
| if (isset($_GET[' | if (isset($_GET[' | ||
| Line 673: | Line 700: | ||
| </ | </ | ||
| - | This way you can have any links you want. | + | In this way, you can make parameters with any names or dots; in a word, your imagination is not limited in any way. |
| - | ===== Quick Pagination | + | ===== How to display all pages in navigation |
| + | |||
| + | Typically navigation (aka pagination) looks something like this: 1 2 3 ... 40 41 42. | ||
| + | |||
| + | If you need to display all 42 without... you need to replace the navigation with something like the following | ||
| - | Basic pagination looks like | ||
| < | < | ||
| + | |||
| + | Was | ||
| < | < | ||
| - | < | + | < |
| </ | </ | ||
| + | |||
| + | replace it with | ||
| + | |||
| + | <!-- | ||
| + | commented out the current navigation without removing it from the template altogether | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | --> | ||
| + | |||
| + | <?php | ||
| + | $thumbs_per_page = 200; | ||
| + | $total_pages = ceil(< | ||
| + | |||
| + | for ($i = 1; $i <= $total_pages; | ||
| + | ?> | ||
| + | < | ||
| + | <?php }?> | ||
| + | |||
| + | |||
| + | |||
| + | where $thumbs_per_page = 200; accordingly, | ||
| </ | </ | ||
| - | But if you have a big DB it takes time to calculate how much galleries you actually have in particular category, and at the same time user doesn' | ||
| - | So here's what we can do to save some resources of your server: we don't count total results and output just a link to the next page. | + | ===== Rating ===== |
| + | To add a custom gallery rating you need (using the example of content_custom_pic) | ||
| + | |||
| + | Add styles to make the stars beautiful | ||
| < | < | ||
| + | < | ||
| + | div.rating-cancel, | ||
| + | div.rating-cancel, | ||
| + | div.star-rating, | ||
| + | div.rating-cancel a, | ||
| + | div.star-rating-on a{background-position: | ||
| + | div.star-rating-hover a{background-position: | ||
| + | /* Read Only CSS */ | ||
| + | div.star-rating-readonly a{cursor: | ||
| + | /* Partial Star CSS */ | ||
| + | div.star-rating{background: | ||
| + | /* END jQuery.Rating Plugin CSS */ | ||
| + | </ | ||
| + | </ | ||
| - | So if there' | ||
| - | <?php if ('< | + | Add a JS script that will beautifully do mouseover for stars |
| - | < | + | |
| - | <?php } ?> | + | |
| - | <?php if ('< | + | <code> |
| - | <li><a href="/category/< | + | <script src='/ |
| - | <?php } ?> | + | <script src='/scj/ |
| + | <script> | ||
| + | $(function(){ | ||
| + | $(' | ||
| + | callback: function(value, | ||
| + | $('# | ||
| + | $.get('/ | ||
| + | { | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | }, | ||
| + | function(data) { | ||
| + | $('# | ||
| + | } | ||
| + | ); | ||
| + | } | ||
| + | }); | ||
| + | }); | ||
| + | </ | ||
| </ | </ | ||
| - | Note, that in this case we also don't have TOTAL_ITEMS | + | |
| + | We add the stars themselves | ||
| + | |||
| + | < | ||
| + | < | ||
| + | <input class=" | ||
| + | <input class=" | ||
| + | <input class=" | ||
| + | <input class=" | ||
| + | <input class=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | All. | ||
| + | |||
| + | PS You can display the rating anywhere with the tag < | ||
| + | the simplest example in the sub | ||
| + | < | ||
| + | <? if(< | ||
| + | <? if(< | ||
| + | <? if(< | ||
| + | <? if(< | ||
| + | <? if(< | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Rating +1\-1 like\dislike ===== | ||
| + | |||
| + | And other 2-variant ratings. | ||
| + | The idea is simple: reduce the rating scale to two values, 1 and 2. In practice, 1 means dislike and 2 means like. So an average of 1.5 means a 50/50 split between likes and dislikes, while 1.75 means 75% like and 25% dislike. | ||
| + | |||
| + | Technical implementation: | ||
| + | |||
| + | Add a JS script | ||
| + | < | ||
| + | |||
| + | <script src='/ | ||
| + | |||
| + | < | ||
| + | function post_rating(value) { | ||
| + | |||
| + | $.get('/ | ||
| + | { | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | }, | ||
| + | function(data) { | ||
| + | | ||
| + | } | ||
| + | ); | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Adding voting buttons and rating output | ||
| + | |||
| + | < | ||
| + | |||
| + | <div id=' | ||
| + | current rating = <? | ||
| + | rate it: | ||
| + | |||
| + | <span onclick=' | ||
| + | <span onclick=' | ||
| + | |||
| + | </ | ||
| + | |||
| + | +1 and -1 are replaced with fingers, checkmarks, etc. | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | All. | ||
| + | |||
| + | ===== PHP code in template ===== | ||
| + | |||
| + | As you probably know, you can use PHP code in templates. Of course, it will not be possible to consider all the nuances of the language in one example, and apparently it is not necessary, but I would like to show a small example. For example, | ||
| + | |||
| + | change < | ||
| + | |||
| + | However, there is one important caveat: if the description contains a quote, you will get something like <?php echo strtoupper(' | ||
| + | |||
| + | < | ||
| + | An example with < | ||
| + | |||
| + | <?php echo strtoupper('< | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== Comments ===== | ||
| + | |||
| + | It's just as easy to add comments. | ||
| + | |||
| + | Add code that will post a comment without reloading the page (AJAX) | ||
| + | |||
| + | < | ||
| + | |||
| + | <script src='/ | ||
| + | |||
| + | |||
| + | < | ||
| + | function post_comment() { | ||
| + | |||
| + | $.post( | ||
| + | '/ | ||
| + | { | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | }, | ||
| + | function(data) { | ||
| + | if (data != ' | ||
| + | $('# | ||
| + | } else { | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | } | ||
| + | ); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | Adding an HTML comment form | ||
| + | |||
| + | < | ||
| + | |||
| + | <div id=' | ||
| + | <div id=' | ||
| + | <div class=" | ||
| + | < | ||
| + | |||
| + | <FORM name=" | ||
| + | |||
| + | <div class=" | ||
| + | < | ||
| + | </ | ||
| + | <div class=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <? if ($rot_settings[' | ||
| + | <div class=" | ||
| + | < | ||
| + | <input id=' | ||
| + | </ | ||
| + | <div class=" | ||
| + | <input type=' | ||
| + | </ | ||
| + | <? } ?> | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | and add the output of existing comments | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | All. | ||
| + | |||
| + | |||
| + | ===== Geo targeting ===== | ||
| + | |||
| + | In fact, this is an example of PHP code in templates | ||
| + | |||
| + | < | ||
| + | <? | ||
| + | if ($_SERVER[' | ||
| + | ?> | ||
| + | |||
| + | banner code 1 | ||
| + | |||
| + | <? } else { ?> | ||
| + | |||
| + | banner code 2 | ||
| + | |||
| + | <? } ?> | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Two indexes with different content types ===== | ||
| + | |||
| + | Suppose you need two pages, one for movie content and one for image content. For example: movies.php and images.php | ||
| + | |||
| + | Option 2 | ||
| + | |||
| + | 1. We do everything | ||
| + | |||
| + | * create 2 files of the form | ||
| + | < | ||
| + | <?php | ||
| + | $_GET[' | ||
| + | include(' | ||
| + | </ | ||
| + | * we register any of these pages in CJ Pages - this will be the site index | ||
| + | * since template is not specified here, index will be used | ||
| + | * if in your design you somehow work differently with different sizes of movie and picture thumbs, then for processing use code like this | ||
| + | < | ||
| + | <?php | ||
| + | if ($_GET[' | ||
| + | ?> | ||
| + | text 1 | ||
| + | <? | ||
| + | } else | ||
| + | ?> | ||
| + | testct 2 | ||
| + | <? | ||
| + | } | ||
| + | |||
| + | Please note that this code can be used both in the sub and in the template itself. | ||
| + | Accordingly, | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | Option 2. We make 2 different templates, for example index_movies and index_images with the desired design and navigation, as well as 2 view files | ||
| + | |||
| + | < | ||
| + | <?php | ||
| + | $_GET[' | ||
| + | $_GET[' | ||
| + | include(' | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Translation of the site menu (i18) ===== | ||
| + | |||
| + | It’s quite easy to translate the site menu (those links like Most Popular, Order By date, etc.) into other languages. | ||
| + | |||
| + | Rotation - CMS Templates - Tpl Custom Var add custom variables, for example most_popular, | ||
| + | |||
| + | |||
| + | ===== Another flash player ===== | ||
| + | |||
| + | By default in the script there is a free player Jwplayer, at the moment it is already a bit old player, but it works :) If you want any other player, then the main thing is that you need to understand that the player and the script are not connected in any way. The script generates an HTML page where it replaces tags and how the page is displayed depends on the browser. How the movie plays depends on the player. | ||
| + | |||
| + | By default the code is as follows | ||
| + | |||
| + | < | ||
| + | <object id=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | < | ||
| + | type=" | ||
| + | id=" | ||
| + | name=" | ||
| + | src="/ | ||
| + | width="< | ||
| + | height="< | ||
| + | allowscriptaccess=" | ||
| + | allowfullscreen=" | ||
| + | flashvars=" | ||
| + | /> | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | As you can see, the player / | ||
| + | You can put your player anywhere convenient, any player, change the template so that it loads your player, just check how it needs to pass parameters. For example, Kernel player | ||
| + | |||
| + | < | ||
| + | |||
| + | <object id=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <embed src=" | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ===== How to quickly create a blog using an existing database ===== | ||
| + | |||
| + | If you filled the database well initially and you have good descriptions and a custom gallery is highly desirable, then you can create a parallel blog for the site in 10 minutes. | ||
| + | |||
| + | * create a subdomain conditionally blog.yourdomain.com | ||
| + | * set this to the smartcj subdomain | ||
| + | * make it slave yourdomain.com | ||
| + | * download [[http:// | ||
| + | * upload this file to Rotation - CMS (at the bottom Upload Templates) | ||
| + | |||
| + | That's it, the blog is ready :) | ||
| ===== Suggestions Based on logged searches ===== | ===== Suggestions Based on logged searches ===== | ||
| - | You can add ' | + | Auto-suggestions |
| - | Addings JS and styles to template | ||
| < | < | ||
| - | <script type=" | + | <script type=" |
| - | <script type=" | + | <script type=" |
| Line 725: | Line 1119: | ||
| $(document).ready(function(){ | $(document).ready(function(){ | ||
| $('# | $('# | ||
| - | serviceUrl: '/ | + | serviceUrl: '/ |
| onSelect: function(suggestion, | onSelect: function(suggestion, | ||
| Line 736: | Line 1130: | ||
| </ | </ | ||
| | | ||
| + | |||
| + | some styles for beauty | ||
| | | ||
| < | < | ||
| Line 747: | Line 1143: | ||
| - | and a search field | + | the search field itself |
| < | < | ||
| Line 753: | Line 1149: | ||
| </ | </ | ||
| - | You can notice that script requests | + | The template ' |
| < | < | ||
| <?php | <?php | ||
| - | header(' | + | header(' |
| ?>{ | ?>{ | ||
| " | " | ||
| Line 770: | Line 1166: | ||
| </ | </ | ||
| - | As you can see it is a regular template with a couple of new things like header -application/xml | + | How to check: |
| - | and a tag prefix < | + | |
| ===== Suggestions : Based on regular search ===== | ===== Suggestions : Based on regular search ===== | ||
| - | You can also suggest results based on existing galleries. Basically | + | The same as above, but it suggests not by the search database, but by the gallery database |
| Line 822: | Line 1216: | ||
| - | Another | + | template ' |
| Line 833: | Line 1227: | ||
| {" | {" | ||
| - | <thumb skip_search_log=true search=GET_QUERY | + | <thumb skip_search_log=true search=GET_query |
| , | , | ||
| </ | </ | ||
| Line 841: | Line 1235: | ||
| + | As you can see, the only difference is that in the template itself, specifically in the <thumb tag | ||
| + | |||
| + | ===== Site with main niches ===== | ||
| + | |||
| + | Let's say we want to create a site with 3 main categories (general (id 1), gay (2) and shemale (3)), each of these categories has sub-niches (typically teen, mature, etc.). They should be specifically for subcategories (in editing a category there is a parent category field) | ||
| + | |||
| + | /? | ||
| + | | ||
| + | For example, if he searches by tag and it is necessary from category 1 then | ||
| + | |||
| + | /? | ||
| + | | ||
| + | | ||
| + | |||
| + | **Category thumbs** | ||
| + | |||
| + | You can create 3 sets of thumb categories just for this situation | ||
| + | |||
| + | Settings - System Thumbs | ||
| + | |||
| + | When displaying thumb categories, we can indicate the set number | ||
| + | |||
| + | < | ||
| + | | ||
| + | Please note that the set can also be passed in a URL | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | |||
| + | ===== Custom flv: content separation ===== | ||
| + | |||
| + | Let's imagine that we have a gallery with 3 flash movies, like this http:// | ||
| + | |||
| + | If you make a custom gallery out of it, but if you do it just like that, you will get a gallery with 3 movies (in the gallery template, the sponsor cleverly made direct links to movies for scripts that do not know how to rob flash content), 3 flash movies and all this will be on one page. And we want each of the movies to open on a separate page, like with pixelated content. | ||
| + | |||
| + | **How to do it:** | ||
| + | |||
| + | 1. Let’s create a new template for the flash gallery, where on the gallery page there will only be a thumb of this gallery (like the pix one), the movies themselves will be played on a separate page (again, like the pix gallery), let’s say it will be called **content_flv_gallery** and its template will be | ||
| + | |||
| + | < | ||
| + | <a href='/ | ||
| + | <br> | ||
| + | <a href='/ | ||
| + | <br> | ||
| + | <a href='/ | ||
| + | <br> | ||
| + | </ | ||
| + | |||
| + | As it’s not difficult to notice, there is no flash player and all thumbs point to / | ||
| + | |||
| + | where there is another template **content_flv_single_item** where the flash player will be, as well as item_id - where the number of the movie from the gallery is transmitted, | ||
| + | |||
| + | **Content content_flv_single_item** | ||
| + | |||
| + | < | ||
| + | <? if ($_GET[' | ||
| + | <div class=" | ||
| + | <div class=" | ||
| + | |||
| + | <object id=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <embed | ||
| + | type=" | ||
| + | id=" | ||
| + | name=" | ||
| + | src="/ | ||
| + | width="< | ||
| + | height="< | ||
| + | allowscriptaccess=" | ||
| + | allowfullscreen=" | ||
| + | flashvars=" | ||
| + | /> | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | <? } ?> | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | <? if ($_GET[' | ||
| + | <div class=" | ||
| + | <div class=" | ||
| + | |||
| + | <object id=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <embed | ||
| + | type=" | ||
| + | id=" | ||
| + | name=" | ||
| + | src="/ | ||
| + | width="< | ||
| + | height="< | ||
| + | allowscriptaccess=" | ||
| + | allowfullscreen=" | ||
| + | flashvars=" | ||
| + | /> | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | <? } ?> | ||
| + | |||
| + | |||
| + | |||
| + | <? if ($_GET[' | ||
| + | <div class=" | ||
| + | <div class=" | ||
| + | |||
| + | <object id=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <embed | ||
| + | type=" | ||
| + | id=" | ||
| + | name=" | ||
| + | src="/ | ||
| + | width="< | ||
| + | height="< | ||
| + | allowscriptaccess=" | ||
| + | allowfullscreen=" | ||
| + | flashvars=" | ||
| + | /> | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | <? } ?> | ||
| + | |||
| + | </ | ||
| + | |||
| + | there are 3 almost identical pieces that differ only <? if ($_GET[' | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | **2. Grabbed gallery** | ||
| + | |||
| + | When grabbing content or later through editing, you need to set **Embed Template** for this gallery, respectively - content_flv_gallery | ||
| + | |||
| + | |||
| + | **3. rewrite** | ||
| + | |||
| + | URLs like / | ||
| + | |||
| + | < | ||
| + | RewriteRule ^flash_gallery/ | ||
| + | </ | ||
| + | |||
| + | and accordingly replace content_flv_gallery in the template | ||
| + | |||
| + | < | ||
| + | links like | ||
| + | <a href='/ | ||
| + | on | ||
| + | <a href='/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | **4. Features of this gallery** | ||
| + | |||
| + | Her sponsor posted 2 types of links to content: they are flash, others are in the form of links to movie clips for scripts that do not know how to rob flash content. This is correct, but the script will download both options, although we only want to output flash. For us, this is only bad because some of the content that we don’t need will be stored on disk. Accordingly, | ||
| + | |||
| + | ===== Navigation within one gallery ===== | ||
| + | |||
| + | For example, we have a custom pix gallery with a certain number of images. Clicking on thumb opens not the picture itself, but a page with this picture plus some additional advertising, | ||
| + | |||
| + | < | ||
| + | |||
| + | <? if ($_GET[' | ||
| + | <a href='/ | ||
| + | <? } ?> | ||
| + | |||
| + | <? if ($_GET[' | ||
| + | <a href='/ | ||
| + | <? } ?> | ||
| + | |||
| + | </ | ||
| + | |||
| + | If you have other rewrites, do not forget to edit the links. | ||
| + | |||
| + | |||
| + | ===== Friendly tube ===== | ||
| + | |||
| + | For content sites on the same base (master slave), there is an option to organize a trader among themselves, when the surfer sees the content but on another site in the network. | ||
| + | |||
| + | For example, a user clicks on http:// | ||
| + | |||
| + | This has a positive effect on the product of the original site (the person wanted to see the movie - he saw it), and also makes it possible to show other thumbs around the embed itself = the surfer can click on these thumbs on the trader’s site. | ||
| + | |||
| + | To do this, on the domain1.com website for the domain2.com trader, specify the site type - Friendly Tube. In this case, if the script decides to send to this trader, then the script will send the slug gallery to the trader. Of course, only if the redirect to the trader occurred when they clicked on the content, and not in the toplist. The script will simply send those to http:// | ||
| + | |||
| + | On domain2.com, | ||
| + | |||
| + | http:// | ||
| + | |||
| + | those redirect to gallery. If you have your own rewrites, then you need to change the URL to match your rewrites. | ||
| + | |||
| + | This is of course only relevant when | ||
| + | - if the trader also has SmartCJ | ||
| + | - if you use either master-slave (then the IDs are 100% the same) or if the content as a whole overlaps. | ||
| + | |||
| + | If there is no gallery with this ID on the trader’s website, it will just be an index | ||
| + | |||
| + | |||
| + | |||
| + | ===== Custom links ===== | ||
| + | |||
| + | Links to gallery in the default version / | ||
| + | |||
| + | Likewise for categories, tags, etc. | ||
| + | |||
| + | The only special case here is category links such as / | ||
| + | |||
| + | To change to this option you need to: | ||
| + | |||
| + | Add to common.php (note: they should all be the same) | ||
| + | < | ||
| + | if (isset($_GET[' | ||
| + | $_GET[' | ||
| + | } elseif (isset($_GET[' | ||
| + | $_GET[' | ||
| + | } else { | ||
| + | $_GET[' | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Now the / | ||
| + | |||
| + | However, in the navigation itself there is SORT_ORDER, which is actually equal to $_GET[' | ||
| + | |||
| + | < | ||
| + | if (isset($_GET[' | ||
| + | $_GET[' | ||
| + | $GLOBALS[' | ||
| + | } elseif (isset($_GET[' | ||
| + | $_GET[' | ||
| + | $GLOBALS[' | ||
| + | } else { | ||
| + | $_GET[' | ||
| + | $GLOBALS[' | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | And in the template, instead of SORT_ORDER, we use <? | ||
| + | |||
| + | PS In the navigation tag you need to add skip_href_deletion=true so that it does not clean up your PHP code. | ||
| + | |||
| + | |||
| + | ===== Random keywords for galleries ===== | ||
| + | |||
| + | If you have a list of keywords that you would like to randomly scatter throughout the gallery (for example, create a custom var and then use it somewhere in the gallery), then you can do it like this: | ||
| + | |||
| + | * create a text file with keywords (conditionally keywords.txt) | ||
| + | * PHP script kw.php | ||
| + | |||
| + | < | ||
| + | <? | ||
| + | $lines = file('/ | ||
| + | echo $lines[rand(0, | ||
| + | </ | ||
| + | |||
| + | * make sure that in the browser http:// | ||
| + | * add import replacement of the form | ||
| + | |||
| + | < | ||
| + | If this field = URL | ||
| + | Contains this value = http | ||
| + | Then Search For = * | ||
| + | in This Field = Custom field 1 | ||
| + | And Replace it With = external: | ||
| + | </ | ||
| + | |||
| + | All. | ||
| + | |||
| + | The main thing here is external: | ||
| ===== Site with main niches ===== | ===== Site with main niches ===== | ||
| - | Let's say we'd like to create a site with 3 main niches and X additional. | + | Let's say we need to create a website |
| - | Main niches: general (id 1) , gay (2) and shemale(3) | + | Main niches: general (id 1), guy (2) and bumblebee |
| - | and for example 100 niches like 'teen' | + | and for example 100 niches like teen (id 4), amateur (id 5) and so on |
| - | It's pretty obvious | + | It is logical |
| - | That's why all gallery belong to at least 2 groups: (1 2 or 3) and (4 or 5 for example). | + | Thus, all galleries on our site end up in at least 2 categories: one of 1 2 3 and at least one of the others |
| - | When we show content | + | When outputting gallery, |
| /? | /? | ||
| | | ||
| - | If he wants to see teen but gay we exclude | + | If you need to see a teen, but which is a guy in the group (this means you need to exclude 1 and 3), then the link will be |
| /? | /? | ||
| - | The same works for search by tag | + | Using the same scheme, you can divide, |
| /? | /? | ||
| - | **Category thumbs** | + | **thumb categories:** |
| - | Settings - System Thumbs | + | Settings - System Thumbs |
| + | In this case, we need 3 sets (sets) of thumb categories - for each of groups 1 2 and 3. | ||
| + | In order to filter thumb categories there is a field Skip group ids, comma separated | ||
| - | In this example | + | For example, for category |
| - | So let say for niche 1 (general) we don't want to see thumbs from 2 and 3 - so we add 2,3 into that field. | + | When displaying thumb categories, we can specify |
| - | + | ||
| - | We we output category thumbs | + | |
| < | < | ||
| | | ||
| - | Note what you can pass set id in URL like /?set_id=2 | + | For convenience, |
| < | < | ||
| - | + | | |
| - | Note that some category thumb sets might miss galleries for some specific groups so we can add min_gallery_count filter | + | Since we don’t want to display the current group itself, the skip_group_id parameter will come in handy (when displaying set 2, we don’t need to display the group guy (2) itself) /? |
| - | < | + | |
| + | |||
| + | As you can see in this example, the category and set IDs match, so the tag can even be made | ||
| + | |||
| + | < | ||
| + | |||
| + | but to avoid confusion in the example of such a replacement, | ||
| + | |||
| + | In addition, some categories may be specific to a certain niche and therefore there may not be a gallery there, so it makes sense to add min_gallery_count=1 | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | |||
| + | ===== Content protection ===== | ||
| + | |||
| + | By default, the content is in scj/ | ||
| + | |||
| + | On the page we output <img src='/ | ||
| + | |||
| + | And the surfer sees a direct link to / | ||
| + | |||
| + | 1. first, in the nginx config, disable downloading files directly | ||
| + | |||
| + | < | ||
| + | location ~* / | ||
| + | deny all; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | and add a secret location there too | ||
| + | |||
| + | location /protected { | ||
| + | root /var/www; | ||
| + | internal; | ||
| + | } | ||
| + | |||
| + | |||
| + | 2. Let's tweak the template a little. For example now it looks something like this | ||
| + | |||
| + | <a href='< | ||
| + | |||
| + | |||
| + | which gives us approximately the following result | ||
| + | |||
| + | <a href='/ | ||
| + | |||
| + | we will add / | ||
| + | |||
| + | <a href='/ | ||
| + | |||
| + | and the result will be | ||
| + | |||
| + | <a href='/ | ||
| + | |||
| + | |||
| + | 3. create content.php | ||
| + | |||
| + | < | ||
| + | <?php | ||
| + | if (!$_GET[' | ||
| + | die(" | ||
| + | } | ||
| + | |||
| + | header(" | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | In total, if you configured nginx correctly, then when you directly request / | ||
| + | |||
| + | The link / | ||
| + | |||
| + | ===== Content when no content is found ===== | ||
| + | |||
| + | For example, a person was looking for some keyword that you don’t have on your site, and he was given 0 search results. But you would like to show at least something. | ||
| + | |||
| + | There are 3 options: | ||
| + | |||
| + | |||
| + | **First** | ||
| + | |||
| + | By default, if nothing is found, it shows template content_not_found , but if you display it there | ||
| + | |||
| + | <thumb num=1-10 order=easy_random > | ||
| + | |||
| + | then these will be your random gallery | ||
| + | |||
| + | |||
| + | **Option 2** | ||
| + | |||
| + | if you don’t want to change content_not_found then make a separate random_content template | ||
| + | |||
| + | < | ||
| + | Nothing found , look at those links | ||
| + | |||
| + | <thumb num=1-10 order=easy_random zero_items_to_404=off> | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | and change the search template (content_search) as | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | <?if (< | ||
| + | |||
| + | < | ||
| + | window.location.replace(" | ||
| + | </ | ||
| + | |||
| + | <? } else { ?> | ||
| + | |||
| + | display thumb as usual in search | ||
| + | |||
| + | <? } ?> | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | Nothing extra is added to this soup. | ||
| + | |||
| + | |||
| + | **Option 3** | ||
| + | |||
| + | Just change content_search like | ||
| + | |||
| + | < | ||
| + | |||
| + | <?if (< | ||
| + | |||
| + | Nothing found , look at those links | ||
| + | |||
| + | <thumb num=1-10 order=easy_random search="" | ||
| + | |||
| + | |||
| + | <? } else { ?> | ||
| + | |||
| + | <thumb num=1-10 zero_items_to_404=off page_main_tag=true> | ||
| + | display thumb as usual in search | ||
| + | |||
| + | <? } ?> | ||
| + | |||
| + | </ | ||
| + | |||
| + | This option is simpler, but the downside is that even if something is found, the <thumb num=1-10 order=easy_random> | ||
| + | |||
| + | |||
| + | |||
| + | ===== Last Visited Galleries ===== | ||
| + | |||
| + | This is an example of using cache in template and macros | ||
| + | |||
| + | Add the following piece of code to the gallery template (for example content_page) | ||
| + | |||
| + | < | ||
| + | Current gallery id: < | ||
| + | |||
| + | <? | ||
| + | if ((int) '< | ||
| + | $last_items = Cache:: | ||
| + | |||
| + | if (!$last_items) $last_items = array(); | ||
| + | |||
| + | if ($last_items[0] != (int) '< | ||
| + | $last_items = array_slice($last_items, | ||
| + | |||
| + | Cache:: | ||
| + | } | ||
| + | |||
| + | ?> | ||
| + | |||
| + | |||
| + | <thumb num=1-10 limit_by_gallery_id=true order=row gallery_id=CACHE_last_items cache_time=10> | ||
| + | Last visited: < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | Here you should note for yourself | ||
| + | |||
| + | - Cache:: | ||
| + | - in the tag we display it, picking it up from cache <thumb num=1-10 limit_by_gallery_id=true **gallery_id=CACHE_last_items** order=row > | ||
| + | - added to the list of recently viewed only if there is one if ('< | ||
| + | - but the list itself can also be displayed on the index | ||
| + | |||
| + | |||
| + | Here you need to understand that | ||
| + | |||
| + | - if you open a page without cache, then the list of recent ones will not be read (no cache) | ||
| + | - the cache page along with this list, if you looked at gallery ID 1 2 and 3, then for 3 in the last viewed there will be 1 and 2, but for 2, even if you open it again after 3, only 1 gallery 2 will be cached. | ||
| + | |||
| + | |||
| + | There are 2 options here: | ||
| + | |||
| + | - leave it as it is because for a surfer it’s not so important | ||
| + | - reduce cache time (cache_time=100) | ||
| + | |||
| + | |||
| + | ===== Last Visited Galleries by Country ===== | ||
| + | |||
| + | Here we need a slightly deeper understanding of the process. | ||
| + | |||
| + | You have a website page, so you don’t have to generate it for each surfer - it is generated and stored in cache for some time, so you don’t have to generate a new page for the next visitors. If we want to show as in the example above, but by country, we need to at least remake the page for each country, given that there are 190 countries in the world, which means we will need to generate 190 times more pages (for each country separately) | ||
| + | |||
| + | |||
| + | To avoid this, you can go another way | ||
| + | |||
| + | - for example, on the index we make a code that conditionally requests the last_viewed.php page and displays the content | ||
| + | - it turns out that the index will be the same for everyone and only last_viewed.php will need to be worked out 190 (according to the number of countries) | ||
| + | |||
| + | |||
| + | How to do it step by step | ||
| + | |||
| + | 1. add gallery to the template | ||
| + | |||
| + | < | ||
| + | id: < | ||
| + | |||
| + | |||
| + | <? | ||
| + | if ((int) '< | ||
| + | |||
| + | $cache_id = ' | ||
| + | |||
| + | $last_items = Cache:: | ||
| + | |||
| + | $last_items[(int) '< | ||
| + | $last_items = array_slice($last_items, | ||
| + | |||
| + | Cache:: | ||
| + | |||
| + | } | ||
| + | |||
| + | |||
| + | ?> | ||
| + | |||
| + | </ | ||
| + | |||
| + | here in the cache variable | ||
| + | |||
| + | $cache_id = ' | ||
| + | |||
| + | the gallery list is added (last 100). As you can see, the variable depends on the country. | ||
| + | |||
| + | |||
| + | |||
| + | 2. create a new template viewed_in_country | ||
| + | |||
| + | < | ||
| + | <thumb num=1-10 limit_by_gallery_id=true gallery_id=CACHE_GET_last_viewed_cache_id order=row > | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | Pay attention to gallery_id=CACHE_GET_last_viewed_cache_id. This means the gallery_id list is taken from CACHE using the GET variable last_viewed_cache_id. | ||
| + | |||
| + | |||
| + | |||
| + | 3. where you need to display a gallery list for the current country | ||
| + | |||
| + | < | ||
| + | |||
| + | <script src="// | ||
| + | |||
| + | last viewed in <? | ||
| + | |||
| + | <script language=" | ||
| + | |||
| + | $(document).ready(function(){ | ||
| + | |||
| + | $.get(' | ||
| + | function(data) { | ||
| + | $('# | ||
| + | } | ||
| + | ); | ||
| + | |||
| + | }); | ||
| + | |||
| + | </ | ||
| + | |||
| + | <div id=' | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | the main thing here is that we are requesting a URL | ||
| + | |||
| + | ./? | ||
| + | |||
| + | where in the last_viewed_cache_id variable we pass from which cache id the gallery list should be taken, and this variable will be different for each country. | ||
| + | |||
| + | the resulting content is inserted into div = last_viewed | ||
| + | |||
| + | Total needed for the test | ||
| + | |||
| + | * go to a couple of gallery for step 1 to work | ||
| + | * open in the browser ./? | ||
| + | |||
| + | |||
| + | |||
| + | ===== Master/ | ||
| + | |||
| + | The master and slave have the same gallery set since it is one database. This means we can arrange a trade between sites on the same base in such a way that when going to the trader, the first thumb matches the one on which the click was made. This should boost sales. | ||
| + | |||
| + | How to set it up: a simple version for clarity | ||
| + | |||
| + | 1. on site A, surfer click on gallery 12345, when going to the trader (site B), we need to let site B know which gallery to show first (id 12345). | ||
| + | |||
| + | < | ||
| + | <thumb num=1-10> | ||
| + | <a href='/ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | As you can see here, the show_gallery_id= parameter is passed to out, the URLs will be like out.php? | ||
| + | |||
| + | 2. On site A, change the URL of the trader (site B) (only those that are on the same database and will support this feature) | ||
| + | |||
| + | http:// | ||
| + | |||
| + | |||
| + | Note the {GET_show_gallery_id} placeholder from step 1. When sending traffic to the trader, it is replaced with the value that was passed to out, so the trader receives a URL like http:// | ||
| + | |||
| + | |||
| + | 3. add an index to the trader’s template | ||
| + | |||
| + | |||
| + | < | ||
| + | |||
| + | <thumb num=1 gallery_id=GET_first_gallery_id limit_by_gallery_id=true> | ||
| + | first gallery < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | here you should note gallery_id=GET_first_gallery_id which is taken from point 2 | ||
| + | |||
| + | |||
| + | All. | ||
| + | |||
| + | |||
| + | |||
| + | ===== Rotate for Rows ===== | ||
| + | |||
| + | There is a useful rotation option | ||
| + | |||
| + | Rotate page for raws | ||
| + | ie if surfer visits us for a second time - show him second page instead of the first one | ||
| + | |||
| + | |||
| + | If a surfer goes to the site’s index, then we can automatically change the &page= parameter, those on the first visit the user actually sees & | ||
| + | |||
| + | <thumb num=1-10> | ||
| + | |||
| + | then on the first login the user will see thumb 1-10, on the 2nd thumb number 11 - 20. | ||
| + | |||
| + | |||
| + | **If you have thumb categories on your index** then the situation is different and there are 2 options | ||
| + | |||
| + | 1. if, for example, you have only 100 categories, and you display 50 on the index | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | then on the first run there will be categories 1 - 50, and on the second 51 - 100 | ||
| + | |||
| + | |||
| + | |||
| + | 2. if you have only 100 categories and you display all 100 on the index | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | in this situation, in order to show other thumbs, you need to create an additional set of thumb categories. To do this, in the settings of the Category thumbs rotation, turn on set 2 (and for example also set 3). We get 3 sets of thumb categories. | ||
| + | |||
| + | |||
| + | add the set number in the template | ||
| + | |||
| + | |||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | |||
| + | Pay attention to set_id=GET_page. The script will then rotate three different sets of thumb categories. | ||
| + | |||
| + | |||
| + | ===== Custom Vars for Ads ===== | ||
| + | |||
| + | If the same ad insertion code is used then I often see something like | ||
| + | |||
| + | 1. create an ads template in which | ||
| + | |||
| + | $ads = '<a href= .. > <img = .. '; | ||
| + | |||
| + | 2. in page templates it is added in different places | ||
| + | |||
| + | <? | ||
| + | |||
| + | |||
| + | The problem is | ||
| + | |||
| + | - the code is not cached and PHP is executed every time (such simple code does not add much load, but still) | ||
| + | - if you need to change advertising, | ||
| + | - the client can edit to something like $ads = ' | ||
| + | |||
| + | |||
| + | If you use Rotation - CMS -TPL Custom var then you can | ||
| + | |||
| + | - get variables for template in the form of < | ||
| + | - There you can edit these custom tags on the entire network at once. Moreover, both all at once and individual tags. | ||
| + | - no problems with quotes | ||
| + | |||
| + | |||
| + | |||
| + | ===== Related From Another Domain | ||
| + | |||
| + | You can add traffic for your new domains if, for example, you include a link to gallery on your domains with traffic, for example | ||
| + | |||
| + | * you have a domain And where there is a lot of traffic | ||
| + | * there is a new domain B | ||
| + | * on domain B we make a template like | ||
| + | |||
| + | < | ||
| + | |||
| + | <thumb num=1-5> | ||
| + | <a href=" | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | * and display the template on domain A for example like this | ||
| + | |||
| + | <iframe src=" | ||
| + | |||
| + | |||
| + | Thus, on domain A there will be links directly to gallery from domain B, plus thumb from domain B will begin to receive CTR. | ||
| + | |||
| + | |||
| + | ===== Sphinx Related Search | ||
| + | |||
| + | Advanced search with synonyms. For example, a user searches for “car”, but in our database it says “auto”, because the descriptions do not match - they will not be found. Sphinx has synonyms that solve this problem. | ||
| + | |||
| + | 1. collect search phrases and make a list like | ||
| + | |||
| + | word1 => synonym1 | ||
| + | word2 => synonym2 | synonym3 | ||
| + | |||
| + | 2. add it to the sphinx | ||
| + | |||
| + | | ||
| + | |||
| + | 3. That's it, the sphinx will be able to search taking into account synonyms. | ||
| + | |||
| + | |||
| + | ===== Related Search Queries ===== | ||
| + | |||
| + | Test version. | ||
| + | |||
| + | The user searches for “car” on the site, and then searches for “trailer”. Or after “auto”, it searches for “gasoline”. | ||
| + | These are not synonyms, but we understand that these are related searches that may interest the user. | ||
| + | |||
| + | The next time the user searches for “car”, we will not only show him “car”, but we can display “maybe you also want a trailer and gas”. | ||
| + | |||
| + | Let's do it basicly using the search_query_limit feature. | ||
| + | |||
| + | 1. In the search template, you need to add a parameter that takes into account whether the user was looking for something before. | ||
| + | |||
| + | For example, the user came to the page http:// | ||
| + | |||
| + | This way you make it clear that “trailer” and “car” are related searches. | ||
| + | |||
| + | |||
| + | 2. Display related searches (content_search) | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | filter=GET_search - display search queries with the word currently searched for | ||
| + | |||
| + | search_query_field=search_query_limit - displays “related searches” rather than the search queries themselves | ||
| + | |||
| + | |||
| + | </ | ||
new_rotation_hints.1673257582.txt.gz · Last modified: by admin
