'يناير','02'=>'فبراير','03'=>'مارس','04'=>'ابريل','05'=>'مايو','06'=>'يونيه','07'=>'يوليو','08'=>'اغسطس','09'=> 'سبتمبر','10'=>'اكتوبر','11'=>'نوفمبر','12'=>'ديسمبر'); $ar_day_array = array('Sat'=>'السبت','Sun'=>'الاحد','Mon'=>'الاثنين','Tue'=>'الثلاثاء','Wed'=>'الاربعاء','Thu'=>'الخميس','Fri'=>'الجمعة'); $ar_date_y =date("Y",$timestamp); $ar_date_d =date("d",$timestamp); $ar_date_dAR =date("D",$timestamp); $ar_date_m =date("m",$timestamp); $ar_time_m =date("h:i",$timestamp); $ar_date_m1 =$ar_month_array[$ar_date_m]; $ar_date_day =$ar_day_array[$ar_date_dAR]; $arabic_date ="$ar_date_day $ar_date_d $ar_date_m1 $ar_date_y - $ar_time_m"; $resultip = mysql_query("SELECT ip FROM useronline WHERE ip='$ip'")or die(mysql_error()); $userip = mysql_num_rows($resultip); if($userip == 0 ){ $insert1 =mysql_query("UPDATE setting SET visitor=visitor+1")or die(mysql_error()); $insert = mysql_query("INSERT INTO useronline VALUES ('$timestamp','$ip')"); } $xmlmap =displaymap(0,'./',100,$mx[url_st]); $lcx = $_GET['show']; $lid = strip_tags(preg_replace("/'\/<>\"/","",filter_sql($_GET['c']))); $xid = strip_tags(preg_replace("/'\/<>\"/","",filter_sql($_GET['last']))); $pgel = strip_tags(preg_replace("/'\/<>\"/","",filter_sql($_GET['pge']))); eval ("\$sidebar = \"".gettemplates("sidebar",$templat_f)."\";"); eval ("\$sidebar2 = \"".gettemplates("sidebar2",$templat_f)."\";"); switch($lcx){ case 'cat': $idarticle = filter_sql(strip_tags($_GET['c'])); $cates_images = mysql_query("select * from lessons_cat where id='$idarticle' ")or die(mysql_error()); if(!mysql_num_rows($cates_images)){ $main_form .="عفوا العنوان خاطئ" ; }else{ $mxc = mysql_fetch_array($cates_images); $cat_name =$mxc[cat_name]; $site_description =$mxc[cat_describe]; $site_kewords =$mxc[cat_keywords]; $mnutitle =$mxc[cat_name]; mysql_query("UPDATE lessons_cat SET cat_visit=cat_visit+1 where id='$idarticle'")or die(mysql_error()); //--------->>>>>> فهرس القسم $cat_link_list .="$cat_name"; $index_link_word .="الرئيسية | "; $index_list .="$index_link_word $cat_link_list"; //--------->>>>> if(!(isset($_GET[last]))){ $page=1; $site_name = "$cat_name"; }else{ $page = $_GET['last']; $page = strip_tags($page); $page = filter_sql($page); $site_name = "$cat_name $page"; } $cat_name_sm = $mxc[cat_name]; $end = $mxc[num_img_page]; $show = 5; $start= $page*$end-$end; $query_news = mysql_query("SELECT * FROM lessons_files where lesson_stat='1' && cat_id='$idarticle' && del='0' ORDER BY id desc LIMIT $start,$end") or die(mysql_error()); if( mysql_num_rows($query_news) == 0){ $erorresult .="
لا يوجد مقالات فى هذا القسم"; eval ("\$saymaster = \"".gettemplates("result",$templat_f)."\";"); $main_form .=" $saymaster"; }else{ require_once('include/functions.php'); //replace( $nu =mysql_num_rows($query_news); for($i=1 ;$i<=$nu;$i++){ $r = mysql_fetch_array($query_news); $id = $r['id']; $title = $r['lesson_title']; $text2 = long_text(strip_tags(Replacesmall($r['lesson_text'])),5,0,200,$id); $counts = $r['lesson_views']; $time = $r['lesson_date']; $vote_rate = $r['vote_rate']; $count_rate = $r['count_rate']; $date = date("m/d/Y", $time); $copyright = $r['lesson_copyright']; $usrid = $r['usr_id']; //-------->>>استعراض الصورة $filattach = mysql_query("select * from attach_table where lid='$id' && st=1 limit 1") or die (mysql_error()); if( mysql_num_rows($filattach) !== 0){ $lch = mysql_fetch_array($filattach); $logimg = $lch['fname']; }else{ $logimg = (''); } eval ("\$articleforumx = \"".gettemplates("article_role",$templat_f)."\";"); $article_titles .=$articleforumx; } $sqlnum2 = mysql_query("select * from lessons_files where cat_id='$idarticle' && del='0'") or die (mysql_error()); $rowsnum =mysql_num_rows($sqlnum2); $mlinks =$rowsnum/$end; $lastlink =ceil($mlinks); if ($lastlink!=1 ) { $signfilex .= "الصفحات :  "; if (($lastlink<=$page+$show and $page-$show>1) or ($page-$show>1) ) { $signfilex .= "«الاولى   .."; } if ($page-$show<1) { for ($i=1 ;$i<=$page-1 ;$i++) $signfilex .= "[$i]  "; } if ($page-$show>=1){ for ($i=$page-$show ;$i<=$page-1 ;$i++) $signfilex .= "[$i]  -"; } if ($lastlink>$page+$show) { $signfilex .= "[$page]  "; for ($i=$page+1 ;$i<=$page+$show ;$i++){ $signfilex.= "[$i]  "; } $signfilex .= " .. »الاخيرة  "; } if ($lastlink<=$page+$show) { $signfilex .= "[$page]  "; for ($i=$page+1 ;$i<=$lastlink ;$i++) $signfilex .= "[$i]  "; } } $templserach = "artarchive_$idarticle"; $templpath = "templates/mansoura/$templserach.html"; if (file_exists($templpath)){ eval ("\$main_form = \"".gettemplates($templserach,$templat_f)."\";"); }else{ eval ("\$main_form = \"".gettemplates("artarchive",$templat_f)."\";"); } } } break; case'search': $sort_search = filter_sql(strip_tags(preg_replace("/'\/<>\"/","",$_REQUEST['sort_search']))); //$wordbsearch = filter_sql(); $wordbsearchnull = str_replace(" ","_",strip_tags(preg_replace("/'\/<>\"/","",trim($_REQUEST['word'])))); $wordbsearch = str_replace("_"," ",strip_tags(preg_replace("/'\/<>\"/","",trim($_REQUEST['word'])))); if(!(isset($_GET[c]))){ $page=1; }else{ $page = $_GET['c']; $page = strip_tags($page); $page = filter_sql($page); } $end = 5; $show = 5; $start= $page*$end-$end; if($sort_search == 3){ $usrqurt = mysql_query("select * from users where username= '$wordbsearch'")or die(mysql_error()); $usrow = mysql_fetch_array($usrqurt); if($usrow){ $srchfiles1 = "select * from lessons_files where usr_id ='$usrow[uid]' && del='0' and lesson_stat=1 "; $srchfiles = mysql_query($srchfiles1." LIMIT $start,$end ")or die(mysql_error()); } } elseif($sort_search == 1){ $srchfiles1 = "select * from lessons_files where lesson_title like '%$wordbsearch%' && del='0' and lesson_stat=1 "; $srchfiles = mysql_query($srchfiles1." LIMIT $start,$end ")or die(mysql_error()); }else{ $srchfiles1 = "select * from lessons_files where lesson_text like '%$wordbsearch%' && del='0' and lesson_stat=1"; $srchfiles = mysql_query($srchfiles1." LIMIT $start,$end ")or die(mysql_error()); } if( @mysql_num_rows($srchfiles) == "0"){ $erorresult .= ('
لا يوجد نتيجة لبحثك'); eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); }elseif(!$wordbsearch){ $erorresult .= ('
ادخل كلمة البحث'); eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); }else{ require_once('include/functions.php'); while($r = mysql_fetch_array($srchfiles)) { $id = $r['id']; $usrid = $r[usr_id]; $title = $r['lesson_title']; $text2 = long_text(strip_tags(Replacesmall($r['lesson_text'])),5,0,200,$id); $counts = $r['lesson_views']; $vote_rate = $r['vote_rate']; $count_rate = $r['count_rate']; $time = $r['lesson_date']; $date = date("m/d/Y", $time); $copyright = $r['lesson_copyright']; eval ("\$articleforumx = \"".gettemplates("article_role",$templat_f)."\";"); $article_titles .=$articleforumx; } $sqlnum2 = mysql_query("$srchfiles1") or die (mysql_error()); $rowsnum = mysql_num_rows($sqlnum2); $mlinks = $rowsnum/$end; $lastlink = ceil($mlinks); if ($lastlink!=1 ) { $signfilex .= "الصفحات :  "; if (($lastlink<=$page+$show and $page-$show>1) or ($page-$show>1) ) { $signfilex .= "«الاولى   .."; } if ($page-$show<1) { for ($i=1 ;$i<=$page-1 ;$i++) $signfilex .= "[$i]  "; } if ($page-$show>=1){ for ($i=$page-$show ;$i<=$page-1 ;$i++) $signfilex .= "[$i]  -"; } if ($lastlink>$page+$show) { $signfilex .= "[$page]  "; for ($i=$page+1 ;$i<=$page+$show ;$i++){ $signfilex.= "[$i]  "; } $signfilex .= " .. »الاخيرة  "; } if ($lastlink<=$page+$show) { $signfilex .= "[$page]  "; for ($i=$page+1 ;$i<=$lastlink ;$i++) $signfilex .= "[$i]  "; } } eval ("\$main_form = \"".gettemplates("artarchive",$templat_f)."\";"); } @mysql_free_result($srchfiles); break; case 'article': $idarticle = filter_sql(strip_tags($_GET['c'])); require_once('include/functions.php'); if ((!$idarticle) or (!eregi("[0-9]{1,2}$", $idarticle))) { $main_form .= "عفوا : هذا طلب غير شرعى ."; }else{ $query_article = mysql_query("SELECT * FROM lessons_files WHERE lesson_stat=1 && del='0' && id='$idarticle'") or die(mysql_error()); if($r = mysql_fetch_array($query_article)){ $id = $r[id]; $catid = $r[cat_id]; $title = $r[lesson_title]; $text2 = $r[lesson_text]; //EmptyReplace(Replace( $text2 = Replacesmall(imgbbcode_small($text2)); $badfiltr = filtearticle(); $text2 = str_replace($badfiltr['find'], "*****", $text2); $hyprlink = findhyperlink(); $text2 = str_replace($hyprlink[word], $hyprlink[links], $text2); //-------->>>استعراض باقى الصور $filattachx = mysql_query("select * from attach_table where lid='$id' and st >1 order by id asc ") or die (mysql_error()); while( $lcvf= mysql_fetch_array($filattachx)){ $imgpathd =$lcvf['fpath'].$lcvf['fname']; $allimags .=('

'.$lcvf['descs'].'
'); //$logimg = (''); } $filattachx1 = mysql_query("select * from attach_table where lid='$id' and st=1 order by id asc ") or die (mysql_error()); while( $lcvf1= mysql_fetch_array($filattachx1)){ $imgpathd1 =$lcvf1['fpath'].$lcvf1['fname']; $masterpostimage .=('
'.$lcvf1['descs'].'

'.$lcvf1['descs'].'

'); } $text3 =$text2."
$allimags"; $count = $r[lesson_views]; $dat = $r[lesson_date]; $copyright = $r[lesson_copyright]; $dat = date("m/d/Y", $dat); $viewscount = array(1,3,5,7,9,10,14,16,17); $addviewscount = $viewscount[array_rand($viewscount)]; $countupdate =mysql_query("update lessons_files set lesson_views=lesson_views+$addviewscount where id='$id'"); $cates_query = mysql_query("select * from lessons_cat where id='$catid' ")or die(mysql_error()); $mxc = mysql_fetch_array($cates_query); $cat_name =$mxc[cat_name]; //-------->>>استعراض اسم العضو $usrinfol = mysql_query("select * from users where uid='$r[usr_id]' limit 1") or die (mysql_error()); $sroh = mysql_fetch_array($usrinfol); $user_copyrights =$sroh[username]; $user_maskname =$sroh[mask_name]; $user_useremail =$sroh[useremail]; if($r[cat_id] == $writer_cat_id){ if(!$sroh[usr_logo] ){ if($sroh[usr_sex]=='female'){ $usr_article_logo ="icon/user_female.png"; }else{ $usr_article_logo ="icon/user_male.png"; } }else{ $usr_article_logo ="$logo_path/$sroh[usr_logo]"; } } //-------->>>استعراض الصورة $filattach = mysql_query("select * from attach_table where lid='$id' order by id asc limit 1 ") or die (mysql_error()); if( mysql_num_rows($filattach) !== 0){ $lch = mysql_fetch_array($filattach); $logimg = (''); }else{ $logimg = (''); } //-------->>Seo $mnutitle = $title; $site_name = $title; $rgscaribsearch = cuttext($text2,200,0,200); $site_description = strip_tags($rgscaribsearch); //$site_description = $r[article_kewords]; $site_kewords = strip_tags(str_replace(" ", ",", $rgscaribsearch));//$r[article_description]; //-------->> //--------->> مقالات لنفس الكاتب $copfiles = mysql_query("select * from lessons_files where usr_id='$r[usr_id]' && lesson_stat=1 order by id desc limit 4")or die(mysql_error()); while ($simxl = mysql_fetch_array($copfiles)){ //replace( if($id !== $simxl[id]){ $cutsimilratx = cuttext(strip_tags(Replacesmall(imgbbcode_small($simxl['lesson_text']))),1,0,100); eval ("\$say34783 = \"".gettemplates("sam_writer",$templat_f)."\";"); $samwriter_rle .= $say34783; } } mysql_free_result($copfiles); eval ("\$samearticlewriter_mu = \"".gettemplates("samwriter_block",$templat_f)."\";"); //--------->> //--------->> مقالات متشابهة $rgscaribsearch = cuttext(strip_tags(Replacesmall(imgbbcode_small($r['lesson_title']))),1,0,100); $mctg = split(' ', $rgscaribsearch); $mctg = array_unique($mctg); while(list($k,$v)=each($mctg)){ $txtmax = strlen($v); if($txtmax > 1){ $vv = mysql_real_escape_string($v); $simfiles = mysql_query("select * from lessons_files where lesson_title like '%$vv%' && lesson_stat=1 order by id limit 1")or die(mysql_error()); while ($simx = mysql_fetch_array($simfiles)){ //replace( eval ("\$say3478 = \"".gettemplates("similar_lst",$templat_f)."\";"); $smiliar_rle .= $say3478; } mysql_free_result($simfiles); } } eval ("\$similararticle_menu = \"".gettemplates("similarartcle_block",$templat_f)."\";"); //--------->> $smailmenu = ""; //الغاء قائمة البريد وسابتدال قواءت التصويت والاعلان بقاوائم مقالات متشابهة //----->>>> استعراض التعليقات if(!(isset($_GET[last]))){ $page=1; }else{ $page = $_GET['last']; $page = strip_tags($page); $page = filter_sql($page); } $end = $mx[comnt_count_page]; $show = 5; $start= $page*$end-$end; $filecomments = mysql_query("select * from comments_tables where c_bid='$id' && c_stat=1 ORDER BY cid asc LIMIT $start,$end") or die (mysql_error()); if( mysql_num_rows($filecomments) == 0){ $allcommentstxt .="

منصورة سيتي

لا يوجد تعليقات لهذا الملف، اكتب تعليقك الآن.
"; }else{ while($lnc = mysql_fetch_array($filecomments)){ $cid = $lnc['cid']; $c_name = $lnc['c_name']; $c_added = $lnc['c_added']; $c_added = date("d/m/Y h:m:s A",$c_added); $c_txt = Replacesmall(imgbbcode_small($lnc['c_txt'])); $badfiltr = filtearticle(); $c_txt = str_replace($badfiltr['find'], "*****", $c_txt); $c_title = $lnc['c_title']; eval ("\$saycomment = \"".gettemplates("comment_role",$templat_f)."\";"); $allcommentstxt .="$saycomment" ; } $sqlnum2 = mysql_query("select * from comments_tables where c_bid='$id' && c_stat=1 ORDER BY cid asc") or die (mysql_error()); $rows_comments_num =mysql_num_rows($sqlnum2); $mlinks =$rows_comments_num/$end; $lastlink =ceil($mlinks); if ($lastlink!=1 ) { $signfilex .= "الصفحات :  "; if (($lastlink<=$page+$show and $page-$show>1) or ($page-$show>1) ) { $signfilex .= "«الاولى   .."; } if ($page-$show<1) { for ($i=1 ;$i<=$page-1 ;$i++) $signfilex .= "[$i]  "; } if ($page-$show>=1){ for ($i=$page-$show ;$i<=$page-1 ;$i++) $signfilex .= "[$i]  -"; } if ($lastlink>$page+$show) { $signfilex .= "[$page]  "; for ($i=$page+1 ;$i<=$page+$show ;$i++){ $signfilex.= "[$i]  "; } $signfilex .= " .. »الاخيرة  "; } if ($lastlink<=$page+$show) { $signfilex .= "[$page]  "; for ($i=$page+1 ;$i<=$lastlink ;$i++) $signfilex .= "[$i]  "; } } } //if($loggedin){ $Brwoser = CheckBrowser(); if($Brwoser == 'IE'){ $nal =('
'); $stl =('position:absolute; top:15px; right:5px;'); }else{ $nal =(''); $stl =('position:relative; top:-6px; left:1px;'); $nie =(''); } if($loggedin){ $input_area_type="hidden"; }else{ $input_area_type="text"; } eval ("\$saycomment = \"".gettemplates("comment_form",$templat_f)."\";"); $comment1_form ="$saycomment" ; //}else{ //$comment1_form ="
يلزم تسجيل الدخول لكى تتمكن من نشر التعليقات لهذا المقال." ; //} //---------->>>> $templserach = "article_show_$catid"; $templpath = "templates/mansoura/$templserach.html"; if (file_exists($templpath)){ eval ("\$main_form = \"".gettemplates($templserach,$templat_f)."\";"); }else{ eval ("\$main_form = \"".gettemplates("article_show",$templat_f)."\";"); } }else{ eval ("\$articleforumxv = \"".gettemplates("article_error",$templat_f)."\";"); $main_form .=$articleforumxv ; } } break; case 'comment': $fileid = strip_tags($_POST['lessonid']); $email = strip_tags($_POST['email']); $title = strip_tags($_POST['title']); $username = strip_tags($_POST['username']); $pincode = md5(strip_tags(trim($_POST['pincode']))); $cincode = $_SESSION['key']; require_once('include/functions.php'); $lesson = add_slashes(XSS_Remove(stripslashes(convert_wysiwyg_to_bbcode_small($_POST['WYSIWYG_HTML'])))); $lesson = addlinebreak(str_replace("'",""",$lesson)); if (!isset($username) || $username['name'] == "") { $erorresult .= "
اكتب الاسم"; }elseif (!isset($lesson) || $lesson['name'] == "") { $erorresult .= "
اكتب نص التعليق"; }elseif ((!$email) or (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $email))) { $erorresult .= "
بريد الكترونى خاطئ"; }elseif (!$pincode) { $erorresult .= "
يرجى كتابة رمز التاكيد"; }elseif ($pincode !== $cincode) { $erorresult .= "
رمز التاكيد خاطئ . يرجى اعادة المحاولة"; }else { $timenow =time(); if($mx[active_comment]){ $act =0; }else{ $act =1; } $sql = mysql_query("INSERT INTO comments_tables (c_bid, c_name, c_title, c_added, c_txt, c_stat,c_ip,usr_id,email) VALUES('$fileid', '$username', '$title', '$timenow', '$lesson', '$act','$ip','$myusruid','$email')"); $updateusrcomments =mysql_query("UPDATE users SET usr_comments=usr_comments+1 where uid='$myusruid'")or die(mysql_error()); $_SESSION['key'] = 1; if($act){ $erorresult .= "
شكرا لك .تم حفظ تعليقك

"; }else{ $erorresult .= "

شكرا لك .تم حفظ تعليقك وجارى مراجعته من قبل المشرف

"; } $erorresult .= "

لحظات وسيتم اعادتك تلقائيا
"; $erorresult .="\n"; } eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); break; case 'meeting': $mnutitle = "لقاءات مسؤلين"; if(!(isset($_GET[c]))){ $page=1; }else{ $page = $_GET['c']; $page = strip_tags($page); $page = filter_sql($page); } $cat_name_sm = $mxc[cat_name]; $end = 5; $show = 5; $start= $page*$end-$end; $query_news = mysql_query("SELECT * FROM meeting ORDER BY id desc LIMIT $start,$end") or die(mysql_error()); if( mysql_num_rows($query_news) == 0){ $erorresult .="
$site_name

لا يوجد لقاءات"; eval ("\$saymaster = \"".gettemplates("result",$templat_f)."\";"); $main_form .=" $saymaster"; }else{ require_once('include/functions.php'); //replace( $nu =mysql_num_rows($query_news); for($i=1 ;$i<=$nu;$i++){ $r = mysql_fetch_array($query_news); $id = $r['id']; $title = $r['title']; $text2 = longtext(strip_tags(Replacesmall(imgbbcode_small($r['text']))),5,0,200,$id); //-------->>>استعراض الصورة if($r['logo']){ $logimg = (''); }else{ $logimg = (''); } eval ("\$articleforumx = \"".gettemplates("meeting_role",$templat_f)."\";"); $article_titles .=$articleforumx; } $sqlnum2 = mysql_query("select * from meeting ") or die (mysql_error()); $rowsnum =mysql_num_rows($sqlnum2); $mlinks =$rowsnum/$end; $lastlink =ceil($mlinks); if ($lastlink!=1 ) { $signfilex .= "الصفحات :  "; if (($lastlink<=$page+$show and $page-$show>1) or ($page-$show>1) ) { $signfilex .= "«الاولى   .."; } if ($page-$show<1) { for ($i=1 ;$i<=$page-1 ;$i++) $signfilex .= "[$i]  "; } if ($page-$show>=1){ for ($i=$page-$show ;$i<=$page-1 ;$i++) $signfilex .= "[$i]  -"; } if ($lastlink>$page+$show) { $signfilex .= "[$page]  "; for ($i=$page+1 ;$i<=$page+$show ;$i++){ $linkpages.= "[$i]  "; } $signfilex .= " .. »الاخيرة  "; } if ($lastlink<=$page+$show) { $signfilex .= "[$page]  "; for ($i=$page+1 ;$i<=$lastlink ;$i++) $signfilex .= "[$i]  "; } } eval ("\$articleforumx = \"".gettemplates("artarchive",$templat_f)."\";"); $main_form =$articleforumx; } break; case 'met': if ((!$lid) or (!eregi("[0-9]{1,2}$", $lid))) { $main_form .= "

عفوا : هذا طلب غير شرعى ."; }else{ $pagesinfo = mysql_query("select * from meeting where id='$lid' ")or die(mysql_error()); $mxco = mysql_fetch_array($pagesinfo); $pgtitle = $mxco[title]; $Pagetxt1 = $mxco[text]; $logo = $mxco[logo]; $mnutitle = $pgtitle; require_once('include/functions.php'); //Replace( $pagetxt = Replacesmall(imgbbcode_small($Pagetxt1)); if($logo){ $logimg = (''); }else{ $logimg = (''); } eval ("\$saypage = \"".gettemplates("page",$templat_f)."\";"); $main_form .="$saypage"; } break; case 'callus': $mnutitle = "اتصل بنا"; $save = strip_tags($_POST['save']); $name = strip_tags($_POST['name']); $email = strip_tags($_POST['email']); $body = strip_tags($_POST['body']); $title = strip_tags($_POST['title']); $message = strip_tags($_POST['message']); $currentip = $_SERVER['REMOTE_ADDR']; $pincode = trim($_POST['pincode']); $pincode = md5(strip_tags($pincode)); $cincode = $_SESSION['key']; if($save){ if (!isset($name) || $name['name'] == "") { $erorresult .= "
فضلاً أكتب اسمك "; }elseif ((!$email) or (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $email))) { $erorresult .= "
بريد الكترونى خاطئ"; }elseif (!isset($body) || $body['name'] == "") { $erorresult .= "
اكتب موضوع الرسالة"; }elseif (!isset($title) || $title['name'] == "") { $erorresult .= "
اكتب عنوان الرسالة"; }elseif (!isset($message) || $message['name'] == "") { $erorresult .= "
اكتب نص الرسالة"; }elseif (!$pincode) { $erorresult .= "
يرجى كتابة رمز التاكيد"; }elseif ($pincode !== $cincode) { $erorresult .= "
رمز التاكيد خاطئ . يرجى اعادة المحاولة"; }else { $timenow =time(); $sql = mysql_query("INSERT INTO callus (name, email, body, title, message, ip,time) VALUES('$name', '$email', '$body', '$title', '$message', '$currentip','$timenow')"); $_SESSION['key'] = 1; $erorresult .= "
شكرا لك . وسيتم مراسلتك فى اسرع وقت ممكن
"; $erorresult .="\n"; } eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); }else{ eval ("\$main_form = \"".gettemplates("callus",$templat_f)."\";"); } break; case 'register'; $mnutitle = "عضوية جديدة"; if($loggedin){ $erorresult .="
عفوا انت مسجل لدينا مسبقا"; eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); } elseif(!$mx[registerstat]){ $erorresult .= "
عفوا التسجيل مغلق حاليا بالموقع"; eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); }else{ require "include/country.php"; $usr_country = country_menu($country1,$country_array); eval ("\$main_form = \"".gettemplates("register",$templat_f)."\";"); } break; case 'active': $site_name ="تفعيل عضوية"; $queryusr = mysql_query("SELECT * FROM users WHERE uid='$lid'") or die (mysql_error()); if(mysql_num_rows($queryusr) == 1){ $x = mysql_fetch_array($queryusr); $uid = $x[uid]; $status = $x[usr_stat]; if($status == '1'){ $erorresult .= "
هذه العضوية مفعلة سابقا ."; }else{ $upde = mysql_query("UPDATE users SET usr_stat='1' where uid='$uid'")or die (mysql_error()); $erorresult .= "
تم تفعيل العضوية بنجاح

يمكنك تسجل الدخول الان."; } }else{ $erorresult .= "

عفوا هذا الطلب غير متاح."; } eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); break; case 'login': $mnutitle = "تسجيل دخول"; if($loggedin){ $erorresult .="
عفوا انت مسجل لديناحاليا ."; eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); }else{ $referer = $_SERVER['HTTP_REFERER']; eval ("\$main_form = \"".gettemplates("login",$templat_f)."\";"); } break; case 'gallery': require_once "gallery.php"; break; case 'videos': require_once "videos.php"; break; case 'sendpass': $mnutitle = "استعادة كلمة المرور"; eval ("\$main_form = \"".gettemplates("sendpass",$templat_f)."\";"); break; case 'dalil': require "dalil.php"; break; case 'msg': require "res.php"; break; case 'addarticle': $mnutitle = "اضافة خبر"; $save = strip_tags($_POST['save']); $lesson_title = strip_tags($_POST['lesson_title']); $lesson_cat = strip_tags($_POST['lesson_cat']); $article_kewords = strip_tags($_POST['article_keywords']); $article_description = strip_tags($_POST['article_description']); $pincode = md5(strip_tags(trim($_POST['pincode']))); $cincode = $_SESSION['key']; require_once('include/functions.php'); //convert_wysiwyg_html_to_bbcode( $lesson = add_slashes(XSS_Remove(stripslashes(convert_wysiwyg_to_bbcode_small($_POST['WYSIWYG_HTML'])))); $lesson = addlinebreak(str_replace("'",""",$lesson)); if($save){ if (!isset($lesson_title) || $lesson_title['name'] == "") { $erorresult .= "فضلاً أكتب عنوان الخبر "; }elseif (!isset($lesson) || $lesson['name'] == "") { $erorresult .= "اكتب محتوى الخبر"; }else { $thmub_list = count($thumb_width_array); //------>> حفظ المرفقات اذا وجدت $tfile2 = $_FILES['thefile1']; if($tfile2['name']){ for($i=1;$i<=$mx[attach_num];$i++){ $thefile = $_FILES['thefile'.$i]; $thedesc = $_POST['desc'.$i]; $file_ext = check_extension($thefile['name']); if($file_ext){ $filetypes = explode(",",$attach_type); //if ( $file_ext == "jpg" ||$file_ext == "png" ||$file_ext == "gif" ||$file_ext == "GIF" || $file_ext == "JPG" || $file_ext == "PNG" || $file_ext == "jpeg" || $file_ext == "JPEG") { $prevent_tags = array('ini_set','set_magic_quotes_runtime','stripslashes', '@is_object', '@function_exists', '@file','@ob_get_contents','@chdir','','
',' ($attach_size * 1024 * 1024)) { $erorresult = "
حجم الملف اكبر من الحجم المسموح به"; eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); eval ("\$saymaster = \"".gettemplates("master",$templat_f)."\";"); echo"$saymaster" ; exit; }elseif(!in_array($file_ext, $filetypes)){ $erorresult = "
امتداد الملف غير مسموح به"; eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); eval ("\$saymaster = \"".gettemplates("master",$templat_f)."\";"); echo"$saymaster" ; exit; }else{//--حفظ الملف $watermarkfile ='watermark.gif'; $newFileName = newImageName($thefile['name']); $folder2x = "/$attach_fld/"; $folder3x = "$attach_fld/"; move_uploaded_file($thefile['tmp_name'], ".$folder2x".$newFileName); $txmg = (".$folder2x".$newFileName) ; if($_FILES['thefile'.$i]){ if ($file_ext == "jpg" ||$file_ext == "png" || $file_ext == "JPG" || $file_ext == "PNG" || $file_ext == "jpeg" || $file_ext == "JPEG" ) { mergePixl($txmg,$watermarkfile,$txmg, $pos=4,$transition=80); } } if($_FILES['thefile1']){ if ($file_ext == "jpg" ||$file_ext == "png" || $file_ext == "JPG" || $file_ext == "PNG" || $file_ext == "jpeg" || $file_ext == "JPEG" ) { if ($file_ext == "jpg" || $file_ext == "JPG") { $source_id = imagecreatefromjpeg($txmg); } elseif ($file_ext == "png" || $file_ext == "PNG") { $source_id = imagecreatefrompng($txmg); } elseif ($file_ext == "GIF" || $file_ext == "gif") { $source_id = imagecreatefromgif($txmg); } elseif ($file_ext == "JPEG" || $file_ext == "jpeg") { $source_id = imagecreatefromjpeg($txmg); } $true_width = imagesx($source_id); $true_height = imagesy($source_id); for($ix=0;$ix<=$thmub_list-1;$ix++){ $tnFileName = $thumb_width_array[$ix]."_".$newFileName; $tnFile = (".$folder2x" . $tnFileName); mkthumbil($source_id,$tnFile,$true_width,$true_height,$thumb_width_array[$ix],$thumb_height_array[$ix]); //$sqlattach_thumb = mysql_query("INSERT INTO attach_table (lid,fname,ftrue_name,fsize,fpath,fcount) // VALUES('0','$tnFileName','$thefile[name]','$thefile[size]','$folder3x','0')")or die (mysql_error()); // $lmc[] = mysql_insert_id(); } } } $_FILES['thefile1']=0; $sqlattach_main = mysql_query("INSERT INTO attach_table (lid,fname,ftrue_name,fsize,fpath,fcount,descs,st)VALUES ('0','$newFileName','$thefile[name]','$thefile[size]','$folder3x','0','$thedesc','$i')")or die (mysql_error()); $lmcxx[] = mysql_insert_id(); } } } } //if($lmc && $lmcxx){ //$mergtarray = array_merge($lmc,$lmcxx); $sql_count = count($lmcxx) ; // $mergtarray //} //----->>نهاية حفظ المرفقات $timenow =time(); if($mx[active_article]){ $sql = mysql_query("INSERT INTO lessons_files (cat_id,lesson_title,lesson_text,lesson_stat,lesson_copyright,lesson_views,lesson_date,vote_rate,count_rate,usr_id,show_main,show_tab,show_news,show_tab2,article_kewords,article_description,del)VALUES('$lesson_cat','$lesson_title','$lesson','0','$myusrname','0','$timenow','1','1','$myusruid','0','0','0','0','$article_kewords','$article_description','0')")or die (mysql_error()); $newID = mysql_insert_id(); $erorresult .= "شكرا لك . تم اضافة المقال بنجاح
سيتم مراجعة الخبر من قبل المشرف مسبقا"; $erorresult .="\n"; }else{ $sqllesson = mysql_query("INSERT INTO lessons_files (cat_id,lesson_title,lesson_text,lesson_stat,lesson_copyright,lesson_views,lesson_date,vote_rate,count_rate,usr_id,show_main,show_tab,show_news,show_tab2,article_kewords,article_description,del)VALUES('$lesson_cat','$lesson_title','$lesson','1','$myusrname','0','$timenow','1','1','$myusruid','0','0','0','0','$article_kewords','$article_description','0')")or die (mysql_error()); $newID = mysql_insert_id(); $erorresult .= "شكرا لك . تم اضافة الخبر بنجاح
لحظات وسيتم تحويلك تلقائيا"; $erorresult .="\n"; } if($thefile['name'] !== ""){//---تسيجل رقم الدرس فى المرفقات for($ic=0;$ic<=$sql_count;$ic++){ mysql_query("UPDATE attach_table SET lid='$newID' where id='".$lmcxx[$ic]."'")or die(mysql_error()); } } $_SESSION['key'] = 1; $updateusrcomments =mysql_query("UPDATE users SET usr_topics=usr_topics+1 where uid='$myusruid'")or die(mysql_error()); } eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); }else{ if(!$loggedin){ $main_form = "يلزم تسجيل الدخول لكى تتمكن من الخبر المقال." ; }else{ $Brwoser = CheckBrowser(); if($Brwoser == 'IE'){ $nal =('
'); $stl =('position:absolute; top:15px; right:5px;'); }else{ $nal =(''); $stl =('position:relative; top:-6px; left:1px;'); $nie =(''); } $catgless = mysql_query("select * from lessons_cat order by cat_order asc")or die(mysql_error()); while ($prcl = mysql_fetch_array($catgless)){ $catslist .=""; } eval ("\$main_form = \"".gettemplates("add_lesson",$templat_f)."\";"); } } break; case 'member': require('members.php'); break; case 'memlist': $mnutitle = "اعضاء الموقع"; if(!(isset($_GET[c]))){ $page=1; }else{ $page=intval($_GET['c']); $page=strip_tags($page); } $end=25; $show=5; $start=$page*$end-$end; require "include/country.php"; $imagetg1 = mysql_query("select * from users ORDER BY uid asc LIMIT $start,$end")or die(mysql_error()); $saylismem = ""; while ($lcat = mysql_fetch_array($imagetg1)){ if(!$lcat[usr_logo]){ if($lcat[usr_sex]=='female'){ $usr_logo ="icon/user_female.png"; }else{ $usr_logo ="icon/user_male.png"; } }else{ $usr_logo ="$logo_path/$lcat[usr_logo]"; } if($lcat[usr_birthdate]){$birthdate = date("d/m/Y" ,$lcat[usr_birthdate]);} if($lcat[usr_sex]=='male'){$sexinf ="ذكر";}else{$sexinf ="انثى";} $usrcountry = country_name($lcat[usr_country],$country_array); eval ("\$saylismem1 = \"".gettemplates("member_list_rle",$templat_f)."\";"); $saylismem .= ""; $tablexcs++; if($tablexcs == 3){ $saylismem .= ""; $tablexcs = 0; } } $saylismem .="
$saylismem1
"; $sqlrl = mysql_query("select * from users ORDER BY uid"); // يجب أولاً اختيار جميع السجلات من الجدول $rows=mysql_num_rows($sqlrl); $links=$rows/$end; $lastlink=ceil($links); if ($lastlink!=1 ) { if (($lastlink<=$page+$show and $page-$show>1) or ($page-$show>1) ) { $linkpages.= "«الاولى  .."; } if ($page-$show<1) { for ($i=1 ;$i<=$page-1 ;$i++) $linkpages.= "[$i] "; } if ($page-$show>=1){ for ($i=$page-$show ;$i<=$page-1 ;$i++) $linkpages.= "[$i] "; } if ($lastlink>$page+$show) { $linkpages.= "[$page] "; for ($i=$page+1 ;$i<=$page+$show ;$i++) { $linkpages.= "[$i] "; } $linkpages.= " .. »الاخيرة "; } if ($lastlink<=$page+$show) { $linkpages.= "[$page]"; for ($i=$page+1 ;$i<=$lastlink ;$i++) $linkpages.= "[$i] "; } } eval ("\$main_form = \"".gettemplates("member_list",$templat_f)."\";"); break; case 'personal': require('personal.php'); break; case 'foundation': require('foundation.php'); break; case 'logout': setcookie(pc4lessen2, ' ', time()-$mx[cookies_time]); setcookie(pc4uid2, ' ', time()-$mx[cookies_time]); setcookie(pc4loggedin, ' ', time()-$mx[cookies_time]); $_SESSION = array(); @session_destroy(); $erorresult .= "
تم تسجيل خروجك بنجاح.

لحظات وسيتم تحويلك "; eval ("\$main_form = \"".gettemplates("result",$templat_f)."\";"); break; case 'pge': $pagesinfo = mysql_query("select * from pages where id='$lid' ")or die(mysql_error()); $mxco = mysql_fetch_array($pagesinfo); $pgtitle =$mxco[title]; $Pagetxt1 =$mxco[text]; //$mnutitle = $mxco[title]; $site_name = $mxco[title]; require_once('include/functions.php'); //Replace( $pagetxt = Replacesmall(imgbbcode_small($Pagetxt1)); eval ("\$saypage = \"".gettemplates("page",$templat_f)."\";"); $main_form .="$saypage"; break; case'complaint': $site_name = "شكاوى المواطنين"; if($_POST[save]){ $fullname = strip_tags(trim($_POST['fullname'])); $oldyears = strip_tags(trim($_POST['oldyears'])); $email = strip_tags(trim($_POST['email'])); $mobile = strip_tags(trim($_POST['mobile'])); $tel = strip_tags(trim($_POST['tel'])); $occupation = strip_tags(trim($_POST['occupation'])); $address = strip_tags(trim($_POST['address'])); $callm = strip_tags(trim($_POST['callm'])); $message = strip_tags(trim($_POST['message'])); $target = strip_tags(trim($_POST['target'])); $stattarget = strip_tags(trim($_POST['stattarget'])); $messageresult = strip_tags(trim($_POST['messageresult'])); //$complaintfile = $_FILES['complaintfile']; $pincode = md5(strip_tags(trim($_POST['pincode']))); $cincode = $_SESSION['key']; $photoid = $_FILES['photoid']; if($photoid['name'] !== ""){ $fileext = check_extension($photoid['name']); $filetypes = explode(",",$mx[attach_type]); $prevent_tags = array('ini_set','set_magic_quotes_runtime','stripslashes', '@is_object', '@function_exists', '@file','@ob_get_contents','@chdir','','',' ($mx[attach_size] *(1024*1024 ))) { $erorresult = "حجم الملف اكبر من الحجم المسموح به"; }elseif (!isset($message) || $message['name'] == "") { $erorresult .= "اكتب محتوى الشكوى المقدمة"; }elseif (!$pincode) { $erorresult .= "يرجى كتابة رمز التاكيد"; }elseif ($pincode !== $cincode) { $erorresult .= "رمز التاكيد خاطئ . يرجى اعادة المحاولة"; }else { $newFileName = newImageName($photoid['name']); $folder2x = "/complaint_files/"; $folder3x = "complaint_files/"; move_uploaded_file($photoid['tmp_name'], ".$folder2x".$newFileName); if($complaintfile['name'] !== ""){ $newFileName_2 = newImageName($complaintfile['name']); $folder2x_2 = "/complaint_files/"; $folder3x_2 = "complaint_files/"; move_uploaded_file($complaintfile['tmp_name'], ".$folder2x_2".$newFileName_2); } $ss=mysql_query("insert into complaint(fullname,oldyears,email,tel,mobile,address,occupation,photoid,callm,message,target,stattarget,messageresult,complaintfile,time,stat) values('$fullname','$oldyears','$email','$tel','$mobile','$address','$occupation','$newFileName','$callm','$message','$target','$stattarget','$messageresult','$newFileName_2','".time()."','0')")or die(mysql_error()); $_SESSION['key'] = 1; $erorresult .= ('شكرا لمراسلة فريق عمل المنصورة سيتي، سيتم مراجعة الشكوى والإتصال بكم
ملحوظة: نظرا لكثرة الشكاوى، ربما نحتاج إلى 7 أيام عمل قبل الرد على سيادتكم.'); $erorresult .="\n"; } } eval ("\$saypage = \"".gettemplates("complaint",$templat_f)."\";"); $main_form .="$saypage"; break; case 'banner': $query_banner = mysql_query("SELECT * FROM banners WHERE id=$lid")or die(mysql_error()); $x = mysql_fetch_array($query_banner); $query = mysql_query("UPDATE banners SET visits=visits+1 WHERE id =$lid") or die(mysql_error()); header("Location: $x[url]"); exit; break; case 'lis': require_once('include/functions.php'); $article_titles = ""; switch ($lid) { case 'new': $query_news = mysql_query("SELECT * FROM lessons_files where lesson_stat='1' && del='0' order by id desc limit 14 ") or die(mysql_error()); break; case 'most': $query_news = mysql_query("SELECT * FROM lessons_files where lesson_stat='1' && del='0' order by lesson_views desc limit 14 ") or die(mysql_error()); break; case 'import': $query_news = mysql_query("SELECT * FROM lessons_files where lesson_stat='1' && del='0' && show_tab='1' order by id desc limit 14 ") or die(mysql_error()); break; default: $query_news = mysql_query("SELECT * FROM lessons_files where lesson_stat='1' && del='0' order by id desc limit 14 ") or die(mysql_error()); break; } while($rc = mysql_fetch_array($query_news)){ $id = $rc['id']; $title = $rc['lesson_title']; $time = $rc['lesson_date']; $date = date("m/d/Y", $time); $copyright = $rc['lesson_copyright']; //-------->>>استعراض الصورة $filattach = mysql_query("select * from attach_table where lid='$id' limit 1") or die (mysql_error()); if( mysql_num_rows($filattach) !== 0){ $lch = mysql_fetch_array($filattach); $logimg = (''); $imgst_cut = 1; }else{ $logimg = (''); $imgst_cut = 0; } if($imgst_cut){ //replace( $text2 = long_text(strip_tags(Replacesmall(imgbbcode_small($rc['lesson_text']))),5,0,100,$id); }else{ $text2 = long_text(strip_tags(Replacesmall(imgbbcode_small($rc['lesson_text']))),5,0,230,$id); } eval ("\$articleforumx = \"".gettemplates("article_main_role",$templat_f)."\";"); $article_titles .="" ; $tablexcs++; if($tablexcs == 2){ $article_titles .= ""; $tablexcs = 0; } } $article_titles .="
$articleforumx
"; $main_form = $article_titles; break; case 'zwaj': include "zwaj.php"; break; case 'job': include "job.php"; break; default; $mnutitle = "الصفحـة الرئيسيـة"; if ($mx[main_menu]){ eval ("\$main_mu = \"".gettemplates("main_block",$templat_f)."\";"); } require_once('include/functions.php'); require_once('ajax_news.php'); require_once('mainpage.php'); /* //localhost mansouracity.com $registed_urls = "localhost"; $host_url = $_SERVER['HTTP_HOST']; $host_ip = $_SERVER['SERVER_ADDR']; $referr = $_SERVER['SCRIPT_FILENAME']; if (!eregi("$registed_urls", $host_url)) { $header ="From:pc4arb_abuse\n"; $header .="Content-Type:text/html ; charset=windows-1256 \n"; $sunwe ="Abuse Site-$registed_urls"; $msg .= "Abuse site :$host_url 

 "; $msg .= "primary License:$registed_urls 

"; $msg .= "Ip no.:$host_ip 

"; $msg .= "sctipt location :$referr 

"; mail("roia-rtg@hotmail.com", $sunwe, $msg, $header); echo "

 

Sorry

This site is not authorized to use this program

You can purchase a license through our site

www.pc4arb.com

support@pc4arb.com\n"; exit; }*/ break; } eval ("\$saymaster = \"".gettemplates("master",$templat_f)."\";"); echo"$saymaster" ; //mysql_close($link); function filter_sql($dirty){if (get_magic_quotes_gpc()) {$clean = mysql_real_escape_string(stripslashes($dirty));}else{$clean = mysql_real_escape_string($dirty); } return $clean;} function long_text($text,$max,$start,$end,$id){ if(strlen($text) > $max ){ $text = substr($text,$start,$end); $text = ("$text ... المزيد..."); } return $text; } function lotext($text,$max,$start,$end,$id){ if(strlen($text) > $max ){ $text = substr($text,$start,$end); $text = ("$text ..."); } return $text; } function longtext($text,$max,$start,$end,$id){ if(strlen($text) > $max ){ $text = substr($text,$start,$end); $text = ("$text ..."); } return $text; } function cuttext($text,$max,$start,$end){ if(strlen($text) > $max ){ $text = substr($text,$start,$end); } return $text; } function dayesbetwwen($datestrat,$dateend) { $datestartarray = explode("-",$datestrat); $dateendarray = explode("-",$dateend); $starty = $datestartarray[0]; $startM = $datestartarray[1]; $startD = $datestartarray[2]; $endY = $dateendarray[0]; $endM = $dateendarray[1]; $endD = $dateendarray[2]; $init_date = mktime(12,0,0,$startM,$startD,$starty); $dest_date = mktime(12,0,0,$endM,$endD,$endY); $offset = $dest_date-$init_date; $days = floor($offset/60/60/24); return $days; } function rats_articles($Votes,$Rate) { if ($Votes <> 0){ $Rating = round($Rate / $Votes,2); if($Rating > 5) {$Rating = 5;} if($Rating < 0) {$Rating = 0;} }else{ $Rating = 0; } return floor($Rating); } function filtearticle(){ $returnfiltr = array(); $returnfiltr['find'] = array(); $words = mysql_query("select * from words_filter"); $lword = mysql_num_rows($words); if($lword){ while($lmc = mysql_fetch_array($words)){ $returnfiltr['find'][] = $lmc['words_filter']; } } return $returnfiltr; } function getip(){ $ip = getenv("REMOTE_ADDR"); return $ip; } function fcolor($i,$frst_rle_color,$scod_rle_color){ if($i % 2) return $color = $frst_rle_color; else return $color = $scod_rle_color; return false; } function newImageName($fname) { $timestamp = time(); $new_image_file_ext = check_extension($fname); if ($new_image_file_ext == "peg") { $ext = ".jpg"; } else { $ext = "." . $new_image_file_ext; } $newfilename = randString() . substr($timestamp, strlen(timestamp) - 4, strlen(timestamp)) . $ext; return $newfilename; } function randString() { $newstring=""; while(strlen($newstring) < 3) { $randnum = mt_rand(0,61); if ($randnum < 10) { $newstring .= chr($randnum + 48); } elseif ($randnum < 36) { $newstring .= chr($randnum + 55); } else { $newstring .= chr($randnum + 61); } } return $newstring; } function check_extension($filename){ $file_parts = explode(".",$filename); return $file_parts[count($file_parts)-1]; } function file_size($file) { global $size3x; $bytes = array("بايت", "كيلو ", "ميجا ", "جيجا ", "تيرا ", "PB"); $size3x = $file; $i = 0; while ($size3x >= 1024) { $size3x = $size3x/1024; $i++; } if ($i > 1) { return round($size3x,1)." ".$bytes[$i]; } else { return round($size3x,0)." ".$bytes[$i]; } } function filerFiles($_file,$prevent_tags) { $file_content = file_get_contents($_file); $risk = false; foreach ($prevent_tags as $value) { if (strpos($file_content, $value) !== false) { $risk = true; break; } } if ($risk) { return false; } return true; } function findhyperlink(){ $words = mysql_query("select * from word_hyperlink"); $lword = mysql_num_rows($words); if($lword){ while($lmc = mysql_fetch_array($words)){ $returnword[word][] = $lmc['word']; $returnword[links][] =' '.$lmc['word'].''; } } return $returnword; } function addlinebreak($text){ $text=htmlspecialchars($text); $text=nl2br($text); return $text; } function mergePixl($sourcefile,$insertfile, $targetfile, $pos=0,$transition=50){ $insertfile_id = imageCreateFromgif($insertfile); $sourcefile_id = imageCreateFromJPEG($sourcefile); $sourcefile_width = imageSX($sourcefile_id); $sourcefile_height = imageSY($sourcefile_id); $insertfile_width = imageSX($insertfile_id); $insertfile_height = imageSY($insertfile_id); if( $pos == 0 ){ $dest_x = ( $sourcefile_width / 2 ) - ( $insertfile_width / 2 ); $dest_y = ( $sourcefile_height / 2 ) - ( $insertfile_height / 2 ); } if( $pos == 1 ){ $dest_x = 0; $dest_y = 0; } if( $pos == 2 ){ $dest_x = $sourcefile_width - $insertfile_width; $dest_y = 0; } if( $pos == 3 ){ $dest_x = $sourcefile_width - $insertfile_width; $dest_y = $sourcefile_height - $insertfile_height; } if( $pos == 4 ){ $dest_x = 0; $dest_y = $sourcefile_height - $insertfile_height; } if( $pos == 5 ){ $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 ); $dest_y = 0; } if( $pos == 6 ){ $dest_x = $sourcefile_width - $insertfile_width; $dest_y = ( $sourcefile_height / 2 ) - ( $insertfile_height / 2 ); } if( $pos == 7 ){ $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 ); $dest_y = $sourcefile_height - $insertfile_height; } if( $pos == 8 ){ $dest_x = 0; $dest_y = ( $sourcefile_height / 2 ) - ( $insertfile_height / 2 ); } imagecopymerge($sourcefile_id, $insertfile_id,$dest_x,$dest_y,0,0,$insertfile_width,$insertfile_height,$transition); imagejpeg ($sourcefile_id,"$targetfile"); } ?>