Пример #1
0
}
setcookie('orderby', $tpl['orderby'], time() + 86400 * 90, '/', $domain);
$tpl['pagenum'] = request('pagenum') ? request('pagenum') : 1;
if ($tpl['pagenum'] > 1) {
    $urlParams['pagenum'] = $tpl['pagenum'];
}
$countpubs = $news_class->countallByParams($WhereParams);
if (!$countpubs) {
    $tpl['news']['errors'][] = "Новостей нет";
}
$Meta = $news_class->getMeta("keywords", "text", "`check`=1", "date desc", $tpl['pagenum'], $tpl['onpage']);
$tpl['news']['_Description'] = 'Последние новости нумизматики.' . $Meta[1];
$tpl['news']['_Title'] = "Новости нумизматики - выпуск юбилейных и памятных монет банков мира | Клуб Нумизмат";
$tpl['news']['data'] = $news_class->getItemsByParams($WhereParams, $tpl['pagenum'], $tpl['onpage']);
foreach ($tpl['news']['data'] as $key => $rows) {
    $tpl['news']['data'][$key]['img'] = $news_class->getImg($rows['news'], $rows['text']);
    //if($tpl['user']['user_id']==352480){
    if ($tpl['user']['user_id'] == 352480) {
        //var_dump($tpl['news']['data'][$key]['img']);
        //echo "<br>";
    }
    $tpl['news']['data'][$key]['img'] = imageMini::getMini($tpl['news']['data'][$key]['img'], "news_img/");
    //}
    $news_text = $rows['text'];
    $news_text = str_replace("</h1>", "</h1>. ", $news_text);
    $news_text = strip_tags($news_text);
    while (substr_count($news_text, "<<<")) {
        $news_text = mb_substr($news_text, 0, strpos($news_text, "<<<")) . substr(strstr($news_text, ">>>"), 3, 'utf-8');
    }
    $news_text = mb_substr($news_text, 0, 320, 'utf-8') . '...';
    $tpl['news']['data'][$key]['text'] = strip_tags($news_text);