static function getMini($src,$base_path,$recreate=false) { $src = str_replace('http://numizmatik.ru/','',$src); $sub = str_replace($base_path,'',$src); $path_to_file = self::$DIR_PATH.$base_path.$sub; $path_to_mini = self::$DIR_PATH.$base_path.'mini/'.$sub; if(!file_exists(self::$DIR_PATH.$base_path.'mini/'.$sub)||$recreate){ return imageMini::createMini($path_to_file,$path_to_mini); } return str_replace(self::$DIR_PATH,self::$SITE_PATH,$path_to_mini); }
$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); $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");
*/ if(!$tpl['user']['error_coll']) { if($tpl['user']['data']['photo']){ unlink($path_on_server."images/".$tpl['user']['data']['photo']); unlink($path_on_server."tmp/".$tpl['user']['data']['photo']); } $fileNameOnServer = $path_on_server."tmp/".$tpl['user']["user_id"].".$fileType"; if (is_uploaded_file($fileNameToUpload)){ $res = move_uploaded_file($fileNameToUpload, $fileNameOnServer); } $fileName= $tpl['user']["user_id"].".$fileType"; //require("../advertise/resizeImageAndSave.php"); //resizeImageAndSave("tmp/", "collector/images/", $fileName, 200, 200); $res = imageMini::SaveSmallImage($path_on_server."tmp/", $path_on_server."images/",$fileName, 200, 200,false); //var_dump($res ); $data_update = array(); $tpl['user']['data']['photo']=$data_update['photo'] = $fileName; //var_dump($fileName); $user_class->updateUser($data_update); } } } require_once($cfg['path'].'/models/collector.php'); $collectors_class = new model_collectors($db_class); $tpl['user']["collectors"]['interests'] = array(); $collector_info = array(); $collector_info['user'] = $tpl['user']['user_id']; for ($i=1; $i<=sizeof($interests); $i++){
} elseif (!sizeof($errors)&&$submitaftererror) { //теперь копируем и уменьшаем наше изображение до нужных нам размеров $last_transaction = $catalognew_class->getCatalogtransaction(); $imagemaxtransaction = ($last_transaction+1).".jpg"; $imageid = ($last_transaction + 1)."_".rand(1,10000); $res = copy($_FILES['image']['tmp_name'], $cfg['oldpath']."/catalognew/files/".$imageid.".".$type); unlink($_FILES['image']['tmp_name']); $image = $imageid.".".$type; //теперь делаем обработку для $file_data = imageMini::SaveSmallImage ($cfg['oldpath']."/catalognew/files/", $cfg['oldpath']."/catalognew/i/", $image, 606, 606); $catalognew_class->saveImageData($file_data); $file_data = imageMini::SaveSmallImage ($cfg['oldpath']."/catalognew/files/", $cfg['oldpath']."/catalognew/is/", $image, 210, 210); $catalognew_class->saveImageData($file_data); $file_data = imageMini::SaveSmallImage ($cfg['oldpath']."/catalognew/files/", $cfg['oldpath']."/catalognew/iss/", $image, 80, 80); $catalognew_class->saveImageData($file_data); $image_small_url = "is/".$imagemaxtransaction; $image_big_url = "i/".$imagemaxtransaction; $data = array('group'=> $group, 'name' => $name, 'yearstart'=>$yearstart, 'metal'=> $metal, 'probe'=> $probe, 'procent' => $procent, 'amount' => $amount, 'size' => $size, 'thick' => $thick, 'weight' => $weight,
$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'); 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();