$smarty->assign(". $ max_list_users_viewed", $max_list_users_viewed);
function maxListUsersViwed($id) {
global $db;
$max_list_users_viewed=$db->fetchRow("select `id`, `viewed` from ".TABLE_AQQ." where `user_id`='$id' ORDER BY `viewed` DESC LIMIT 1");
if(!$max_list_users_viewed) return 0;
return $max_list_users_viewed;
}
$max_list_users_viewed = $usr->maxListUsersViwed($crt_usr);
$smarty->assign("$max_list_users_viewed", $max_list_users_viewed);
<a href="{$live_site}/edit.php/id={if isset($max_list_users_viewed) && $max_list_users_viewed}{$max_list_users_viewed}{else}0{/if}"> </a>
$('.google-ad-container').click(function (event) {
$user_info_get = users::getInfoForUser($crt_usr);
$smarty->var_dump assign("user_info_get", $user_info_get);
EXPLAIN SELECT class_ads . * , class_ads.id AS adid, DATE_FORMAT( class_ads.`date_added` , '%d.%m РІ %H:%i' ) AS date_nice, DATE_FORMAT( class_ads.`date_expires` , '%d.%m РІ %H:%i' ) AS date_expires_nice, UNIX_TIMESTAMP( class_ads.`date_added` ) AS `time_added` , (
class_ads.date_expires < '2019-09-03 23:30:04'
AND class_ads.date_expires != '0000-00-00 00:00:00'
AND class_ads.active =0
) AS expired, class_slugs.slug
FROM class_ads
INNER JOIN class_slugs ON class_ads.id = class_slugs.object_id
WHERE class_ads.active LIKE 1
AND class_ads.category_id = '116'
AND class_ads.id != '99178'
AND class_slugs.`type` = 'listing'
LIMIT 52054 , 12
(select_type)SIMPLE
(table)class_slugs
(type)ref
(possible_keys)idx_type,idx_object_id
(key)idx_type
(key_len)63
(ref)const
(rows)67741
(Extra)Using index condition; Using where
SIMPLE
class_ads
eq_ref
PRIMARY,idx_category,idx_active,active_2,active_3,...
PRIMARY
4
tix_db.class_slugs.object_id
1
Using where
EXPLAIN SELECT class_ads . * , class_ads.id AS adid, DATE_FORMAT( class_ads.`date_added` , '%d.%m РІ %H:%i' ) AS date_nice, DATE_FORMAT( class_ads.`date_expires` , '%d.%m РІ %H:%i' ) AS date_expires_nice, UNIX_TIMESTAMP( class_ads.`date_added` ) AS `time_added` , (
class_ads.date_expires < '2019-09-03 23:30:04'
AND class_ads.date_expires != '0000-00-00 00:00:00'
AND class_ads.active =0
) AS expired, class_slugs.slug
FROM class_ads
INNER JOIN class_slugs ON class_ads.id = class_slugs.object_id
WHERE class_ads.active LIKE 1
AND class_ads.category_id = '116'
AND class_ads.id != '99178'
AND class_slugs.`type` = 'listing'
LIMIT 52054 , 12
(select_type)SIMPLE
(table)class_slugs
(type)ref
(possible_keys)idx_type,idx_object_id
(key)idx_type
(key_len)63
(ref)const
(rows)67741
(Extra)Using index condition; Using where
SIMPLE
class_ads
eq_ref
PRIMARY,idx_category,idx_active,active_2,active_3,...
PRIMARY
4
tix_db.class_slugs.object_id
1
Using where