<?php
function text($type,$text)
{

if($type==1){

if (!get_magic_quotes_gpc()) {
$text = addslashes($text);
}
$text = trim($text);
return $text;

}elseif($type==2){

$text = stripslashes($text);
$text = trim($text);
return $text;
}elseif($type==3){
$text = stripslashes($text);
$text = str_replace("&lt;","<",$text);
$text = str_replace("&gt;",">",$text);
$text = str_replace("&#092;","\\",$text);
$text = str_replace("&#39;","'",$text);
$text = str_replace("&#33;","!",$text);
$text = str_replace("&#036;","$",$text);
$text = str_replace("&#124;","|",$text);
$text = str_replace("&amp;","&",$text);
$text = str_replace('&quot;','"',$text);
$text = str_replace("&#153;","(tm)",$text);
$text = str_replace("&nbsp;"," ",$text);
$text2 = htmlspecialchars($text);
return $text2;
}
}

$sql = @mysql_query("SELECT * FROM opitions where id=1") or die ("Query failed");
$opitions = @mysql_fetch_array($sql);

$name_site            = text(3,$opitions['name_site']);
$name_script          = text(3,$opitions['name_script']);
$name_url             = text(3,$opitions['name_url']);
$name_path            = text(3,$opitions['name_path']);
$add_threads          = $opitions['add_threads'];
$name_email           = text(3,$opitions['name_email']);
$num_news             = $opitions['num_news'];
$table_news           = $opitions['table_news'];
$adsloop              = $opitions['num_photo'];
$htmlorphp            = $opitions['htmlorphp'];
$archivethreadsnumber = $opitions['archivethreadsnumber'];
$aldleel_catsloop     = $opitions['aldleel_catsloop'];
$aldleel_sitesloop    = $opitions['aldleel_sitesloop'];
$fatawa_catsloop      = $opitions['fatawa_catsloop'];
$fatawa_loop          = $opitions['fatawa_loop'];
$signatures_catsloop  = $opitions['signatures_catsloop'];
$signatures_loop      = $opitions['signatures_loop'];
$flash_catsloop       = $opitions['flash_catsloop'];
$flash_loop           = $opitions['flash_loop'];
$anasheed_catsloop    = $opitions['anasheed_catsloop'];
$anasheeds_loop       = $opitions['anasheeds_loop'];
$sjl_loop             = $opitions['sjl_loop'];
$idpool               = $opitions['idpool'];
$telawat_catsloop     = $opitions['telawat_catsloop'];
$threadsloop          = $opitions['threadsloop'];
$catsloop             = $opitions['catsloop'];
$limit_telawat        = $opitions['limit_telawat'];
$limit_anasheed       = $opitions['limit_anasheed'];
$limit_mhadrat        = $opitions['limit_mhadrat'];
$mhadrat_catsloop     = $opitions['mhadrat_catsloop'];
$booksloop            = $opitions['booksloop'];
$booksviewloop        = $opitions['booksviewloop'];
$copyrights           = text(2,$opitions['copyrights']);
$limited = $opitions['limited'];
/*
if(isset($_COOKIE['stylepath'])){
$checks = file_exists($_COOKIE['stylepath']);
if(!$checks){
$folder = $opitions['folder'];
}else{
$folder = $_COOKIE['stylepath'];
}
}else{
$folder = $opitions['folder'];
}
*/

$folder = text(3,$opitions['folder']);

function stylepages($folderstyle)
{
global $folder;
if(file_exists(text(3,$folderstyle)) AND $folderstyle != ""){
$text = text(3,$folderstyle);
}else{
$text = $folder;
}
return $text;
}

$foldernews = stylepages($opitions['foldernews']);
$folderquran = stylepages($opitions['folderquran']);
$foldersound = stylepages($opitions['foldersound']);
$folderfatawa = stylepages($opitions['folderfatawa']);
$folderbook = stylepages($opitions['folderbook']);
$folderanashed = stylepages($opitions['folderanashed']);
$foldersignatures = stylepages($opitions['foldersignatures']);
$folderlinks = stylepages($opitions['folderlinks']);
$folderstory = stylepages($opitions['folderstory']);
$folderdownload = stylepages($opitions['folderdownload']);
$folderflash = stylepages($opitions['folderflash']);
$foldergeustbook = stylepages($opitions['foldergeustbook']);
$folderyoutube = stylepages($opitions['folderyoutube']);

$foldervideo = stylepages($opitions['foldervideo']);
$foldertext = stylepages($opitions['foldertext']);

$menustyle = $opitions['menustyle'];

$textheader = text(2,$opitions['textheader']);
$textfooter = text(2,$opitions['textfooter']);
$textclose = text(2,$opitions['textclose']);
$closesite = intval($opitions['closesite']);
$activeguestbook = $opitions['activeguestbook'];
$youtube_catsloop = $opitions['youtube_catsloop'];
$youtube_vidloop = $opitions['youtube_vidloop'];
$youtube_limit = $opitions['youtube_limit'];
$youtube_catsmenu = $opitions['youtube_catsmenu'];
$keywords = text(3,$opitions['keywords']);
$description = text(3,$opitions['description']);
$story_catsloop = $opitions['story_catsloop'];
$limitmenu_story = $opitions['limitmenu_story'];
$limit_story = $opitions['limit_story'];
$download_catsloop = $opitions['download_catsloop'];
$limitmenu_download = $opitions['limitmenu_download'];
$limit_download = $opitions['limit_download'];
$limitmenu_news = $opitions['limitmenu_news'];
$limitmenu_fatawa = $opitions['limitmenu_fatawa'];
$limitmenu_book = $opitions['limitmenu_book'];
$limitmenu_flash = $opitions['limitmenu_flash'];
$limitmenu_links = $opitions['limitmenu_links'];
$limitmenu_signatures = $opitions['limitmenu_signatures'];

$d1 = text(3,$opitions['d1']);
$d2 = text(3,$opitions['d2']);
$d3 = text(3,$opitions['d3']);
$d4 = text(3,$opitions['d4']);
$d5 = text(3,$opitions['d5']);
$d6 = text(3,$opitions['d6']);
$d7 = text(3,$opitions['d7']);
$d8 = text(3,$opitions['d8']);
$d9 = text(3,$opitions['d9']);
$d10 = text(3,$opitions['d10']);
$d11 = text(3,$opitions['d11']);
$d12 = text(3,$opitions['d12']);
$d13 = text(3,$opitions['d13']);
$d14 = text(3,$opitions['d14']);
$d15 = text(3,$opitions['d15']);

$k1 = text(3,$opitions['k1']);
$k2 = text(3,$opitions['k2']);
$k3 = text(3,$opitions['k3']);
$k4 = text(3,$opitions['k4']);
$k5 = text(3,$opitions['k5']);
$k6 = text(3,$opitions['k6']);
$k7 = text(3,$opitions['k7']);
$k8 = text(3,$opitions['k8']);
$k9 = text(3,$opitions['k9']);
$k10 = text(3,$opitions['k10']);
$k11 = text(3,$opitions['k11']);
$k12 = text(3,$opitions['k12']);
$k13 = text(3,$opitions['k13']);
$k14 = text(3,$opitions['k14']);
$k15 = text(3,$opitions['k15']);

$video_catsloop = text(3,$opitions['video_catsloop']);
$limit_video = text(3,$opitions['limit_video']);
$limitmenu_video = $opitions['limitmenu_video'];

$limit_text = $opitions['limit_text'];
$limitmenu_text = $opitions['limitmenu_text'];
$text_catsloop = $opitions['text_catsloop'];

$allowcomment_news = $opitions['allowcomment_news'];
$allowshowcomment_news = $opitions['allowshowcomment_news'];
$activecomment = $opitions['activecomment'];
$limitcomments = $opitions['limitcomments'];

function comments($cat,$idt,$limitcomments) {
global $htmlorphp,$LANGAUGE;

$page = (int) (!isset($_GET["page"]) ? 1 : $_GET["page"]);
$page = ($page == 0 ? 1 : $page);
$perpage = $limitcomments;
$startpoint = ($page * $perpage) - $perpage;

$printcats = "<div id='comments'><h1>".$LANGAUGE[298]."</h1>";

$sql = @mysql_query("SELECT * FROM comment where active='1' AND cat='$cat' AND idt='$idt' order by id desc limit $startpoint,$perpage");
$nu = mysql_num_rows($sql);
if($nu == 0){
$printcats .= "";
}else{
$printcats .= "<br />";
$ff=0;
while ($Row = @mysql_fetch_array($sql))
{
++$ff;
$text = text(3,$Row['text']);
$text = nl2br($text);
//$text = Replace($text);
//$text = str_replace("[LIST]","<ul>",$text);
//$text = str_replace("[/LIST]","</ul>",$text);
//$text = str_replace("[LIST1]","<ol>",$text);
//$text = str_replace("[/LIST1]","</ol>",$text);
//$text = str_replace("[*]","<li>",$text);

$name = text(3,$Row[name]);
$email = text(3,$Row[email]);

$sqq = mysql_query ("SELECT * FROM contries where id='".$Row['country']."'");
$con = mysql_fetch_array($sqq);
$con['name_ar'] = text(3,$con['name_ar']);

if($con['name_ar']==""){
$rrrw = $LANGAUGE[246];
}else{
$rrrw = $con['name_ar'];
}

$d = date("j/n/Y",$Row['date']);

if($nu == $ff){
$br = "";
}else{
$br = "<br />";
}

$printcats .= "<div class='ginfo'><a href='mailto:$email'>$name</a> - $rrrw - $d</div>";
$printcats .= "<div class='gcomments'><div class='gpadding'>".$text."</div></div>".$br;
}

$pagesnum = @ceil(mysql_num_rows(mysql_query("select id from comment where active='1' AND cat='$cat' AND idt='$idt'")) / $perpage);

if($pagesnum > 1){
$printcats .= "<div class='multipage'>";
for ($i=1; $i<=$pagesnum; $i++) {
if ($i != $page) {

if ($htmlorphp=="1"){
$z = "<span><a href='c1-$idt-$i.html'>$i</a></span>";
}else{
$z = "<span><a href='news.php?action=view&id=$idt&page=$i'>$i</a></span>";
}

} else {
$z = "<span class='act'>$i</span>";
}
$printcats .= "$z";

}
$printcats .= "</div>";
}

$printcats .= "</div>";
}
return $printcats;
}

function comment_form($cat,$idt,$allowcomment_news,$allowshowcomment_news) {
global $htmlorphp,$folder,$_SESSION,$LANGAUGE,$limitcomments;

if($allowshowcomment_news==1){
$form = comments($cat,$idt,$limitcomments);
}else{
$form = '';
}

if($allowcomment_news==1){
$text1 = rand(0,9);
$text2 = rand(0,9);
$text3 = "<label for='xzx5'>".$LANGAUGE[176]." ".$text1." + ".$text2."</label>";
$text4 = $text1 + $text2;

$_SESSION["captchacode"] = $text4;

$string = mt_rand();
$string = substr(sha1($string), 0, 6);
$string = str_replace(array('0', 'O', 'o', '9', 'g', 'G'), rand(1, 8), $string);
$datex = time();
$codemembers = $datex.$string;
$codemembers = MD5($codemembers);
$codemembers = substr($codemembers, 0, 15);

$form .= '<script type="text/javascript">
// function to verify registration data
function regCheck(submitform) {
var correct = true;
var emailPat =/^(.+)@(.+)$/;
var matchArray = submitform.sender.value.match(emailPat);

var count = 0;

if (submitform.name.value == "") {
        correct = false;
        alert("'.$LANGAUGE[196].'");
        submitform.name.focus();

} else if (matchArray == null) {
        correct = false;
        alert("'.$LANGAUGE[172].'");
        submitform.sender.focus();

} else if (submitform.message.value == "") {
        correct = false;
        alert("'.$LANGAUGE[174].'");
        submitform.message.focus();


} else if (submitform.code.value == "") {
        correct = false;
        alert("'.$LANGAUGE[177].'");
        submitform.code.focus();
}

if (correct) {
        submitform.submit();
}

}
</script>';

if ($htmlorphp=="1"){
$ccat = "comment.html";
}else{
$ccat = "comment.php";
}

$form .= '<br />
<div class="comment">
<h4>'.$LANGAUGE[289].'</h4>
<form name="signup" method="post" action="'.$ccat.'">
<input type="hidden" name="codenumber" value="'.$codemembers.'" />
<input type="hidden" name="cat" value="'.$cat.'" />
<input type="hidden" name="idt" value="'.$idt.'" />

<label for="ttt2">'.$LANGAUGE[247].'</label><br />
<input id="ttt2" size="60" name="name" onfocus="this.select()" type="text" /><br /><br />
<label for="ttt1">'.$LANGAUGE[248].'</label><br />
<input id="ttt1" dir="ltr" size="60" name="sender" onfocus="this.select()" type="text" /><br /><br />
<label for="ttt4">'.$LANGAUGE[249].'</label><br />
<select id="ttt4" size="1" name="countryid">';
$sql = mysql_query ("SELECT * FROM  contries order by orders ASC");
while($cat=mysql_fetch_array($sql))
{
$cat['name_ar'] = stripslashes($cat['name_ar']);
$cat['name_ar'] = htmlspecialchars($cat['name_ar']);
$form .= '<option value="'.$cat['id'].'">'.$cat['name_ar'].'</option>';
}
$form .= '</select><br /><br />

<!-- <script type="text/javascript">edToolbar(\'mytxtarea\'); </script> -->
<textarea id="mytxtarea" name="message" rows="15" cols="60"></textarea>

<br /><br />

'.$text3.' <input id="xzx5" name="code" size="10" onfocus="this.select()" /><br /><br />
<input type="button" value=" '.$LANGAUGE[201].' " name="Send" id="Send" onclick="regCheck(signup)" />
</form>
</div>';
}else{
$form .= '';
}
return $form;
}

function swfobject($flodergallery,$width=540,$height=500)
{
$text = '<div id="gallery" style="text-align:center;">
<h1>No flash player!</h1>
<p>It looks like you do not have flash player installed. <a href="http://www.macromedia.com/go/getflashplayer" >Click here</a> to go to Macromedia download page.</p>
</div>

<script language="javascript" type="text/javascript">
var so = new SWFObject("swf/flashgallery.swf", "gallery", "'.$width.'", "'.$height.'", "8"); // Location of swf file. You can change gallery width and height here (using pixels or percents).
so.addParam("quality", "high");
so.addParam("allowFullScreen", "true");
so.addParam("wmode", "transparent");
so.addVariable("content_path","'.$flodergallery.'"); // Location of a folder with JPG and PNG files (relative to php script) or a link to Flickr photostream (for example "http://www.flickr.com/photos/username/" or "http://www.flickr.com/photos/username/sets/setid/").
so.addVariable("color_path","swf/default.xml"); // Location of xml file with settings.
so.addVariable("script_path","swf/flashgallery.php"); // Location of php script (not requred if you work with Flickr).
so.write("gallery");
</script>

<br/>';
return $text;
}


function albumswf()
{
global $folder,$htmlorphp;

$sql = @mysql_query("SELECT * FROM swfobject where active='1' order by id desc");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[275];
}else{
$m = "<ul>";
while ($Row = @mysql_fetch_array($sql))
{
$Row['name'] = text(3,$Row['name']);

if($htmlorphp==1){
$m .= "<li><a href='album-".$Row['id'].".html'>".$Row['name']."</a></li>";
}else{
$m .= "<li><a href='album.php?action=show&id=".$Row['id']."'>".$Row['name']."</a></li>";
}
}
$m .= "</ul>";
}
return $m;
}



function youtubedisplay($size,$border,$related,$color,$code)
{
global $folder,$htmlorphp;

$code = str_replace("http://www.youtube.com/v/","",$code);
$code = str_replace("http://www.youtube.com/watch?v=","",$code);
$code = str_replace("&hl=en_US&fs=1","",$code);

if($border==1){
$borders = "&border=1";
$n = 20;
}else{
$borders = "";
$n = 0;
}

if($related==1){
$relateds = "";
}else{
$relateds = "&rel=0";
}

if($color==1){
$colors = "&color1=0x3a3a3a&color2=0x999999";
}elseif($color==2){
$colors = "&color1=0x2b405b&color2=0x6b8ab6";
}elseif($color==3){
$colors = "&color1=0x006699&color2=0x54abd6";
}elseif($color==4){
$colors = "&color1=0x234900&color2=0x4e9e00";
}elseif($color==5){
$colors = "&color1=0xe1600f&color2=0xfebd01";
}elseif($color==6){
$colors = "&color1=0xcc2550&color2=0xe87a9f";
}elseif($color==7){
$colors = "&color1=0x402061&color2=0x9461ca";
}elseif($color==8){
$colors = "&color1=0x5d1719&color2=0xcd311b";
}else{
$colors = "";
}

if($size==1){
$width = 480+$n;
$height = 295+$n;
}elseif($size==2){
$width = 560+$n;
$height = 340+$n;
}elseif($size==3){
$width = 640+$n;
$height = 385+$n;
}elseif($size==4){
$width = 853+$n;
$height = 505+$n;
}else{
$width = 560+$n;
$height = 340+$n;
}

$m = '<div style="text-align:center;"><object width="'.$width.'" height="'.$height.'">
<param name="movie" value="http://www.youtube.com/v/'.$code.'&hl=en_US&fs=1'.$borders.''.$relateds.''.$colors.'"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/'.$code.'&hl=en_US&fs=1'.$borders.''.$relateds.''.$colors.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$width.'" height="'.$height.'"></embed>
</object></div>';

return $m;
}


function clean_bbcode($text)
{
//$text = htmlspecialchars($text);
$text = str_replace("[CENTER]", "", $text);
$text = str_replace("[/CENTER]", "", $text);
$text = str_replace("[JUSTIFY]", "", $text);
$text = str_replace("[RIGHT]", "", $text);
$text = str_replace("[LEFT]", "", $text);
$text = str_replace("[/P]", "", $text);
$text = str_replace("[U]", "", $text);
$text = str_replace("[/U]", "", $text);
$text = str_replace("[q]", "", $text);
$text = str_replace("[/q]", "", $text);
$text = str_replace("[I]", "", $text);
$text = str_replace("[/I]", "", $text);
$text = str_replace("[B]", "", $text);
$text = str_replace("[/B]", "", $text);
$text = str_replace("[img]", "", $text);
$text = str_replace("[/img]", "", $text);
$text = str_replace("[url=http://]", "", $text);
$text = str_replace("[url]", "", $text);
$text = str_replace("[/url]", "", $text);
$text = str_replace("[h]", "", $text);
$text = str_replace("[/h]", "", $text);
$text = str_replace("[quote]", "", $text);
$text = str_replace("[/quote]", "", $text);
$text = str_replace("[code]", "", $text);
$text = str_replace("[/code]", "", $text);
//$text=strip_tags($text);
return $text;
}


function clean_value($getandpost)
    {
    $getandpost = htmlspecialchars($getandpost);
    $getandpost = str_replace("select","",$getandpost);
    $getandpost = str_replace("union", "", $getandpost);
    $getandpost = str_replace("update","",$getandpost);
    $getandpost = str_replace("insert","",$getandpost);
    $getandpost = str_replace("where","",$getandpost);
    $getandpost = str_replace("like","",$getandpost);
    $getandpost = str_replace("or","",$getandpost);
    $getandpost = str_replace("and","",$getandpost);
    $getandpost = str_replace("set","",$getandpost);
    $getandpost = str_replace("into","",$getandpost);
    $codenumber = str_replace("'", "", $codenumber);
    $codenumber = str_replace(";", "", $codenumber);
    $codenumber = str_replace(">", "", $codenumber);
    $codenumber = str_replace("<", "", $codenumber);
    $codenumber = str_replace("*", "", $codenumber);
    $codenumber = str_replace("\'", "", $codenumber);
    $codenumber = str_replace('\"', '', $codenumber);
    return $getandpost;
}

function embed($url,$width,$height)
{
$exx = explode(".",$url);
$typefile = $exx[count($exx)-1];

if($typefile == "mp3" OR $typefile == "wav" OR $typefile == "wav"){
$ttt = '<OBJECT id="mediaPlayer" width="'.$width.'" height="'.$height.'" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
      <param name="fileName" value="'.$url.'" />
      <param name="animationatStart" value="true" />
      <param name="transparentatStart" value="true" />
      <param name="autoStart" value="true" />
      <param name="showControls" value="true" />
      <param name="loop" value="true" />
      <EMBED type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="-1" bgcolor="darkblue" showcontrols="true" showtracker="-1" showdisplay="0" showstatusbar="-1" videoborder3d="-1" width="'.$width.'" height="'.$height.'" src="'.$url.'" autostart="true" designtimesp="5311" loop="true">
      </EMBED>
      </OBJECT>';

}elseif($typefile == "flash"){
$ttt = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='$width' height='$height'>
<param name='movie' value='".$url."' />
<param name='quality' value='High' />
<param name='_cx' value='5054' />
<param name='_cy' value='4075' />
<param name='Src' value='".$url."' />
<param name='WMode' value='Window' />
<param name='Play' value='-1' />
<param name='Loop' value='-1' />
<param name='SAlign' value />
<param name='Menu' value='-1' />
<param name='Base' value />
<param name='Scale' value='ShowAll' />
<param name='DeviceFont' value='0' />
<param name='EmbedMovie' value='0' />
<param name='BGColor' value />
<param name='SWRemote' value />
<param name='Stacking' value='below' />
<embed src='".$url."' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='$width' height='$height' /></object>";
}else{
$ttt = "<OBJECT id='rvocx' classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'
        width='".$width."' height='".$height."'>
        <param name='src' value='".$url."' />
        <param name='autostart' value='true' />
        <param name='controls' value='imagewindow' />
        <param name='console' value='video' />
        <param name='loop' value='true' />
        <EMBED src='".$url."' width='".$width."' height='".$height."'
        loop='true' type='audio/x-pn-realaudio-plugin' controls='imagewindow' console='video' autostart='true'>
        </EMBED>
        </OBJECT>
        <br />
          <OBJECT id='rvocx' classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'
          width='".$width."' height='30' />
          <param name='src' value='".$url."' />
          <param name='autostart' value='true' />
          <param name='controls' value='ControlPanel' />
          <param name='console' value='video' />
          <EMBED src='".$url."' width='".$width."' height='30'
          controls='ControlPanel' type='audio/x-pn-realaudio-plugin' console='video' autostart='true'>
          </EMBED>
          </OBJECT>";
$tttx = '<OBJECT classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" id=video1 HEIGHT="'.$height.'" width="'.$width.'">
        <PARAM NAME="_ExtentX" VALUE="7276" />
        <PARAM NAME="_ExtentY" VALUE="1588" />
        <PARAM NAME="autostart" VALUE="true" />
        <PARAM NAME="SHUFFLE" VALUE="0" />
        <PARAM NAME="PREFETCH" VALUE="0" />
        <PARAM NAME="NOLABELS" VALUE="0" />
        <PARAM NAME="SRC" VALUE="'.$url.'" />
        <PARAM NAME="CONTROLS" VALUE="ControlPanel,StatusBar" />
        <PARAM NAME="CONSOLE" VALUE="Clip1" />
        <PARAM NAME="LOOP" VALUE="0" />
        <PARAM NAME="NUMLOOP" VALUE="0" />
        <PARAM NAME="CENTER" VALUE="0" />
        <PARAM NAME="MAINTAINASPECT" VALUE="0" />
        <PARAM NAME="BACKGROUNDCOLOR" VALUE="#00fff0" />
        <embed SRC="'.$url.'" type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ControlPanel,StatusBar" HEIGHT="'.$height.'" WIDTH="'.$width.'" AUTOSTART="false" /></OBJECT>';

}
return $ttt;
}

function my_filesize($file)
{
    if(!is_file($file))
    {
        $wrong_link = "-  -  -";
        return($wrong_link);
    }
    $kb = 1024;         // Kilobyte
    $mb = 1024 * $kb;   // Megabyte
    $gb = 1024 * $mb;   // Gigabyte
    $tb = 1024 * $gb;   // Terabyte

    $size = filesize($file);
    if($size < $kb)
    {
        return $size." B";
    }
    else if($size < $mb)
    {
        return round($size/$kb,2)." KB";
    }
    else if($size < $gb)
    {
        return round($size/$mb,2)." MB";
    }
    else if($size < $tb)
    {
        return round($size/$gb,2)." GB";
    }
    else
    {
        return round($size/$tb,2)." TB";
    }
}

function cuttext($n, $text, $end){

    // للتأكد أن العدد المطلوب لا يقف على نهاية كلمة أو العدد أطول من النص //
    if ($text[$n] != " " and $text[$n] != ""){

        // للحساب عدد حروف النص المدخل //
        $crop = strlen($text);

        // عملية تكرار تقلص النص حتى تصل إلى أقرب كلمة وتقف عليها //
        for ($i=0 ; $i<=$crop;$i++) {
            $a = $n-$i;
            if ($text[$a] == " "){$i=$crop;}
            if ($a == 0){$i=$crop;}
        }

        // يدخل في هذه العملية إذا كان لا يوجد كلمة يقف عليها في الخلف //
        if ($a == 0){

            // عملية تكرار للبحث عن أقرب كلمة في الأمام //
            for ($i=0 ; $i<=$crop;$i++) {
                $a = $n+$i;
                if ($text[$a] == " "){$i=$crop; }
                if ($a == $crop){$i=$crop;}
            }

            // إذا كان لا يوجد كلمة يقف عليها //
            if ($a == $crop){$a=$n;}
        }

        // نتيجة النص //
        $msg =  substr($text, 0, $a);
    }

    // يدخل هنا إذا كان العدد المطلوب أكبر من النص أو أن العدد المطلوب يقف على نهاية كلمة //
    else {
        $a = $n;
        // نتيجة النص //
        $msg =  substr($text, 0, $a);
    }

    // نتيجة النص النهائية //
    return $msg." ".$end;
}

function datex($t_lan)
{
$dateday = date("j",time());
$datexyear = date("Y",time());
$datemonth = date("n",time());
$dateweek = date("w",time());

if($datemonth==1){
$mm = "يناير";
$mmen = "January";
}elseif($datemonth==2){
$mm = "فبراير";
$mmen = "February";
}elseif($datemonth==3){
$mm = "مارس";
$mmen = "March";
}elseif($datemonth==4){
$mm = "ابريل";
$mmen = "April";
}elseif($datemonth==5){
$mm = "مايو";
$mmen = "May";
}elseif($datemonth==6){
$mm = "يونيو";
$mmen = "June";
}elseif($datemonth==7){
$mm = "يوليو";
$mmen = "July";
}elseif($datemonth==8){
$mm = "اغسطس";
$mmen = "August";
}elseif($datemonth==9){
$mm = "سبتمبر";
$mmen = "September";
}elseif($datemonth==10){
$mm = "اكتوبر";
$mmen = "October";
}elseif($datemonth==11){
$mm = "نوفمبر";
$mmen = "November";
}elseif($datemonth==12){
$mm = "ديسمبر";
$mmen = "December";
}


if($dateweek==0){
$ww = "الأحد";
$wwen = "Sunday";
}elseif($dateweek==1){
$ww = "الاثنين";
$wwen = "Monday";
}elseif($dateweek==2){
$ww = "الثلاثاء";
$wwen = "Tuesday";
}elseif($dateweek==3){
$ww = "الاربعاء";
$wwen = "Wednesday";
}elseif($dateweek==4){
$ww = "الخميس";
$wwen = "Thursday";
}elseif($dateweek==5){
$ww = "الجمعة";
$wwen = "Friday";
}elseif($dateweek==6){
$ww = "السبت";
$wwen = "Saturday";
}

if($t_lan==2){
$t = "$wwen $dateday $mmen $datexyear";
}else{
$t = "$ww $dateday $mm $datexyear";
}

return $t;
}

function error()
{
global $htmlorphp;

if ($htmlorphp=="1"){
ECHO "<meta http-equiv='Refresh' content='1;URL=index.html' />";
}else{
ECHO "<meta http-equiv='Refresh' content='1;URL=index.php' />";
}
}

function  resizeimg($img,$hight=150,$with=150,$name){
$image = @getimagesize($img);
if($image[0] > $with || $image[1] > $hight){
$imgwith = $with;
$imghight = $hight;
}else{
$imgwith = $image[0];
$imghight = $image[1];
}
return "<img src='$img' width='$imgwith' height='$imghight' border='0' alt='$name' />";
}

function ads($fh)
{
global $htmlorphp,$adsloop;

if($adsloop=="1"){$width = "100%";}
elseif($adsloop=="2"){$width = "50%";}
elseif($adsloop=="3"){$width = "33%";}
elseif($adsloop=="4"){$width = "25%";}
elseif($adsloop=="5"){$width = "20%";}
elseif($adsloop=="6"){$width = "16%";}
else{$width = "";}

$sql = @mysql_query("select * from ads where cat='$fh' AND active=1") or die ("Query failed");
$num = mysql_num_rows($sql);
if($num == "0"){
$ads = "";
}else{
$ads = "<div class='ads'>
<table border='0' cellpadding='2' style='border-collapse: collapse' width='100%' id='Au44oNumber1'>";
$looptable = '0';
while ($adss = mysql_fetch_array($sql))
{
++$looptable;
if($looptable=="$adsloop"){
$tr = "</tr><tr>";
$looptable="0";
}else{
$tr = "";
}
$nameads  = text(3,$adss['name']);
$imageads = text(3,$adss['image']);
$urlads   = text(3,$adss['url']);
$codex    = text(2,$adss['codex']);
$visads   = $adss['vis'];
$i        = $adss['adsid'];

if ($htmlorphp=="1"){
$li = "visitsite-$i.html";
}else{
$li = "ads.php?adsid=$i";
}

if($adss['type'] == 0){
$ads .= "<td width='".$width."' align='center'><a href='$li' target='_blank'><img border='0' src='$imageads' alt='$nameads' /></a></td>$tr";
}elseif($adss['type'] == 1){
$flainfo = @getimagesize($imageads);
$ww = $flainfo[0];
$hh = $flainfo[1];
$fflash = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' width='$ww' height='$hh' id='algy_name'>
<param name='movie' value='$imageads' />
<param name='quality' value='high' />
<param name='bgcolor' value='#FFFFFF' />
<embed src='$imageads' quality='high' width='$ww' height='$hh' name='myMovieName' align='center' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>
</object>";
$ads .= "<td width='".$width."' align='center'>$fflash</td>$tr";
}elseif($adss['type'] == 2){
$ads .= "<td width='".$width."' align='center'><a href='$li' target='_blank'>$nameads</a></td>$tr";
}elseif($adss['type'] == 3){
$ads .= "<td width='".$width."' align='center'>".$codex."</td>$tr";
}
}
$ads .= "</table>
</div>";
}

return $ads;
}



function table($title,$text,$box)
{
global $centerblock;
echo "<div class='divrightx'>";
blocks(1);
echo "</div><div class='divleftx'>";
blocks(0);
echo "</div><div class='divcenterx'>";
if($centerblock==1){
blocks(2);
}
if($box==1){
tpl_table($title,$text);
}else{
echo "<div class='divcenterxpadding'>";
echo $text;
echo "</div>";
}
echo "</div>";
}

function typefile($url,$name)
{
global $folder;
$exx = explode(".",$url);
$typefile = $exx[count($exx)-1];

if($typefile == "pdf" OR $typefile == "PDF"){
$ttt = "<img src='$folder/icons/pdf.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "doc" OR $typefile == "DOC" OR $typefile == "docx" OR $typefile == "DOCX"){
$ttt = "<img src='$folder/icons/doc.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "mp3" OR $typefile == "MP3"){
$ttt = "<img src='$folder/icons/mp3.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "ram" OR $typefile == "ra"){
$ttt = "<img src='$folder/icons/ram.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "3gp"){
$ttt = "<img src='$folder/icons/3gp.png'  alt='".$name."' border='0' />";
}elseif($typefile == "rm" OR $typefile == "RM"){
$ttt = "<img src='$folder/icons/audios.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "exe" OR $typefile == "EXE"){
$ttt = "<img src='$folder/icons/exe.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "zip" OR $typefile == "ZIP"){
$ttt = "<img src='$folder/icons/zip.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "rar" OR $typefile == "RAR"){
$ttt = "<img src='$folder/icons/rar.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "jpg" OR $typefile == "JPG" OR $typefile == "jpeg" OR $typefile == "JPEG"){
$ttt = "<img src='$folder/icons/jpg.png'  alt='".$name."' border='0' />";
}elseif($typefile == "gif" OR $typefile == "GIF"){
$ttt = "<img src='$folder/icons/image.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "png" OR $typefile == "PNG"){
$ttt = "<img src='$folder/icons/image.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "html" OR $typefile == "HTML" OR $typefile == "htm" OR $typefile == "HTM"){
$ttt = "<img src='$folder/icons/html.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "swf" OR $typefile == "SWF"){
$ttt = "<img src='$folder/icons/swf.png'  alt='".$name."' border='0' />";
}elseif($typefile == "txt" OR $typefile == "TXT"){
$ttt = "<img src='$folder/icons/txt.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "psd" OR $typefile == "PSD"){
$ttt = "<img src='$folder/icons/psd.gif'  alt='".$name."' border='0' />";
}elseif($typefile == "pps" OR $typefile == "PPS"){
$ttt = "<img src='$folder/icons/pps.png'  alt='".$name."' border='0' />";
}elseif($typefile == "wav" OR $typefile == "WAV"){
$ttt = "<img src='$folder/icons/audios.gif'  alt='".$name."' border='0' />";
}else{
$ttt = "<img src='$folder/icons/other.gif'  alt='".$name."' border='0' />";
}
return $ttt;
}



if ($htmlorphp=="1"){
$namelinks1 = "<a href='index.html'>$name_site</a>";
$namelinks2 = "<a href='mhadrat.html'>".$LANGAUGE[51]."</a>";
$namelinks3 = "<a href='book.html'>".$LANGAUGE[52]."</a>";
$namelinks4 = "<a href='telawat.html'>".$LANGAUGE[53]."</a>";
$namelinks5 = "<a href='aldlel.html'>".$LANGAUGE[54]."</a>";
$namelinks1a = "<a href='fatawa.html'>".$LANGAUGE[55]."</a>";
$namelinks6 = "<a href='signatures.html'>".$LANGAUGE[56]."</a>";
$namelinks7 = "<a href='flash.html'>".$LANGAUGE[57]."</a>";
$namelinks8 = "<a href='anasheed.html'>".$LANGAUGE[58]."</a>";
$namelinks9 = "<a href='guestbok.html'>".$LANGAUGE[59]."</a>";
$namelinks10 = "<a href='news.html'>".$LANGAUGE[60]."</a>";
$namelinks11 = "<a href='story.html'>".$LANGAUGE[61]."</a>";
$namelinks12 = "<a href='download.html'>".$LANGAUGE[62]."</a>";
$namelinks13 = "<a href='youtube.html'>".$LANGAUGE[252]."</a>";
$namelinks14 = "<a href='album.html'>".$LANGAUGE[276]."</a>";
$namelinks15 = "<a href='video.html'>".$LANGAUGE[278]."</a>";
$namelinks16 = "<a href='text.html'>".$LANGAUGE[295]."</a>";
}else{
$namelinks1 = "<a href='index.php'>$name_site</a>";
$namelinks2 = "<a href='sound.php'>".$LANGAUGE[51]."</a>";
$namelinks3 = "<a href='book.php'>".$LANGAUGE[52]."</a>";
$namelinks4 = "<a href='quran.php'>".$LANGAUGE[53]."</a>";
$namelinks5 = "<a href='links.php'>".$LANGAUGE[54]."</a>";
$namelinks1a = "<a href='fatawa.php'>".$LANGAUGE[55]."</a>";
$namelinks6 = "<a href='signatures.php'>".$LANGAUGE[56]."</a>";
$namelinks7 = "<a href='flash.php'>".$LANGAUGE[57]."</a>";
$namelinks8 = "<a href='anasheed.php'>".$LANGAUGE[58]."</a>";
$namelinks9 = "<a href='guestbook.php'>".$LANGAUGE[59]."</a>";
$namelinks10 = "<a href='news.php'>".$LANGAUGE[60]."</a>";
$namelinks11 = "<a href='story.php'>".$LANGAUGE[61]."</a>";
$namelinks12 = "<a href='download.php'>".$LANGAUGE[62]."</a>";
$namelinks13 = "<a href='youtube.php'>".$LANGAUGE[252]."</a>";
$namelinks14 = "<a href='album.php'>".$LANGAUGE[276]."</a>";
$namelinks15 = "<a href='video.php'>".$LANGAUGE[278]."</a>";
$namelinks16 = "<a href='text.php'>".$LANGAUGE[295]."</a>";
}

$q = array('القرآن الكريم','الفاتحة','البقرة','آل عمران','النساء','المائدة','الأنعام','الأعراف','الأنفال','التوبة','يونس'
,'هود','يوسف','الرعد','إبراهيم','الحجر','النحل','الإسراء','الكهف','مريم','طه','الأنبياء','الحج','المؤمنون','النور','الفرقان','الشعراء','النمل'
,'القصص','العنكبوت','الروم','لقمان','السجدة','الأحزاب','سبأ','فاطر','يس','الصافات','ص','الزمر','غافر','فصلت','الشورى','الزخرف','الدخان','الجاثية','الأحقاف'
,'محمد','الفتح','الحجرات','ق','الذاريات','الطور','النجم','القمر','الرحمن','الواقعة','الحديد','المجادلة','الحشر','الممتحنة','الصف','الجمعة','المنافقون','التغابن','الطلاق'
,'التحريم','الملك','القلم','الحاقة','المعارج','نوح','الجن','المزمل','المدثر','القيامة','الإنسان','المرسلات','النبأ','النازعات','عبس','التكوير','الانفطار','المطففين','الانشقاق','البروج','الطارق','الأعلى'
,'الغاشية','الفجر','البلد','الشمس','الليل','الضحى','الشرح','التين','العلق','القدر','البينة','الزلزلة','العاديات','القارعة','التكاثر','العصر','الهمزة','الفيل','قريش','الماعون','الكوثر','الكافرون','النصر','المسد','الإخلاص','الفلق','الناس');


function navbar()
{
global $folder,$htmlorphp,$LANGAUGE;

$sql = @mysql_query("SELECT id,name,url,urlactive,target FROM pages where active='1' AND addmenu='1' order by url_trteeb");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = "";
}else{
$m = "<ul>";
while ($Row = @mysql_fetch_array($sql))
{
$Row['name'] = text(3,$Row['name']);
$Row['url'] = text(3,$Row['url']);

if($Row['target']==1){
$target="target='_blank'";
}else{
$target="";
}

if($htmlorphp==1){
$turl="page-".$Row['id'].".html";
}else{
$turl="page.php?id=".$Row['id']."";
}

if($Row['urlactive']==1){
if($Row['url']==""){
$tau=$turl;
}else{
$tau=$Row['url'];
}
}else{
$tau=$turl;
}


$m .= "<li><a ".$target." href='".$tau."'>".$Row['name']."</a></li>";

}
$m .= "</ul>";
}
return $m;
}

function menu_data($view)
{
global $folder,$htmlorphp,$limit_telawat,$limit_mhadrat,$limit_anasheed,$idpool,$online,$total,$LANGAUGE,$youtube_catsmenu,$limitmenu_story,$limitmenu_download,$limitmenu_news,$limitmenu_fatawa,$limitmenu_book,$limitmenu_flash,$limitmenu_links,$limitmenu_signatures,$limitmenu_video,$limitmenu_text,$Htoday,$Hmonth,$Hyear;

if($view==1){
$sql = @mysql_query("SELECT * FROM links_my_site where active='1' order by url_trteeb");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[1];
}else{
$m = "<ul>";
while ($Row_links_my_site = @mysql_fetch_array($sql))
{
$Row_links_my_site['name_site'] = text(3,$Row_links_my_site['name_site']);
$Row_links_my_site['url_site'] = text(3,$Row_links_my_site['url_site']);
$Row_links_my_site['urlm'] = text(3,$Row_links_my_site['urlm']);
$Row_links_my_site['class'] = text(3,$Row_links_my_site['class']);
if($Row_links_my_site['target']==1){
$target="target='_blank'";
}else{
$target="";
}

if($Row_links_my_site['class']==""){
$cls = "";
}else{
$cls = "class='".$Row_links_my_site['class']."'";
}

if($htmlorphp==1){
$m .= "<li ".$cls."><a ".$target." href='".$Row_links_my_site['urlm']."'>".$Row_links_my_site['name_site']."</a></li>";
}else{
$m .= "<li ".$cls."><a ".$target." href='".$Row_links_my_site['url_site']."'>".$Row_links_my_site['name_site']."</a></li>";
}
}
$m .= "</ul>";
}
}elseif($view==2){
$sql = mysql_query("SELECT * FROM news_cat where active='1' AND sub='0' order by order_cat limit $limitmenu_news");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[2];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "news_cat-$row[id].html";
}else{
$l = "news.php?action=cat&id=$row[id]";
}
$row['name'] = text(3,$row['name']);
$m .= "<li><a href='".$l."'>".$row['name']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==3){
$sql = @mysql_query("SELECT * FROM telawat_cat where active='1' AND sub='0' order by order_cat limit $limit_telawat");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[3];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "telawat_cat-$row[id].html";
}else{
$l = "quran.php?action=telawat&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);
$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==4){
$sql = @mysql_query("SELECT * FROM mhadrat_cat where active='1' AND sub='0' order by order_cat limit $limit_mhadrat");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[4];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "mhadrat_cat-$row[id].html";
}else{
$l = "sound.php?action=mhadrat&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==5){
$sql = @mysql_query("SELECT * FROM anasheed_cat where active='1' AND sub='0' order by order_cat limit $limit_anasheed");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[5];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "anasheed_cat-$row[id].html";
}else{
$l = "anasheed.php?action=anasheed&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==6){
$sql = @mysql_query("SELECT * FROM fatawa_cat where active='1' AND sub='0' order by order_cat limit $limitmenu_fatawa");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[6];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "fatawa_cat-$row[id].html";
}else{
$l = "fatawa.php?action=fatawa&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==7){
$sql = @mysql_query("SELECT * FROM  book_cat where active='1' AND sub='0' order by order_cat limit $limitmenu_book");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[7];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "book_cat-$row[id].html";
}else{
$l = "book.php?action=book_cat&id=$row[id]";
}

$row['name'] = text(3,$row['name']);

$m .= "<li><a href='".$l."'>".$row['name']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==8){
$sql = @mysql_query("SELECT * FROM flash_cat where active='1' AND sub='0' order by order_cat limit $limitmenu_flash");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[8];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "flash_cat-$row[id].html";
}else{
$l = "flash.php?action=flash&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==9){
$sql = @mysql_query("SELECT * FROM dlil_cat where active='1' AND sub='0' order by order_cat limit $limitmenu_links");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[9];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "aldlel_cat-$row[id].html";
}else{
$l = "links.php?action=islam_dlil&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==10){
$sql = @mysql_query("SELECT * FROM signatures_cat where active='1' AND sub='0' order by order_cat limit $limitmenu_signatures");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[10];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "signatures_cat-$row[id].html";
}else{
$l = "signatures.php?action=signatures&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==11){
$sql = @mysql_query("SELECT * FROM story_cat where active='1' AND sub='0' order by order_cat limit $limitmenu_story");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[11];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "storycat-$row[id].html";
}else{
$l = "story.php?action=cat&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==12){
$sql = @mysql_query("SELECT * FROM download_cat where active='1' AND sub='0' order by order_cat limit $limitmenu_download");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[12];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "downloadcat-$row[id].html";
}else{
$l = "download.php?action=cat&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}

}elseif($view==13){

if ($htmlorphp=="1"){
$y = "vote.html";
}else{
$y = "poll.php?action=vote4pool";
}

if(empty($idpool) OR $idpool==0){
$idpool2 = 1;
}else{
$idpool2 = $idpool;
}

$query = @mysql_query("SELECT * FROM pool where id='$idpool2'");
$row = @mysql_fetch_array($query);
if($row[answer1] == ""){ $P1 = ""; }else{ $P1 = "<input class='poll' type='radio' value='vote1' name='answers' id='w1' checked='checked' /> <label for='w1'>".text(3,$row['answer1'])."</label><br />"; }
if($row[answer2] == ""){ $P2 = ""; }else{ $P2 = "<input class='poll' type='radio' value='vote2' name='answers' id='w2' /> <label for='w2'>".text(3,$row['answer2'])."</label><br />"; }
if($row[answer3] == ""){ $P3 = ""; }else{ $P3 = "<input class='poll' type='radio' value='vote3' name='answers' id='w3' /> <label for='w3'>".text(3,$row['answer3'])."</label><br />"; }
if($row[answer4] == ""){ $P4 = ""; }else{ $P4 = "<input class='poll' type='radio' value='vote4' name='answers' id='w4' /> <label for='w4'>".text(3,$row['answer4'])."</label><br />"; }
if($row[answer5] == ""){ $P5 = ""; }else{ $P5 = "<input class='poll' type='radio' value='vote5' name='answers' id='w5' /> <label for='w5'>".text(3,$row['answer5'])."</label><br />"; }
if($row[answer6] == ""){ $P6 = ""; }else{ $P6 = "<input class='poll' type='radio' value='vote6' name='answers' id='w6' /> <label for='w6'>".text(3,$row['answer6'])."</label><br />"; }

if($row['question']==""){
$m = $LANGAUGE[13];
}else{
$m = "<div align='center'>".text(3,$row['question'])."</div>
<form name='f' method='post' action='$y'>
$P1
$P2
$P3
$P4
$P5
$P6
<div align='center'><input type='submit' value='".$LANGAUGE[63]."' name='B1' /></div>
</form>";
}
}elseif($view==14){
$m = "<ul>";

$num_newscat = mysql_num_rows(mysql_query("SELECT id FROM news_cat"));
if($num_newscat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[35]." $num_newscat</li>"; }

$num_news = mysql_num_rows(mysql_query("SELECT id FROM news"));
if($num_news == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[36]." $num_news</li>"; }

$textcat = mysql_num_rows(mysql_query("SELECT id FROM text_cat"));
if($textcat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[302]." $textcat</li>"; }

$textx = mysql_num_rows(mysql_query("SELECT id FROM text"));
if($textx == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[303]." $textx</li>"; }

$num_telawatcat = mysql_num_rows(mysql_query("SELECT id FROM telawat_cat"));
if($num_telawatcat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[39]." $num_telawatcat</li>"; }


$num_telawat = mysql_num_rows(mysql_query("SELECT id FROM telawat"));
if($num_telawat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[40]." $num_telawat</li>"; }


$num_mhadratcat = mysql_num_rows(mysql_query("SELECT id FROM mhadrat_cat"));
if($num_mhadratcat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[41]." $num_mhadratcat</li>"; }


$num_mhadrat = mysql_num_rows(mysql_query("SELECT id FROM mhadrat"));
if($num_mhadrat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[42]." $num_mhadrat</li>"; }

$videocategory = mysql_num_rows(mysql_query("SELECT id FROM  videocategory"));
if($videocategory == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[304]." $videocategory</li>"; }

$videocontentx = mysql_num_rows(mysql_query("SELECT id FROM videocontent"));
if($videocontentx == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[305]." $videocontentx</li>"; }

$youtubecat = mysql_num_rows(mysql_query("SELECT id FROM youtubecat"));
if($youtubecat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[306]." $youtubecat</li>"; }

$youtubex = mysql_num_rows(mysql_query("SELECT id FROM youtube"));
if($youtubex == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[307]." $youtubex</li>"; }

$num_bookcat = mysql_num_rows(mysql_query("SELECT id FROM book_cat"));
if($num_bookcat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[43]." $num_bookcat</li>"; }


$num_book = mysql_num_rows(mysql_query("SELECT id FROM book_all"));
if($num_book == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[44]." $num_book</li>"; }


$num_ftawacat = mysql_num_rows(mysql_query("SELECT id FROM fatawa_cat"));
if($num_ftawacat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[27]." $num_ftawacat</li>"; }


$num_ftawa = mysql_num_rows(mysql_query("SELECT id FROM fatawa"));
if($num_ftawa == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[28]." $num_ftawa</li>"; }


$num_flashcat = mysql_num_rows(mysql_query("SELECT id FROM flash_cat"));
if($num_flashcat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[29]." $num_flashcat</li>"; }


$num_flash = mysql_num_rows(mysql_query("SELECT id FROM flash"));
if($num_flash == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[30]." $num_flash</li>"; }


$num_signaturescat = mysql_num_rows(mysql_query("SELECT id FROM signatures_cat"));
if($num_signaturescat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[31]." $num_signaturescat</li>"; }


$num_signatures = mysql_num_rows(mysql_query("SELECT id FROM signatures"));
if($num_signatures == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[32]." $num_signatures</li>"; }


$num_anasheedcat = mysql_num_rows(mysql_query("SELECT id FROM anasheed_cat"));
if($num_anasheedcat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[33]." $num_anasheedcat</li>"; }


$num_anasheed = mysql_num_rows(mysql_query("SELECT id FROM anasheed"));
if($num_anasheed == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[34]." $num_anasheed</li>"; }


$num_dlilcat = mysql_num_rows(mysql_query("SELECT id FROM dlil_cat"));
if($num_dlilcat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[37]." $num_dlilcat</li>"; }


$num_dlil = mysql_num_rows(mysql_query("SELECT id FROM islam_dlil"));
if($num_dlil == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[38]." $num_dlil</li>"; }

$downloadcat = mysql_num_rows(mysql_query("SELECT id FROM download_cat"));
if($downloadcat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[46]." $downloadcat</li>"; }

$downloadx = mysql_num_rows(mysql_query("SELECT id FROM download"));
if($downloadx == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[47]." $downloadx</li>"; }

$storycat = mysql_num_rows(mysql_query("SELECT id FROM story_cat"));
if($storycat == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[48]." $storycat</li>"; }

$storyx = mysql_num_rows(mysql_query("SELECT id FROM story"));
if($storyx == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[49]." $storyx</li>"; }

$num_sjl_alzwar = mysql_num_rows(mysql_query("SELECT id FROM sjl_alzwar"));
if($num_sjl_alzwar == "0"){ $m .= ""; }else{ $m .= "<li>".$LANGAUGE[45]." $num_sjl_alzwar</li>"; }

$num_pages = mysql_num_rows(mysql_query("SELECT id FROM pages"));



$m .= "<li>".$LANGAUGE[50]." $online</li>";
$m .= "<li>".$LANGAUGE[25]." $total</li>";
//$m .= "<li>".$LANGAUGE[299]." $Htoday</li>";
//$m .= "<li>".$LANGAUGE[300]." $Hmonth</li>";
//$m .= "<li>".$LANGAUGE[301]." $Hyear</li>";

$m .= "</ul>";

}elseif($view==15){
if ($htmlorphp=="1"){
$fff = "result.html";
}else{
$fff  = "result.php";
}
$m = "<div align='center'><form name='sss' action='".$fff."' method='post'>
<input name='namesearch' size='20' /><br />
<input type='submit' value='".$LANGAUGE[64]."' name='S' /></form></div>";

}elseif($view==16){
$sql = @mysql_query("SELECT * FROM youtubecat where active='1' AND sub='0' order by order_cat limit $youtube_catsmenu");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[254];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "youtubecat-$row[id].html";
}else{
$l = "youtube.php?action=cat&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}

}elseif($view==17){
$sql = @mysql_query("SELECT * FROM videocategory where active='1' order by order_cat limit $limitmenu_video");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[254];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "video-cats-$row[id].html";
}else{
$l = "video.php?x=category&id=$row[id]";
}

$row['name'] = text(3,$row['name']);

$m .= "<li><a href='".$l."'>".$row['name']."</a></li>";
}
$m .= "</ul>";
}

}elseif($view==18){
$sql = @mysql_query("SELECT * FROM text_cat where active='1' order by order_cat limit $limitmenu_text");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[254];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "textcat-$row[id].html";
}else{
$l = "text.php?action=cat&id=$row[id]";
}

$row['name_cat'] = text(3,$row['name_cat']);

$m .= "<li><a href='".$l."'>".$row['name_cat']."</a></li>";
}
$m .= "</ul>";
}
}else{
$m = $LANGAUGE[14];
}

return $m;
}


















function last_data($view)
{
global $htmlorphp,$folder,$num_news,$limited,$q,$LANGAUGE;

if($view==1){
$sql = @mysql_query("SELECT id,sub,date,vis,cat FROM news where active='1' order by id desc limit 0,$num_news");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[15];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "news-$row[id].html";
}else{
$l = "news.php?action=view&id=$row[id]";
}

$name = text(3,$row['sub']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==2){
$sql = @mysql_query("SELECT id,name,cat,date,vis FROM telawat where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[16];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
$sql2 = @mysql_query("SELECT id,name_cat FROM telawat_cat where id='$row[cat]'");
$Row2 = @mysql_fetch_array($sql2);

if ($htmlorphp=="1"){
$l = "telawat_show-$row[id].html";
$c = "telawat_cat-$Row2[id].html";
}else{
$l = "quran.php?action=telawat_show&id=$row[id]";
$c = "quran.php?action=telawat&id=$Row2[id]";
}


$namec = text(3,$Row2['name_cat']);

$n = $row['name'];
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$name = $q[$n];

$m .= "<li><a href='".$l."'>".$name."</a> - <a href='$c'>".$namec."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==3){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM mhadrat where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[17];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "mhadrat_show-".$row['id']."-0.html";
}else{
$l = "sound.php?action=mhadrat_show&id=".$row['id']."&n=0";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==4){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM anasheed where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[18];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "anasheed_show-$row[id].html";
}else{
$l = "anasheed.php?action=anasheed_show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==5){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM fatawa where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[19];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "fatawa_show-$row[id].html";
}else{
$l = "fatawa.php?action=fatawa_show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==6){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM book_all where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[20];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "showbook-$row[id].html";
}else{
$l = "book.php?action=showbook&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==7){
$sql = @mysql_query("SELECT id,name_site,date,vis,cat FROM islam_dlil where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[21];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "aldlel_gosite-$row[id].html";
}else{
$l = "links.php?action=islam_dlil_go&id=$row[id]";
}

$name = text(3,$row['name_site']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==8){
$sql = @mysql_query("SELECT id,name_flash,date,vis,cat FROM flash where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[22];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "flash_show-$row[id].html";
}else{
$l = "flash.php?action=flash_show&id=$row[id]";
}

$name = text(3,$row['name_flash']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==9){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM download where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[23];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "downloadshow-$row[id].html";
}else{
$l = "download.php?action=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==10){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM story where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[24];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "storyshow-$row[id].html";
}else{
$l = "story.php?action=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}

}elseif($view==11){
$sql = @mysql_query("SELECT id,name,date,visitor,cat FROM videocontent where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[24];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "video-show-$row[id].html";
}else{
$l = "video.php?x=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}

}elseif($view==12){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM youtube where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[24];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "youtubeshow-$row[id].html";
}else{
$l = "youtube.php?action=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}


}elseif($view==13){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM text where active='1' order by id desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[24];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "textshow-$row[id].html";
}else{
$l = "text.php?action=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}else{
$m = $LANGAUGE[14];
}

return $m;
}


















function top_data($view)
{
global $htmlorphp,$folder,$limited,$q,$LANGAUGE,$num_news;

if($view==1){
$sql = @mysql_query("SELECT id,name,cat,date,vis FROM telawat where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[16];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
$sql2 = @mysql_query("SELECT id,name_cat FROM telawat_cat where id='$row[cat]'");
$Row2 = @mysql_fetch_array($sql2);

if ($htmlorphp=="1"){
$l = "telawat_show-$row[id].html";
$c = "telawat_cat-$Row2[id].html";
}else{
$l = "quran.php?action=telawat_show&id=$row[id]";
$c = "quran.php?action=telawat&id=$Row2[id]";
}

$n = $row['name'];
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$name = $q[$n];
$namec = text(3,$Row2['name_cat']);
$m .= "<li><a href='".$l."'>".$name."</a> - <a href='$c'>".$namec."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==2){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM mhadrat where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[17];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{
if ($htmlorphp=="1"){
$l = "mhadrat_show-".$row['id']."-0.html";
}else{
$l = "sound.php?action=mhadrat_show&id=".$row['id']."&n=0";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==3){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM anasheed where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[18];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "anasheed_show-$row[id].html";
}else{
$l = "anasheed.php?action=anasheed_show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==4){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM fatawa where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[19];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "fatawa_show-$row[id].html";
}else{
$l = "fatawa.php?action=fatawa_show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==5){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM book_all where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[20];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "showbook-$row[id].html";
}else{
$l = "book.php?action=showbook&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==6){
$sql = @mysql_query("SELECT id,name_site,date,vis,cat FROM islam_dlil where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[21];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "aldlel_gosite-$row[id].html";
}else{
$l = "links.php?action=islam_dlil_go&id=$row[id]";
}

$name = text(3,$row['name_site']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==7){
$sql = @mysql_query("SELECT id,name_flash,date,vis,cat FROM flash where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[22];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "flash_show-$row[id].html";
}else{
$l = "flash.php?action=flash_show&id=$row[id]";
}

$name = text(3,$row['name_flash']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==8){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM download where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[23];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "downloadshow-$row[id].html";
}else{
$l = "download.php?action=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}
}elseif($view==9){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM story where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[24];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "storyshow-$row[id].html";
}else{
$l = "story.php?action=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}

}elseif($view==10){
$sql = @mysql_query("SELECT id,sub,date,vis,cat FROM news where active='1' order by vis desc limit 0,$num_news");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[15];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "news-$row[id].html";
}else{
$l = "news.php?action=view&id=$row[id]";
}

$name = text(3,$row['sub']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}

}elseif($view==11){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM youtube where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[24];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "youtubeshow-$row[id].html";
}else{
$l = "youtube.php?action=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}

}elseif($view==12){
$sql = @mysql_query("SELECT id,name,date,visitor,cat FROM videocontent where active='1' order by visitor desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[24];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "video-show-$row[id].html";
}else{
$l = "video.php?x=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}


}elseif($view==13){
$sql = @mysql_query("SELECT id,name,date,vis,cat FROM text where active='1' order by vis desc limit 0,$limited");
$xx = mysql_num_rows($sql);
if($xx == 0){
$m = $LANGAUGE[24];
}else{
$m = "<ul>";
while ($row = mysql_fetch_array($sql))
{

if ($htmlorphp=="1"){
$l = "textshow-$row[id].html";
}else{
$l = "text.php?action=show&id=$row[id]";
}

$name = text(3,$row['name']);
$d = date("j/n/Y",$row['date']);
$v = $row['vis'];

$m .= "<li><a href='".$l."'>".$name."</a></li>";
}
$m .= "</ul>";
}

}else{
$m = $LANGAUGE[14];
}

return $m;
}


if ($htmlorphp=="1"){
$lxlist = "list.html";
}else{
$lxlist = "list.php";
}

$mailform = '<div class="mailformbox">
<form name="formname" action="'.$lxlist.'" method="post">
'.$LANGAUGE[287].'
<input id="e1" class="txt" name="email" type="text" /><br />
<input class="subx" type="submit" value="'.$LANGAUGE[288].'" />
</form>
</div>';

function blocks_re($text)
{
global $table_news,$mailform;

if($table_news == 1){
$nnn = newswithimage();
}elseif($table_news == 2){
$nnn = news();
}elseif($table_news == 3){
$nnn = news2table();
}

$text = str_replace("{menu}",menu_data(1),$text);
$text = str_replace("{catnews}",menu_data(2),$text);
$text = str_replace("{catquran}",menu_data(3),$text);
$text = str_replace("{catsound}",menu_data(4),$text);
$text = str_replace("{catanashed}",menu_data(5),$text);
$text = str_replace("{catftawa}",menu_data(6),$text);
$text = str_replace("{catbook}",menu_data(7),$text);
$text = str_replace("{catflash}",menu_data(8),$text);
$text = str_replace("{catlinks}",menu_data(9),$text);
$text = str_replace("{catimage}",menu_data(10),$text);
$text = str_replace("{catstory}",menu_data(11),$text);
$text = str_replace("{catdownload}",menu_data(12),$text);
$text = str_replace("{poll}",menu_data(13),$text);
$text = str_replace("{stats}",menu_data(14),$text);
$text = str_replace("{search}",menu_data(15),$text);
$text = str_replace("{youtubecats}",menu_data(16),$text);
$text = str_replace("{videocats}",menu_data(17),$text);
$text = str_replace("{textcats}",menu_data(18),$text);

$text = str_replace("{lastnews}",last_data(1),$text);
$text = str_replace("{lastquran}",last_data(2),$text);
$text = str_replace("{lastsound}",last_data(3),$text);
$text = str_replace("{lastanasheed}",last_data(4),$text);
$text = str_replace("{lastfatawa}",last_data(5),$text);
$text = str_replace("{lastbook}",last_data(6),$text);
$text = str_replace("{lastlinks}",last_data(7),$text);
$text = str_replace("{lastflash}",last_data(8),$text);
$text = str_replace("{lastdownload}",last_data(9),$text);
$text = str_replace("{laststory}",last_data(10),$text);
$text = str_replace("{lastvideo}",last_data(11),$text);
$text = str_replace("{lastyoutube}",last_data(12),$text);
$text = str_replace("{lasttext}",last_data(13),$text);

$text = str_replace("{topquran}",top_data(1),$text);
$text = str_replace("{topsound}",top_data(2),$text);
$text = str_replace("{topanasheed}",top_data(3),$text);
$text = str_replace("{topfatawa}",top_data(4),$text);
$text = str_replace("{topbook}",top_data(5),$text);
$text = str_replace("{toplinks}",top_data(6),$text);
$text = str_replace("{topflash}",top_data(7),$text);
$text = str_replace("{topdownload}",top_data(8),$text);
$text = str_replace("{topstory}",top_data(9),$text);
$text = str_replace("{topnews}",top_data(10),$text);
$text = str_replace("{topyoutube}",top_data(11),$text);
$text = str_replace("{topvideo}",top_data(12),$text);
$text = str_replace("{toptext}",top_data(13),$text);
$text = str_replace("{news}",$nnn,$text);
$text = str_replace("{list}",$mailform,$text);

return $text;
}

function blocks($place)
{
global $table_news,$mailform;

$query = mysql_query("SELECT * FROM blocks where active='1' AND rightorleft='$place' order by orderblock");
$xx = mysql_num_rows($query);
if($xx == 0){
echo "";
}else{
while($b = mysql_fetch_array($query))
{
$b['title'] = text(3,$b['title']);
$b['text'] = text(2,$b['text']);
$b['codeblock'] = text(3,$b['codeblock']);

if($b['codeblock'] == "{poll}"){
$bbb = str_replace("{poll}",menu_data(13),$b['codeblock']);
}elseif($b['codeblock'] == "{search}"){
$bbb = str_replace("{search}",menu_data(15),$b['codeblock']);
}elseif($b['codeblock'] == "{stats}"){
$bbb = str_replace("{stats}",menu_data(14),$b['codeblock']);
}elseif($b['codeblock'] == "{menu}"){
$bbb = str_replace("{menu}",menu_data(1),$b['codeblock']);
}elseif($b['codeblock'] == "{catnews}"){
$bbb = str_replace("{catnews}",menu_data(2),$b['codeblock']);
}elseif($b['codeblock'] == "{catquran}"){
$bbb = str_replace("{catquran}",menu_data(3),$b['codeblock']);
}elseif($b['codeblock'] == "{catsound}"){
$bbb = str_replace("{catsound}",menu_data(4),$b['codeblock']);
}elseif($b['codeblock'] == "{catanashed}"){
$bbb = str_replace("{catanashed}",menu_data(5),$b['codeblock']);
}elseif($b['codeblock'] == "{catftawa}"){
$bbb = str_replace("{catftawa}",menu_data(6),$b['codeblock']);
}elseif($b['codeblock'] == "{catbook}"){
$bbb = str_replace("{catbook}",menu_data(7),$b['codeblock']);
}elseif($b['codeblock'] == "{catflash}"){
$bbb = str_replace("{catflash}",menu_data(8),$b['codeblock']);
}elseif($b['codeblock'] == "{catlinks}"){
$bbb = str_replace("{catlinks}",menu_data(9),$b['codeblock']);
}elseif($b['codeblock'] == "{catimage}"){
$bbb = str_replace("{catimage}",menu_data(10),$b['codeblock']);
}elseif($b['codeblock'] == "{catstory}"){
$bbb = str_replace("{catstory}",menu_data(11),$b['codeblock']);
}elseif($b['codeblock'] == "{catdownload}"){
$bbb = str_replace("{catdownload}",menu_data(12),$b['codeblock']);
}elseif($b['codeblock'] == "{lastnews}"){
$bbb = str_replace("{lastnews}",last_data(1),$b['codeblock']);
}elseif($b['codeblock'] == "{lastquran}"){
$bbb = str_replace("{lastquran}",last_data(2),$b['codeblock']);
}elseif($b['codeblock'] == "{lastsound}"){
$bbb = str_replace("{lastsound}",last_data(3),$b['codeblock']);
}elseif($b['codeblock'] == "{lastanasheed}"){
$bbb = str_replace("{lastanasheed}",last_data(4),$b['codeblock']);
}elseif($b['codeblock'] == "{lastfatawa}"){
$bbb = str_replace("{lastfatawa}",last_data(5),$b['codeblock']);
}elseif($b['codeblock'] == "{lastbook}"){
$bbb = str_replace("{lastbook}",last_data(6),$b['codeblock']);
}elseif($b['codeblock'] == "{lastlinks}"){
$bbb = str_replace("{lastlinks}",last_data(7),$b['codeblock']);
}elseif($b['codeblock'] == "{lastflash}"){
$bbb = str_replace("{lastflash}",last_data(8),$b['codeblock']);
}elseif($b['codeblock'] == "{lastdownload}"){
$bbb = str_replace("{lastdownload}",last_data(9),$b['codeblock']);
}elseif($b['codeblock'] == "{laststory}"){
$bbb = str_replace("{laststory}",last_data(10),$b['codeblock']);
}elseif($b['codeblock'] == "{lastvideo}"){
$bbb = str_replace("{lastvideo}",last_data(11),$b['codeblock']);
}elseif($b['codeblock'] == "{lastyoutube}"){
$bbb = str_replace("{lastyoutube}",last_data(12),$b['codeblock']);
}elseif($b['codeblock'] == "{lasttext}"){
$bbb = str_replace("{lasttext}",last_data(13),$b['codeblock']);
}elseif($b['codeblock'] == "{topnews}"){
$bbb = str_replace("{topnews}",top_data(10),$b['codeblock']);
}elseif($b['codeblock'] == "{topyoutube}"){
$bbb = str_replace("{topyoutube}",top_data(11),$b['codeblock']);
}elseif($b['codeblock'] == "{topvideo}"){
$bbb = str_replace("{topvideo}",top_data(12),$b['codeblock']);
}elseif($b['codeblock'] == "{toptext}"){
$bbb = str_replace("{toptext}",top_data(13),$b['codeblock']);
}elseif($b['codeblock'] == "{topquran}"){
$bbb = str_replace("{topquran}",top_data(1),$b['codeblock']);
}elseif($b['codeblock'] == "{topsound}"){
$bbb = str_replace("{topsound}",top_data(2),$b['codeblock']);
}elseif($b['codeblock'] == "{topanasheed}"){
$bbb = str_replace("{topanasheed}",top_data(3),$b['codeblock']);
}elseif($b['codeblock'] == "{topfatawa}"){
$bbb = str_replace("{topfatawa}",top_data(4),$b['codeblock']);
}elseif($b['codeblock'] == "{topbook}"){
$bbb = str_replace("{topbook}",top_data(5),$b['codeblock']);
}elseif($b['codeblock'] == "{toplinks}"){
$bbb = str_replace("{toplinks}",top_data(6),$b['codeblock']);
}elseif($b['codeblock'] == "{topflash}"){
$bbb = str_replace("{topflash}",top_data(7),$b['codeblock']);
}elseif($b['codeblock'] == "{topdownload}"){
$bbb = str_replace("{topdownload}",top_data(8),$b['codeblock']);
}elseif($b['codeblock'] == "{topstory}"){
$bbb = str_replace("{topstory}",top_data(9),$b['codeblock']);
}elseif($b['codeblock'] == "{youtubecats}"){
$bbb = str_replace("{youtubecats}",menu_data(16),$b['codeblock']);
}elseif($b['codeblock'] == "{videocats}"){
$bbb = str_replace("{videocats}",menu_data(17),$b['codeblock']);
}elseif($b['codeblock'] == "{textcats}"){
$bbb = str_replace("{textcats}",menu_data(18),$b['codeblock']);
}elseif($b['codeblock'] == "{list}"){
$bbb = str_replace("{list}",$mailform,$b['codeblock']);
}else{
$bbb = $b['text'];
}


if($place == 2){

$bbbxb = blocks_re($b['text']);

if($b['textbox']==1){
if($b['codeblock']==""){
tpl_table($b['title'],$bbbxb);
echo "<br />";
}else{
tpl_table($b['title'],$bbb);
echo "<br />";
}
}else{
if($b['codeblock']==""){
echo $bbbxb;
}else{
echo $bbb;
}
}
}else{
if($b['textbox']==1){
tpl_menu($b['title'],$bbb);
}else{
echo $bbb;
}
}


}
}

}


function changestyle()
{
global $_SERVER,$folder;

$namepage = explode("/", $_SERVER['REQUEST_URI']);
$pa = $namepage[count($namepage)-1];


$sql = mysql_query ("SELECT * FROM pathstyle where active=1");
if (mysql_num_rows($sql)==1){
echo "";
}else{
echo "<div align='center' style='clear:both;'>
<form name='fff' action='style.php' method='post'>
<input name='page' type='hidden' value='$pa' />
<select size='1' name='styleid'>";
while($s=mysql_fetch_array($sql))
{

if($s['pathfolder'] ==  $folder){
echo "<option value='$s[id]' selected='selected'>$s[name]</option>";
}else{
echo "<option value='$s[id]'>$s[name]</option>";
}

}
echo "</select> <input type='submit' value=' تغيير ' name='stylecahnge' />
</form></div>";
}
}


function result($name,$limit)
{
global $LANGAUGE,$folder,$htmlorphp;
$xxyy = "<div class='result'>";
$sql = @mysql_query("SELECT id,cat,sub FROM `news` WHERE (active='1') AND (sub LIKE '%$name%' OR news LIKE '%$name%') order by id desc LIMIT $limit") or die ("Query failed");
$num1 = mysql_num_rows($sql);
if($num1 == 0){
//$xxyy .= $LANGAUGE[219];
}else{
$xxyy .= "<h1>".$LANGAUGE[262]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all['sub']);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$newscat    = "news_cat-$all[cat].html";
$newsthread = "news-$all[id].html";
}else{
$newscat    = "news.php?action=cat&id=$all[cat]";
$newsthread = "news.php?action=view&id=$all[id]";
}

$xxyy .= "<li><a href='$newsthread'>$allll</a></li>";
}
$xxyy .= "</ul>";
}





$sql = @mysql_query("SELECT id,name_cat FROM `telawat_cat` WHERE (active='1') AND (name_cat LIKE '%$name%' OR description LIKE '%$name%') limit $limit") or die ("Query failed");
$num2 = mysql_num_rows($sql);
if($num2 == 0){
//$xxyy .= $LANGAUGE[220];
}else{
$xxyy .= "<h1>".$LANGAUGE[263]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name_cat]);

$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);
if ($htmlorphp=="1"){
$telawatcat = "telawat_cat-$all[id].html";
}else{
$telawatcat = "quran.php?action=telawat&id=$all[id]";
}

$xxyy .= "<li><a href='$telawatcat'>$allll</a></li>";
}
$xxyy .= "</ul>";
}




$sql = @mysql_query("SELECT id,name_cat FROM `mhadrat_cat` WHERE (active='1') AND (name_cat LIKE '%$name%' OR description LIKE '%$name%') limit $limit") or die ("Query failed");
$num3 = mysql_num_rows($sql);
if($num3 == 0){
//$xxyy .= $LANGAUGE[221];
}else{
$xxyy .= "<h1>".$LANGAUGE[264]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = $all[name_cat];
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$soundscat  = "mhadrat_cat-$all[id].html";
}else{
$soundscat  = "sound.php?action=mhadrat&id=$all[id]";
}

$xxyy .= "<li><a href='$soundscat'>$allll</a></li>";
}
$xxyy .= "</ul>";
}





$sql = @mysql_query("SELECT id,cat,name FROM `mhadrat` WHERE (active='1') AND (name LIKE '%$name%' OR metadescription LIKE '%$name%') limit $limit");
$num4 = mysql_num_rows($sql);
if($num4 == 0){
//$xxyy .= $LANGAUGE[222];
}else{
$xxyy .= "<h1>".$LANGAUGE[265]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$soundscat  = "mhadrat_cat-$all[cat].html";
$soundsall  = "mhadrat_show-$all[id].html";
}else{
$soundscat  = "sound.php?action=mhadrat&id=$all[cat]";
$soundsall  = "sound.php?action=mhadrat_show&id=$all[id]";
}

$xxyy .= "<li><a href='$soundsall'>$allll</a></li>";
}
$xxyy .= "</ul>";
}





$sql = @mysql_query("SELECT id,cat,name FROM `book_all` WHERE (active='1') AND (name LIKE '%$name%' OR metadescription LIKE '%$name%' OR writerbook LIKE '%".$name."%') limit $limit") or die ("Query failed");
$num5 = mysql_num_rows($sql);
if($num5 == 0){
//$xxyy .= $LANGAUGE[223];
}else{
$xxyy .= "<h1>".$LANGAUGE[266]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$bookscat   = "book_cat-$all[cat].html";
$booksall   = "showbook-$all[id].html";
}else{
$bookscat   = "book.php?action=book_cat&id=$all[cat]";
$booksall   = "book.php?action=showbook&id=$all[id]";
}

$xxyy .= "<li><a href='$booksall'>$allll</a></li>";
}
$xxyy .= "</ul>";

}




$sql = @mysql_query("SELECT id,cat,name FROM `fatawa` WHERE (active='1') AND (name LIKE '%$name%' OR title LIKE '%$name%' OR answer LIKE '%".$name."%') limit $limit") or die ("Query failed");
$num6 = mysql_num_rows($sql);
if($num6 == 0){
//$xxyy .= $LANGAUGE[224];
}else{
$xxyy .= "<h1>".$LANGAUGE[267]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$fatawacat  = "fatawa_cat-$all[cat].html";
$fatawaall  = "fatawa_show-$all[id].html";
}else{
$fatawacat  = "fatawa.php?action=fatawa&id=$all[cat]";
$fatawaall  = "fatawa.php?action=fatawa_show&id=$all[id]";
}

$xxyy .= "<li><a href='$fatawaall'>$allll</a></li>";
}
$xxyy .= "</ul>";
}





$sql = @mysql_query("SELECT id,name_cat FROM `anasheed_cat` WHERE (active='1') AND (name_cat LIKE '%$name%' OR description LIKE '%$name%') limit $limit") or die ("Query failed");
$num7 = mysql_num_rows($sql);
if($num7 == 0){
//$xxyy .= $LANGAUGE[225];
}else{
$xxyy .= "<h1>".$LANGAUGE[268]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name_cat]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$anashedcat = "anasheed_cat-$all[id].html";
}else{
$anashedcat = "anasheed.php?action=anasheed&id=$all[id]";
}

$xxyy .= "<li><a href='$anashedcat'>$allll</a></li>";
}
$xxyy .= "</ul>";

}




$sql = @mysql_query("SELECT id,name,cat FROM `anasheed` WHERE (active='1') AND (name LIKE '%$name%' OR metadescription LIKE '%$name%') limit $limit") or die ("Query failed");
$num8 = mysql_num_rows($sql);
if($num8 == 0){
//$xxyy .= $LANGAUGE[226];
}else{
$xxyy .= "<h1>".$LANGAUGE[269]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$anashedcat = "anasheed_cat-$all[cat].html";
$anashedall = "anasheed_show-$all[id].html";
}else{
$anashedcat = "anasheed.php?action=anasheed&id=$all[cat]";
$anashedall = "anasheed.php?action=anasheed_show&id=$all[id]";
}

$xxyy .= "<li><a href='$anashedall'>$allll</a></li>";
}
$xxyy .= "</ul>";

}





$sql = @mysql_query("SELECT id,name_flash,cat FROM `flash` WHERE (active='1') AND (name_flash LIKE '%$name%' OR metadescription LIKE '%$name%') limit $limit") or die ("Query failed");
$num9 = mysql_num_rows($sql);
if($num9 == 0){
//$xxyy .= $LANGAUGE[227];
}else{
$xxyy .= "<h1>".$LANGAUGE[270]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name_flash]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$flashcat   = "flash_cat-$all[cat].html";
$flashall   = "flash_show-$all[id].html";
}else{
$flashcat   = "flash.php?action=flash&id=$all[cat]";
$flashall   = "flash.php?action=flash_show&id=$all[id]";
}

$xxyy .= "<li><a href='$flashall'>$allll</a></li>";
}
$xxyy .= "</ul>";

}




$sql = @mysql_query("SELECT id,name_site,cat FROM `islam_dlil` WHERE (active='1') AND (name_site LIKE '%$name%' OR url_site LIKE '%$name%') limit $limit") or die ("Query failed");
$num10 = mysql_num_rows($sql);
if($num10 == 0){
//$xxyy .= $LANGAUGE[228];
}else{
$xxyy .= "<h1>".$LANGAUGE[271]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name_site]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$aldlelcat  = "aldlel_cat-$all[cat].html";
$aldlelall  = "aldlel_gosite-$all[id].html";
}else{
$aldlelcat  = "links.php?action=islam_dlil&id=$all[cat]";
$aldlelall  = "links.php?action=islam_dlil_go&id=$all[id]";
}

$xxyy .= "<li><a href='$aldlelall'>$allll</a></li>";
}
$xxyy .= "</ul>";

}





$sql = @mysql_query("SELECT id,name,cat FROM `download` WHERE (active='1') AND (name LIKE '%$name%' OR short LIKE '%$name%') limit $limit") or die ("Query failed");
$num11 = mysql_num_rows($sql);
if($num11 == 0){
//$xxyy .= $LANGAUGE[229];
}else{
$xxyy .= "<h1>".$LANGAUGE[272]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$aldlelcat  = "downloadcat-$all[cat].html";
$aldlelall  = "downloadshow-$all[id].html";
}else{
$aldlelcat  = "download.php?action=cat&id=$all[cat]";
$aldlelall  = "download.php?action=show&id=$all[id]";
}

$xxyy .= "<li><a href='$aldlelall'>$allll</a>";
}
$xxyy .= "</ul>";
}





$sql = @mysql_query("SELECT id,name,cat FROM `story` WHERE (active='1') AND (name LIKE '%$name%' OR text LIKE '%$name%') limit $limit") or die ("Query failed");
$num12 = mysql_num_rows($sql);
if($num12 == 0){
//$xxyy .= $LANGAUGE[230];
}else{
$xxyy .= "<h1>".$LANGAUGE[273]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$aldlelcat  = "storycat-$all[cat].html";
$aldlelall  = "storyshow-$all[id].html";
}else{
$aldlelcat  = "story.php?action=cat&id=$all[cat]";
$aldlelall  = "story.php?action=show&id=$all[id]";
}

$xxyy .= "<li><a href='$aldlelall'>$allll</a></li>";
}
$xxyy .= "</ul>";
}


$sql = @mysql_query("SELECT id,name,cat FROM `youtube` WHERE (active='1') AND (name LIKE '%$name%' OR keywords LIKE '%$name%'OR description LIKE '%$name%') limit $limit") or die ("Query failed");
$num13 = mysql_num_rows($sql);
if($num13 == 0){
//$xxyy .= $LANGAUGE[230];
}else{
$xxyy .= "<h1>".$LANGAUGE[274]."</h1>";
$xxyy .= "<ul>";
while($all = @mysql_fetch_array($sql))
{
$allll = text(3,$all[name]);
$allll = str_replace( "$name" , "<font color='#FF0000'>$name</font>", $allll);

if ($htmlorphp=="1"){
$youtubecat  = "youtubecat-$all[cat].html";
$youtubeall  = "youtubeshow-$all[id].html";
}else{
$youtubecat  = "youtube.php?action=cat&id=$all[cat]";
$youtubeall  = "youtube.php?action=show&id=$all[id]";
}

$xxyy .= "<li><a href='$youtubeall'>$allll</a></li>";
}
$xxyy .= "</ul>";
}

if($num1==0 && $num2==0 && $num3==0 && $num4==0 && $num5==0 && $num6==0 && $num7==0 && $num8==0 && $num9==0 && $num10==0 && $num11==0 && $num12==0 && $num13==0){
$xxyy .= $LANGAUGE[231];
}else{
$xxyy .= "";
}

$xxyy .= "</div>";
return $xxyy;
}
?>