"a", "Б"=>"b", "В"=>"v", "Г"=>"g", "Д"=>"d", "Е"=>"e", "Ё"=>"yo", "Ж"=>"zh", "З"=>"z", "И"=>"i", "Й"=>"j", "К"=>"k", "Л"=>"l", "М"=>"m", "Н"=>"n", "О"=>"o", "П"=>"p", "Р"=>"r", "С"=>"s", "Т"=>"t", "У"=>"u", "Ф"=>"f", "Х"=>"kh", "Ц"=>"ts", "Ч"=>"ch", "Ш"=>"sh", "Щ"=>"sch", "Ъ"=>"", "Ы"=>"y", "Ь"=>"", "Э"=>"e", "Ю"=>"yu", "Я"=>"ya", "а"=>"a", "б"=>"b", "в"=>"v", "г"=>"g", "д"=>"d", "е"=>"e", "ё"=>"yo", "ж"=>"zh", "з"=>"z", "и"=>"i", "й"=>"j", "к"=>"k", "л"=>"l", "м"=>"m", "н"=>"n", "о"=>"o", "п"=>"p", "р"=>"r", "с"=>"s", "т"=>"t", "у"=>"u", "ф"=>"f", "х"=>"kh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh", "щ"=>"sch", "ъ"=>"", "ы"=>"y", "ь"=>"", "э"=>"e", "ю"=>"yu", "я"=>"ya", "ß"=>"ss", "ţ"=>"t", "ľ"=>"l", "ľ"=>"l", ","=>"", ";"=>"", "!"=>"", "%"=>"", "#"=>"", "$"=>"", "&"=>"", "?"=>"", "."=>"", "="=>"", "/"=>"", ":"=>"", "+"=>"", "–"=>"", "("=>"", ")"=>"", "["=>"", "]"=>"", "{"=>"", "}"=>"", "’"=>"", "'"=>"", "\""=>"", "”"=>"", "„"=>"", "°"=>"" ); return strtr($str,$tr); } function coolURI($string, $separator = '') { if ($separator=='') { $separator = '-'; } if (StrLen($separator)>1) { $separator = $separator[0]; } $string = cyrilic2lat($string); $sChar = array('/ą/', '/ż/', '/ź/', '/ę/', '/ć/', '/ń/', '/ó/', '/ł/', '/ś/', '/Ą/', '/Ż/', '/Ź/', '/Ę/', '/Ć/', '/Ń/', '/Ó/', '/Ł/', '/Ś/'); $dChar = array('a', 'z', 'z', 'e', 'c', 'n', 'o', 'l', 's', 'A', 'Z', 'Z', 'E', 'C', 'N', 'O', 'L', 'S'); $string = preg_replace( $sChar, $dChar, $string ); $string = strip_tags(html_entity_decode(trim($string))); $string = iconv("UTF-8","windows-1250"."//TRANSLIT",$string); $cString1 ="\xc1\xc9\xcd\xd3\xda\xdd\xe1\xe9\xed\xf3\xfa\xfd\xc2\xca\xce\xd4\xdb\xe2\xea\xee\xf4\xfb\xc0\xc8\xcc\xd2\xd9\xe0\xe8\xec\xf2\xf9\xc4\xcb\xcf\xd6\xdc\xe4\xeb\xef\xf6\xfc\xc3\xe3\xd5\xf5\xc5\xe5\xd1\xf1\xc7\xe7\xba\xaa\x8e\x9e\x9d\x8d\xd8\xf8\x8a\x9a"; $cString2 = 'AEIOUYaeiouyAEIOUaeiouACENUrcenuAEIOUaedouAaOoLlNnCcsSZztTRrSs'; $string = strtr($string , $cString1, $cString2); $string = StrTr($string, ' ', $separator); $string = StrTr($string, $cString1, $cString2); $string = StrToLower($string); return urlencode($string); } function coolCode($string) { $string = cyrilic2lat($string); $string = strip_tags(html_entity_decode(trim($string))); $string = iconv("UTF-8","windows-1250"."//TRANSLIT",$string); $sChar = array('/ą/', '/ż/', '/ź/', '/ę/', '/ć/', '/ń/', '/ó/', '/ł/', '/ś/', '/Ą/', '/Ż/', '/Ź/', '/Ę/', '/Ć/', '/Ń/', '/Ó/', '/Ł/', '/Ś/'); $dChar = array('a', 'z', 'z', 'e', 'c', 'n', 'o', 'l', 's', 'A', 'Z', 'Z', 'E', 'C', 'N', 'O', 'L', 'S'); $string = preg_replace( $sChar, $dChar, $string ); $cString1 ="\xc1\xc9\xcd\xd3\xda\xdd\xe1\xe9\xed\xf3\xfa\xfd\xc2\xca\xce\xd4\xdb\xe2\xea\xee\xf4\xfb\xc0\xc8\xcc\xd2\xd9\xe0\xe8\xec\xf2\xf9\xc4\xcb\xcf\xd6\xdc\xe4\xeb\xef\xf6\xfc\xc3\xe3\xd5\xf5\xc5\xe5\xd1\xf1\xc7\xe7\xba\xaa\x8e\x9e\x9d\x8d\xd8\xf8\x8a\x9a"; $cString2 = 'AEIOUYaeiouyAEIOUaeiouACENUrcenuAEIOUaedouAaOoLlNnCcsSZztTRrSs'; $text = strtr($text , $cString1, $cString2); $string = StrTr($string, ' ', ''); $string = StrTr($string, $cString1, $cString2); $string = StrToLower($string); return $string; } function getYoutubeCode($url) { $exist = strpos($url, "="); $exist1 = strpos($url, "youtube"); if((!$exist) or (!$exist1)){ $error="1"; return $error; } else{ $similar = strstr($url, "youtube.com"); $exp = explode("=", $similar); $code = trim($exp[1]); return $code; } } function comboWorldStates($country_id = 0) { global $webSetting; $query = "select countries.country_id as country_id, countries.code as code, countries_data.title as title from (countries, countries_data) where (countries.country_id=countries_data.country_id) and (countries_data.lang_id=".$webSetting["lang_id"].") and (countries.publish='1') order by countries.code asc"; @$result = mysql_query($query); $str = ''; while ($res = mysql_fetch_array($result)) { $str .= ''; } else { $str .= ''; } comboPagesPath($page_id, $parent_id, $pages_category_id, $res["page_id"], $currentPath); } return $str; } function comboPagesMap($page_id, $virtual_id, $parentID, $path, $pageType) { global $str; global $adminSetting; if ($parentID=='O') { $str = ''; } $query = "select pages.page_id as page_id, pages.pages_category_id as pages_category_id, pages.publish as publish, pages.date_created as date_created, pages.order_no as order_no, pages_data.title as title, pages_category.order_no as pages_order_no, pages_category_data.title as pages_category_title from (pages, pages_data, pages_category, pages_category_data) where (pages.parent_id='$parentID') and (pages.page_id<>$page_id) and (pages_category.pages_category_id=pages.pages_category_id) and (pages_category.pages_category_id=pages_category_data.pages_category_id) and (pages_category_data.lang_id='".$adminSetting["default_lang"]."') and (pages_data.lang_id='".$adminSetting["default_lang"]."') and (pages.page_id=pages_data.page_id)"; if ($pageType=='real') { $query .= " and (pages.virtual_page=0)"; } elseif ($pageType=='virtual') { $query .= " and (pages.virtual_page>0)"; } $query .= "order by pages_category.order_no, pages.order_no asc, pages_data.title asc"; // echo ($query); $result = mysql_query($query); while($res = mysql_fetch_array($result)) { $currentPath = $path; if ($currentPath!='') { $currentPath .= ' > '; } else { $currentPath = $res["pages_category_title"].' > '; } $currentPath .= $res["title"]; if($res["page_id"] == $virtual_id) { $str .= ''; } else { $str .= ''; } comboPagesMap($page_id, $virtual_id, $res["page_id"], $currentPath, $pageType); } return $str; } function comboSetRelatedPages($page_id, $relatedPages, $parentID, $path, $pageType) { global $str; global $adminSetting; if ($parentID=='O') { $str = ''; } $query = "select pages.page_id as page_id, pages.pages_category_id as pages_category_id, pages.publish as publish, pages.date_created as date_created, pages.order_no as order_no, pages_data.title as title, pages_category.order_no as pages_order_no, pages_category_data.title as pages_category_title from (pages, pages_data, pages_category, pages_category_data) where (pages.parent_id='$parentID') and (pages.page_id<>$page_id) and (pages.page_id not in ($relatedPages)) and (pages_category.pages_category_id=pages.pages_category_id) and (pages_category.pages_category_id=pages_category_data.pages_category_id) and (pages_category_data.lang_id='".$adminSetting["default_lang"]."') and (pages_data.lang_id='".$adminSetting["default_lang"]."') and (pages.page_id=pages_data.page_id)"; if ($pageType=='real') { $query .= " and (pages.virtual_page=0)"; } elseif ($pageType=='virtual') { $query .= " and (pages.virtual_page>0)"; } $query .= "order by pages_category.order_no, pages.order_no asc, pages_data.title asc"; // echo ($query); $result = mysql_query($query); while($res = mysql_fetch_array($result)) { $currentPath = $path; if ($currentPath!='') { $currentPath .= ' > '; } else { $currentPath = $res["pages_category_title"].' > '; } $currentPath .= $res["title"]; $str .= ''; comboSetRelatedPages($page_id, $relatedPages, $res["page_id"], $currentPath, $pageType); } return $str; } function comboPagesCategory($pages_category_id) { global $adminSetting; $query = "select pages_category.pages_category_id as pages_category_id, pages_category.order_no as order_no, pages_category_data.title as title from (pages_category, pages_category_data) where (pages_category_data.lang_id='".$adminSetting["default_lang"]."') and (pages_category.pages_category_id=pages_category_data.pages_category_id) order by order_no asc"; @$result = mysql_query($query); while ($res = mysql_fetch_array($result)) { $str .= ''; } else { $str .= ''; } comboCatalogueCategoryPath($catalogue_category_id, $parent_id, $res["catalogue_category_id"], $currentPath); } return $str; } function catalogueCategoryFullTitlePath($catalogue_category_id, $lang_id) { global $currentTitlePath; $query = "select catalogue_category.catalogue_category_id as catalogue_category_id, catalogue_category.parent_id as parent_id, catalogue_category_data.title as title from (catalogue_category, catalogue_category_data) where (catalogue_category.catalogue_category_id=$catalogue_category_id) and (catalogue_category_data.lang_id='$lang_id') and (catalogue_category.catalogue_category_id=catalogue_category_data.catalogue_category_id)"; $result = mysql_query($query); $res = mysql_fetch_array($result); if (trim($res["title"])!='') { if ($currentTitlePath!='') { $currentTitlePath = ' > '.$currentTitlePath; } $currentTitlePath = trim($res["title"]).$currentTitlePath; } if ($res["parent_id"]>0) { catalogueCategoryFullTitlePath($res["parent_id"], $lang_id); } return $currentTitlePath; } function catalogueCategoryFullPath($catalogue_category_id, $lang_id) { global $currentPath; $query = "select catalogue_category.catalogue_category_id as catalogue_category_id, catalogue_category.parent_id as parent_id, catalogue_category_data.title as title from (catalogue_category, catalogue_category_data) where (catalogue_category.catalogue_category_id=$catalogue_category_id) and (catalogue_category_data.lang_id='$lang_id') and (catalogue_category.catalogue_category_id=catalogue_category_data.catalogue_category_id)"; $result = mysql_query($query); $res = mysql_fetch_array($result); if (trim($res["title"])!='') { if ($currentPath!='') { $currentPath = '/'.$currentPath; } $currentPath = trim(coolURI($res["title"], '-')).$currentPath; } if ($res["parent_id"]>0) { catalogueCategoryFullPath($res["parent_id"], $lang_id); } return $currentPath; } function catalogueCategoryPath($catalogue_category_id, $parentID, $path) { global $str; global $adminSetting; global $b; if ($parentID=='O') { $str = ''; } $query = "select catalogue_category.catalogue_category_id as catalogue_category_id, catalogue_category.publish as publish, catalogue_category.date_created as date_created, catalogue_category.order_no as order_no, catalogue_category.code as code, catalogue_category_data.title as title from (catalogue_category, catalogue_category_data) where (catalogue_category.parent_id='$parentID') and (catalogue_category_data.lang_id='".$adminSetting["default_lang"]."') and (catalogue_category.catalogue_category_id=catalogue_category_data.catalogue_category_id) order by catalogue_category.order_no asc, catalogue_category_data.title asc"; $result = mysql_query($query); while($res = mysql_fetch_array($result)) { $currentPath = $path; if ($currentPath!='') { $currentPath .= ' > '; } $currentPath .= $res["title"]; if ($b == 1) { $b = 2; } else { $b = 1; } $str .= ' 0) { $str .= ' checked'; } $str .= ' /> '.$res["code"].' '.$currentPath.' '.$res["title"].' '; if ($res["order_no"]>0) { $str .= ''.$res["order_no"].''; } $str .= ' '; catalogueCategoryPath($catalogue_category_id, $res["catalogue_category_id"], $currentPath); } return $str; } function catalogueProductCategoryRelations($catalogue_category_id, $parentID, $path) { global $str; global $adminSetting; global $catalogueProductCategoryRelation; if ($parentID=='O') { $str = ''; $treeCount = 0; } $query = "select catalogue_category.catalogue_category_id as catalogue_category_id, catalogue_category.publish as publish, catalogue_category.date_created as date_created, catalogue_category.order_no as order_no, catalogue_category_data.title as title from (catalogue_category, catalogue_category_data) where (catalogue_category.parent_id='$parentID') and (catalogue_category_data.lang_id='".$adminSetting["default_lang"]."') and (catalogue_category.catalogue_category_id=catalogue_category_data.catalogue_category_id) order by catalogue_category.order_no asc, catalogue_category_data.title asc"; $result = mysql_query($query); if (mysql_num_rows($result)>0) { $str .= ' '; } return $str; } function comboSetRelatedCatalogueProducts($catalogue_product_id, $relatedProducts) { global $adminSetting; $query = "select catalogue_products.catalogue_product_id as catalogue_product_id, catalogue_products.publish as publish, catalogue_products.order_no as order_no, catalogue_products.code as code, catalogue_products.price_1 as price_1, catalogue_products.price_2 as price_2, catalogue_products.catalogue_brand_id as catalogue_brand_id, catalogue_brands_data.title as catalogue_brand_title, catalogue_products_data.title as title from (catalogue_products, catalogue_products_data) left join catalogue_brands on (catalogue_products.catalogue_brand_id=catalogue_brands.catalogue_brand_id) left join catalogue_brands_data on (catalogue_brands_data.lang_id='".$adminSetting["default_lang"]."') and (catalogue_brands.catalogue_brand_id=catalogue_brands_data.catalogue_brand_id) where (catalogue_products.catalogue_product_id not in ($relatedProducts)) and (catalogue_products_data.lang_id='".$adminSetting["default_lang"]."') and (catalogue_products.catalogue_product_id=catalogue_products_data.catalogue_product_id) order by order_no asc, title asc"; $result = mysql_query($query); while($res = mysql_fetch_array($result)) { $thisProductTitle = trim($res["catalogue_brand_title"].' '.$res["title"]); if ($res["code"]!='') { $thisProductTitle = '['.$res["code"].'] '.$thisProductTitle; } $str .= ''; } return $str; } function comboWorldStatesRegion($country_id, $state_region_id) { global $adminSetting; $query = "select * from countries_regions where (country_id='$country_id') and (publish='1') order by order_no asc"; @$result = mysql_query($query); while ($res = mysql_fetch_array($result)) { $str .= '