if (count($years_data) == 1 && $years_data[0]) { $urlParams['years'] = $years_data; $tpl['breadcrumbs'][] = array('text' => $years[0], 'href' => $r_url . '/years_' . $years_data[0], 'base_href' => $r_url . '/years_' . $years_data[0]); } else { $urlParams['years'] = $years_data; } if (count($theme_data) == 1) { $themeMain = $theme_data[0]; $data_filter['theme_id'] = $themeMain; $themeMainTitle = $ThemeArray[$theme_data[0]]; $urlParams['theme'] = array($themeMain => $themeMainTitle); } else { $urlParams['theme'] = $theme_data; } //var_dump($years); $news_class = new model_news($db_class, $tpl['user']['user_id']); $tpl['news']['errors'] = false; //сохраняем количество элементов на странице в куке if (request('onpage')) { $tpl['onpage'] = request('onpage'); } elseif (isset($_COOKIE['onpage'])) { $tpl['onpage'] = $_COOKIE['onpage']; } if (!isset($tpl['onpage'])) { $tpl['onpage'] = 18; } $tpl['pager']['itemsOnpage'] = array(9 => 9, 18 => 18, 36 => 36, 48 => 48, 72 => 72); setcookie('onpage', $tpl['onpage'], time() + 86400 * 90, '/', $domain); //сохраняем сортировку элементов на странице в куке if (request('orderby')) { $tpl['orderby'] = request('orderby');
$sql_ins = "insert into sitemaps (`url`,`page`,`priority`,`type`,`dateinsert`,`lastmod`) \n\t\t\t\t\t\t\tvalues ('" . $link . "', '{$page}','{$priority}','shopcoins'," . time() . ",'" . date('Y-m-d', time()) . "')"; $shopcoins_class->setQuery($sql_ins); } catch (Exception $e) { echo $e->getMessage(); } } $priority -= 0.01; } } $urls = array(); $sql = "delete from `sitemaps` where type='news';"; $shopcoins_class->setQuery($sql); require_once $cfg['path'] . '/models/news.php'; require_once $cfg['path'] . '/configs/config_news.php'; $r_url = "http://www.numizmatik.ru/news"; $news_class = new model_news($db_class); $sql = "select news, date, name, text, source from news where `check`=1 ;"; //echo $sql; $result = $news_class->getDataSql($sql); $newstime = ''; foreach ($result as $rows) { $namehref = contentHelper::strtolower_ru($rows["name"]) . "_n" . $rows["news"] . ".html"; //echo "http://numizmatik.ru/news/".$namehref."<br>"; $sql_ins = "insert into sitemaps (`url`,`page`,`priority`,`type`,`dateinsert`,`lastmod`) \n\tvalues ('http://numizmatik.ru/news/" . $namehref . "', 'daily',0.5,'news'," . time() . ",'" . date('Y-m-d', $rows['date']) . "')"; $shopcoins_class->setQuery($sql_ins); if ($newstime < $rows['date']) { $newstime = $rows['date']; } } $WhereParams = array(); $count = $news_class->countallByParams($WhereParams);
<?php require_once $cfg['path'] . '/models/news.php'; require_once $cfg['path'] . '/configs/config_news.php'; $id = request('id'); //для инициализации фильтров $text = ''; $years = array(); $sp_s = array(); $news_class = new model_news($db_class, $tpl['user']['user_id']); $tpl['news']['errors'] = false; $Meta = $news_class->getMeta("keywords", "text", "news='{$id}'", "", 0, 0); $tpl['news']['data'] = $news_class->getItem($id); $correct_links = contentHelper::strtolower_ru($tpl['news']['data']["name"]) . "_n" . $tpl['news']['data']["news"] . ".html"; if ("/news/" . $correct_links != urldecode($_SERVER['REQUEST_URI'])) { //header('HTTP/1.1 301 Moved Permanently'); //header('Location: '.$cfg['site_dir']."news/".$correct_links); //die(); } if ($tpl['news']['data']['pagetitle']) { $tpl['news']['_Title'] = $tpl['news']['data']['pagetitle']; } else { $tpl['news']['_Title'] = $tpl['news']['data']["name"] . " | Новости нумизматики - выпуск юбилейных и памятных монет центральных банков мира | Клуб Нумизмат"; } if ($tpl['news']['data']['description']) { $tpl['news']['_Description'] = $tpl['news']['data']['description']; } else { $tpl['news']['_Description'] = 'Последние новости нумизматики.' . $Meta[1]; } $tpl['news']['data']['text'] = preg_replace_callback('#(<img\\s(?>(?!src=)[^>])*?src=")(.*?)("[^>]*>)#', "data_to_img", $tpl['news']['data']['text']); $tpl['news']['data']['text'] = str_replace('</div><div class="sep"></div><div class="news-img">', '</div><div class="news-img">', $tpl['news']['data']['text']);
<? require_once $cfg['path'] . '/models/news.php'; require_once $cfg['path'] . '/models/forum.php'; require_once $cfg['path'] . '/configs/config_news.php'; require_once($cfg['path'].'/helpers/imageMini.php'); $tpl['index']['_Title'] = "Клуб Нумизмат. Купить и продать монеты, банкноты и альбомы на любой вкус"; $tpl['index']['_Description'] = "Крупнейший портал коллекционеров. Магазин, оценка стоимости монет, библиотека, уникальный каталог монет, последние новости и форум. Заходите скорее монеты ждут вас!"; $tpl['banners']['main_center_1'] = '<img border="0" src="'.$cfg['site_root'].'/images/banners/main_center_1.jpg">'; $tpl['banners']['main_center_2'] = '<img border="0" src="'.$cfg['site_root'].'/images/banners/main_center_2.jpg">'; //$tpl['coins']['populars_in_category'] = $shopcoins_class->getPopular(4); $news_class = new model_news($db_class,$tpl['user']['user_id']); $forum_class = new model_forum($db_class,$tpl['user']['user_id']); $tpl['lastNews'] = $news_class->getItemsByParams(array(),1,10); foreach ($tpl['lastNews'] as $key=>$rows){ $tpl['lastNews'][$key]['img'] = $news_class->getImg($rows['news'],$rows['text']); if($tpl['user']['user_id']==352480){ //var_dump($rows['news'],$tpl['lastNews'][$key]['img']); //echo "<br>"; } $tpl['lastNews'][$key]['img'] = imageMini::getMini($tpl['lastNews'][$key]['img'],"news_img/"); $text = mb_substr($rows['text'], 0, 350,'utf-8');