Powered by Mobilelib Gold v2 Copyright © ac4p.com 2005.

\n"; $html=getthemeM("show.tpl"); function getthemeM($file) { global $themes; $templat="templates/$themes/$file"; $tempindex=@fopen($templat,"r"); if (!$tempindex) { $html ="

لم يستطع إيجاد ملف القالب.

"; } $html = @fread($tempindex,filesize($templat)); @fclose ($tempindex); return $html; } function getTemplate($tpl, $html){ $match="/<\!\-\-$tpl\-\->(.*?)<\!\-\-$tpl\-\->/s"; preg_match($match, $html, $tmp); return $tmp[1]; } $html=eregi_replace("{marquee}","$Newnews",$html); function newsscats($cid) { global $smsdbhost,$smsdbuname,$smsdbpass,$smsdbname,$htmllink,$cname; $dbconnect=@mysql_connect($smsdbhost,$smsdbuname,$smsdbpass); $dd=@mysql_select_db($smsdbname,$dbconnect); $scats = @mysql_query("SELECT * FROM ac4p_news_category WHERE scat='$cid'"); $cal3dd= mysql_num_rows($scats); if($cal3dd>0) { $ascats .="
أقسام فرعية"; $count=0; while($row = @mysql_fetch_array($scats)) { $count++; extract($row); $cname=$rows[cname]; global $cname; if($count==1) { $ascats .=""; } $msgs = @mysql_query("SELECT * from ac4pcom_news WHERE cid='$cid'"); $al3dd=@mysql_num_rows($msgs); $catpic=str_replace("../","./",$catpic); if($htmllink==on) { $xzckl="articles-".$row[cid].".html"; } else { $xzckl="artcat.php?cid=$row[cid]"; } $ascats .="\n"; if($count==3) { $ascats .=""; $count=0; } } $ascats .="
\"$row[cname]\"
$row[cname]
عدد المقالات ($al3dd)
\n"; } else { $ascats=""; } return $ascats; } if($_GET['cid']) { $cid = intval( $_GET['cid'] ); $cid = preg_replace("/'\/<>\"/","",$_GET['cid']); $cid=strip_tags($cid); if(!isset($start)){$start = 0;} else{$start = intval( $_GET['start'] );} $page = intval( $_GET['page'] ); $Page = new Pager($start,$page); if(!$perpage) { $perpage='30'; } $dbconnect=mysql_connect($smsdbhost,$smsdbuname,$smsdbpass); $dd=mysql_select_db($smsdbname,$dbconnect); $cats = mysql_query("SELECT * from ac4p_news_category WHERE cid='$cid' "); $rows = mysql_fetch_array($cats); if($rows[scat]>0) { $ascats = @mysql_query("SELECT * FROM ac4p_news_category WHERE cid='$rows[scat]'"); $arow = @mysql_fetch_array($ascats); if($htmllink==on) { $bmxzckl="articles-".$arow[cid].".html"; } else { $bmxzckl="artcat.php?cid=$arow[cid]"; } $acatlinkss=" » $arow[cname]"; } $catname=$rows[cname]; $catpic=$rows[catpic]; $main .=newsscats($cid); $catpic=str_replace("../","./",$catpic); @mysql_free_result($cats); $dbconnect=mysql_connect($smsdbhost,$smsdbuname,$smsdbpass); $dd=mysql_select_db($smsdbname,$dbconnect); $sounds=mysql_query("SELECT * from ac4pcom_news WHERE cid='$cid' order by nid desc limit $start,$perpage"); $page_result = mysql_query("SELECT * FROM ac4pcom_news WHERE cid='$cid'"); $al3dd=mysql_num_rows($page_result); if($al3dd>0) { $Page->SetPagerN($perpage,mysql_num_rows($page_result)); $pagenav = $Page->PageNum(); if($htmllink==on) { $mxzckl="articles-".$cid.".html"; $ndec="indexart.html"; } else { $mxzckl="artcat.php?cid=$cid"; $ndec="index.php?cat=art"; } $main .= "

\"$catname\"

\n\n"; $main .= " \n\n"; $main .= " \n\n"; $main .= " \n\n"; $main .= "
المقالات $acatlinkss  »  $catname
\n\n"; $main .= "
\n"; $main .= "
\n"; $thtml=getthemeM("archiv.tpl"); $Hnews=getTemplate("Hnews","$thtml"); $main .="$Hnews\n"; while($newsrow = mysql_fetch_array($sounds)) { //extract($row); if($htmllink==on) { $nxzckl="viewArt-".$newsrow[nid].".html"; } else { $nxzckl="show.php?cat=news&id=$newsrow[nid]"; } $news=getTemplate("news","$thtml"); $news=eregi_replace("{title}","$newsrow[title]",$news); $news=eregi_replace("{date}","$newsrow[date]",$news); $news=eregi_replace("{hits}","$newsrow[visit]",$news); if(!$newsrow[name]) { $newsrow[name]="مدير الموقع"; } $news=eregi_replace("{name}","$newsrow[name]",$news); $main .="$news\n"; } $main .= "
$pagenav

\n"; if(!$catname) {$catname=$cname;} $html=eregi_replace("{hedtitle}","$catname",$html); $html=eregi_replace("{block}","$Bloks",$html); $html=eregi_replace("{main}","$main",$html); print $html; @mysql_free_result($sounds); mysql_close($dbconnect); } else { $html=eregi_replace("{hedtitle}","$row[1]",$html); $html=eregi_replace("{block}","$Bloks",$html); $html=eregi_replace("{main}","$main",$html); print $html; mysql_close($dbconnect); } } ?>