Page 5 of 9

Re: Lasted Visited Galleries By Country

Posted: Sun Jan 08, 2023 2:47 pm
by admin
я жду когда будет точно ясно что с фичей по last_items нет вопросов что б перейти дальше

если там есть вопросы - скидывайте конкретно как смотреть проблему

Re: Lasted Visited Galleries By Country

Posted: Mon Jan 09, 2023 7:37 am
by ulan
да у меня то откуда вопросы, твоя же разработка фичи
гоу дальше
плиз только правь файл с видео а не в футер код вставлять, зачем он в футере

Re: Lasted Visited Galleries By Country

Posted: Mon Jan 09, 2023 7:46 am
by admin
Те фича работает как надо? больше к ней возврращаться не надо?

Re: Lasted Visited Galleries By Country

Posted: Mon Jan 09, 2023 7:56 am
by ulan
да я откуда знаю как она работает
или работает или нет
в смартсж не бывает такого к чему не надо возвращаться
в смартсж всегда надо возворащаться к чему то

Re: Lasted Visited Galleries By Country

Posted: Mon Jan 09, 2023 8:05 am
by admin
ок, давайте вернемся если что-то не работает

Re: Lasted Visited Galleries By Country

Posted: Mon Jan 09, 2023 8:12 am
by ulan
ок, пошлите к странам

Re: Lasted Visited Galleries By Country

Posted: Mon Jan 09, 2023 9:19 am
by admin
ok

надо добавить код добавления в кеш

Code: Select all


id: <!--GALLERY_ID-->


<?
	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);
		
	}


?>


пока все ясно?

Re: Lasted Visited Galleries By Country

Posted: Mon Jan 09, 2023 9:28 am
by ulan
то есть на страницу видео ставлю такой код который пишет сразу в две переменные?

Code: Select all

<?
if ((int) '<!--GALLERY_ID-->') {
$last_items = Cache::get('last_items');
if (!$last_items) $last_items = array();
if ($last_items[0] != (int) '<!--GALLERY_ID-->') array_unshift($last_items, (int) '<!--GALLERY_ID-->');
$last_items = array_slice($last_items, 0, 100, true);
Cache::set('last_items', $last_items, 3600);
}
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);
}
?>

Re: Lasted Visited Galleries By Country

Posted: Mon Jan 09, 2023 9:42 am
by admin
да

Re: Lasted Visited Galleries By Country

Posted: Mon Jan 09, 2023 10:01 am
by ulan
добавил, что далее