Lasted Visited Galleries By Country
Re: Lasted Visited Galleries By Country
Array ( [19443] => 19443 [12853] => 12853 [20659] => 20659 )
Re: Lasted Visited Galleries By Country
но только на странице с галерей, на индексе и других страницах пустота
Re: Lasted Visited Galleries By Country
$cache_id = 'last_items_' . $_SERVER['GEOIP_COUNTRY_CODE'];
$last_items = Cache::get('last_items');
может потому что разные ИД кеша берутся?
$last_items = Cache::get('last_items');
может потому что разные ИД кеша берутся?
Don't forget to run script update
Re: Lasted Visited Galleries By Country
хз, все делал по вики
Re: Lasted Visited Galleries By Country
вопрос в том что там 2 варианта
один общий и там $last_items = Cache::get('last_items');
другой по странам и там $cache_id = 'last_items_' . $_SERVER['GEOIP_COUNTRY_CODE'];
поэтому не ясно как конкретно у вас сделано
один общий и там $last_items = Cache::get('last_items');
другой по странам и там $cache_id = 'last_items_' . $_SERVER['GEOIP_COUNTRY_CODE'];
поэтому не ясно как конкретно у вас сделано
Don't forget to run script update
Re: Lasted Visited Galleries By Country
может сами глянете, быстро и понято будет
Re: Lasted Visited Galleries By Country
напишите плз какой код в каком темпелйте вы добавили
Don't forget to run script update
Re: Lasted Visited Galleries By Country
так вывожу
такой темплейт
Code: Select all
<script>
function updateLastVisited() {
$.ajax({
url: "/page/lasted_visited/", cache: false, success: function (html) {
$("#lasted_visited").html(html);
}
});
}
function updateCountryViewed() {
$.ajax({
url: "/scj/tube/index.php?force_template=viewed_in_country&last_viewed_cache_id=last_items_<?=$_SERVER['GEOIP_COUNTRY_CODE']?>",
cache: false,
success: function (html) {
$("#viewed_in_country").html(html);
}
});
}
$(document).ready(function () {
updateLastVisited();
setInterval(updateLastVisited, 10 * 60 * 1000);
updateCountryViewed();
setInterval(updateCountryViewed, 10 * 60 * 1000);
});
</script>Code: Select all
<thumb num=1-40 limit_by_gallery_id=true gallery_id=CACHE_GET_last_viewed_cache_id>
<li class="swiper-slide">
<article>
<a class="ths-preview-link" href="/video/<!--GALLERY_ID-->/<!--SAFE_ALT-->/" target="_blank">
<figure>
<img src="<!--THUMB_URL-->" class="lazy" width="320" height="180">
</figure>
</a>
<h3><a href="/video/<!--GALLERY_ID-->/<!--SAFE_ALT-->/"><!--ALT--></a></h3>
<footer>
<span class="likes"><?=min(round(100*"<!--RATING_2-->"/("<!--RATING_2-->"+"<!--RATING_1-->"+0.001)), 100)?>%</span>
<span class="views"><?=number_format("<!--SHOWS-->", 0, '', ' ');?></span>
<span class="durat"><!--DURATION--></span>
</footer>
</article>
</li>
</thumb>Re: Lasted Visited Galleries By Country
как в твоей вики
<?
if ((int) '<!--GALLERY_ID-->') {
$cache_id = 'last_items_' . $_SERVER['GEOIP_COUNTRY_CODE'];
$last_items = Cache::get($cache_id);
$last_items[(int) '<!--GALLERY_ID-->'] = (int) '<!--GALLERY_ID-->';
$last_items = array_slice($last_items, 0, 100);
Cache::set($cache_id, $last_items, 86400);
}
if ((int) '<!--GALLERY_ID-->') {
$last_items = Cache::get('last_items');
$last_items[(int) '<!--GALLERY_ID-->'] = (int) '<!--GALLERY_ID-->';
$last_items = array_slice($last_items, 0, 100, true);
Cache::set('last_items', $last_items, 3600);
}
?>







