예제 #1
0
 static function simbolUrl($title, $id)
 {
     return contentHelper::strtolower_ru($title) . '_s' . $id;
 }
예제 #2
0
	} elseif ($tpl['biblio']['data']['typesource']==4) { 
		echo "<p align=right>Источник: \"".$tpl['biblio']['data']['source']."\"";
	} elseif ($tpl['biblio']['data']['typesource']==5) { 
		echo "<p align=right>Источник: <a href=mailto:".$tpl['biblio']['data']['source'].">".$tpl['biblio']['data']['source']."</a>";
	}
}
if ($tpl['biblio']['data']['author']) echo "<p align=right>Автор: ".$tpl['biblio']['data']['author'];
if ($tpl['biblio']['data']['email']) echo "<p align=right>Email: <a href=mailto:".$tpl['biblio']['data']['email'].">".$tpl['biblio']['data']['email']."</a>";

echo "<br><br>";
	
if ($biblioByKeywords) {
	echo "<p class=txt><b>Статьи по теме:</b></p><ul>";
	foreach ($biblioByKeywords as $rows){
		$namehref = contentHelper::strtolower_ru($rows["name"])."_n".$rows["biblio"].".html";
		echo "<p class=txt><li><a href=\"".$cfg['site_dir']."biblio/$namehref"."\">".$rows["name"]."</a></li>";
	}
	echo "</ul>";
}
echo "<br><br>";

if ($newsbyKeywords){
	echo "<p class=txt><b>Новости по теме:</b></p><ul>";
	$sql = "select news, name from news where $sql1 order by date desc limit 5;";

	foreach ($newsbyKeywords as $rows){
		$namehref = contentHelper::strtolower_ru($rows["name"])."_n".$rows["news"].".html";
		echo "<p class=txt><li><a href=\"".$cfg['site_dir']."news/$namehref"."\">".$rows["name"]."</a></li>";
	}
	echo "</ul>";
}                                                                                                                         
예제 #3
0
<?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']);
예제 #4
0
    //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);
    $tpl['news']['data'][$key]['namehref'] = contentHelper::strtolower_ru($rows["name"]) . "_n" . $rows["news"] . ".html";
}
//if($addhref) $addhref = substr($addhref,1);
$correct_url = urlBuild::makePrettyUrl($urlParams, "http://www.numizmatik.ru/news");
if ($tpl['datatype'] != 'text_html' && $correct_url != urldecode("http://www.numizmatik.ru" . $_SERVER["REQUEST_URI"]) && $_SERVER["REQUEST_URI"] !== '/news/') {
    header("HTTP/1.1 301 Moved Permanently");
    header("location: " . $correct_url);
    die;
}
unset($urlParams['pagenum']);
$correct_url_for_paginator = urlBuild::makePrettyUrl($urlParams, "http://www.numizmatik.ru/news");
$tpl['paginator'] = new Paginator(array('url' => $correct_url_for_paginator, 'count' => $countpubs, 'per_page' => $tpl['onpage'] == 'all' ? $countpubs : $tpl['onpage'], 'page' => $tpl['pagenum'], 'border' => 4));
foreach ($tpl['breadcrumbs'] as $key => $value) {
    if ($value["base_href"] == $correct_url) {
        $tpl['breadcrumbs'][$key]['base_href'] = '';
    }
예제 #5
0
$keywords = $tpl['biblio']['_Keywords'];
$correct_links = contentHelper::strtolower_ru($tpl['biblio']['data']["name"]) . "_n" . $tpl['biblio']['data']["biblio"] . ".html";
if ("/biblio/" . $correct_links != urldecode($_SERVER['REQUEST_URI'])) {
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: ' . $cfg['site_dir'] . "biblio/" . $correct_links);
    die;
}
$tpl['breadcrumbs'][] = array('text' => 'Библиотека нумизмата', 'href' => $cfg['site_dir'] . 'biblio', 'base_href' => $cfg['site_dir'] . 'biblio');
$tpl['breadcrumbs'][] = array('text' => $tpl['biblio']['data']['name'], 'href' => '', 'base_href' => "");
$mytext = str_replace(chr(13), "<br>", $tpl['biblio']['data']['text']);
$mytext = str_replace("<<<", "<img src={$biblioimagesfolder}/", $mytext);
$mytext = str_replace(">>>", ">", $mytext);
$tpl['biblio']['data']['text'] = str_replace("`", "'", $mytext);
$tpl['pages'] = array();
if (!$tpl['biblio']['data']['parent']) {
    //является вершиной дерева
    $sql = "select biblio,name from biblio where parent='{$biblio}' order by biblio;";
    $tpl['pages'] = $biblio_class->getDataSql($sql);
    foreach ($tpl['pages'] as $i => $rows1) {
        $tpl['pages'][$i]['correct_link'] = contentHelper::strtolower_ru($rows1["name"]) . "_n" . $rows1["biblio"] . ".html";
    }
} else {
    //является лепестком
    $sql = "select biblio,name from biblio where biblio='" . $tpl['biblio']['data']['parent'] . "' or parent='" . $tpl['biblio']['data']['parent'] . "' order by parent, biblio;";
    $tpl['pages'] = $biblio_class->getDataSql($sql);
    foreach ($tpl['pages'] as $i => $rows1) {
        $tpl['pages'][$i]['correct_link'] = contentHelper::strtolower_ru($rows1["name"]) . "_n" . $rows1["biblio"] . ".html";
    }
}
$biblioByKeywords = $biblio_class->getBiblioByKeywords($keywords, $biblio);
$newsbyKeywords = $biblio_class->getNewsByKeywords($keywords, $biblio);
예제 #6
0
			$sql = "update user set star=star+2 where user='******';";
			$result = mysql_query($sql);
		}
		$check = 1;
	} else {
		$check = 2;
	}
}

if ( substr_count($_SERVER['REQUEST_URI'],".html")==0 && $weekquestion>0 && !$weekquestionsubmit) {

	$sql = "select * from weekquestion where weekquestion='".intval($weekquestion)."';";
	$result = mysql_query($sql);
	$rows = $shopcoins_class->getRowSql($sql);
		
	$namehref = contentHelper::strtolower_ru($rows['question'])."_n".$rows['tboard']."_p".$pagenum."_s1.html";
	
	//header('HTTP/1.1 301 Moved Permanently');
	//header('Location: http://'.$_SERVER['HTTP_HOST'].'/weekquestion/'.$namehref);
}


if ($weekquestion) {
	
	$sql = "select question, answer1, answer2, answer3, answer4, answer5 from weekquestion where weekquestion=$weekquestion and type='week';";
	$rows = $shopcoins_class->getRowSql($sql);

	$tpl['breadcrumbs'][] = array(
	    	'text' => $rows['question'],
	    	 'href' => '',
	    	'base_href' =>''
예제 #7
0
        } elseif ($st == 4) {
            $sql1 = "(name like '%{$s}%' or text like '%{$s}%' or keywords like '%{$s}%')";
        }
        //отображаем страницы
        $sql = "Select count(*) from biblio where `check`=1 and {$sql1};";
        $count = $biblio_class->getOneSql($sql);
        $pages = ceil($count / $tpl['onpage']);
        if ($tpl['pagenum'] > $pages) {
            $tpl['pagenum'] = $pages;
        }
        $p_url = $cfg['site_dir'] . "biblio/?s={$s}&st={$st}" . ($group ? "&group={$group}" : "");
        if ($count > 0) {
            $sql = "select biblio, FROM_UNIXTIME(date, \"%d.%m.%Y\"), \n            name, text from biblio \n            where {$sql1} and `check`=1 order by date desc \n            limit " . ($tpl['pagenum'] - 1) * $tpl['onpage'] . "," . $tpl['onpage'];
            $tpl['result'] = $biblio_class->getDataSql($sql);
            $nnn = 0;
            foreach ($tpl['result'] as $n => $rows) {
                $text = mb_substr($rows['text'], 0, 250, 'utf8');
                while (substr_count($text, "<<<")) {
                    $text = substr($text, 0, strpos($text, "<<<")) . substr(strstr($text, ">>>"), 3);
                }
                $tpl['result'][$n]['text'] = substr($text, 0, strlen($text) - strpos(strrev($text), '.'));
                $tpl['result'][$n]['namehref'] = contentHelper::strtolower_ru($rows["name"]) . "_n" . $rows["biblio"] . ".html";
            }
        } else {
            $tpl['error'] = "Извините, нет результатов, удовлетворяющих поиску. Попробуйте другие варианты.";
        }
    } else {
        $tpl['error'] = "Внимание!!!</font> Cлово для поиска должно состоять более чем из трех букв";
    }
}
$tpl['paginator'] = new Paginator(array('url' => $p_url, 'count' => $count, 'per_page' => $tpl['onpage'], 'page' => $tpl['pagenum'], 'border' => 3));
예제 #8
0
			$tpl['price']['years'][$rows['year']][$rows2['simbol']]['url'] = urlBuild::makePrettyUrl($urlParams,$r_url);
		}
	}
	
	
	if (!$pcondition) {	
		
		$rehref = "Монета ";				
					
		if ($rows_main['gname'])$rehref .= $rows_main['gname']." ";
		$rehref .= $rows_main['aname'];
		if ($rows['ametal'])$rehref .= " ".$rows_main['ametal']; 
		if ($rows['year'])	$rehref .= " ".$rows_main['year'];
		$namecoins = $rehref;
		
		$tpl['rehref'] = contentHelper::strtolower_ru($rehref)."_cpc".$rows_main['priceshopcoins']."_cpr".$rows_main['parent']."_pcn0.html";
		
		$sql_n = "select priceshopcoins.*, group.name as gname, `pricename`.name as aname, `pricemetal`.metal as ametal, pricesimbols.simbols as asimbols, `pricecondition`.`condition` as acondition 
		from `priceshopcoins`,`pricename`,pricemetal, pricesimbols, pricecondition,`group` 
		where priceshopcoins.parent='$parent' and `priceshopcoins`.`name`=`pricename`.`pricename` and priceshopcoins.metal=pricemetal.pricemetal and priceshopcoins.simbols=pricesimbols.pricesimbols and priceshopcoins.condition=pricecondition.pricecondition and priceshopcoins.group=group.group order by pricecondition.position;";
		//echo $sql_n;
		$tpl['result_n'] = $price_class->getDataSql($sql_n);
		$tpl['arrayprice'] = $tpl['arrayamount'] = $tpl['arraycondition'] = array();
		$condition = 0;
		foreach ($tpl['result_n'] as $rows_n) {		
			if ($condition != $rows_n['condition'] && $condition!=9) {				
				$tpl['arraycondition'][$rows_n['condition']] = $rows_n['acondition'];
				$condition = $rows_n['condition'];
			}
			
			$tpl['arrayprice'][$rows_n['acondition']] += $rows_n['priceend'];
예제 #9
0
<table width=98% border=0 cellpadding=2 cellspacing=1 class=txt>
			<tr bgcolor=#ffcc66>
			<td width=55% class=tboard><b>Тема</b></td>
			<td nowrap class=tboard><b>дата начала</b></td>
			<td nowrap class=tboard ><b>дата окончания</b></td>
			</tr>
<?

foreach ($tpl['data']  as $i=>$rows){?>
	
	<tr <?php 
echo $i % 2 == 1 ? "" : "bgcolor=#ebe4d4";
?>
><td  class=tboard><a href="<?php 
echo contentHelper::strtolower_ru($rows['question']) . "_n" . $rows["weekquestion"] . "_p" . $pagenum . "_s1.html";
?>
"><?php 
echo $rows['question'];
?>
</a></td>
	<td class=tboard><?php 
echo $rows['d1'];
?>
</td>
	<td class=tboard><?php 
echo $rows['d2'];
?>
</td>
	</tr>
<?}?>
예제 #10
0
 static function getRegHref($rows, $materialtype = 0, $parent = 0)
 {
     $mtype = $rows['materialtype'] > 0 ? $rows['materialtype'] : $materialtype;
     $rows['year'] = contentHelper::setYearText($rows['year'], $rows['materialtype']);
     $rehref = "";
     if ($materialtype == 5 || $materialtype == 3) {
         if ($mtype == 1) {
             $rehref = "Монета-";
         }
         if ($mtype == 8) {
             $rehref = "Монета-";
         }
         if ($mtype == 7) {
             $rehref = "Набор-монет-";
         }
         if ($mtype == 2) {
             $rehref = "Банкнота-";
         }
         if ($mtype == 4) {
             $rehref = "Набор-монет-";
         }
         if ($mtype == 5) {
             $rehref = "книга-";
         }
         if ($mtype == 9) {
             $rehref = "Лот монет ";
         }
         if ($rows['gname']) {
             $rehref .= $rows['gname'] . "-";
         }
         $rehref .= $rows['name'];
         if ($rows['metal']) {
             $rehref .= "-" . $rows['metal'];
         }
         if ($rows['year']) {
             $rehref .= "-" . $rows['year'];
         }
         $namecoins = $rehref;
         $rehrefdubdle = contentHelper::strtolower_ru($rehref) . "_c" . ($mtype == 1 ? $rows['parent'] : $rows['shopcoins']) . "_pc" . ($parent > 0 ? $parent : (($mtype == 7 || $mtype == 8 || $mtype == 6 || $mtype == 4 || $mtype == 2) && $rows["amount"] > 1 ? $rows['shopcoins'] : ($mtype == 1 ? $rows['parent'] : 0))) . "_m" . $rows['materialtype'] . "_pp1.html";
         $rehref = contentHelper::strtolower_ru($rehref) . "_c" . $rows['shopcoins'] . "_m" . $rows['materialtype'] . ".html";
     } else {
         if ($mtype == 1) {
             $rehref = "Монета ";
         }
         if ($mtype == 8) {
             $rehref = "Монета ";
         }
         if ($mtype == 7) {
             $rehref = "Набор монет ";
         }
         if ($mtype == 2) {
             $rehref = "Банкнота ";
         }
         if ($mtype == 4) {
             $rehref = "Набор монет ";
         }
         if ($mtype == 5) {
             $rehref = "Книга ";
         }
         if ($mtype == 9) {
             $rehref = "Лот монет ";
         }
         if ($mtype == 10) {
             $rehref = "Нотгельд ";
         }
         if ($mtype == 11) {
             $rehref = "Монета ";
         }
         if (in_array($rows["materialtype"], array(2, 4, 7, 8, 6)) && $rows['amount'] > 10) {
             $rows['amount'] = 10;
         }
         if ($rows['gname']) {
             $rehref .= $rows['gname'] . " ";
         }
         $rehref .= $rows['name'];
         if ($rows['metal']) {
             $rehref .= " " . $rows['metal'];
         }
         if ($rows['year']) {
             $rehref .= " " . $rows['year'];
         }
         $namecoins = $rehref;
         $rehrefdubdle = contentHelper::strtolower_ru($rehref) . "_c" . ($mtype == 1 || $mtype == 10 || $mtype == 12 ? $rows['parent'] : $rows['shopcoins']) . "_pc" . ($parent > 0 ? $parent : (($mtype == 7 || $mtype == 8 || $mtype == 6 || $mtype == 4 || $mtype == 2) && $rows["amount"] > 1 ? $rows['shopcoins'] : ($mtype == 1 || $mtype == 10 ? $rows['parent'] : 0))) . "_m" . $rows['materialtype'] . "_pp1.html";
         $rehref = contentHelper::strtolower_ru($rehref) . "_c" . $rows['shopcoins'] . "_m" . $rows['materialtype'] . ".html";
     }
     return array('namecoins' => $namecoins, 'rehrefdubdle' => $rehrefdubdle, 'rehref' => $rehref);
 }
예제 #11
0
$tpl['filter']['nominals'] = array();
$tpl['filter']['series'] = array();
$tpl['filter']['prices'] = array();
/*

монеты
наборы монет
мелочь
цветные
подарочные наборы
барахолка - что это
*/
            


$cache_prefix = contentHelper::strtolower_ru("$materialtype"."_".md5($search));
$cache_prefix .= $nocheck?"_nocheck":"";
$cache_prefix .= $mycoins?"_mycoins":"";
if($bydate) $cache_prefix .= "_bydate$bydate";


if($mycoins) $cache_prefix .='mycoins_1_u_'.$tpl['user']['user_id'];
if($nocheck) $cache_prefix .='nocheck_'.$nocheck;

if(in_array($materialtype,array(1,7,8,6,4,'newcoins'))){

	//if(!$tpl['filters']['metalls'] = $cache->load("metalls_$cache_prefix")) {	   
	    $tpl['filters']['metalls'] = $shopcoins_class->getMetalls(false,$groups,$nominals,$bydate);	 
	   // $cache->save($tpl['filters']['metalls'], "metalls_".$cache_prefix);	    	 
	//} 	
예제 #12
0
$tpl['filter'] = array();
$tpl['filter']['metals'] = array();
$tpl['filter']['childen_data_conditions'] = array();
$tpl['filter']['years'] = array();
$tpl['filter']['thems'] = array();
$tpl['filter']['nominals'] = array();
/*

монеты
наборы монет
мелочь
цветные
подарочные наборы
барахолка - что это
*/
$cache_prefix = contentHelper::strtolower_ru("catalog_{$materialtype}" . "_" . md5($search));
if (in_array($materialtype, array(1, 7, 8, 6, 4))) {
    //if(!$tpl['filters']['metalls'] = $cache->load("metalls_$cache_prefix")) {
    $tpl['filters']['metalls'] = $catalognew_class->getMetalls(false, $groups, $nominals, $WhereParams);
    // $cache->save($tpl['filters']['metalls'], "metalls_".$cache_prefix);
    //}
    foreach ($tpl['filters']['metalls'] as $value) {
        $childen_data_metal[] = array('filter_id' => $value["metal"], 'name' => $value['name']);
    }
}
/*
if(in_array($materialtype,array(1,7,8,6,4,2))){
	//if(!$tpl['filters']['conditions'] = $cache->load("conditions_$cache_prefix")) {	   
	    $tpl['filters']['conditions'] = $catalognew_class->getConditions(false,$groups,$nominals);
	    //$cache->save($tpl['filters']['conditions'], "conditions_$cache_prefix");	 
	//} 	
예제 #13
0
    	//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');

	while(substr_count($text,"<<<"))
	{
		$text=mb_substr($text,0,strpos($text,"<<<")).substr(strstr($text,">>>"),3,'utf-8');
	}

	$tpl['lastNews'][$key]['text'] = strip_tags($text);

    $tpl['lastNews'][$key]['namehref'] = $cfg['site_dir']."news/".contentHelper::strtolower_ru($rows["name"])."_n".$rows["news"].".html";
}

$tpl['lastForumNews'] = $forum_class->getLast();

foreach ($tpl['lastForumNews'] as $key=>$thread_get) {    
	$tid = $thread_get['threadid'];
	$getp = $forum_class->getPost($tid);

	$tpl['lastForumNews'][$key]['getp'] = $getp;
	$tpl['lastForumNews'][$key]["pagetext"] = str_replace("[","<",$getp["pagetext"]);
	$tpl['lastForumNews'][$key]["pagetext"] = str_replace("]",">",$tpl['lastForumNews'][$key]["pagetext"]);

}	

$sql_video = "select * from video where `check`=1 order by rand() limit 3;";