template_dir = '/templates/'; $smarty->compile_dir = 'templates_c/'; $smarty->config_dir = '/configs/'; $smarty->cache_dir = '/cache/'; //** раскомментируйте следующую строку для отображения отладочной консоли //$smarty->debugging = true; error_reporting(0); //error_reporting(E_ALL); $domain="fonts.radio-electronics.co"; $url=""; if (array_key_exists('REQUEST_URI', $_SERVER)) { $url=split("/", $_SERVER["REQUEST_URI"]); for($i=0;$igetMessage(); } //$prefix="http://www.safehost.biz/~chipfind/datasheets/"; //$short_prefix="/~chipfind/datasheets/"; if($url[1]=="find"){ if($url[2]) { if ($url[2]<>'0-9'){ $searchstring=preg_replace("/[\s\-\+\.\,\(\)\<\>\[\]\!\@\#\$\%\^\&\*\/]/", '', trim(addslashes($url[2]))); /* $query="INSERT INTO search_stat SET keyword='".$searchstring."', time='".time()."', ip='".$_SERVER["REMOTE_ADDR"]."', site='prices', page='search'"; $result=$db->query($query); */ //Делаем пагинацию и запрос на выборку с пагинацией $query="SELECT COUNT(id) FROM fonts WHERE name LIKE '".$searchstring."%' GROUP BY name"; } else { $searchstring='0-9'; //Делаем пагинацию и запрос на выборку с пагинацией $query="SELECT COUNT( id ) FROM fonts WHERE name REGEXP '^[0-9#@&]' GROUP BY name"; } $title="Free fonts search and download. Fonts begins from ".$searchstring." - free fonts download. Preview fonts, fonts examples. Archive of freely downloadable fonts."; $keywords=$searchstring.", fonts, search, online, free, download"; $describe="Archive of freely downloadable fonts. Download free fonts from our site! No login, no pay."; $result=$db->query($query); $row=$result->fetchAll(); $row[0]=count($row); if($row[0]>50) //Если результатов больше 50 { //if(is_int($url[3])) { $page_c=$url[3]; //} else {$page_c=1;} //echo($page_c); if(!$page_c){ $page_c=1; } if(!is_numeric($page_c)){ $page_c=1; } $pages_count=(int)($row[0]/50); if(($row[0]/50-$pages_count)>0) ++$pages_count; if($pages_count<=5) { for($i=1;$i<=$pages_count;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.=$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } else { if($page_c<5){ for($i=1;$i<=5;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.=$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } elseif($page_c>$pages_count-5){ for($i=$pages_count-4;$i<=$pages_count;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.=$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } else { for($i=$page_c-2;$i<=$page_c+2;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.=$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } } if ($url[2]<>'0-9'){ $query="SELECT id, name, file_id FROM fonts WHERE name LIKE '".$searchstring."%' GROUP BY name LIMIT ".(($page_c-1)*50).", 50"; } else { $query="SELECT id, name, file_id FROM fonts WHERE name REGEXP '^[0-9#@&]' GROUP BY name LIMIT ".(($page_c-1)*50).", 50"; } } else { if ($url[2]<>'0-9') { $query="SELECT id, name, file_id FROM fonts WHERE name LIKE '".$searchstring."%' GROUP BY name ORDER BY id"; } else { $query="SELECT id, name, file_id FROM fonts WHERE name REGEXP '^[0-9#@&]' GROUP BY name ORDER BY id"; } } //закончилась пагинация и создание запроса с пагинацией $result=$db->query($query); $content.=""; $count=0; $count1=0; while($row=$result->fetch()) { //print_r($row); ++$count1; if($count) { --$count; $bg="bgcolor='#ffffff'"; } else { ++$count; $bg="bgcolor='#eeeeee'"; } $content.=""; if(($count1==5)||($count1==35)){ $content.=" "; } else { $content.=""; } } $content.="
Font NamePreview
".$row[1]." (download font)
Preview of ".$row[1]." fontPreview of ".$row[1]." font
"; } else { $content.="Empty search string!"; } if (array_key_exists("HTTP_REFERER", $_SERVER)) $content.="Back
"; $content.="Return to main page"; } elseif($url[1]=="search"){ if(array_key_exists("partnumber", $_REQUEST)||$url[2]) { if(array_key_exists("partnumber", $_REQUEST)) { $searchstring=preg_replace("/[\s\-\+\.\,\(\)\<\>\[\]\!\@\#\$\%\^\&\*\/]/", '', trim(addslashes($_REQUEST["partnumber"]))); } else { $searchstring=preg_replace("/[\s\-\+\.\,\(\)\<\>\[\]\!\@\#\$\%\^\&\*\/]/", '', trim(addslashes($url[2]))); } $query="INSERT INTO search_stat SET keyword='".$searchstring."', time='".time()."', ip='".$_SERVER["REMOTE_ADDR"]."', site='prices', page='search'"; $result=$db->query($query); //?????? ????????? ? ?????? ?? ??????? ? ?????????? $query="SELECT COUNT(id) FROM comps WHERE s_name LIKE '".$searchstring."%'"; $result=$db->query($query); $row=$result->fetch(); if($row[0]>50) //???? ??????????? ?????? 50 { //if(is_int($url[3])) { if(array_key_exists(3, $url)){ $page_c=$url[3]; } //} else {$page_c=1;} //echo($page_c); if(!$page_c){ $page_c=1; } if(!is_numeric($page_c)){ $page_c=1; } $pages_count=(int)($row[0]/50); if(($row[0]/50-$pages_count)>0) ++$pages_count; if($pages_count<=5) { for($i=1;$i<=$pages_count;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.=$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } else { if($page_c<5){ for($i=1;$i<=5;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.=$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } elseif($page_c>$pages_count-5){ for($i=$pages_count-4;$i<=$pages_count;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.=$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } else { for($i=$page_c-2;$i<=$page_c+2;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.=$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } } $query="SELECT id, name, s_name FROM comps WHERE s_name LIKE '".$searchstring."%' LIMIT ".(($page_c-1)*50).", 50 "; } else { $query="SELECT id, name, s_name FROM comps WHERE s_name LIKE '".$searchstring."%'"; } //??????????? ????????? ? ???????? ??????? ? ?????????? $result=$db->query($query); $content.=""; $count=0; $count1=0; while($row=$result->fetch()) { ++$count1; if($count) { --$count; $bg="bgcolor='#ffffff'"; } else { ++$count; $bg="bgcolor='#eeeeee'"; } $query1="SELECT COUNT(id) FROM pricelist WHERE comp_id=".$row['id']; $result1=$db->query($query1); $row1=$result1->fetch(); if ($row1[0]>0) { $content.=""; //$content.=""; if($count1==5){ $content.=" "; } else { $content.=''; } } else { $content.=""; if($count1==5){ $content.=" "; } else { $content.=""; } } } $content.="
Part NamePricelist Search Results
".$row[1]." (see datasheet)
".$row[1]." Prices and suppliers for ".$row[1]." - see ".$row1[0]." resultsPrices and suppliers for '.$row[1].' - see '.$row1[0].' results
".$row[1]." (see datasheet)
Prices for ".$row[1]." - global searchPrices for ".$row[1]." - global search
"; } else { $content.="Empty search string!"; } if (array_key_exists("HTTP_REFERER", $_SERVER)) $content.="Back
"; $content.="Return to main page"; } elseif($url[1]=="download"){ $font_name=$url[2]; unset($font_id); $font_id=(int) addslashes(stripslashes(htmlspecialchars($url[3]))); $title="Download ".$font_name." right now! Cool fonts for windows and macintosh. Fonts examples. Free download some fonts."; $keywords="fonts, ".$font_name.", free fonts, download fonts, search font, preview font."; $describe="Download ".$font_name." right now! Search free fonts in largest free fonts collection on the web. Free fonts search."; $order_id=mt_rand(); $content.="

Download ".$font_name." font

For the order of font ".$font_name.", it is necessary for you to pay back 1 US dollar via LiqPay service.
It's not a font price - it is payment for our filestore.
You will be asked about your mobile phone number - it is for your security. You will be receive free SMS with password for access. Then you'll complete payment - link to the file will be shown.

"; $query="INSERT INTO fonts_orders SET id=".$order_id.", font_id=".$font_id.", date=".time().", useragent='".$_SERVER['HTTP_USER_AGENT']."'"; $result=$db->query($query); } elseif($url[1]=="payment"){ if($_REQUEST['status']=="failure"){ $content.="

Your payment was failed.
"; } elseif($_REQUEST['status']=="success"){ $content.="

Your payment was succefull!
Your link for download: http://".$domain."/download.php?id=".$_POST['order_id'].".
"; } elseif($_REQUEST['status']=="wait_secure") { $content.="Your payment is checking now! After this, your link for download: http://".$domain."/download.php?id=".$_POST['order_id'].". Checking of payment can continue up to 2 hour, try download file later!"; } else { $content.="

Error. Try again.
"; } } elseif($url[1]=="font"){ if($url[2]) { $query="SELECT * FROM fonts WHERE name='".urldecode($url[2])."'"; $result=$db->query($query); $row=$result->fetchAll(); //print_r($row); $content.="

".urldecode($url[2])." FREE Font download. ".urldecode($url[2])." - page with downloadable free font.

".count($row); count($row)>1 ? $content.=" results " : $content.=" result "; $content.="found for font \"".urldecode($url[2])."\"

font ".urldecode($url[2])." example, font ".urldecode($url[2])." preview
"; prev($row); foreach($row as $key){ //print_r($key); $content.=""; $content.=""; $content.=""; $content.=""; $content.=""; $content.=""; $content.=""; $content.=""; $content.=""; $content.=""; $content.="
Name:".$key[1]."
Type:".$key[2]."
Version:".$key[4]."
Author:".$key[5]."
Copyright:".$key[3]."
Created:".$key[8]."
Describe:".$key[6]." ".$key[7]."
Lang id:".$key[10]."
Download file:Download \"".urldecode($url[2])."\" font free now


"; } $title=urldecode($url[2])." font download free. Preview font ".urldecode($url[2])." - font example. Archive of freely downloadable fonts."; $keywords=urldecode($url[2]).", font, ".urldecode($url[2])." font, fonts, preview font, font example, free fonts, download fonts, search font, preview font."; $describe="Archive of freely downloadable fonts. Here you can FREE download ".urldecode($url[2])." font. Preview font, font example. Free fonts search and download."; } else { $content.="Bad font name!"; } } else { $content.=""; $content.=""; $content.=""; $content.="

Free fonts download

Our free fonts collection is exists since march 2003 and has since grown to become the most popular free fonts archive online. We receive more than 50,000 visitors daily and we have been visited by over 60,000,000 visitors since 2003. Over 1,000,000,000 free fonts have been downloaded since 2003. We would like to thank you all for your continued support and hope you return shortly.

High quality signature fonts.

Signature fonts can save you time and improve office efficiency and productivity. We will convert your signature and initials into a signature font for use in documents and online faxes. When you place your order we will convert your signature into a TrueType font which can be accessed just like any other font installed on your system. You simply select your signature font from the font menu like other installed fonts. Signature fonts add personality and a professional touch to any document, plus you can easily change the size and color of your signature font. Signature fonts are perfect for signing letters, documents, faxes, checks, mass mailings and for initialing memos. Signature fonts are compatible with all version of Windows, Windows 95, 98, ME, XP, 2000, 2003, and NT and will work with any Windows based text or graphics program which allows you access to the font menu such as MS Word, MS Works, MS Word Pad, WinFax Pro, WordPerfect and many more. For the low price of $7.77 we will convert your signature and initials into a scalable TrueType font.
"; include("alph.php"); /*
Complete list of fonts: 0-9 # @ & "; $array="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for($i=0;$i".$array[$i]." "; } */ $content.="
"; /* if($url[1]<>'') { $page=$url[1]; } else { $page=1; } $query=" SELECT name FROM `fonts` WHERE name<>'' GROUP BY file_id ORDER BY name LIMIT ".(($page-1)*100)." , 100"; $content.=''; $result=$db->query($query); while($row=$result->fetch()){ ++$count; if($count==1) $content.=""; $content.=""; if($count==10) { $content.=""; $count=0; } } $content.='
".$row['name']."
'; */ } if(!isset($template)) $template='index.tpl'; // используемый шаблон //эти метатеги могут произвести другие модули, например, каталог, тогда они "важнее", чем дефолтные //передаем разные элементы содержания в смарти $smarty->assign('content', $content); $smarty->assign('title', $title); $smarty->assign('keywords', $keywords); $smarty->assign('describe', $describe); $smarty->assign('domain', $domain); $smarty->display($template); ?>