Moved Permanently

The document has moved here.

'; die(); } if(sizeof($_GET)>1) { //слишком много параметров через $_GET $uref = $_GET['uref']; page_301die("http://www.cars-directory.net/gallery{$uref}"); } if (($REQUEST_URI{strlen($REQUEST_URI)-1} != "/") && strpos($REQUEST_URI,"?")===false && !strstr($REQUEST_URI, ".html")) { $REQUEST_URI = $REQUEST_URI.'/'; //делаем 301 редирект //header("Location: ".$REQUEST_URI); page_301die($REQUEST_URI); } else if(strstr($REQUEST_URI, '.html/')) { $REQUEST_URI = substr($REQUEST_URI,0, -1); //делаем 301 редирект //header("Location: ".$REQUEST_URI); //exit; page_301die($REQUEST_URI); } $dir_content_type = "UTF-8"; header("Content-Type: text/html; charset=$dir_content_type"); $from_gallery = 1; $history_data = ""; $header_info = "
Car Gallery
"; @include_once $_SERVER['DOCUMENT_ROOT'].'/init.php'; @include_once $_SERVER['DOCUMENT_ROOT'].'/lib.php'; @include_once $_SERVER['DOCUMENT_ROOT']."/from_wiki/get_from_wiki.php"; $do_no_ads = 0; //if(IS_ADMIN) { include "mlib.php"; $ret = my_is_exist_file($uref); } if($ret) { header("HTTP/1.1 503 Service Temporarily Unavailable"); header("Status: 503 Service Temporarily Unavailable"); header('X-Powered-By:'); $err = 0; $do_no_ads = 1; require $_SERVER['DOCUMENT_ROOT']."/new_header.php"; echo "This page is temporarily unavailable"; $err = 1; require $_SERVER['DOCUMENT_ROOT']."/new_footer.php"; die(); } $arr_korobka=array(1=>'Manual',0=>'Automatic','3'=>'CVT'); $arr_toplivo=array(1=>'Gasoline',0=>'Diesel'); $arr_privod=array(1=>'FF',0=>'FR or RR','3'=>'4WD'); $obj_detail_info = NULL; //$gallery_dir = '2gallery'; //get base info function get_base_info($id) { global $furl; //check in file system //echo "$id"; $path = '/home/kav/cars-directory.net/htdocs/pics_define/'.$furl.$id.'.desc'; /*if(IS_ADMIN) { echo $path."
"; }*/ if(file_exists($path)) { $obj = @unserialize(@read_file_ex($path)); return $obj; } return NULL; /* connect_to_my(); $arr_tables = array('test-auto-sale', 'test-auto-sale-arch-4', 'test-auto-sale-arch-3', 'test-auto-sale-arch-2', 'test-auto-sale-arch-1'); $obj = (object)NULL; for($i = 0; $i < sizeof($arr_tables); $i++) { $table = $arr_tables[$i]; $sql = "select volume, cena, korobka, toplivo, privod from `$table` where id='$id'"; $rc = ex_mysql_query($sql); if(mysql_num_rows($rc)>0) { $obj = mysql_fetch_object($rc); break; } } write_file_ex($path, serialize($obj)); return $obj; //connect to mysql */ } function get_detail_info($file, $template) { global $arr_korobka, $arr_toplivo, $arr_privod, $furl, $obj_detail_info; /*$ret = preg_match("/_(\d+)(?:_\d{1,2})?_(?:p|orig)\.(?:html|jpg)/", basename($file), $match); if(!$ret) return ''; $id = (int)$match[1]; if($id<1) return ''; */ if(IS_ADMIN) { echo "file: ".$file."
"; } $id = get_pic_id(basename($file)); if($id=='') return ''; if(IS_ADMIN) { echo "id: ".$id."
"; } $obj = get_base_info($id); if(!$obj) return ''; $obj_detail_info = $obj; if($template=='short') { if($obj->volume>0) $str = "
$obj->volume cc"; if($arr_korobka[$obj->korobka]) $str .= "
".$arr_korobka[$obj->korobka]; if($arr_toplivo[$obj->toplivo]) $str .= "
".$arr_toplivo[$obj->toplivo]; if($arr_toplivo[$obj->privod]) $str .= "
".$arr_privod[$obj->privod]; if($str) $str = substr($str, 4); } else if($template=='full') { if($obj->volume>0) $str = "Displacement, cc:$obj->volume"; if($arr_korobka[$obj->korobka]) $str .= "Transmission:".$arr_korobka[$obj->korobka].""; if($arr_toplivo[$obj->toplivo]) $str .= "Fuel Type:".$arr_toplivo[$obj->toplivo].""; if($arr_toplivo[$obj->privod]) $str .= "Drive Type:".$arr_privod[$obj->privod].""; if($obj->cena>0) $str .= "Approximate cost (price):\$$obj->cena"; if($str) $str = "$str
"; } return $str; } //try to get picture number function get_pic_number($file) { global $pic_id, $pic_index, $ex_pictures; $pic_id = 0; if(preg_match("/_a\d+b\d+_/sim", $file)) $ex_pictures = 1; $ret = preg_match("/_(\d+|a\d+b\d+)_(\d{1,2})_p\.html/sim", $file, $match); if($ret) { $pic_id = trim($match[1]); $pic_index = (int)$match[2]-1; $file = preg_replace("/(_\d{1,2})(_p\.html)/sim", "\\2", $file); } else { $ret = preg_match("/_(\d+|a\d+b\d+)_p\.html/sim", $file, $match); $pic_id = trim($match[1]); $pic_index = 0; } return $file; } //try to get picture id function get_pic_id($file) { $pic_id = 0; /* if(preg_match("/_a\d+b\d+_/sim", $file)) $ex_pictures = 1; */ /*$ret = preg_match("/_(\d+)(?:_\d{1,2})?_(?:p|orig)\.(?:html|jpg)/", basename($file), $match);*/ $ret = preg_match("/_(\d+|a\d+b\d+)_(\d{1,2})_(?:p|orig)\./sim", $file, $match); if($ret) { $pic_id = trim($match[1]); //$pic_index = (int)$match[2]-1; //$file = preg_replace("/(_\d{1,2})(_p\.)/sim", "\\2", $file); } else { $ret = preg_match("/_(\d+|a\d+b\d+)_(?:p|orig)\./sim", $file, $match); $pic_id = trim($match[1]); //$pic_index = 0; } /* $ret = preg_match("/_(\d+|a\d+b\d+)_(\d{1,2})_p\.html/sim", $file, $match); if($ret) { $pic_id = trim($match[1]); $pic_index = (int)$match[2]-1; $file = preg_replace("/(_\d{1,2})(_p\.html)/sim", "\\2", $file); } else { $ret = preg_match("/_(\d+|a\d+b\d+)_p\.html/sim", $file, $match); $pic_id = trim($match[1]); $pic_index = 0; } */ return $pic_id; } //user defined compare func function cmp_nat_desc($a, $b) { if ($a[1] == $b[1]) { return 0; } return ($a[1] < $b[1]) ? 1 : -1; } function cmp_nat_asc($a, $b) { if ($a[1] == $b[1]) { return 0; } return ($a[1] < $b[1]) ? -1 : 1; } //user defined compare func function cmp_file($a, $b) { if ($a[0] == $b[0]) { return 0; } return ($a[0] < $b[0]) ? 1 : -1; } function get_car_desc() { global $year, $firm, $model, $furl; start_profile(); // //echo "$year, $ffirm, $fmodel, $furl"; $obj = (object)NULL; if($firm&&$model) { //check in file system $path = $_SERVER['DOCUMENT_ROOT']."/pics_define/$firm/$model/model.desc"; $path_model = $_SERVER['DOCUMENT_ROOT']."/pics_define/$firm/$model/picture.jpg"; if(file_exists($path)) { $time = filemtime($path); if($time>1115977292) { $obj = @unserialize(@read_file_ex($path)); end_profile(__FUNCTION__); return $obj; } } connect_to_my(); $str_like = str_replace(' ', '%', $firm.' '.$model); $sql = "select SQL_CACHE id, description, MSRP, image_url from bazar_ex_beta.reviews_model where model like '%$str_like%' limit 1"; $rc = ex_mysql_query($sql); if(mysql_num_rows($rc)>0) { $obj = mysql_fetch_object($rc); //$obj->description = preg_replace("/
  • /sim", ",", $obj->description); //$obj->description = strip_tags($obj->description); //get photo - and save it /*if(strlen($obj->image_url)>0) { $f = @fopen($obj->image_url, "r"); if($f) { //read jpeg file $jpg_file = ''; while (!@feof($f)) { $jpg_file .= @fread($f, 4096); } @fclose($f); if(strlen($jpg_file)>0) { write_file_ex($path_model, $jpg_file); $cmd="/usr/bin/convert -quality 85 $path_model $path_model"; @exec($cmd, $ret, $ret_code); } } }*/ } write_file_ex($path, serialize($obj)); end_profile(__FUNCTION__); return $obj; //connect to mysql } end_profile(__FUNCTION__); return $obj; } function get_file_photo_info($file) { global $fwidth, $fheight; $fwidth = 0; $fheight = 0; $size = @getimagesize($file); if(is_array($size)) { $fwidth = $size[0]; $fheight = $size[1]; $fsize = intval(filesize($file)/1024); return "Photo Information (Width: {$fwidth}px, Height: {$fheight}px, Size: {$fsize}Kb)

    "; } return ''; } function view_pictures($dr) { global $year, $firm, $model, $ffirm, $fmodel,$content, $err, $pic_id, $pic_index, $ex_pictures; $alts = array(0=>$year.' '.$ffirm.' '.$fmodel, 1=>$fmodel, 2=>$year.' '.$fmodel, 3=>$ffirm.' '.$fmodel); $hit_str = ''; //if($_SERVER['REMOTE_ADDR']=='80.92.161.1') //{ /* /pics/mazda/familia/2002/mazda_familia_a1155699134b1014473.jpg */ if(sizeof($dr)>0) { //list(,,$firm, $model, $year, $file) = @explode("/", ); //list(,, $file_id) = @split('[_.]', $file); $file = preg_replace("/(?:_orig)?\.jpg/i", "_p.html", $dr[0][0]); $file_id = get_pic_id($file); $url = "{$firm}/{$model}/{$year}/{$file_id}"; $url = urlencode($url); $hit_str = ""; //echo "$firm $model $year $file_id
    "; //echo $dr[0][0]."
    ".$url."
    "; } //print_r($dr); //} $i = 0; if($ex_pictures&&sizeof($dr)>1) { if(sizeof($dr)==1) $content .= "

    $year $ffirm $fmodel


    "; else $content .= "

    $year $ffirm $fmodel


    "; $max_cols = 5; // $col_cnt = 0; $big_pic = ''; if($dr[$pic_index]=='') { $err=1; return; } $content .= ""; foreach($dr as $key=>$value) { $value = $value[0]; $alt = $alts[$i]; if(!$alt) $alt = $alts[3]; $preview_pic = str_replace('.jpg', '_p.jpg', $value); if($i%$max_cols==0) { if($i==0) $content .= ""; else $content .= ""; } if($key==$pic_index) { $big_pic = $value; $content .= ""; } else { $url_pic = str_replace(".jpg", ".html", basename($preview_pic)); $content .= ""; } $i++; } $content .= "
    \"Preview\"Preview

    "; $content .= ""; if(sizeof($dr)>1) $content .= "Photo #".($pic_index+1).""; $enlarge_photo_src = $dr[$pic_index][1]; if($enlarge_photo_src) { $enlarge_width = $dr[$pic_index][2]; $enlarge_height = $dr[$pic_index][3]; $content .= " - Enlarge photo {$enlarge_width}x{$enlarge_height}
    "; } else $content .="
    "; $content .= "\"$year\" class=\"screenshot\" align=left>";//$big_pic global $fwidth; $photo_info = get_file_photo_info($_SERVER['DOCUMENT_ROOT'].$big_pic); if(!strstr($big_pic, "_orig.")) { $content .= get_small_vote($big_pic, "{$ffirm} {$fmodel}", 1, $fwidth); $content .= do_right_block($firm, $model, $year, $ffirm, $fmodel, $fwidth, $ex_pictures, sizeof($dr)); } $content .= "
    \n"; $content .= $photo_info; global $file; $content .= get_detail_info($file, 'full'); //$content .= @view_ads("middle_unit")."

    "; } else { //current file space global $file; /* if(sizeof($dr)==1) { $content .= "$year $ffirm $fmodel picture"; if(preg_match("/_orig\.html$/sim", $file)) { $url_back = str_replace("_orig.", "_p.", basename($file)); $content .= " (go back)"; } $content .= "
    "; } else */ $content .= "

    $year $ffirm $fmodel


    "; $content .= "
    ";//style=\"width:520px\" //print_r($dr); //echo $year; global $uref; if(!strstr($uref, $year)) $prefix = "$year/"; else $prefix = ''; foreach($dr as $key=>$value) { //print_r($value); $alt = $alts[$i]; if(!$alt) $alt = $alts[3]; $pic_file = $value[0]; if(!$value[1]) { $content .= "\"{$alt}\"\n"; global $fwidth; $photo_info = get_file_photo_info($_SERVER['DOCUMENT_ROOT'].$pic_file); $content .= get_small_vote($pic_file, "{$ffirm} {$fmodel}", sizeof($dr), $fwidth); $content .= do_right_block($firm, $model, $year, $ffirm, $fmodel, $fwidth, $ex_pictures, sizeof($dr)); $content .= "
    \n"; $content .= $photo_info; } else { $big_file = str_replace(".jpg", ".html", $prefix.basename($value[1])); $content .= "\"$alt\""; global $fwidth; $fwidth = 0; $content .= get_small_vote($pic_file, "{$ffirm} {$fmodel}", sizeof($dr), $fwidth); $content .= do_right_block($firm, $model, $year, $ffirm, $fmodel, $fwidth, $ex_pictures, sizeof($dr)); $content .= "
    \n"; $content .= "Full Picture Size: ".$value[2].'x'.$value[3]."

    \n"; } $i++; } $content .= "
    "; //$content .= @view_ads("middle_unit")."

    "; $content .= get_detail_info($file, 'full'); } /*if(sizeof($dr)>1) $ads_type = "left_big"; else $ads_type = "middle_cube";*/ /* if(sizeof($dr)>1&&!$ex_pictures) { $ads = @view_ads("left_big"); $content = str_replace("", "
    {$ads}
    ", $content); //$ads = @view_ads("middle_cube", "FFFFFF", "", $firm, $model, "22229C"); //$content = str_replace("", "{$ads}", $content); //$ads = ""; } else { $ads = @view_ads("middle_cube", "FFFFFF", "", $firm, $model, "22229C"); $content = str_replace("", "{$ads}", $content); } */ //27.01.2012 измени 60% на 85% return "{$hit_str}"; $show_my_block = ""; $content .= "
     ".$content; } function compose_files(&$file, $furl) { global $last_update, $ex_pictures; start_profile(); $dr = array(); $file = get_pic_number($file); //echo "file: $file
    "; $pref = preg_replace('/(_p\.html)$/sim', '', $file); if($pref!=$file) { for($i = 0; $i<15; $i++) { $orig_file = 0; $orig_width = 0; $orig_height = 0; if($i>0) $cnt_pref = "_".($i+1); else $cnt_pref = ''; $nf = '/pics/'.$furl.$pref.$cnt_pref.'.jpg'; if(file_exists($_SERVER['DOCUMENT_ROOT'].$nf)) { $mtime = filemtime($_SERVER['DOCUMENT_ROOT'].$nf); if($mtime>$last_update) $last_update = $mtime; $size_small = @getimagesize($_SERVER['DOCUMENT_ROOT'].$nf); if(!is_array($size_small)) { write_file_ex(MY_LOG_FILE, date("d/m/Y H:i:s").", not correct file: {$nf}, ".$_SERVER['REQUEST_URI']."\n", "a+"); continue;//jopa } $nf_orig = '/pics/'.$furl.$pref.$cnt_pref.'_orig.jpg'; if(file_exists($_SERVER['DOCUMENT_ROOT'].$nf_orig)) { //check orig file exist $size = @getimagesize($_SERVER['DOCUMENT_ROOT'].$nf_orig); if(is_array($size))//больше по ширине на 30% от маленького размера { $proc = (100*$size[0]/$size_small[0]); if($proc>=125) { $orig_file = $nf_orig; $orig_width = $size[0]; $orig_height = $size[1]; } else { //write_file_ex(MY_LOG_FILE, date("d/m/Y H:i:s").", proc: {$proc}, {$nf_orig}, ".$_SERVER['REQUEST_URI']."\n", "a+"); } } } $dr[] = array($nf, $orig_file, $orig_width, $orig_height); } else if($i>2) break; } //if(IS_ADMIN) print_r($dr); } else { $ret = preg_match('/(_orig\.html)$/sim', $file); if($ret) { $pref = preg_replace("/\.html$/sim", ".jpg", $file); $nf = '/pics/'.$furl.$pref; if(file_exists($_SERVER['DOCUMENT_ROOT'].$nf)) { $mtime = filemtime($_SERVER['DOCUMENT_ROOT'].$nf); if($mtime>$last_update) $last_update = $mtime; $dr[] = array($nf, '', 0, 0); } } } end_profile(__FUNCTION__); return $dr; } function ex_is_file($file) { return preg_match("/[^.]+\.[^.]+/", $file); } function ex_is_page($file, &$number) { $ret = preg_match('/^page(\d+)\.html$/', $file, $match); if($ret) { $number = (int)$match[1]; } return $ret; } function dir_list($dir, &$sz, $view) { global $last_update; start_profile(); $dr = array(); $last_update = 0; //кешируем только если в dir больше $cache_list = $dir.".cache_list"; if($view=='files'&&@file_exists($cache_list)) { $dt = filemtime($cache_list); if(time()-$dt<3600*24*7)//на 7 дней кешируем { $data = @read_file_ex($cache_list); if($data) { $un_data = unserialize($data); if(is_array($un_data)) { list($last_update, $dr) = $un_data; if(is_array($dr)) { if(IS_ADMIN) echo "read from cache: $cache_list
    "; end_profile(__FUNCTION__); return $dr; } } } } } $dr = array(); $sz = array();//filesize for files $dup_pics = array(); if(file_exists($dir)) { $d = dir($dir); while (false !== ($entry = $d->read())) { if($entry!='.'&&$entry!='..') { $mtime = filemtime($dir.$entry); if($mtime>$last_update) $last_update = $mtime; if($view=='files'&&is_file($dir.$entry)&&(preg_match('/_(?:a\d+b\d+)_p\./', $entry)||(preg_match('/\d{3,}_p\./', $entry)&&!preg_match('/_(?:a\d+b\d+)_(?:\d{1,2})_p\./', $entry)))) { $fl = str_replace('_p.', '.', $entry); $sz = filesize($dir.$fl); $mz = filesize($dir.$entry); //if pics is duplicate or preview size < 1000 bytes if($mz<500) { //add to remove log $remove_it = str_replace("_p.jpg", "*", $dir.$entry); @write_file_ex("/home/kav/cars-directory.net/logs/remove2.log", $remove_it."\n", "a+"); } if($dup_pics[$sz]||$mz<500) continue; $dr[] = array($mtime, $entry); $dup_pics[$sz] = 1; } else if(($view=='dir'||$view=='year')&&is_dir($dir.$entry)) $dr[] = array($mtime, $entry); } } $d->close(); } if($view=='dir') usort($dr, "cmp_nat_asc"); else if($view=='year') usort($dr, "cmp_nat_desc"); else if($view=='files') usort($dr, "cmp_file"); //save to cache 15 days if($view=='files'&&sizeof($dr)>30)/*>30 больше 2-х страниц >75 больше 5-ти страниц*/ { $data = array($last_update, $dr); @write_file_ex($cache_list, @serialize($data)); if(IS_ADMIN) echo "write to cache: {$cache_list}
    "; } end_profile(__FUNCTION__); return $dr; } $uref = preg_replace("/\/\/+/", "/", $uref); $upper_path = ''; $content = ''; $max_pic_per_col = 5; $max_cols_per_page = 3; $page_nav = ''; $footer_info = ''; $index_page = false; $Title = 'Car Gallery'; $upper_sep = ' » '; $upper_path = $upper_sep.$suffix_upper_path; $dr = array();//files content $last_update = 0; $firm = ''; $model = ''; $year = ''; $file = ''; $view = ''; $ex_pictures = 0; //$path = $err = 1; if($uref==''||$uref=='/') { $index_page = true; } else { if($uref{0}=='/') $uref = substr($uref, 1); if(!preg_match("/[^a-z0-9&~._\\/-]/sm", $uref)) { //символы больше чем один - не могут содержаться //символы в начале и в конце не могут содеражаться $picture_preview = false; list($firm, $model, $year, $file) = explode('/', $uref); if($model=='pic_preview'&&$year==''&&$file=='') { $model = ''; $picture_preview = true; //get_preview_index_images("/home/ibaza/www/pics/$firm/"); } if($allow_dir[$firm]&&!strstr($model, '.')&&!strstr($year, '.')&&(strlen($file)==0||ex_is_file($file))) { //$ffirm = ucfirst(str_replace('_', ' ',$firm)); //$ffirm = ucmark($ffirm); $ffirm = get_caption($firm); $fmodel = get_caption($model); //$fmodel = ucfirst(str_replace('_', ' ',$model)); //$fmodel = ucmark($fmodel); $ufirm = "$ffirm"; $umodel = "$fmodel"; $uyear = "$year"; $page = 1; $pic_index = 0; if(ex_is_page($file, $page)) { $footer_info = " $year $ffirm $fmodel"; $Title = "$year $ffirm $fmodel - Car Pictures Gallery"; $furl = "$firm/$model/$year/"; $view = 'files'; $upper_path = $prefix_gallery_root.'
    '.$upper_sep.$ufirm.'
    '.$upper_sep.$umodel; } else if(ex_is_file($file)) { $footer_info = " $year $ffirm $fmodel"; //try to get pic_index $Title = "$year $ffirm $fmodel "; $furl = "$firm/$model/$year/"; $view = 'file'; $upper_path = $prefix_gallery_root.'
    '.$upper_sep.$ufirm.'
    '.$upper_sep.$umodel.'
    '.$upper_sep.$uyear; } else if($year) { $footer_info = " $year $ffirm $fmodel"; $Title = "$year $ffirm $fmodel - Car Pictures Gallery"; $furl = "$firm/$model/$year/"; $view = 'files'; $upper_path = $prefix_gallery_root.'
    '.$upper_sep.$ufirm.'
    '.$upper_sep.$umodel; } else if($model) { $footer_info = " $ffirm $fmodel"; $Title = "$ffirm $fmodel - Car Pictures Gallery"; $furl = "$firm/$model/"; $view = 'year'; $upper_path = $prefix_gallery_root.'
    '.$upper_sep.$ufirm; } else { $footer_info = " $ffirm"; $Title = "$ffirm - Car Pictures Gallery"; $furl = "$firm/"; $view = 'dir'; $upper_path = $prefix_gallery_root; } $url = $_SERVER['DOCUMENT_ROOT'].'/pics/'.$furl; if($view=='file'||file_exists($url)) { $err = ''; if($view=='file') { $dr = compose_files($file, $furl); } else { //time //if(IS_ADMIN) $st_time = getmicrotime(); $dr = dir_list($url, $sz, $view); //end time /*if(IS_ADMIN) { $ed_time = getmicrotime()-$st_time; echo "\n\n"; }*/ } if($view=='file') { $content = view_pictures($dr); } else if($view=='year') { $found_files = sizeof($dr); $bb = true; //если только один год, то узнем сколько в этом году разных машин /*if($found_files==1) { $year = $dr[0][1]; $my_url = $url.$year.'/'; $my_dr = dir_list($my_url, $sz, 'files'); if(sizeof($my_dr)==1) { list($mtime, $pic_name) = $my_dr[0];//file $content = ''; $dr = array(); $furl = "$firm/$model/$year/"; $view = 'file'; $file = str_replace(".jpg", ".html", $pic_name); $dr = compose_files($file, $furl); $content = view_pictures($dr); $bb = false; } else if(sizeof($my_dr)==0) { $content = ''; $err = 1; } }*/ if($bb) { $bstr = ''; $today = time()-86400; $arr_y = array(); foreach($dr as $key=>$value) { list($mtime, $myear) = $value; //если годов больше 3-х и выбранный год ошибочный, то пропускаем его. if(($myear>2100||$myear<1800)&&sizeof($dr)>3) continue; if($mtime>$today) $str = " new"; else $str = ''; $arr_y[intval($myear/10)] .= "$myear$str
    \n"; $bstr .= ' - '.$myear; } $bstr = substr($bstr, 3); if($footer_info) $footer_info = $bstr."
    ".$footer_info; else $footer_info = $bstr; if(sizeof($arr_y)<1) { $content .= "

    At the moment the photo is not available!

    "; $do_no_ads = 1; } else { //$show_my_block = "
    ".@view_ads("180x150")."
    {$show_my_block}{$show_my_block}

    ".implode("

    ", $arr_y)."

    "; } //$content = "

    Gallery $ffirm $fmodel

    ".get_preview_images("/home/kav/cars-directory.net/htdocs/pics/$firm/$model/")."

    Year of $ffirm $fmodel


    $content
    ".@view_ads("middle_cube")."
    "; $content = "

    $ffirm $fmodel pictures

    ".get_preview_images("/home/kav/cars-directory.net/htdocs/pics/$firm/$model/")."

    Year of $ffirm $fmodel


    $content
    ".@view_ads("middle_cube")."
    "; } } else if($view=='dir') { $found_files = sizeof($dr); //@view_ads("middle_cube", "FFFFFF", "", $firm, "", "22229C"). $content .= "

    $ffirm models


    "; if($picture_preview) { $str_plain_view = "text preview"; $str_picture_view = "picture preview"; } else { $str_plain_view = "text preview"; $str_picture_view = "picture preview"; } $content .= "
    Preview by: $str_plain_view / $str_picture_view

    "; if($picture_preview) $content .= get_preview_index_images("/home/kav/cars-directory.net/htdocs/pics/$firm/"); else { if(sizeof($dr)<1) { $content .= "


    At the moment the photo is not available!

    "; } else { $content .= ""; $count_in_col = 0; $cols_cnt = 0; $all_cnt = -1; $max_cols_per_page = 4; $width_per_col = intval(100/($max_cols_per_page+1)); $my_col = "";//""; $max_models_per_col = ceil($found_files/$max_cols_per_page); foreach($dr as $key=>$value) { $all_cnt++; list($mtime, $value) = $value; $fname = strtoupper(get_caption($value)); if($count_in_col==0||$count_in_col==$max_models_per_col) { if($cols_cnt>=$max_cols_per_page) break; if($count_in_col!=0) { $content .= ""; if($cols_cnt==$max_cols_per_page/2) { $content .= $my_col; } } $content .= ""; $content .= "
    ".@view_ads("middle_unit").""; $count_in_col = 0; $cols_cnt++; } $content .= "$fname
    \n"; $count_in_col++; } if($count_in_col>0) $content .= "
    "; } } } else if($view=='files') { $found_files = sizeof($dr); /*if(IS_ADMIN) { echo "
    ";
    							print_r($dr);
    							echo "
    "; }*/ //$content .= @view_ads("header_unit"); //$content .= "

    ".@view_ads("header_unit")."

    "; $content .= "

    $year $ffirm $fmodel



    "; $content .= ""; $count_in_col = 0; $cols_cnt = 0; $all_cnt = -1; //usort($dr, "cmp_file"); $from_cnt = $max_pic_per_col*$max_cols_per_page*($page-1); // "$found_files<=$from_cnt
    "; if($found_files<=$from_cnt) $err = 1; else { if($found_files-$from_cnt<5*3) $inner_max_pic_per_col = ceil(($found_files-$from_cnt)/$max_cols_per_page); else $inner_max_pic_per_col = $max_pic_per_col; foreach($dr as $key=>$value) { $mtime = $value[0]; $pic_file = $value[1]; if($found_files==1) { $content = ''; $dr = array(); $furl = "$firm/$model/$year/"; $view = 'file'; $file = str_replace(".jpg", ".html", $pic_file); $dr = compose_files($file, $furl); $content = view_pictures($dr); break; } $all_cnt++; if($all_cnt<$from_cnt) continue; $fname = ucfirst($pic_file); if($count_in_col==0||$count_in_col==$inner_max_pic_per_col) { if($cols_cnt>=$max_cols_per_page) break; if($count_in_col!=0) $content .= "
    "; $content .= ""; $count_in_col = 0; $cols_cnt++; } $jpg_file = preg_replace('/(\.jpg)$/sim', ".html", $pic_file); $content .= "\n"; $count_in_col++; } if($view != 'file') { if($count_in_col>0) $content .= "
    \"<phrase $ffirm $fmodel\" width=\"75\" height=\"56\" class=\"screenshot\">".get_detail_info($jpg_file, 'short')."
    "; $content .= ""; $pages_count = ceil($found_files/($max_cols_per_page*$max_pic_per_col)); if($pages_count>1) { $rz = ""; for($i=1;$i<=$pages_count;$i++) { if($i==$page) $pages_nav .= " | ".$i.""; else { if($i==1) $pages_nav .= " | $i"; else $pages_nav .= " | $i"; } } $pages_nav = substr($pages_nav, 3); } } /*foreach($dr as $key=>$value) { $fname = ucfirst($value); $content .= "
    \n"; } */ } } } } } } if($last_update>0) { //&&$_SERVER['REMOTE_ADDR']!='80.92.161.1' // date("d/m/Y H:i:s", $last_update); ex_cache_page($last_update); } if(strlen($pic_id)>1) { $spic_id = ' - '.$pic_id; if(strstr($pic_id, 'a')) { $idx_offset = intval(substr(preg_replace("/[^0-9]+/sim", '', $pic_id), 0, 9))-$pic_index; } else { $idx_offset = $pic_id; } } else if($page>1) { $idx_offset = $page+2; } else { $idx_offset = 0; } if($idx_offset>0) { $arr_word = array('Photos', 'Photos', 'Pictures', 'Pictures', 'Pics', 'Pictures', 'Images', 'For Sale', 'Wallpapers','For Sale', 'Photos', 'Pictures'); $cnt = sizeof($arr_word); $id_arr = $idx_offset%$cnt; $phrase = $arr_word[$id_arr]; $arr_word_prefix = array(" Used ", '', '', '', '', '', '', '', '', ''); $cnt_prefix = sizeof($arr_word_prefix); $id_arr_prefix = $idx_offset%$cnt_prefix; $phrase_prefix = $arr_word_prefix[$id_arr_prefix]; } else { $spic_id = ''; $phrase = 'Pictures'; $phrase_prefix = ''; } $Title = str_replace('', $phrase, $Title); $Title = trim(str_replace('', $phrase_prefix, $Title)); $content = str_replace('', $phrase, $content); $content = trim(str_replace('', $phrase_prefix, $content)); $footer_info = str_replace('', $phrase, $footer_info); $upper_path = str_replace('', $phrase, $upper_path); $header_info = str_replace('', $phrase, $header_info); //get car description $obj = get_car_desc(); $obj->description = str_replace("''''", "'", $obj->description); $keys = normKeywords($obj->description.' '.$content); $metakeywords = genKeywords($Title.' '.$keys); $meta_about = strtoupper(normKeywords(str_replace("from Car Picture Gallery", "", $Title))).$spic_id; if($obj->description) { $metadescription = $meta_about.' - '.$obj->description; } else { $metadescription = $meta_about.' - Pics Photos Wallpapers Images'; } $str_title_addon = ""; if($view=='file'&&$obj_detail_info) { if($obj_detail_info->volume>0) { $arr_word_volume = array('cc.', '', 'l.'); $cnt = sizeof($arr_word_volume); $id_arr = $idx_offset%$cnt; $volume_phrase = $arr_word_volume[$id_arr]; $liter = round($obj_detail_info->volume/1000, 1); $str_volume = str_replace("", $obj_detail_info->volume, $volume_phrase); $str_volume = str_replace("", number_format($liter, 1, '.', ''), $str_volume); $str_title_addon .= ", {$str_volume}"; } if($arr_toplivo[$obj_detail_info->toplivo]) { $str_title_addon .= ", ".$arr_toplivo[$obj_detail_info->toplivo]; } if($arr_toplivo[$obj_detail_info->privod]) { $str_title_addon .= ", ".$arr_privod[$obj_detail_info->privod]; } if($arr_korobka[$obj_detail_info->korobka]) { $str_title_addon .= ", ".$arr_korobka[$obj_detail_info->korobka]; } //if($_SERVER['REMOTE_ADDR']=='80.92.161.1') //{ $Title = str_replace(" - Car Pictures Gallery", "", $Title); $Title .= $str_title_addon." For Sale"; //} //if($obj->cena>0) $str .= "Approximate cost (price):\$$obj->cena"; //if($str) $str = "$str
    "; } $rz = ""; if(!$err&&$firmids[$firm]&&$firm!='lexus'&&$firm!='hino') { //check exist firm $str = ''; $sql = "select id from auto.newfirms where name_url='$firm'"; $rc = @ex_mysql_query($sql, $sqlid); echo mysql_error(); if(mysql_num_rows($rc)>0) { list($firm_id) = mysql_fetch_array($rc); if($model) { $sql = "select nm.id from auto.newmodels as nm inner join auto.newmodelsdesc as nmd on nm.catfirmid='$firm_id' and nm.name like '$model' and nmd.catmodelid=nm.id"; $rc = ex_mysql_query($sql, $sqlid); if(mysql_num_rows($rc)>0) { list($model_id) = mysql_fetch_array($rc); //echo $model_id; $header_info .= "$ffirm $fmodel Specs"; $rz = " | "; } else { $header_info .= "$ffirm Specs"; $rz = " | "; } } else { $header_info .= "$ffirm Specs"; $rz = " | "; } } // $header_info = "Specs $ffirm $fmodel"; } $forum_maked_url = ""; if(!$err&&$firm&&$ffirm&&$forum_link[$firm]) { $forum_maked_url = "$ffirm Forum"; $header_info .= $rz.$forum_maked_url; $rz = " | "; if($model=='supra') { $header_info .= $rz."Supra Forums"; $upper_path .= '
    '.$upper_sep."Supra Forums"; } } $review_link = "Write a Review"; if($model&&($reviews_link=is_review_exists($firm, $model))) { $header_info .= $rz.$reviews_link; $rz = " | "; } else if($reviews_link=is_review_exists($firm)) { $header_info .= $rz.$reviews_link; $rz = " | "; } else { $header_info .= $rz.$review_link; $rz = " | "; } $upper_path .= '

    '.$upper_sep.'Used Cars For Sale
    '.$upper_sep.$review_link; $solution_link = "Do you have problems with car?"; $header_info .= $rz.$solution_link; //$upper_path .= '

    '.$upper_sep.$solution_link; //$header_info .= $rz."Car Insurance"; if(strlen($pic_id)>1) $uniq_info = "id:$pic_id"; //custom 503 error if($err) { header("HTTP/1.1 503 Service Temporarily Unavailable"); header("Status: 503 Service Temporarily Unavailable"); $err = 0; $do_no_ads = 1; require $_SERVER['DOCUMENT_ROOT']."/new_header.php"; echo "This page is temporarily unavailable"; $err = 1; require $_SERVER['DOCUMENT_ROOT']."/new_footer.php"; die(); } require $_SERVER['DOCUMENT_ROOT']."/new_header.php"; // echo "
    "; //if($_SERVER['REMOTE_ADDR']=='80.92.161.1') //{ // echo "Test"; //if($view=='file') $cnt = 5; //else $cnt = 10; /*if($view=='year'&&!$err) { echo @view_ads("middle_cube", "FFFFFF", "", $firm, $model, "22229C")."
    "; } */ $wiki_show_left_pic = true; if($firm) { //echo "
    test
    "; //$_SERVER['REMOTE_ADDR']=='80.92.161.1'&& $auto_url = "$firm/"; $auto_orig = str_replace(" ", "_", $ffirm); if(strlen($model)>0) { $auto_url .= "$model/"; $auto_orig .= "_".str_replace(" ", "_", $fmodel); $kb = 256;//model preview } if($view=='file'||$view=='files') $kb = 256;//model single privew else $kb = 512;//firm preview $return_p_count = 0; $data = history_preview($auto_url, $auto_orig, $kb, $return_p_count, false, true); if(strlen($data)==0&&strlen($model)>0) { $return_p_count = 0; $auto_url = "$firm/"; $auto_orig = str_replace(" ", "_", $ffirm); $kb = 512; $data = history_preview($auto_url, $auto_orig, $kb, $return_p_count, false, true); } $data = str_replace("



    ", "
    ", $data); $history_data = $data; if($data) { echo "

    {$Title}

    "; } if($view=='file') { echo "
    {$data}
    "; } else { echo $data; } $wiki_show_left_pic = false; } $top_images = show_top_images_ex($firm, $model, $year, 7); echo $top_images; //} if($obj->description) { /*if(file_exists($_SERVER['DOCUMENT_ROOT']."/pics_define/$firm/$model/picture.jpg")) $img = "\"define"; else */ $img = ''; echo "

    $img{$obj->description}

    "; } if(!$err&&($view=='file'||$view=='dir'||$view=='files')) { //echo "

    ".view_ads("wide")."
    "; echo "
    ".@view_ads("wide_unit")."

    "; } $sub_menu = ''; $sub_menu_footer = ''; if($view=='file'||$err) { if($found_files==1&&!strstr($_SERVER['REQUEST_URI'], ".html")) { $_SERVER['REQUEST_URI'] .= $file; } if($view=='file') $sub_menu .= "
    "; $link_review = "Write a Review"; $solution_link = "Do you have problems with car?"; $link_report = "Report to Moderator"; //$sub_menu .= "
    $link_report
    "; if($view=='file') { $link_comment = "Add Comment"; //$sub_menu .= "$link_comment
    "; $sub_menu_footer = "$solution_link | $link_review | $link_comment | $link_report".($forum_maked_url?" | {$forum_maked_url}":"").""; $forum_maked_url = "";//clear } //$sub_menu = "$sub_menu"; //echo $sub_menu; } if(!$err) { /* if($firm&&$model&&$view=='year') { echo get_preview_images("/home/ibaza/www/pics/$firm/$model/")."
    "; } */ if($view=='dir'||$view=='files') { echo ""; /*if($view=='files') { echo ""; echo "
    ".@view_ads('left_big', "FFFFFF").""; } else {*/ echo ""; /*} */ } echo $content; if($pages_nav) { ?>
    Pages:
    2) { echo "
    ".@view_ads("middle_cube")."

    "; } echo get_text_link("
    %s
    "); echo "
    $sub_menu_footer"; } if($forum_maked_url) { $forum_maked_url = str_replace("\">", "\">Join the ", $forum_maked_url); echo get_text_link('
    %s
    '); echo "
    {$forum_maked_url}
    "; } //history block if($firm) { //$_SERVER['REMOTE_ADDR']=='80.92.161.1'&& $auto_url = "$firm/"; $auto_orig = str_replace(" ", "_", $ffirm); if(strlen($model)>0) { $auto_url .= "$model/"; $auto_orig .= "_".str_replace(" ", "_", $fmodel); $kb = 2048;//model preview } if($view=='file'||$view=='files') $kb = 1024;//mobel single privew else $kb = 2048;//firm preview //echo "year: $year
    "; if(IS_ADMIN) { if($_COOKIE['rewrite_orig']) $auto_orig = $_COOKIE['rewrite_orig']; else { $auto_orig = str_replace("_", " ", $auto_orig); $auto_orig = ucwords(strtolower($auto_orig)); $auto_orig = str_replace(" ", "_", $auto_orig); //$_COOKIE['rewrite_orig'] = $auto_orig; } //echo "$auto_url, $auto_orig
    "; echo admin_get_wiki_content($auto_url, $auto_orig); } else { $data = history_preview($auto_url, $auto_orig, $kb, $return_p_count, true, $wiki_show_left_pic); if(strlen($data)==0&&strlen($model)>0) { // $auto_url = "$firm/"; $auto_orig = str_replace(" ", "_", $ffirm); $kb = 1024; $data = history_preview($auto_url, $auto_orig, $kb, $return_p_count, true, $wiki_show_left_pic); } if(strlen($data)>512) { ?>



    ", "
    ", $data); $history_data = $data; echo $data; } } //end history block //if($_SERVER['REMOTE_ADDR']=='80.92.161.1') //{ /*include "../news_lib.php"; $content = ""; $return = preview_news($firm, $model, $content); if(!$return&&strlen($content)>0) { echo $content; }*/ //} if($view=='dir'||$view=='files'||$view=="file") { echo "
    "; } //echo $sub_menu; } else if($err&&!$index_page) { if($found_files==0) { echo "

    Pictures not found!

    "; } else { echo "

    Page not found!

    "; } } if($index_page) { } // $footer_info .= ' - Photos, Pics, Wallpapers, Images.'; $car = trim("$year $ffirm $fmodel"); if($car) { $footer_info .= '
    Used '.$car.' For Sale'; if($str_title_addon) { $footer_info .= "{$str_title_addon}."; } else { $str_title_addon = "."; } } require $_SERVER['DOCUMENT_ROOT']."/new_footer.php"; // if($_SERVER['REMOTE_ADDR']=='80.92.161.1') // { // echo get_preview_index_images("/home/ibaza/www/pics/$firm/"); // } if(($_SERVER['REMOTE_ADDR']=='80.92.161.1'||$_SERVER['REMOTE_ADDR']=='80.92.160.252')&&$_COOKIE['admin']=='malex') { if($view=="files"||$view=="file"||$view=="year") { echo "x"; } }