Unable to connect to database server at this time

'); } if(!@mysql_select_db($db1)) { exit('

Unable to connect to database at this time

'); } } //////////////////////////////////////////// CATEGORIES //////////////////////////////////////////// CATEGORIES function redirect_to( $location = NULL ) { if ($location != NULL) { header("Location: {$location}"); exit; } } //////////////////////////////////////// function confirm_query($result_set) { if (!$result_set) { die("Database query failed: " . mysql_error()); } } //////////////////////////////////////////// CATEGORIES ///////////////////////////////////////// function show_topics() { $sex = "select * from nuke_topics order by topicid ASC "; $qx = mysql_query($sex); $numx = mysql_num_rows($qx); for ($j=1 ; $j<= $numx ; $j++) { $rowx = mysql_fetch_array($qx); $uux[$j]= $rowx['topicname']; $ux[$j]= $rowx['topicid']; $s6=$s6."
  • ".$uux[$j]."
  • "; } return $s6; } ////////////////////////////////////////// /* شريط الأخبار */ function ssnews() { $se = "select * from setting where sid='1' "; $q = mysql_query($se); $row = mysql_fetch_array($q); $f_news = $row['snews']; return $f_news; } ///////////////////////////////////////// ////////////////////////////////////////// /* شريط الأخبار */ function essnews() { $se = "select * from setting where sid='1' "; $q = mysql_query($se); $row = mysql_fetch_array($q); $f_news = $row['enews']; return $f_news; } ///////////////////////////////////////// /* الكلمة الترحيبية بالانكليزي */ function eword() { $se = "select * from setting where sid='1' "; $q = mysql_query($se); $row = mysql_fetch_array($q); $f_news = $row['ehome']; return $f_news; } ///////////////////////////////////////// //////////////////////////////////////////// CATEGORIES ////////////////////////////////////////// function createthumb($name,$filename,$new_w){ // لكل امتداد هناك دالة خاصة و هنا نحدد ما نريد $src_img=imagecreatefromjpeg($name); // نحصل على طول الصورة الأصلية $old_x=imageSX($src_img); // نحصل على ارتفاع الدالة الأصلية $old_y=imageSY($src_img); // ننشأ الصورة الجديدة المصغيرة $new_h=($old_y*$new_w)/$old_x; $dst_img=ImageCreateTrueColor($new_w,$new_h); //ننسخ محتويات الصورة الكبيرة في الصورة الجديدة التي انشأناها في الخطوة السابقة imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$old_x,$old_y); // نحدد الصيغة التي نريد للصورة الجديدة ان تخزن بها .. imagejpeg($dst_img,$filename); // التخلص من الصور المؤقتة التي انشأناها imagedestroy($dst_img); imagedestroy($src_img); } //////////////////////////////////////////// CATEGORIES //////////////////////////////////////////// CATEGORIES /* المواضيع على اليمين */ function rightm () { } ///////////////////////// //////////////////////////////////////////// CATEGORIES function admin_menu() { $seuq = "select * from admintopics order by tid ASC "; $quq = mysql_query($seuq); $numq = mysql_num_rows($quq); for ($j=1 ; $j<= $numq ; $j++) { $rowq = mysql_fetch_array($quq); $z[$j]= $rowq['tid']; $zz[$j]= $rowq['ttitle']; $zlink[$j]= $rowq['tlink']; if ($zlink[$j]!='') $s=$s."".$zz[$j]."

    "; else $s=$s."".$zz[$j]."

    "; } echo $s; } ////////////////////////////////// //// ************************* ////////////////////////////////// function show_flash($swffile,$swfwidth,$swfhight) { echo" "; } ////////////////////////////////// /////////////////////////////////////// //////////////////////////////////////////// Page Head function show_date() { $nameday=date("l"); $day=date("d"); $namemonth=date("m"); $year=date("Y"); switch ($nameday) { case "Saturday": $nameday="السبت"; break; case "Sunday": $nameday="الأحد"; break; case "Monday": $nameday="الاثنين"; break; case "Tuesday": $nameday="الثلاثاء"; break; case "Wednesday": $nameday="الأربعاء"; break; case "Thursday": $nameday="الخميس"; break; case "Friday": $nameday="الجمعة"; break; } switch ($namemonth) { case 1: $namemonth=" كانون الثاني"; break; case 2: $namemonth=" شباط"; break; case 3: $namemonth=" آذار"; break; case 4: $namemonth=" نيسان"; break; case 5: $namemonth=" أيار"; break; case 6: $namemonth=" حزيران"; break; case 7: $namemonth=" تموز"; break; case 8: $namemonth=" آب"; break; case 9: $namemonth=" أيلول"; break; case 10: $namemonth=" تشرين الأول"; break; case 11: $namemonth=" تشرين الثاني"; break; case 12: $namemonth=" كانون الأول"; break; } $xx= "اليوم : $nameday $day $namemonth $year"; return $xx; } ///////////////////////////////////// //////////////////////////////////////////// Page Head function postext($posid) { if ($posid=='r1') { $xpos="يمين "; } else if ($posid=='l1') { $xpos="يسار "; } else { $xpos=" غير معروض"; } return $xpos; } ///////////////////////////////////// //////////////////////""" عرض صورة أو فلاشة الإعلان """"////////////////////// Page Head function disads($adstype,$adfile) { //connect(); // $spos = "select * from ads_width_hieght where ads_pos='$adspos' "; // $qpos = mysql_query($spos); // list($ads_id,$ads_pos,$ads_w,$ads_h) = mysql_fetch_row($qpos); list($xxw,$xxh,$xxtype,$xxattr) = getimagesize("../madsimages/".$adfile); if ($adstype=='image/jpeg' or $adstype=='image/gif') { //echo "\"getimagesize()"; $xrx="\"\""; } else if ($adstype=='application/x-shockwave-flash') { $xrx=" "; } else { $xrx==" "; } return $xrx; } ////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////// function ads_home($pos,$def_file) { connect(); $sr2 = "SELECT * FROM ads_index where ( homepos = '$pos' and aactive = '1' ) and ( aperiod = '0' or ( aperiod = '2' and atimes <> usedtimes ) or ( aperiod = '1' and adate <= fdate ) ) ORDER BY RAND( ) LIMIT 1 "; $qr2 = mysql_query($sr2); $num2 = mysql_num_rows($qr2); if($num2<>0) { ///////////////////في حال كان هناك نتيجة//////////////////////// list($aid,$aname,$aactive,$atype,$alink,$afile,$aperiod,$fdate,$adate,$atimes,$usedtimes,$homepos,$pagepos) = mysql_fetch_row($qr2); list($xxw,$xxh,$xxtype,$xxattr) = getimagesize("madsimages/".$afile); if ($aperiod=='2' ) { $xusedtimes=$usedtimes+1; $inx="update ads_index set usedtimes='$xusedtimes' where aid='$aid'"; $resultx=mysql_query($inx); //echo $inx; //echo " jdddddddddddddddddddddddddd"; } if ($aperiod=='1' ) { $inx="update ads_index set adate=CURDATE() where aid='$aid'"; $resultx=mysql_query($inx); } if ($atype=='application/x-shockwave-flash') { $xr2=" "; } else if ($atype=='image/jpeg' or $atype=='image/gif') { $xr2="\"\""; } ///////////////////في حال لم يكن هناك نتيجة//////////////////////// } else { list($xxw,$xxh,$xxtype,$xxattr) = getimagesize("madsimages/".$def_file); $xr2="\"\""; } return $xr2; } //////////////////////////////////////////// ///////////////////////////////////// function ads_page($pos,$def_file) { connect(); $sr2 = "SELECT * FROM ads_index where (pagepos = '$pos' and aactive = '1') and (aperiod = '0' or ( aperiod = '2' and atimes <> usedtimes) or (aperiod = '1' and adate <= fdate) ) ORDER BY RAND( ) LIMIT 1 "; //echo $sr2; $qr2 = mysql_query($sr2); $num2 = mysql_num_rows($qr2); if($num2<>0) { ///////////////////في حال كان هناك نتيجة//////////////////////// list($aid,$aname,$aactive,$atype,$alink,$afile,$aperiod,$fdate,$adate,$atimes,$usedtimes,$homepos,$pagepos) = mysql_fetch_row($qr2); list($xxw,$xxh,$xxtype,$xxattr) = getimagesize("madsimages/".$afile); if ($aperiod=='2' ) { $xusedtimes=$usedtimes+1; $inx="update ads_index set usedtimes='$xusedtimes' where aid='$aid'"; $resultx=mysql_query($inx); //echo $inx; //echo " jdddddddddddddddddddddddddd"; } if ($aperiod=='1' ) { $inx="update ads_index set adate=CURDATE() where aid='$aid'"; $resultx=mysql_query($inx); } if ($atype=='application/x-shockwave-flash') { $xr2=" "; } else if ($atype=='image/jpeg' or $atype=='image/gif') { $xr2="\"\""; } ///////////////////في حال لم يكن هناك نتيجة//////////////////////// } else { list($xxw,$xxh,$xxtype,$xxattr) = getimagesize("madsimages/".$def_file); $xr2="\"\""; } return $xr2; ////////////////////////////////////////////////////// } ?>