"; // Turn off all error reporting //error_reporting(0); // Report simple running errors //error_reporting(E_ERROR | E_WARNING | E_PARSE); // Reporting E_NOTICE can be good too (to report uninitialized // variables or catch variable name misspellings ...) //error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE); // Report all PHP errors (see changelog) //error_reporting(E_ALL); // Report all PHP errors //error_reporting(-1); // Same as error_reporting(E_ALL); //ini_set('error_reporting', E_ALL); //error_reporting(E_ALL); ini_set('display_errors', '1'); //$current_error_reporting = error_reporting(); //echo "B: ".$current_error_reporting."
"; ?> "", "pics" => array() ); $product_featured_max_count = array( "main" => 12, "secondary" => 12 ); /* $poza_maxWidth_sm = 130; $poza_maxHeight_sm = 115; */ $poza_maxWidth_feat_sm = 550; $poza_maxHeight_feat_sm = 550; $poza_maxWidth_sm = 130; $poza_maxHeight_sm = 130; $poza_maxWidth = 700; $poza_maxHeight = 500; $vila_poza_maxWidth_sm = 200; $vila_poza_maxHeight_sm = 200; $vila_poza_maxWidth = 450; $vila_poza_maxHeight = 450; $edit_mode = 0; $id_index = "0p1"; $d = 1; $eshop_pics_size['prod'] = Array(); $eshop_pics_size['prod']['small'] = Array(); $eshop_pics_size['prod']['small']['width'] = '400'; $eshop_pics_size['prod']['small']['height'] = '300'; $eshop_pics_size['prod'][0] = $eshop_pics_size['prod']['small']; $eshop_pics_size['prod']['big'] = Array(); $eshop_pics_size['prod']['big']['width'] = '1020'; $eshop_pics_size['prod']['big']['height'] = '1020'; $eshop_pics_size['prod'][1] = $eshop_pics_size['prod']['big']; define("DEFAULT_DATE_FORMAT", "dd/mm/yyyy"); $newsletter_config = array( 'enabled' => '0' ); $multiuser_config = array( 'enabled' => '0' ); $allow_multiple_connections = TRUE; ?> true, "drop-proprietary-attributes" => true, "drop-font-tags" => true, "drop-empty-paras" => true, "hide-comments" => true, "join-classes" => true, "join-styles" => true, "wrap" => 300 /* Line length before wrapping */ ); ?> dirname}"; $topic_dirname = cms_get_dirname_correct( $topic->topic_id ); //gen prj_results $aux = array(); $remove_index_php = str_replace("index.php","",$_SERVER['PHP_SELF']).'_slideshow'; $images_base_url = $site_base_url.'_images/'.$GLOBALS['cms_images'].'/'.$topic_dirname.'_slideshow'; $diri = $level.'_images/'.$GLOBALS['cms_images'].'/'.$topic_dirname.'_slideshow'; if ( is_dir($diri) ){ $folder = dir($diri); } else { $folder = false; } if ( $folder ){ $counter = 0; while( $folderEntry=$folder->read() ) { $ext=explode('.',$folderEntry); if($folderEntry != '.' && $folderEntry != '..' && $ext[1]){ $fileextension = getExtension($folderEntry); if (strstr($folderEntry, '_sm.')===false){ //$picture_small = "/{$images_base_url}/".str_replace("_big","_sm",$folderEntry); $picture_small = "/{$images_base_url}/".str_replace(".".$fileextension,"_sm.".$fileextension,$folderEntry); $picture_large = "/{$images_base_url}/{$folderEntry}"; if (itsme()){ //echo $picture_small."
"; //echo "
";
              //print_r($ext);
              //echo "
"; } $slideshow .= "
  • \"\"
  • \n"; $counter ++; //$slideshow .= "
  • \"\"
  • \n"; //$slideshow .= "
  • \"\"
  • \n"; //$slideshow .= "
  • \"\"
  • "; } } } $folder->close(); } } $slideshow_title = "

    {$GLOBALS['txt_pictures_gallery'][$GLOBALS['lang']]}

    "; $slideshow_title = ""; if ($slideshow){ $slideshow = " {$slideshow_title} "; } return ($slideshow); } //This function reads the extension of the file. It is used to determine if the file is an image by checking the extension. function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } function dir_exists($dir_name = false, $path = './') { if(!$dir_name) return false; if(is_dir($path.$dir_name)) return true; $tree = glob($path.'*', GLOB_ONLYDIR); if($tree && count($tree)>0) { foreach($tree as $dir) if(dir_exists($dir_name, $dir.'/')) return true; } return false; } //--------------------------------------------------------------------------------------------------------- // FormatDateTime /* Format a timestamp, datetime, date or time field from MySQL $namedformat: 0 - General Date, 1 - Long Date, 2 - Short Date (Default), 3 - Long Time, 4 - Short Time, 5 - Short Date (yyyy/mm/dd), 6 - Short Date (mm/dd/yyyy), 7 - Short Date (dd/mm/yyyy) */ function FormatDateTime($ts, $namedformat){ $DefDateFormat = str_replace("yyyy", "%Y", DEFAULT_DATE_FORMAT); $DefDateFormat = str_replace("mm", "%m", $DefDateFormat); $DefDateFormat = str_replace("dd", "%d", $DefDateFormat); if (is_numeric($ts)){ // timestamp switch (strlen($ts)) { case 14: $patt = '/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/'; break; case 12: $patt = '/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/'; break; case 10: $patt = '/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/'; break; case 8: $patt = '/(\d{4})(\d{2})(\d{2})/'; break; case 6: $patt = '/(\d{2})(\d{2})(\d{2})/'; break; case 4: $patt = '/(\d{2})(\d{2})/'; break; case 2: $patt = '/(\d{2})/'; break; default: return $ts; } if ((isset($patt))&&(preg_match($patt, $ts, $matches))){ $year = $matches[1]; $month = @$matches[2]; $day = @$matches[3]; $hour = @$matches[4]; $min = @$matches[5]; $sec = @$matches[6]; } if (($namedformat==0)&&(strlen($ts)<10)) $namedformat = 2; } elseif (is_string($ts)) { if (preg_match('/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/', $ts, $matches)) // datetime { $year = $matches[1]; $month = $matches[2]; $day = $matches[3]; $hour = $matches[4]; $min = $matches[5]; $sec = $matches[6]; } elseif (preg_match('/(\d{4})-(\d{2})-(\d{2})/', $ts, $matches)) // date { $year = $matches[1]; $month = $matches[2]; $day = $matches[3]; if ($namedformat==0) $namedformat = 2; } elseif (preg_match('/(^|\s)(\d{2}):(\d{2}):(\d{2})/', $ts, $matches)) // time { $hour = $matches[2]; $min = $matches[3]; $sec = $matches[4]; if (($namedformat==0)||($namedformat==1)) $namedformat = 3; if ($namedformat==2) $namedformat = 4; } else { return $ts; } } else { return $ts; } if (!isset($year)) $year = 0; // dummy value for times if (!isset($month)) $month = 1; if (!isset($day)) $day = 1; if (!isset($hour)) $hour = 0; if (!isset($min)) $min = 0; if (!isset($sec)) $sec = 0; $uts = @mktime($hour, $min, $sec, $month, $day, $year); if ($uts == -1) { // failed to convert $year = substr_replace("0000", $year, -1 * strlen($year)); $month = substr_replace("00", $month, -1 * strlen($month)); $day = substr_replace("00", $day, -1 * strlen($day)); $hour = substr_replace("00", $hour, -1 * strlen($hour)); $min = substr_replace("00", $min, -1 * strlen($min)); $sec = substr_replace("00", $sec, -1 * strlen($sec)); $DefDateFormat = str_replace("yyyy", $year, DEFAULT_DATE_FORMAT); $DefDateFormat = str_replace("mm", $month, $DefDateFormat); $DefDateFormat = str_replace("dd", $day, $DefDateFormat); switch ($namedformat) { case 0: return $DefDateFormat." $hour:$min:$sec"; break; case 1://unsupported, return general date return $DefDateFormat." $hour:$min:$sec"; break; case 2: return $DefDateFormat; break; case 3: if (intval($hour)==0) return "12:$min:$sec AM"; elseif (intval($hour)>0 && intval($hour)<12) return "$hour:$min:$sec AM"; elseif (intval($hour)==12) return "$hour:$min:$sec PM"; elseif (intval($hour)>12 && intval($hour)<=23) return (intval($hour)-12).":$min:$sec PM"; else return "$hour:$min:$sec"; break; case 4: return "$hour:$min:$sec"; break; case 5: return "$year/$month/$day"; break; case 6: return "$month/$day/$year"; break; case 7: return "$day/$month/$year"; break; } } else { switch ($namedformat) { case 0: return strftime($DefDateFormat." %H:%M:%S", $uts); break; case 1: return strftime("%A, %B %d, %Y", $uts); break; case 2: return strftime($DefDateFormat, $uts); break; case 3: return strftime("%I:%M:%S %p", $uts); break; case 4: return strftime("%H:%M:%S", $uts); break; case 5: return strftime("%Y/%m/%d", $uts); break; case 6: return strftime("%m/%d/%Y", $uts); break; case 7: return strftime("%d/%m/%Y", $uts); break; } } } //--------------------------------------------------------------------------------------------------------- // Convert a date to MySQL format function ConvertDateToMysqlFormat($dateStr) { switch (DEFAULT_DATE_FORMAT) { case "yyyy/mm/dd": list ($year, $month, $day) = split("/", $dateStr); break; case "mm/dd/yyyy": list ($month, $day, $year) = split("/", $dateStr); break; case "dd/mm/yyyy": list ($day, $month, $year) = split("/", $dateStr); break; } return $year . "-" . $month . "-" . $day; } function valid_email ($vemail) { if (eregi ("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $vemail)) return true; else return false; } function send_email ($e_contact,$e_subject,$e_mesaj,$e_name) { $e_headers .= 'MIME-Version: 1.0'."\r\n"; $e_headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n"; $e_headers .= 'To: '.$e_name.' <'.$e_contact.'>'."\r\n"; $e_headers .= 'From: Antitrafic '."\r\n"; $e_headers .= 'X-Priority: 1'."\r\n"; $e_headers .= 'X-MSMail-Priority: High'."\r\n"; $e_headers .= 'X-Mailer: my.domain'."\r\n"; if (mail ($e_contact, $e_subject, $e_mesaj, $e_headers)) return true; else return false; } // --------- search ---------- // function tokenize ($de_tok) { $arr_exp = explode (" ",$de_tok); foreach ($arr_exp as $k_exp => $v_exp) // de aici se seteaza lungimea minima if ( strlen ($v_exp) > 1 ) $arr_mic [$k_exp] = $v_exp; return $arr_mic; } function str_afis ($ffrom,$wwhat) { $afis = ""; $pos = strpos (strtolower ($ffrom),$wwhat); $caut_st = substr ($ffrom,0,$pos); $caut_dr = substr ($ffrom,$pos+strlen($wwhat),strlen($ffrom)); $afis_st = substr ($caut_st,strlen($caut_st)-50,strlen($caut_st)); $afis_dr = substr ($caut_dr,0,50); $afis_st = substr ($afis_st,strpos($afis_st,' '),strlen($afis_st)); $afis_dr = substr ($afis_dr,0,strrpos($afis_dr,' ')); $afis = '...'.$afis_st.''.strtoupper($wwhat).''.$afis_dr.' ...'; return $afis; } function nr_medias ($arr_num,$arr_pan) { $med = 0; foreach ($arr_pan as $k_pan => $v_pan) if ($arr_num[$k_pan]["ap"] != -1 && $arr_num[$k_pan]["len"] != 0 ) $med += $v_pan * ($arr_num[$k_pan]["ap"]/ $arr_num[$k_pan]["len"]); return $med; } function arr_sort ($arr_rs){ $arr_pnd = array (); foreach ($arr_rs as $k_r => $v_r){ $arr_pnd[$k_r] = $v_r["x_pndr"]; } arsort ($arr_pnd); reset ($arr_pnd); return ($arr_pnd); } function arr_write ($arr_rr,$ksrc){ global $q_srch; $conte = ''; $nnr_src = 0; foreach ($arr_rr as $key => $v){ if ( $v["x_pndr"] > 0 ){ $conte_line = ''; $nnr_src ++; $conte .= "
    "; //$link = cms_get_topic_link( $v["x_id"] ); $link = $GLOBALS['sections_dir'].$v['x_page']; ( strstr( $link, "?" )=== false )?$sep = "?":$sep = "&"; $conte .= ""; foreach ($v["x_afis"] as $k_afs => $v_afs){ if ($v_afs){ $conte_line .= "\n
  • ".$v_afs."
  • \n"; } } if ($conte_line){$conte .= "";} $conte .= "\n
    "; } } $arr_conte = array ($nnr_src,$conte); return $arr_conte; } function arr_sort_by_key($array, $key){ $GLOBALS['sort_key'] = $key; function compare($a, $b){ global $sort_key; if ( $a[$sort_key] == $b[$sort_key] ) return 0; return ( $a[$sort_key] > $b[$sort_key] )? -1 : 1; } usort($array, "compare"); $array = array_slice($array, 0, $GLOBALS['search_limit']); unset($GLOBALS['sort_key']); return $array; } if ( !function_exists('redirect') ) { function redirect( $location ) { header("Location: {$location}", true); exit; } } $allowed = array( '1','2','3','4','5','6','7','8','9','0', 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', '.','_','-'); $capitals = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"); $allowed_alfanum = array( '1','2','3','4','5','6','7','8','9','0', 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', '_','-'); $diacritice = array('ă','î','ş','ţ','â','Ă','Î','Ş','Ţ','Â'); $diacritice_replacement = array('a','i','s','t','a','A','I','S','T','A'); function keep_only_allowed_alphanum($txt){ $return = ''; $chars = preg_split('//', $txt, -1, PREG_SPLIT_NO_EMPTY);// creez un sir cu caracterele lui $dirname foreach ($chars as $key => $val){// recompun $dirname eliminand gunoaiele if (in_array($val,$GLOBALS['allowed_alfanum'])){ $return .= $val; } else{ $return .= "-"; } } //$return = str_replace("---","-",$return); //$return = str_replace("--","-",$return); return($return); } $banned_extensions = array("php","php3","php4","php5","inc"); function valid_string($string){// returneaza (a,b), unde a=0 daca nu e valid sau 1 daca e valid, b=caracterele cu probleme global $allowed; $buba = ''; $valid = 1; $string_array = str_split($string); /* echo "
    ";
      print_r ($string_array);
      echo "
    "; */ foreach ($string_array as $key => $val) { if(!(in_array($val,$allowed))){ $buba .= "{$val},"; $valid = $valid*0; } } $return = array($valid,$buba); return $return; } function find_extension ($filename){ $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } function accepted_extension($name){ global $banned_extensions; $ext = find_extension ($name) ; if (in_array($ext,$banned_extensions)){ return 0; } else{ return 1; } } /* functii pentru cms */ function sql_quote( $value ){ if( get_magic_quotes_gpc() ){ $value = stripslashes( $value ); } //check if this function exists if( function_exists( "mysql_real_escape_string" ) ){ $value = mysql_real_escape_string( $value ); } //for PHP version < 4.3.0 use addslashes else{ $value = addslashes( $value ); } return $value; } function get_breadcrumb_geo(){ global $home,$term,$lang,$page_title,$current_url,$geo_path_base; //echo "
    geo_path_base: ".$geo_path_base."
    "; $cale = ""; $path = cms_get_parent($t_id); $path_len = count($path); if (substr($t_id,0,1)==="1"){ $path_len--; } $cale .="\n"; return $cale; } function get_breadcrumb_array($t_id){ global $home, $sections_dir, $lang; $breadcrumb_array = array(); $breadcrumb_array[] = array( 'text' => $home, 'link' => $site_base_url.'index.php' ); $path = cms_get_parent($t_id); $path_len = count($path); if (substr($t_id,0,1)==="1"){ $path_len--; } $cale .="