User Tools

Site Tools


tcms_rotation_parameter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tcms_rotation_parameter [2016/10/18 20:37] (current)
Line 1: Line 1:
 +**Rotation parameter**
 +
 +====== Rotation parameter ======
 +
 +===== Pass Options =====
 +
 +Default URLs like like http://domain/gallery/cool/index.html?12x34x567, where 12x34x567 is so called rotation parameter ie that's a way for the script to understand where a click happens (you can think of it as google's tracking parameters)
 +
 +You have 3 options to work with it.
 +
 +**1. You can use old style link like ** http://domain/gallery/cool/index.html?12x34x567 and that's a 100% guarantee that the rotation parameter will be passed to the script
 +
 +**2. Pass it via AJAX call ** 
 +The parameter will be passed only if you have JS on. Which is good in some way.
 +
 +Base template
 +<code>
 +
 +<script type="text/javascript" src="/scj/includes/js/jquery.js"></script>
 +<script type="text/javascript">
 +$(document).ready(function(){
 +   $('a[rot_id]').each(function(){
 +      $(this).bind('click', function(){
 +
 +         $.get('/scj/cgi/out.php',
 +            {
 +               'link': 'images/' + $(this).attr('rot_id'),
 +               'url': 'counter',
 +               'click_count': 'rotation_only'
 +            },
 +              function(data) {
 +              }
 +         );
 +
 +      });
 +   });
 +});
 +
 +</script>
 +
 +<thumb num=1-10>
 +<a href="/gallery/<!--GALLERY_SLUG-->/index.html" target=_blank rot_id='<!--THUMB_LINK-->'> text </a>
 +<br>
 +</thumb>
 +
 +</code>
 +
 +**3. No rotation parameter at all** - that's a new one.
 +
 +Rotation - Settings - **Use Magic Rotation Parameter** 
 +
 +SmartCJ will try to guess where each click has been clicked and the script does it extremely good. Give it a try.
 +
 +
 +===== Link options =====
 +
 +So let's see what link options we have for "magic rotation":
 +
 +  - http://domain/gallery/cool/index.html - or any other rewrite. The main idea is to pass $_GET['slug'] = cool - so the script can guess the thumb by gallery's slug
 +  - cgi/out.php?url=http://domain/gallery/cool/index.html - pretty much the same as prev one , we have a gallery slug
 +  - cgi/out.php?url=/gallery/cool/index.html - the same as option 2
 +  - cgi/out.php?url=http://domain/gallery/cool/index.html&link=12x34x567 and cgi/out.php?url=/gallery/cool/index.html&link=12x34x567 also the same as 2
 +  - cgi/out.php?url=http://another_domain/somegallery/at/sponsor/host/index.html - if we have this url http://another_domain/somegallery/at/sponsor/host/index.html in our DB - script can detect the thumb, otherwise you need to use an old-style rotation parameter
 +  - cgi/out.php?url=http://master/gallery/cool/index.html&link=12x34x567 - we want to send to galleries at a master site and we don't have this  http://master/gallery/cool/index.html URL in DB - in this case we have to use old style rotation parameter
 +
 +The rule of the thumb : a click can be counted if 
 +  - the script gets &slug=-..
 +  - the script gets &url=... and this url exists in DB
 +  - if you use old-slyle rotation parameter
 +  - you have &group_name or &group_id for category thumbs
 +
  
tcms_rotation_parameter.txt ยท Last modified: 2016/10/18 20:37 (external edit)