Table of Contents
Update 1
Rotation
Page_main_tag and Return 404
There is a feature “URLs with 0 result thumbs return 404” the general meaning of which is that if you have, for example, 100 thumbs, and pagination by 20, then this is 5 pages. When requesting the 6th page (for example if you manually edit the URL), since there will be no thumbs to fill the page - the script will return 404 and show the content_not_found template
There is also a parameter for the tag page_main_tag=true, which shows by which of the tags to count the navigation and TOTAL_ITEMS on the page if there are multiple such tags.
We get the following example, which includes all of the above.
<category order=ctr num=1-100> category template </category> <thumb num=1-20 search_log=all > search template (<!--SEARCH_QUERY-->, hits <!--HITS--> and so on </thumb> <thumb num=1-20 > regular thumb template </thumb>
For example, we have 100 saved search queries and 500 thumbs total.
The option “URLs with 0 result thumbs return 404” is enabled.
So, in the original variant on the 6th page we have a question: the search_log request returned 0, and for a regular <thumb there are still thumbs. should we show 404 in this case or not - this depends on what you consider main in the template. Maybe you want to output search queries here, or maybe search queries are just a supplement to thumbs.
Let's add an indication of which tag is main
<thumb num=1-20 search_log=all page_main_tag=true> search template (<!--SEARCH_QUERY-->, hits <!--SEARCH_QUERY_HITS--> and so on </thumb> <thumb num=1-20 > regular thumb template </thumb>
now the script will focus on search_log and on the 6th page will return 404.
If you do <thumb num=1-20 page_main_tag=true> then on the 6th page it will output regular thumbs, but here there's a problem that search_log won't output anything (because for the 6th page there's no data yet). Here you can add fixed_num=true to the tag (for example <thumb num=1-20 search_log=all fixed_num=true>) - and it will output exactly 1-20 on all pages, without accounting for the page number offset.
And one more situation where this tag is needed.
<category order=ctr num=1-100> category template </category> <thumb num=1-20 search_log=all > search template (<!--SEARCH_QUERY-->, hits <!--SEARCH_QUERY_HITS--> and so on </thumb>
For example, we just created a site and we don't have any saved search queries. In this situation, when the tag is not specified with page_main_tag, the <thumb num=1-20 search_log=all > tag will output 0 thumbs and the 404 rule will apply.
Here there are at least 2 options for what the designer might have wanted in this case. Perhaps this is a page where search queries are displayed, and categories are just part of the site in the header or footer, and 404 should really be returned.
On the other hand, perhaps search_log is just a supplement and you should output categories. In this case page_main_tag should be added to <category order=ctr num=1-100 page_main_tag=true > to show that this tag is main for this page.
Toplist
A new opportunity for trading with a toplist.
The idea is as follows: you can mix trader thumbs into rotation thumbs. For example.
<thumb num=1-3></thumb> trader thumb <thumb num=3-6></thumb> 2 more trader thumbs and so on
this way you don't need to make a separate toplist and even set skimming to 100.
The problem was that to output 1 or 2 trader thumbs you had to make a large number of top templates and then include them in the right place of the template. Now traders can be output directly in the template in the right quantity.
<thumb num=1-3></thumb> <trader num=1> <!--DOMAIN--> </trader> <thumb num=3-6></thumb> <trader num=2-3> <!--DOMAIN--> </trader>
So inside the <trader tag you can use
<!--DOMAIN--> - domain <!--DESCRIPTION--> = <!--DESC--> <!--IMAGE--> <!--IMAGE2--> and so on if you have more than one thumb for each trader <!--URL--> <!--TOTAL_UNI--> <!--TOTAL_ROW--> <!--TOTAL_CLICKS--> <!--TOTAL_OUT--> <!--TOPLIST_COMMENT-->
Possible parameters for the tag
<trader num=1 .... > num = trader number, can be a range for example 1-5 order = sorting, options uniques, raws, priority, clicks by default - uniques.
The priority sorting option is of primary interest for trading, i.e. thumbs of traders to which we should give first will be higher in the template.
Custom Gallery From A List of Images
The ability to create custom galleries by specifying a list of images has been added, i.e. without specifying the source gallery. For this in the import there is an option 'Image List' where you enter a comma-separated list of URLs.
Category Boost \ Separate Thumb CTR
A test option to separate CTR for each thumb in a category.
Rotation Settings - Test settings - Boost gallery CTR in category, %
The idea is that in each category, gallery CTR is increased proportionally to the number of clicks in that category. As a result, each thumb gets both an overall CTR and a separate category-specific CTR, which still depends partly on the overall CTR. With a small boost, category CTR stays close to the overall CTR; with a large boost, it diverges much more.
For example, a thumb has 10 impressions and 1 click on the index, 2 in category A and 3 in category B. Boost = 50%, general CTR when displaying a thumb on the index or without specifying a category (1+2+3)/10 = 0.6
For category A (1+2*1.5(boost)+3)/10 = 0.7
For category B (1+2+3*1.5(boost) )/10 = 0.75
Currently this only works when using magic rotation parameter.
Animated Gifs
The ability to create animated gif files for video has been added which is trendy for Pinterest-style sites. To use it you need to:
- make sure you have mplayer and ffmpeg on your server and specify the paths in rotation - settings
- add a gallery with video (URL) or immediately a URL to the video (FLV URL) and add to preload
- after processing in preload 1 you can click on any thumb and a thumb editing page will open with a player and added video
You can take a screenshot from any moment of the video. Or make an animated gif of any duration and frame rate there. Note that the size of the resulting file is directly proportional to the frame rate and duration of the video.
Prefix encodehtml2js
A prefix has been added for tags that transforms any HTML into encoded JS code. The most likely use is encoding of embed code. For example,
original variant <!--EMBED_CODE--> can be replaced with <!--ENCODEHTML2JS_EMBED_CODE-->
Sphinx config
Since the database was changed a bit the sphinx config changed
sql_query = SELECT gi.gallery_id, UNIX_TIMESTAMP(gi.activation_date) as date, alt, description, gi.duration, sponsor_id, gs.total_ctr, gi.content_type, \
(SELECT group_concat(tag_name) FROM rot_gal2tag g2t \
LEFT JOIN rot_tags as t on t.tag_id = g2t.tag_id \
WHERE g2t.gallery_id = gi.gallery_id) as tags, \
(SELECT group_concat(gss.group_id) FROM rot_gallery_stats1 as gss \
WHERE gss.gallery_id = gi.gallery_id AND group_id != 0) as categories \
FROM rot_gallery_info AS gi \
JOIN rot_gallery_data1 AS gd ON gi.gallery_id = gd.gallery_id \
JOIN rot_gallery_stats1 AS gs ON gs.gallery_id = gi.gallery_id \
WHERE gallery_status = 'active' and gallery_type = 0 \
and gs.best_thumb = 'yes' and gs.group_id = 0
sql_attr_timestamp = date
sql_attr_uint = duration
sql_attr_uint = sponsor_id
sql_attr_float = total_ctr
sql_attr_uint = content_type
sql_attr_uint = gallery_id
sql_attr_multi = uint categories from field;
Search Log Advanced Queries
The script has long had a feature to output the latest search phrases
<thumb num=1-10 search_log=all ...
It outputs the log of the latest search queries on your site. But now it has become more advanced. Now you can search for related queries to the current page. For example, on a category page you can search for queries with the name of that category.
<thumb num=1-10 search_log=all filter=GET_group_name
On a tag page you can filter by tag name
<thumb num=1-10 search_log=all filter=GET_tag
On a search page you can filter by search query
<thumb num=1-10 search_log=all filter=GET_search
Here it should be reminded that parameters starting with GET_ are variables from the request (from the URL).
By default the results are sorted by the number of searches for a particular query, but you can also sort by the number of results for such a search (so we have 2 order options)
<thumb num=1-10 search_log=all filter=GET_search order=items_found <thumb num=1-10 search_log=all filter=GET_search order=hits
Thus on each page links are created to other pages and the total number of pages on the site grows.
Of course, queries are accumulated very slowly, and to force this event in Search Log in the admin panel (/admin/?operation=rotation&sub=rot_tube&subsub=rot_search_log&) you can add any search queries as if they were already searched on your site.
For example, on bigbase.smartcj.com about 2M requests were added. From which several problems emerged, which were immediately resolved.
1. because the requests were taken from general sources it turned out that for some requests the database found nothing. Thus there was a chance to get a link on the page that had 0 search results. To solve this issue rotation.php, which is run by cron periodically checks new requests and makes sure that something is found for them in the database. If nothing is found - deletes the request from the list. This event can be forced in the shell
php rotation.php check_search_queries=true
2. when there are few search queries in the database then Mysql handles them without problems. However, when 2M queries were added, searching such a table became heavy and Sphinx was added for indexing - this made not only the search fast, but also the search more advanced. To add Sphinx you need to add to the sphinx config
source search_queries
{
type = mysql
sql_host = ........
sql_user = .......
sql_pass = ........
sql_db = ......
sql_port = 3306 # optional, default is 3306
sql_query_pre = SET NAMES utf8
sql_query = SELECT sq_id, search_query, hits, items_found FROM rot_search_queries WHERE hits > 0 GROUP BY search_query
sql_attr_uint = hits
sql_attr_uint = items_found
}
index search_queries_index
{
source = search_queries
path = /path_where_to_store_index
docinfo = extern
morphology = stem_en
}
After this sphinx will be able to index your existing queries.
For SmartCJ to be able to start using this index you need to specify it in the rotation settings Sphinx Search, field Sphinx Search Log Index = search_queries_index
Done.
Search query limit
There can be many options for limiting the search on the site, for example
/?search=... can turn into /?search=...&group_id=.. or /?search=...&tag=..
and so on, the options can be different and combined, so a free parameter &search_query_limit has been added
For example, we have a search by teen group. We add search_query_limit=teen to the URL, for example /?search=…&group_name=teen&search_query_limit=teen and for example a search just without group limit /?search=….&search_query_limit=empty
when outputting <thumb search_log=all num=1-20> if we want to output searches only that were by teen group then (and we remember that there was search_query_limit=teen)
<thumb search_log=all num=1-20 search_query_limit=teen>
You can substitute &search_query_limit depending on how you want to filter queries later. And of course remember that you can make this dynamic by taking a parameter from the URL
<thumb search_log=all num=1-20 search_query_limit=GET_your_param>
Language search Similarly you can make a search split by languages to output on corresponding languages. The script doesn't determine what language a particular sentence is written in, but you can take it from the URL for example by adding a parameter with the current language &search_query_limit=lng_en to the search string
domain/?search=test&force_lng=en&search_query_limit=lng_en domain/?search=test1&force_lng=en&search_query_limit=lng_en domain/?search=blabla&force_lng=de&search_query_limit=lng_de domain/?search=blabla2&force_lng=de&search_query_limit=lng_de
Thus in our database for each search there will be a note of what language it was made in. Adding the parameter is not difficult directly in the template, for example <input type=hidden name=search_query_limit value='lng_<!–GET_force_lng–>'>
In the template we add
<thumb search_log=all num=1-20 search_query_limit=GET_your_param>
and open the page as domain/?your_param=lng_en, we should get
test,test1
because they have the mark lng_en.
Subcategories and filter keywords
A small adjustment in the distribution of subcategories (when a category is a subcategory of a root category, for example 2 top-level categories cars and buses, each of them has subcategories red and blue because both cars and buses can be these colors)
The question arises when you need to import something, but the main keyword is missing, for example the phrase “red wheel” can refer to both cars and buses.
So the adjustment is that if when importing filter keywords are selected (alt+desc) AND (!!!) root category, for example cars in our example, then keywords will only be searched in subcategories of the specified root category.
i.e. for our example by the keyword red it falls only into the subcategory cars → red
Trade
Overclick skimming hold
Let's say we have a situation where noref has 100% skimming and overclick has 0% (or some other number different from 100). Let's say a noref came and made 20 clicks with noref skimming - 100%. After the default 20 clicks, the trader becomes overclick and skimming for him becomes 0%. However, we want that specifically for noref the skimming remained 100% (for overclick traffic from traders - 0%) - for this a special flag has been added - in the skimming field for noref you need to write !100 (exclamation mark at the beginning) - this means that skimming remains 100% even in case of overclick.
Incoming TDS
For incoming traffic you can specify a list of rules, for example TDS_1. This is better than having all rules in TDS, since in TDS you can specify a whole set of rules by which traffic will be processed. At the end of the TDS scheme you can specify {ORIGINAL_URL} and this will be the URL where traffic will go if the TDS rule doesn't work (usually it's the site index, but personalized URLs are possible and so on)
Auto lock traffic in trade groups
Automatically and transparently, without adding to the URL, distributes traffic within the group of the current trader. i.e. if let's say trader A is in trade group 1, then all clicks from surfers who came from him will be distributed within group 1, as if automatically the URL always had &group=1
The setting is located in Settings - Traffic Rules
