اذهب إلى المحتوى

محمد رشيد2

الأعضاء
  • المساهمات

    22
  • تاريخ الانضمام

  • تاريخ آخر زيارة

آخر الزوار

لوحة آخر الزوار معطلة ولن تظهر للأعضاء

إنجازات محمد رشيد2

عضو مساهم

عضو مساهم (2/3)

3

السمعة بالموقع

  1. تم حل المشكلة اخوتي شكرا
  2. الجلسة بدات في function على النحو التالي: function register_my_session() { if( !session_id() ) { session_start(); } } add_action("init", "register_my_session"); لاكن لا يوجد اي دوال متصلة تخص القالب
  3. تقصد هذا <!DOCTYPE html> <html dir="rtl" lang="ar"> <head> <link rel='stylesheet' id='main-stylesheet-css' href='<?php echo get_template_directory_uri(); ?>/css/bootstrap.min.css' type='text/css' media='all' /> <link rel='stylesheet' id='main-stylesheet-css' href='<?php echo get_template_directory_uri(); ?>/css/ekko-lightbox.css' type='text/css' media='all' /> <link rel='stylesheet' id='main-stylesheet-css' href='<?php echo get_template_directory_uri(); ?>/css/style.css' type='text/css' media='all' /> <?php if(get_option('dani_fulldes')=='true'){?> <link rel='stylesheet' id='main-wide-css' href='<?php echo get_template_directory_uri(); ?>/css/wide.css' type='text/css' media='all' /> <?php } ?> <meta charset="UTF-8"> <?php if(is_single()){?> <meta name="description" content="<?php $description = get_option('dani_description');echo $description;?>"> <meta name="keywords" content="<?php $gettags= wp_get_post_tags(get_the_ID()); foreach($gettags as $tag){ echo $tag->name ?>,<?php }?>"> <?php }else{ ?> <meta name="description" content="<?php $description = get_option('dani_description');echo $description;?>"> <meta name="keywords" content="<?php $keywords = get_option('dani_keywords');echo $keywords;?>"> <?php } ?> <meta name="author" content="dani rasheed"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src='https://www.google.com/recaptcha/api.js?hl=ar'></script> <link rel="shortcut icon" href="<?php /* Value of favicon code*/ $favicon = get_option('dani_favicon');echo $favicon;?>"> <?php /* Value of google analytics code*/ $google = get_option('dani_google_analytics');echo $google;?> <?php wp_head(); ?> <!--To Make Internet Explorer understand Bootstrap Elements--> <!--[if lt IE 9]> <script src="<?php echo get_template_directory_uri(); ?>/js/html5shiv.min.js"></script> <script src="<?php echo get_template_directory_uri(); ?>/js/respond.min.js"></script> <![endif]--> </head> <body> <!----Start NAV ----> <nav class="navbar navbar-inverse"> <div class="container"> <?php if(get_option('dani_activeaddadstopmenu')=='true'){?> <div class="addnewjob pull-left"> <a href="<?php $addyourads = get_option('dani_addyouradstopmenu'); echo get_page_link($addyourads);?>" <?php if(get_option('dani_addyouradsblank')=='true'){echo'target="_blank"';}else{} ?> class="btn btn-success">اضف اعلان</a> </div> <?php }?> <?php if ( is_user_logged_in() ) { ?> <style media="screen"> li.loggedin{ display: none !important; } .loggedout{ display: block !important; } </style> <div class="welcomeuser pull-left"> مرحبا بك يا <?php $user_info=get_userdata(get_current_user_id()); echo $user_info->user_login; ?> | <a href="<?php $controlpanel = get_option('dani_controlpanel'); echo get_page_link($controlpanel); ?>">لوحة التحكم</a> | <a href="<?php echo wp_logout_url( home_url() ); ?>">تسجيل الخروج</a> </div> <?php } ?> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="collapse navbar-collapse" id="myNavbar"> <?php wp_nav_menu( array( 'theme_location' => 'main_menu' ,'container' => '','menu_class' => 'nav navbar-nav pull-right')); ?> </div> </div> </nav> <!----End NAV ----> <!----Start header ----> <header> <div class="container"> <div class="row"> <div class="col-lg-12 col-xs-12"> <div class="logo"> <?php $logo = get_option('dani_sitelogo'); ?> <a href="<?php echo get_home_url(); ?>"><img src="<?php echo $logo; ?>" class="img-responsive" alt=""></a> </div> </div> <div class="col-lg-12 col-xs-12 "> <?php dynamic_sidebar( 'header' ); ?> </div> </div> </div> </header> <!----End header ----> <div class="container"> <?php if(get_option('dani_fulldes')!='true'){?> <div class="row"> <div class="col-lg-12"> <?php if(get_option('dani_search')=='true'){?> <?php echo get_search_form(); ?> <?php }?> </div> </div> <?php } ?> <div class="row"> <div class="col-lg-12"> <div class="underheaderads"> <?php dynamic_sidebar( 'underheader' ); ?> </div> </div> </div> </div>
  4. ما هي الشيفرة التي يجب وضعها
  5. اخي الغالي نفس النتيجة ما صار اي شي هل ممكن يكون من قاعدة البيانات لان في هذا الكود موجود في القالب ارسال رسالة خاصة الي العضو :<?php echo $user_meta->user_login; ?> مع العلم انه لما ادخل على قواعد البيانات لم اجد في user_meta اي user_login
  6. اخي الشيفرة موجودة <?php get_header(); ?> <?php $sendto=$_SESSION['authorid']; $sender=get_current_user_id(); $user_meta=get_userdata($sendto); ?>
  7. لم يتغير اي شيء
  8. اخي zonasabri لا الكود غير موجود اين اضع هذا الكود function register_session(){ if( !session_id() ) session_start(); $sendto = $_SESSION['authorid']; } add_action('init','register_session'); واين اضع هذا الكود ايضا global $session; هل اضعه في فايل الfunctions
  9. السلام عليكم اخوتي اخواتي الكرام عندي مشكلة واللي هي تمبلت ارسال رسائل الخاصة في الورد بريس كل ما اجي اضيف صفحة جديدة واختار منها تمبلت ارسال رسائل تجيني هذه الرسالة مع العلم انه اعدادات الروابط الدائمة عاملها روابط مخصصة وهذا هو كود الخطأ شو الخطأ الموجود في هذا الكود وشو هي الدوال كود القالب مرفق <?php if(empty($_SESSION['authorid'])){ echo '<div class="warn">خطأ بالصفحة يرجي اعادة محاولة مراسلة العضو </div>'; }else{ ?> <form class="form-horizontal" action="#" method="post"> <div class="form-group"> <div class="col-sm-12"> <input type="text" name="title" class="form-control" id="input0" placeholder="عنوان الرسالة"> </div> </div> <div class="form-group"> <div class="col-sm-12"> <textarea class="form-control" rows="5" name="content" id="input1" placeholder="محتوي الرسالة"></textarea> </div> </div> <div class="form-group"> <div class="col-sm-12 "> <input type="submit" name="sendmessage" class="btn btn-success " value="ارسل رسالة"> </div> </div> </form> <?php } } ?> </div> </div><!--end single right area--> <div class="singleleft col-lg-4 col-xs-12 pull-right"><!--start single left area--> <?php require_once(TEMPLATEPATH . '/usersidemenu.php'); ?> </div><!--end single left area--> </div><!--end of pagecontainer---> والكود التالي هو قالب التمبلت <?php /* Template Name: تمبلت ارسال رسالة*/ ?> <?php get_header(); ?> <?php $sendto=$_SESSION['authorid']; $sender=get_current_user_id(); $user_meta=get_userdata($sendto); ?> <div class="container pagecon clearfix "> <div class="singleright col-lg-8 col-xs-12 pull-left"><!--start single right area--> <div class="lefpage"> <div class="sendtext"> ارسال رسالة خاصة الي العضو :<?php echo $user_meta->user_login; ?> </div> <?php if(isset($_POST['sendmessage'])){ if(empty($_SESSION['authorid'])){ echo '<div class="warn"> تم ارسال الرسالة من قبل </div>'; }else{ $sender=get_current_user_id(); $receiver=$_SESSION["authorid"]; $title=clean_text($_POST['title']); $content=clean_text($_POST['content']); $mainmessage=clean_text($_POST['mainmessage']); if(empty($title) || empty($content)){ echo '<div class="warn">يجب ادخال عنوان الرسالة ومحتوي الرسالة لاستكمال الارسال </div>'; } else { $new_post = array( 'post_title' => $title, 'post_status' => 'publish', 'post_type' => 'messages' , 'post_content' => $content ); $thesender = wp_insert_post($new_post); if($thesender !=0 ){ update_post_meta( $thesender, 'sender',$sender); update_post_meta( $thesender, 'receiver',$receiver); update_post_meta( $thesender, 'checkmessageread','0'); update_post_meta( $thesender, 'deletefromsender','0'); update_post_meta( $thesender, 'deletefromreceiver','0'); if(!empty($mainmessage)){ update_post_meta( $thesender, 'mainmessage',$mainmessage); }else { update_post_meta( $thesender, 'mainmessage','0'); } echo '<div class="success">تم ارسال الرسالة بنجاح</div>'; unset($_SESSION['authorid']); } } } }else{ ?> <?php if(empty($_SESSION['authorid'])){ echo '<div class="warn">خطأ بالصفحة يرجي اعادة محاولة مراسلة العضو </div>'; }else{ ?> <form class="form-horizontal" action="#" method="post"> <div class="form-group"> <div class="col-sm-12"> <input type="text" name="title" class="form-control" id="input0" placeholder="عنوان الرسالة"> </div> </div> <div class="form-group"> <div class="col-sm-12"> <textarea class="form-control" rows="5" name="content" id="input1" placeholder="محتوي الرسالة"></textarea> </div> </div> <div class="form-group"> <div class="col-sm-12 "> <input type="submit" name="sendmessage" class="btn btn-success " value="ارسل رسالة"> </div> </div> </form> <?php } } ?> </div> </div><!--end single right area--> <div class="singleleft col-lg-4 col-xs-12 pull-right"><!--start single left area--> <?php require_once(TEMPLATEPATH . '/usersidemenu.php'); ?> </div><!--end single left area--> </div><!--end of pagecontainer---> <?php get_footer();?>
  10. اخي حاولت لاكن لم تنجح الطريقة لاكن لدي استفسار اخر هل يمكنني وضع هذه الاكواد <?php /* *################################################# *first the shortcode to hold custom form *################################################# */ session_start(); $getmetaoption = get_option( "dani_activeeditor" ); if($getmetaoption =="true"){ function addnewads_sc() { ob_start(); $getmetaoptionvistor = get_option( "dani_active_editor_vistor" ); if ( !is_user_logged_in() and $getmetaoptionvistor !="true" ) { ?> <center>نأسف, يجب ان تقوم بال <a href="<?php if (!empty(get_option( "dani_login" ))){ echo get_page_link(get_option( "dani_login" )); }else{ echo wp_login_url();}?>">الدخول</a> اذا كانت لديك عضوية او <a href="<?php if (!empty(get_option( "dani_register" ))){ echo get_page_link(get_option( "dani_register" )); }else{ echo wp_registration_url();}?>">تسجيل</a> كعضو جديد لتستطيع المشاركة</center> <?php }else{ global $current_user; get_currentuserinfo(); $user_ID = get_current_user_id(); $author_name = get_userdata($user_ID)->display_name; $author_url = $author_name; ?> <?php /*call javascript files for uploader and subcategory*/ ?> <script src="<?php echo get_template_directory_uri(); ?>/submenu/jquery.min.js"></script> <script src="<?php echo get_template_directory_uri(); ?>/assets/uploadtools/script.js"></script> <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/assets/uploadtools/style.css"> <script type="text/javascript"> $(document).ready(function() { $("#genrecat").change(function() { $(this).after('<div id="loader"><img src="<?php echo get_template_directory_uri(); ?>/submenu/images/upload_wating.gif" alt="loading subcategory" /></div>'); $.get('<?php echo get_template_directory_uri(); ?>/submenu/subordinarycategory.php?genrecat=' + $(this).val(), function(data) { $("#sub_cat").html(data); $('#loader').slideUp(200, function() { $(this).remove(); }); }); }); }); /*catcar*/ $(document).ready(function() { $("#genrecatcar").change(function() { $(this).after('<div id="loader"><img src="<?php echo get_template_directory_uri(); ?>/submenu/images/upload_wating.gif" alt="loading subcategory" /></div>'); $.get('<?php echo get_template_directory_uri(); ?>/submenu/subordinarycategory.php?genrecat=' + $(this).val(), function(data) { $("#sub_catcar").html(data); $('#loader').slideUp(200, function() { $(this).remove(); }); }); }); }); /*counrty*/ $(document).ready(function() { $("#city").change(function() { $(this).after('<div id="loader"><img src="<?php echo get_template_directory_uri(); ?>/submenu/images/upload_wating.gif" alt="loading subcategory" /></div>'); $.get('<?php echo get_template_directory_uri(); ?>/submenu/city.php?city=' + $(this).val(), function(data) { $("#subcity").html(data); $('#loader').slideUp(200, function() { $(this).remove(); }); }); }); }); </script> <?php $deactivefulleditor = get_option( "dani_full_editor_disactive" ); if($deactivefulleditor !="true"){ ?> <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/assets/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ language : 'ar', selector: "textarea", theme: "modern", plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor colorpicker textpattern" ], toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", toolbar2: "print preview media | forecolor backcolor emoticons", image_advtab: true, templates: [ {title: 'Test template 1', content: 'Test 1'}, {title: 'Test template 2', content: 'Test 2'} ] }); </script> <?php } ?> <?php /* End call javascript files for uploader and subcategory*/ ?> <?php /*if submit*/ if(isset($_POST['submit'])){ /*call and clean varibles*/ $vistorname=clean_text($_POST['vistorname']); $mobile=clean_text($_POST['metamobile']); $email=clean_text($_POST['metaemail']); $period=clean_text($_POST['period']); $city=clean_text($_POST['getcity']); $year=clean_text($_POST['getyear']); $kindadd=clean_text($_POST['kindadd']); $subcity=clean_text($_POST['subcity']); if($kindadd =='yes'){ $genrecat=clean_text($_POST['genrecatcar']); $subcat=clean_text($_POST['sub_catcar']); }else{ $genrecat=clean_text($_POST['genrecat']); $subcat=clean_text($_POST['sub_cat']); } $metaprice=clean_text($_POST['metaprice']); $metatitle=clean_text($_POST['metatitle']); $deactivefulleditor = get_option( "dani_full_editor_disactive" ); if($deactivefulleditor =="true"){ $content=clean_text($_POST['content']); }else{ $content=$_POST['content']; } $captcha = clean_text($_POST['check']); // $googlesecret= get_option('dani_googlesecret'); // $curl = curl_init(); // curl_setopt_array($curl, array( // CURLOPT_RETURNTRANSFER => 1, // CURLOPT_URL => 'https://www.google.com/recaptcha/api/siteverify', // CURLOPT_POST => 1, // CURLOPT_POSTFIELDS => array( // 'secret' => $googlesecret, // 'response' => $captcha // ) // )); // $response = curl_exec($curl); // curl_close($curl); /*call and clean varibles*/ /*this part is for image*/ $target_path = "wp-content/uploads/"; //Declaring Path for uploaded images $imgsname=array_values(array_filter($_FILES['file']['name'])); $imgstmpname=array_values(array_filter($_FILES['file']['tmp_name'])); $imgsizes=array_values(array_filter($_FILES['file']['size'])); $imgerror=array_values(array_filter($_FILES['file']['error'])); $format_file = array("jpg", "png", "gif", "bmp","jpeg",); $max_file_size = 1024*5000000; //maksimal 100 kb $path = $target_path; // Lokasi folder untuk menampung file $count = 0; // Loop $_FILES to exeicute all files foreach ($imgsname as $f => $name) { if ($imgerror[$f] == 10) { continue; // Skip file if any error found } if ($imgerror[$f] == 0) { if ($imgsizes[$f] > $max_file_size) { //$message[] = "$name is too large!."; continue; // Skip large files } elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $format_file) ){ // $message[] = "$name is not a valid format"; continue; // Skip invalid file formats } else{ // No error found! Move uploaded files $temp = explode(".", $name); $newfilename = md5(uniqid()) . '.' . end($temp); if(move_uploaded_file($imgstmpname[$f], $path.$newfilename)) $count++; // Number of successfully uploaded file $myimglink[]=get_site_url()."/".$path.$newfilename; $mmaray=$myimglink; } } } if( ! $current_user->exists() && empty($metatitle)||empty($content)||empty($email) ){ echo '<div class="warn">من فضلك ادخل جميع الحقول المطلوبة</div>'; }elseif($captcha != $_SESSION['captcha']|| empty($captcha) ){ echo '<div class="warn">الكود الامني غير صحيح</div>'; }elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){ echo '<div class="warn">البريد الاليكتروني خاطئ يرجي التحقق منه</div>'; }elseif(get_option( "dani_disable_uploading" ) != "true" and empty($imgsname)){ echo '<div class="warn">يجب رفع صورة حتي يتم نشر اعلانك</div>'; }else{ $userid= $current_user->ID; // $tax_arr = array( // 'category' => array($genrecat ), // 'category' => array($subcat ), // 'city' => array($city), // 'city' => array($subcity ), // ); // if($kindadd =='yes'){ // $tax_arr[]['year']= $year; // } global $wpdb; // If we get here then the user is logged in and we have their id... /*if mazad open*/ $activeorpending = get_option( "dani_accept_ads_wihtout_review" ); if($activeorpending =="true" || current_user_can('administrator') ){ $poststatus="publish"; }else{ $poststatus="pending"; } $new_post_arr = array( 'comment_status' => $status, 'ping_status' => $status, 'post_author' => $userid, 'post_content' =>$content, 'post_name' => $metatitle, 'post_status' => $poststatus, 'post_title' => $metatitle, 'post_type' => 'post', /**'tax_input' => $tax_arr,**/ ); $lastid = wp_insert_post($new_post_arr); $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$genrecat, 'term_order' =>0)); $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$subcat, 'term_order' =>0)); $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$city, 'term_order' =>0)); $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$subcity, 'term_order' =>0)); if($kindadd =='yes'){ $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$year, 'term_order' =>0)); } $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'vistorname', 'meta_value' => $vistorname)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'meta-price', 'meta_value' => $metaprice)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'meta-email', 'meta_value' => $email)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'meta-mobile', 'meta_value' => $mobile)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'period', 'meta_value' => $period)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'kindadd', 'meta_value' => $kindadd)); #tags System $posttags= get_option( "dani_posttags" ); if($posttags== "true"){ $pretitle = explode( ' ', $metatitle ); foreach ($pretitle as $tagsme) { wp_set_object_terms( $lastid, $tagsme, 'post_tag', true ); } }else{ } #End of tags System if($RESULT === FALSE){ }else{ /*back to here*/ // $a1 = array(); // foreach ($myArray as $vara) { // @$mnew_strin .= $vara . ' '; // } $first_value = reset($mmaray); $str = substr(strrchr($first_value, '/'), 1); $mnb=$str; $idi=$lastid +1; $data = date("o-m-d H:i:s"); foreach ($mmaray as $vara) { @$piclink = $vara; $str = substr(strrchr($piclink, '/'), 1); $lmnp=$str; /**$wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'meta-myimg', 'meta_value' => $mnew_strin));**/ // Prepare an array of post data for the attachment. $attachment = array( 'guid' => $piclink, 'post_mime_type' => 'image/jpeg', 'post_title' => $metatitle, 'post_type' => 'attachment', 'post_content' => '', 'post_status' => 'inherit' ); // Insert the attachment. $attach_id = wp_insert_attachment( $attachment, $lmnp, $lastid ); } require_once(ABSPATH . 'wp-admin/includes/image.php'); wp_generate_attachment_metadata( $attach_id,'.$first_value.'); wp_update_attachment_metadata( $attach_id,$fullsizepath); set_post_thumbnail( $lastid, $attach_id ); update_post_meta($lastid, '_wp_attachment_metadata', $attach_id); update_post_meta($lastid, '_thumbnail_id', $attach_id); /*end the part of image*/ } echo '<div class="success">شكرا لك لقد تم استقبال اعلانكم بنجاح</div>'; $getmetaoption = get_option( "dani_sendemailtoadmin" ); if($getmetaoption =="1"){ /**Sending Email To Admin**/ $receiveremails = get_option( "dani_edit_emails" ); if(!empty($receiveremails)){ $adminemail =$receiveremails; }else{ $adminemail = get_option( 'admin_email' ); } $sender= get_option( 'admin_email' ); $name=$vistorname; $contento=clean_text($content); $subject="اعلان جديد بعنوان ".$metatitle." بانتظار المراجعة "; $cont=$contento."\n email:{$sender}"; $cont="\n{$metatitle}\n".$contento; $header = "From: ". $name . " <" . $sender . ">\r\n"; wp_mail($adminemail, $subject, $cont,$header); /**End Of Sending Email To Admin**/ } } }else{ /*create form*/ ?> <form enctype="multipart/form-data" method="POST" action="" class="mobawaba-form"> <div class="form-group"> <?php if(! $current_user->exists()){ ?> <input type="text" class="vistorname form-control" id="vistorname" name="vistorname" size="40" placeholder="الاسم"/> <?php }else{ echo $author_url ; } ?> </div> <div class="form-group"> <input type="text"class="metamobile form-control" id="metamobile" name="metamobile" size="40" placeholder="رقم الجوال"/> </div> <div class="form-group"> <input type="text" id="metaemail" class="form-control" name="metaemail" size="40" placeholder="البريد الاليكتروني"/> </div> <div class="form-group"> <div class="radio"> <label for="[object Object]">نوع الاعلان</label> <div id="kindadd"> <input type="radio" name="kindadd" id="kindadd" value="yes"> <span class="radiosp">اعلان سيارة </span> <input type="radio" checked="checked" name="kindadd" id="kindadd" value="no"> <span class="radiosp">اعلان اخر</span> </div> </div> </div> <div class="hidemaincatforshowcars" style="display:block;"> <div class="form-group"> <select name="genrecat" id="genrecat" class="genrecat required form-control" > <option selected value="0"><?php echo __('اختر القسم', 'mobawaba');?></option> <?php $args = array( 'type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'parent' => 0, 'taxonomy' => 'category', 'pad_counts' => false, 'exclude' => array(get_option('dani_car_category'),'1') ); $categories = get_categories($args); ?> <?php foreach( $categories as $category ) { ?> <option value="<?php echo $category->term_id; ?>"> <?php echo $category->name; ?></option> <?php } ?> </select> </div> <div class="form-group"> <select name="sub_cat" id="sub_cat" class="form-control" > <option value="0">اختر القسم الفرعي</option> </select> </div> </div> <div class="form-group"> <div class="yearx" style="display:none;"> <div class="form-group"> <select name="genrecatcar" id="genrecatcar" class="genrecat required form-control" > <option selected value="0"><?php echo __('اختر القسم', 'mobawaba');?></option> <?php $args = array( 'type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'exclude' =>0, 'parent' => get_option('dani_car_category'), 'taxonomy' => 'category', 'pad_counts' => false ); $categories = get_categories($args); ?> <?php foreach( $categories as $category ) { ?> <option value="<?php echo $category->term_id; ?>"> <?php echo $category->name; ?></option> <?php } ?> </select> </div> <div class="form-group"> <select name="sub_catcar" id="sub_catcar" class="form-control" > <option value="0">اختر القسم الفرعي</option> </select> </div> <select name="getyear" id="year" class="form-control"> <option selected ><?php echo __('اختر سنه الاصدار', 'mobawaba');?></option> <?php $args = array( 'type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'exclude' =>'', 'parent' => 0, 'taxonomy' => 'year', 'pad_counts' => false ); $categories = get_categories($args); ?> <?php foreach( $categories as $category ) { ?> <option value="<?php echo $category->term_id; ?>"> <?php echo $category->name; ?></option> <?php } ?> </select> </div> <script type="text/javascript"> $('.radio :radio').on("click", function(){ var radioval = $(this).val(); if(radioval =='yes'){ $('.yearx').show(); $('.hidemaincatforshowcars').hide(); }else{ $('.yearx').hide(); $('.hidemaincatforshowcars').show(); } }); </script> </div> <div class="form-group"> <select name="getcity" id="city" class="form-control"> <option selected ><?php echo __('اختر البلد', 'mobawaba');?></option> <?php $args = array( 'type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'exclude' =>'', 'parent' => 0, 'taxonomy' => 'city', 'pad_counts' => false ); $categories = get_categories($args); ?> <?php foreach( $categories as $category ) { ?> <option value="<?php echo $category->term_id; ?>"> <?php echo $category->name; ?></option> <?php } ?> </select> </div> <div class="form-group"> <select name="subcity" id="subcity" class="form-control"> <option value="0">اختر المدينة</option> </select> </div> <div class="form-group"> <input type="text" name="metaprice" class="metaprice form-control" id="metaprice" size="40" placeholder="السعر"/> </div> <div class="form-group"> <select name="period" class="form-control"> <option value="">اختر مدة الاعلان</option> <option value="0">دائم</option> <option value="1">يوم</option> <option value="3">ثلاث ايام</option> <option value="7">سبع ايام</option> </select> </div> <div class="form-group"> <input type="text" name="metatitle" class="metatitle form-control" id="metatitle" size="40" placeholder="عنوان الاعلان"/> </div> <div class="form-group"> <textarea rows="4" cols="50" name="content" id="content" class="content form-control" placeholder="محتوي الاعلان"></textarea> </div> <?php $disableuploading= get_option( "dani_disable_uploading" ); if($disableuploading != "true"){ ?> <div class="form-group"> <label for="meta-title">صورة الاعلان</label> <div id="filediv"><input name="file[]" type="file" id="file" class"mfile"/></div> <?php /*if multi upload active*/ $getmetaoption = get_option( "dani_active_multi_upload" ); if($getmetaoption == "true"){ ?> <input type="button" id="add_more" class="upload" value="المزيد من الصور"/> <?php }?> <?php }//end of disable system ?> </div> <div class="form-group"> <label for="meta-adcontent">التحقق الامني</label> <div class="captcha"> <img alt="captcha" src="<?php echo get_template_directory_uri(); ?>/assets/captcha/captcha.php" /> </div> </div> <div class="form-group"> <label for="meta-adcontent">ادخل الكود الامني</label> <div class="captcha"> <input type="number" name="check" class=" form-control"> </div> </div> <div class="form-group"> <input name="submit" type="submit" id="submit" value="اضف اعلانك"/> </div> </form> <?php /* end of create form*/ ?> <?php } /*end of else submit*/ } return ob_get_clean(); } add_shortcode('addnewads', 'addnewads_sc'); }else{ function addnewads_sc() { ob_start(); echo '<div class="warn" align="center">اضافه الاعلانات موقوفه بشكل مؤقت</div>'; return ob_get_clean(); } add_shortcode('addnewads', 'addnewads_sc'); } ?> في هذه الصفحة داخل صندوق اضافة صفحة ليتم عرضها للزوار او هل هناك اي كود يمكن ربط الملف الموجود في ملفات موقعي في هذا الصندوق تم حل المشكلة
  11. السلام عليكم اخواني واخواتي الكرام استفساري بسيط ما هو الكود الذي يمكن عرض صفحةphp من نفس ملفات الموقع في الورد بريس علما اني اضفت خيارات للوحة التحكم مع ان الملف موجود في نفس مسار الموقع ولاكن لا يتم عرضه عند الضغط على زر اضافة اعلان اريد كود لتضمين كود لملفات php لعرضه للازائر وهي عبارة عن فورم لاضافة الاعلانات الفورم متوفر علما ان هذا الخيار مربوط في زر اضف اعلان في الصفحة الرئيسية وهناك ايضا خيار اخر قمت بانشائه في لوحة التحكم علما اني اريد اضافة هذا الكود الي الصفحة <?php /* *################################################# *first the shortcode to hold custom form *################################################# */ session_start(); $getmetaoption = get_option( "dani_activeeditor" ); if($getmetaoption =="true"){ function addnewads_sc() { ob_start(); $getmetaoptionvistor = get_option( "dani_active_editor_vistor" ); if ( !is_user_logged_in() and $getmetaoptionvistor !="true" ) { ?> <center>نأسف, يجب ان تقوم بال <a href="<?php if (!empty(get_option( "dani_login" ))){ echo get_page_link(get_option( "dani_login" )); }else{ echo wp_login_url();}?>">الدخول</a> اذا كانت لديك عضوية او <a href="<?php if (!empty(get_option( "dani_register" ))){ echo get_page_link(get_option( "dani_register" )); }else{ echo wp_registration_url();}?>">تسجيل</a> كعضو جديد لتستطيع المشاركة</center> <?php }else{ global $current_user; get_currentuserinfo(); $user_ID = get_current_user_id(); $author_name = get_userdata($user_ID)->display_name; $author_url = $author_name; ?> <?php /*call javascript files for uploader and subcategory*/ ?> <script src="<?php echo get_template_directory_uri(); ?>/submenu/jquery.min.js"></script> <script src="<?php echo get_template_directory_uri(); ?>/assets/uploadtools/script.js"></script> <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/assets/uploadtools/style.css"> <script type="text/javascript"> $(document).ready(function() { $("#genrecat").change(function() { $(this).after('<div id="loader"><img src="<?php echo get_template_directory_uri(); ?>/submenu/images/upload_wating.gif" alt="loading subcategory" /></div>'); $.get('<?php echo get_template_directory_uri(); ?>/submenu/subordinarycategory.php?genrecat=' + $(this).val(), function(data) { $("#sub_cat").html(data); $('#loader').slideUp(200, function() { $(this).remove(); }); }); }); }); /*catcar*/ $(document).ready(function() { $("#genrecatcar").change(function() { $(this).after('<div id="loader"><img src="<?php echo get_template_directory_uri(); ?>/submenu/images/upload_wating.gif" alt="loading subcategory" /></div>'); $.get('<?php echo get_template_directory_uri(); ?>/submenu/subordinarycategory.php?genrecat=' + $(this).val(), function(data) { $("#sub_catcar").html(data); $('#loader').slideUp(200, function() { $(this).remove(); }); }); }); }); /*counrty*/ $(document).ready(function() { $("#city").change(function() { $(this).after('<div id="loader"><img src="<?php echo get_template_directory_uri(); ?>/submenu/images/upload_wating.gif" alt="loading subcategory" /></div>'); $.get('<?php echo get_template_directory_uri(); ?>/submenu/city.php?city=' + $(this).val(), function(data) { $("#subcity").html(data); $('#loader').slideUp(200, function() { $(this).remove(); }); }); }); }); </script> <?php $deactivefulleditor = get_option( "dani_full_editor_disactive" ); if($deactivefulleditor !="true"){ ?> <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/assets/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ language : 'ar', selector: "textarea", theme: "modern", plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor colorpicker textpattern" ], toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", toolbar2: "print preview media | forecolor backcolor emoticons", image_advtab: true, templates: [ {title: 'Test template 1', content: 'Test 1'}, {title: 'Test template 2', content: 'Test 2'} ] }); </script> <?php } ?> <?php /* End call javascript files for uploader and subcategory*/ ?> <?php /*if submit*/ if(isset($_POST['submit'])){ /*call and clean varibles*/ $vistorname=clean_text($_POST['vistorname']); $mobile=clean_text($_POST['metamobile']); $email=clean_text($_POST['metaemail']); $period=clean_text($_POST['period']); $city=clean_text($_POST['getcity']); $year=clean_text($_POST['getyear']); $kindadd=clean_text($_POST['kindadd']); $subcity=clean_text($_POST['subcity']); if($kindadd =='yes'){ $genrecat=clean_text($_POST['genrecatcar']); $subcat=clean_text($_POST['sub_catcar']); }else{ $genrecat=clean_text($_POST['genrecat']); $subcat=clean_text($_POST['sub_cat']); } $metaprice=clean_text($_POST['metaprice']); $metatitle=clean_text($_POST['metatitle']); $deactivefulleditor = get_option( "dani_full_editor_disactive" ); if($deactivefulleditor =="true"){ $content=clean_text($_POST['content']); }else{ $content=$_POST['content']; } $captcha = clean_text($_POST['check']); // $googlesecret= get_option('dani_googlesecret'); // $curl = curl_init(); // curl_setopt_array($curl, array( // CURLOPT_RETURNTRANSFER => 1, // CURLOPT_URL => 'https://www.google.com/recaptcha/api/siteverify', // CURLOPT_POST => 1, // CURLOPT_POSTFIELDS => array( // 'secret' => $googlesecret, // 'response' => $captcha // ) // )); // $response = curl_exec($curl); // curl_close($curl); /*call and clean varibles*/ /*this part is for image*/ $target_path = "wp-content/uploads/"; //Declaring Path for uploaded images $imgsname=array_values(array_filter($_FILES['file']['name'])); $imgstmpname=array_values(array_filter($_FILES['file']['tmp_name'])); $imgsizes=array_values(array_filter($_FILES['file']['size'])); $imgerror=array_values(array_filter($_FILES['file']['error'])); $format_file = array("jpg", "png", "gif", "bmp","jpeg",); $max_file_size = 1024*5000000; //maksimal 100 kb $path = $target_path; // Lokasi folder untuk menampung file $count = 0; // Loop $_FILES to exeicute all files foreach ($imgsname as $f => $name) { if ($imgerror[$f] == 10) { continue; // Skip file if any error found } if ($imgerror[$f] == 0) { if ($imgsizes[$f] > $max_file_size) { //$message[] = "$name is too large!."; continue; // Skip large files } elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $format_file) ){ // $message[] = "$name is not a valid format"; continue; // Skip invalid file formats } else{ // No error found! Move uploaded files $temp = explode(".", $name); $newfilename = md5(uniqid()) . '.' . end($temp); if(move_uploaded_file($imgstmpname[$f], $path.$newfilename)) $count++; // Number of successfully uploaded file $myimglink[]=get_site_url()."/".$path.$newfilename; $mmaray=$myimglink; } } } if( ! $current_user->exists() && empty($metatitle)||empty($content)||empty($email) ){ echo '<div class="warn">من فضلك ادخل جميع الحقول المطلوبة</div>'; }elseif($captcha != $_SESSION['captcha']|| empty($captcha) ){ echo '<div class="warn">الكود الامني غير صحيح</div>'; }elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){ echo '<div class="warn">البريد الاليكتروني خاطئ يرجي التحقق منه</div>'; }elseif(get_option( "dani_disable_uploading" ) != "true" and empty($imgsname)){ echo '<div class="warn">يجب رفع صورة حتي يتم نشر اعلانك</div>'; }else{ $userid= $current_user->ID; // $tax_arr = array( // 'category' => array($genrecat ), // 'category' => array($subcat ), // 'city' => array($city), // 'city' => array($subcity ), // ); // if($kindadd =='yes'){ // $tax_arr[]['year']= $year; // } global $wpdb; // If we get here then the user is logged in and we have their id... /*if mazad open*/ $activeorpending = get_option( "dani_accept_ads_wihtout_review" ); if($activeorpending =="true" || current_user_can('administrator') ){ $poststatus="publish"; }else{ $poststatus="pending"; } $new_post_arr = array( 'comment_status' => $status, 'ping_status' => $status, 'post_author' => $userid, 'post_content' =>$content, 'post_name' => $metatitle, 'post_status' => $poststatus, 'post_title' => $metatitle, 'post_type' => 'post', /**'tax_input' => $tax_arr,**/ ); $lastid = wp_insert_post($new_post_arr); $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$genrecat, 'term_order' =>0)); $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$subcat, 'term_order' =>0)); $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$city, 'term_order' =>0)); $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$subcity, 'term_order' =>0)); if($kindadd =='yes'){ $wpdb->insert( 'wp_term_relationships', array('object_id' => $lastid, 'term_taxonomy_id' =>$year, 'term_order' =>0)); } $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'vistorname', 'meta_value' => $vistorname)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'meta-price', 'meta_value' => $metaprice)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'meta-email', 'meta_value' => $email)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'meta-mobile', 'meta_value' => $mobile)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'period', 'meta_value' => $period)); $wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'kindadd', 'meta_value' => $kindadd)); #tags System $posttags= get_option( "dani_posttags" ); if($posttags== "true"){ $pretitle = explode( ' ', $metatitle ); foreach ($pretitle as $tagsme) { wp_set_object_terms( $lastid, $tagsme, 'post_tag', true ); } }else{ } #End of tags System if($RESULT === FALSE){ }else{ /*back to here*/ // $a1 = array(); // foreach ($myArray as $vara) { // @$mnew_strin .= $vara . ' '; // } $first_value = reset($mmaray); $str = substr(strrchr($first_value, '/'), 1); $mnb=$str; $idi=$lastid +1; $data = date("o-m-d H:i:s"); foreach ($mmaray as $vara) { @$piclink = $vara; $str = substr(strrchr($piclink, '/'), 1); $lmnp=$str; /**$wpdb->insert( 'wp_postmeta', array('post_id' => $lastid , 'meta_key' =>'meta-myimg', 'meta_value' => $mnew_strin));**/ // Prepare an array of post data for the attachment. $attachment = array( 'guid' => $piclink, 'post_mime_type' => 'image/jpeg', 'post_title' => $metatitle, 'post_type' => 'attachment', 'post_content' => '', 'post_status' => 'inherit' ); // Insert the attachment. $attach_id = wp_insert_attachment( $attachment, $lmnp, $lastid ); } require_once(ABSPATH . 'wp-admin/includes/image.php'); wp_generate_attachment_metadata( $attach_id,'.$first_value.'); wp_update_attachment_metadata( $attach_id,$fullsizepath); set_post_thumbnail( $lastid, $attach_id ); update_post_meta($lastid, '_wp_attachment_metadata', $attach_id); update_post_meta($lastid, '_thumbnail_id', $attach_id); /*end the part of image*/ } echo '<div class="success">شكرا لك لقد تم استقبال اعلانكم بنجاح</div>'; $getmetaoption = get_option( "dani_sendemailtoadmin" ); if($getmetaoption =="1"){ /**Sending Email To Admin**/ $receiveremails = get_option( "dani_edit_emails" ); if(!empty($receiveremails)){ $adminemail =$receiveremails; }else{ $adminemail = get_option( 'admin_email' ); } $sender= get_option( 'admin_email' ); $name=$vistorname; $contento=clean_text($content); $subject="اعلان جديد بعنوان ".$metatitle." بانتظار المراجعة "; $cont=$contento."\n email:{$sender}"; $cont="\n{$metatitle}\n".$contento; $header = "From: ". $name . " <" . $sender . ">\r\n"; wp_mail($adminemail, $subject, $cont,$header); /**End Of Sending Email To Admin**/ } } }else{ /*create form*/ ?> <form enctype="multipart/form-data" method="POST" action="" class="mobawaba-form"> <div class="form-group"> <?php if(! $current_user->exists()){ ?> <input type="text" class="vistorname form-control" id="vistorname" name="vistorname" size="40" placeholder="الاسم"/> <?php }else{ echo $author_url ; } ?> </div> <div class="form-group"> <input type="text"class="metamobile form-control" id="metamobile" name="metamobile" size="40" placeholder="رقم الجوال"/> </div> <div class="form-group"> <input type="text" id="metaemail" class="form-control" name="metaemail" size="40" placeholder="البريد الاليكتروني"/> </div> <div class="form-group"> <div class="radio"> <label for="[object Object]">نوع الاعلان</label> <div id="kindadd"> <input type="radio" name="kindadd" id="kindadd" value="yes"> <span class="radiosp">اعلان سيارة </span> <input type="radio" checked="checked" name="kindadd" id="kindadd" value="no"> <span class="radiosp">اعلان اخر</span> </div> </div> </div> <div class="hidemaincatforshowcars" style="display:block;"> <div class="form-group"> <select name="genrecat" id="genrecat" class="genrecat required form-control" > <option selected value="0"><?php echo __('اختر القسم', 'mobawaba');?></option> <?php $args = array( 'type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'parent' => 0, 'taxonomy' => 'category', 'pad_counts' => false, 'exclude' => array(get_option('dani_car_category'),'1') ); $categories = get_categories($args); ?> <?php foreach( $categories as $category ) { ?> <option value="<?php echo $category->term_id; ?>"> <?php echo $category->name; ?></option> <?php } ?> </select> </div> <div class="form-group"> <select name="sub_cat" id="sub_cat" class="form-control" > <option value="0">اختر القسم الفرعي</option> </select> </div> </div> <div class="form-group"> <div class="yearx" style="display:none;"> <div class="form-group"> <select name="genrecatcar" id="genrecatcar" class="genrecat required form-control" > <option selected value="0"><?php echo __('اختر القسم', 'mobawaba');?></option> <?php $args = array( 'type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'exclude' =>0, 'parent' => get_option('dani_car_category'), 'taxonomy' => 'category', 'pad_counts' => false ); $categories = get_categories($args); ?> <?php foreach( $categories as $category ) { ?> <option value="<?php echo $category->term_id; ?>"> <?php echo $category->name; ?></option> <?php } ?> </select> </div> <div class="form-group"> <select name="sub_catcar" id="sub_catcar" class="form-control" > <option value="0">اختر القسم الفرعي</option> </select> </div> <select name="getyear" id="year" class="form-control"> <option selected ><?php echo __('اختر سنه الاصدار', 'mobawaba');?></option> <?php $args = array( 'type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'exclude' =>'', 'parent' => 0, 'taxonomy' => 'year', 'pad_counts' => false ); $categories = get_categories($args); ?> <?php foreach( $categories as $category ) { ?> <option value="<?php echo $category->term_id; ?>"> <?php echo $category->name; ?></option> <?php } ?> </select> </div> <script type="text/javascript"> $('.radio :radio').on("click", function(){ var radioval = $(this).val(); if(radioval =='yes'){ $('.yearx').show(); $('.hidemaincatforshowcars').hide(); }else{ $('.yearx').hide(); $('.hidemaincatforshowcars').show(); } }); </script> </div> <div class="form-group"> <select name="getcity" id="city" class="form-control"> <option selected ><?php echo __('اختر البلد', 'mobawaba');?></option> <?php $args = array( 'type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'exclude' =>'', 'parent' => 0, 'taxonomy' => 'city', 'pad_counts' => false ); $categories = get_categories($args); ?> <?php foreach( $categories as $category ) { ?> <option value="<?php echo $category->term_id; ?>"> <?php echo $category->name; ?></option> <?php } ?> </select> </div> <div class="form-group"> <select name="subcity" id="subcity" class="form-control"> <option value="0">اختر المدينة</option> </select> </div> <div class="form-group"> <input type="text" name="metaprice" class="metaprice form-control" id="metaprice" size="40" placeholder="السعر"/> </div> <div class="form-group"> <select name="period" class="form-control"> <option value="">اختر مدة الاعلان</option> <option value="0">دائم</option> <option value="1">يوم</option> <option value="3">ثلاث ايام</option> <option value="7">سبع ايام</option> </select> </div> <div class="form-group"> <input type="text" name="metatitle" class="metatitle form-control" id="metatitle" size="40" placeholder="عنوان الاعلان"/> </div> <div class="form-group"> <textarea rows="4" cols="50" name="content" id="content" class="content form-control" placeholder="محتوي الاعلان"></textarea> </div> <?php $disableuploading= get_option( "dani_disable_uploading" ); if($disableuploading != "true"){ ?> <div class="form-group"> <label for="meta-title">صورة الاعلان</label> <div id="filediv"><input name="file[]" type="file" id="file" class"mfile"/></div> <?php /*if multi upload active*/ $getmetaoption = get_option( "dani_active_multi_upload" ); if($getmetaoption == "true"){ ?> <input type="button" id="add_more" class="upload" value="المزيد من الصور"/> <?php }?> <?php }//end of disable system ?> </div> <div class="form-group"> <label for="meta-adcontent">التحقق الامني</label> <div class="captcha"> <img alt="captcha" src="<?php echo get_template_directory_uri(); ?>/assets/captcha/captcha.php" /> </div> </div> <div class="form-group"> <label for="meta-adcontent">ادخل الكود الامني</label> <div class="captcha"> <input type="number" name="check" class=" form-control"> </div> </div> <div class="form-group"> <input name="submit" type="submit" id="submit" value="اضف اعلانك"/> </div> </form> <?php /* end of create form*/ ?> <?php } /*end of else submit*/ } return ob_get_clean(); } add_shortcode('addnewads', 'addnewads_sc'); }else{ function addnewads_sc() { ob_start(); echo '<div class="warn" align="center">اضافه الاعلانات موقوفه بشكل مؤقت</div>'; return ob_get_clean(); } add_shortcode('addnewads', 'addnewads_sc'); } ?>
  12. يا جماعة اسعد الله اوقاتكم جميعا في عندي اخطاء برمجية ارجوا المساعدة Fatal error: Uncaught Error: Call to undefined function albiraq_copyright() in C:\wamp64\www\albiraq\wp-content\themes\albiraq\footer.php:37 Stack trace: #0 C:\wamp64\www\albiraq\wp-includes\template.php(730): require_once() #1 C:\wamp64\www\albiraq\wp-includes\template.php(676): load_template('C:\\wamp64\\www\\a...', true, Array) #2 C:\wamp64\www\albiraq\wp-includes\general-template.php(92): locate_template(Array, true, true, Array) #3 C:\wamp64\www\albiraq\wp-content\themes\albiraq\index.php(58): get_footer() #4 C:\wamp64\www\albiraq\wp-includes\template-loader.php(106): include('C:\\wamp64\\www\\a...') #5 C:\wamp64\www\albiraq\wp-blog-header.php(19): require_once('C:\\wamp64\\www\\a...') #6 C:\wamp64\www\albiraq\index.php(17): require('C:\\wamp64\\www\\a...') #7 {main} thrown in C:\wamp64\www\albiraq\wp-content\themes\albiraq\footer.php on line 37
  13. ما شاء الله اخت يمنى بتشكرك على المرور الاكثر من رائع
  14. يا جماعة اسعد الله اوقاتكم جميعا انا بديت تعلم دورة تصميم قوالب الورد بريس عندي الالمام الكامل ب html وcss والphp مستوى فوق المتوسط بدرجة بسيطة سؤال بسيط لخبراء الجافا سكريبت لدي ملفين جافا سكريبت اريد معرفة هل هو خاص بقوائم القالب ام ماذا بالتحديد وما هو استخداماته /*! jQuery Validation Plugin - v1.15.0 - 2/24/2016 * http://jqueryvalidation.org/ * Copyright (c) 2016 Jörn Zaefferer; Licensed MIT */ ! function (a) { "function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof module && module.exports ? module.exports = a(require("jquery")) : a(jQuery) }(function (a) { a.extend(a.fn, { validate: function (b) { if (!this.length) return void(b && b.debug && window.console && console.warn("Nothing selected, can't validate, returning nothing.")); var c = a.data(this[0], "validator"); return c ? c : (this.attr("novalidate", "novalidate"), c = new a.validator(b, this[0]), a.data(this[0], "validator", c), c.settings.onsubmit && (this.on("click.validate", ":submit", function (b) { c.settings.submitHandler && (c.submitButton = b.target), a(this) .hasClass("cancel") && (c.cancelSubmit = !0), void 0 !== a(this) .attr("formnovalidate") && (c.cancelSubmit = !0) }), this.on("submit.validate", function (b) { function d() { var d, e; return c.settings.submitHandler ? (c.submitButton && (d = a("<input type='hidden'/>") .attr("name", c.submitButton.name) .val(a(c.submitButton) .val()) .appendTo(c.currentForm)), e = c.settings.submitHandler.call(c, c.currentForm, b), c.submitButton && d.remove(), void 0 !== e ? e : !1) : !0 } return c.settings.debug && b.preventDefault(), c.cancelSubmit ? (c.cancelSubmit = !1, d()) : c.form() ? c.pendingRequest ? (c.formSubmitted = !0, !1) : d() : (c.focusInvalid(), !1) })), c) } , valid: function () { var b, c, d; return a(this[0]) .is("form") ? b = this.validate() .form() : (d = [], b = !0, c = a(this[0].form) .validate(), this.each(function () { b = c.element(this) && b, b || (d = d.concat(c.errorList)) }), c.errorList = d), b } , rules: function (b, c) { if (this.length) { var d, e, f, g, h, i, j = this[0]; if (b) switch (d = a.data(j.form, "validator") .settings, e = d.rules, f = a.validator.staticRules(j), b) { case "add": a.extend(f, a.validator.normalizeRule(c)), delete f.messages, e[j.name] = f, c.messages && (d.messages[j.name] = a.extend(d.messages[j.name], c.messages)); break; case "remove": return c ? (i = {}, a.each(c.split(/\s/), function (b, c) { i[c] = f[c], delete f[c], "required" === c && a(j) .removeAttr("aria-required") }), i) : (delete e[j.name], f) } return g = a.validator.normalizeRules(a.extend({}, a.validator.classRules(j), a.validator.attributeRules(j), a.validator.dataRules(j), a.validator.staticRules(j)), j), g.required && (h = g.required, delete g.required, g = a.extend({ required: h }, g), a(j) .attr("aria-required", "true")), g.remote && (h = g.remote, delete g.remote, g = a.extend(g, { remote: h })), g } } }), a.extend(a.expr[":"], { blank: function (b) { return !a.trim("" + a(b) .val()) } , filled: function (b) { var c = a(b) .val(); return null !== c && !!a.trim("" + c) } , unchecked: function (b) { return !a(b) .prop("checked") } }), a.validator = function (b, c) { this.settings = a.extend(!0, {}, a.validator.defaults, b), this.currentForm = c, this.init() }, a.validator.format = function (b, c) { return 1 === arguments.length ? function () { var c = a.makeArray(arguments); return c.unshift(b), a.validator.format.apply(this, c) } : void 0 === c ? b : (arguments.length > 2 && c.constructor !== Array && (c = a.makeArray(arguments) .slice(1)), c.constructor !== Array && (c = [c]), a.each(c, function (a, c) { b = b.replace(new RegExp("\\{" + a + "\\}", "g"), function () { return c }) }), b) }, a.extend(a.validator, { defaults: { messages: {} , groups: {} , rules: {} , errorClass: "error" , pendingClass: "pending" , validClass: "valid" , errorElement: "label" , focusCleanup: !1 , focusInvalid: !0 , errorContainer: a([]) , errorLabelContainer: a([]) , onsubmit: !0 , ignore: ":hidden" , ignoreTitle: !1 , onfocusin: function (a) { this.lastActive = a, this.settings.focusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, a, this.settings.errorClass, this.settings.validClass), this.hideThese(this.errorsFor(a))) } , onfocusout: function (a) { this.checkable(a) || !(a.name in this.submitted) && this.optional(a) || this.element(a) } , onkeyup: function (b, c) { var d = [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225]; 9 === c.which && "" === this.elementValue(b) || -1 !== a.inArray(c.keyCode, d) || (b.name in this.submitted || b.name in this.invalid) && this.element(b) } , onclick: function (a) { a.name in this.submitted ? this.element(a) : a.parentNode.name in this.submitted && this.element(a.parentNode) } , highlight: function (b, c, d) { "radio" === b.type ? this.findByName(b.name) .addClass(c) .removeClass(d) : a(b) .addClass(c) .removeClass(d) } , unhighlight: function (b, c, d) { "radio" === b.type ? this.findByName(b.name) .removeClass(c) .addClass(d) : a(b) .removeClass(c) .addClass(d) } } , setDefaults: function (b) { a.extend(a.validator.defaults, b) } , messages: { required: "This field is required." , remote: "Please fix this field." , email: "Please enter a valid email address." , url: "Please enter a valid URL." , date: "Please enter a valid date." , dateISO: "Please enter a valid date ( ISO )." , number: "Please enter a valid number." , digits: "Please enter only digits." , equalTo: "Please enter the same value again." , maxlength: a.validator.format("Please enter no more than {0} characters.") , minlength: a.validator.format("Please enter at least {0} characters.") , rangelength: a.validator.format("Please enter a value between {0} and {1} characters long.") , range: a.validator.format("Please enter a value between {0} and {1}.") , max: a.validator.format("Please enter a value less than or equal to {0}.") , min: a.validator.format("Please enter a value greater than or equal to {0}.") , step: a.validator.format("Please enter a multiple of {0}.") } , autoCreateRanges: !1 , prototype: { init: function () { function b(b) { var c = a.data(this.form, "validator") , d = "on" + b.type.replace(/^validate/, "") , e = c.settings; e[d] && !a(this) .is(e.ignore) && e[d].call(c, this, b) } this.labelContainer = a(this.settings.errorLabelContainer), this.errorContext = this.labelContainer.length && this.labelContainer || a(this.currentForm), this.containers = a(this.settings.errorContainer) .add(this.settings.errorLabelContainer), this.submitted = {}, this.valueCache = {}, this.pendingRequest = 0, this.pending = {}, this.invalid = {}, this.reset(); var c, d = this.groups = {}; a.each(this.settings.groups, function (b, c) { "string" == typeof c && (c = c.split(/\s/)), a.each(c, function (a, c) { d[c] = b }) }), c = this.settings.rules, a.each(c, function (b, d) { c[b] = a.validator.normalizeRule(d) }), a(this.currentForm) .on("focusin.validate focusout.validate keyup.validate", ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable]", b) .on("click.validate", "select, option, [type='radio'], [type='checkbox']", b), this.settings.invalidHandler && a(this.currentForm) .on("invalid-form.validate", this.settings.invalidHandler), a(this.currentForm) .find("[required], [data-rule-required], .required") .attr("aria-required", "true") } , form: function () { return this.checkForm(), a.extend(this.submitted, this.errorMap), this.invalid = a.extend({}, this.errorMap), this.valid() || a(this.currentForm) .triggerHandler("invalid-form", [this]), this.showErrors(), this.valid() } , checkForm: function () { this.prepareForm(); for (var a = 0, b = this.currentElements = this.elements(); b[a]; a++) this.check(b[a]); return this.valid() } , element: function (b) { var c, d, e = this.clean(b) , f = this.validationTargetFor(e) , g = this , h = !0; return void 0 === f ? delete this.invalid[e.name] : (this.prepareElement(f), this.currentElements = a(f), d = this.groups[f.name], d && a.each(this.groups, function (a, b) { b === d && a !== f.name && (e = g.validationTargetFor(g.clean(g.findByName(a))), e && e.name in g.invalid && (g.currentElements.push(e), h = h && g.check(e))) }), c = this.check(f) !== !1, h = h && c, c ? this.invalid[f.name] = !1 : this.invalid[f.name] = !0, this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), a(b) .attr("aria-invalid", !c)), h } , showErrors: function (b) { if (b) { var c = this; a.extend(this.errorMap, b), this.errorList = a.map(this.errorMap, function (a, b) { return { message: a , element: c.findByName(b)[0] } }), this.successList = a.grep(this.successList, function (a) { return !(a.name in b) }) } this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors() } , resetForm: function () { a.fn.resetForm && a(this.currentForm) .resetForm(), this.invalid = {}, this.submitted = {}, this.prepareForm(), this.hideErrors(); var b = this.elements() .removeData("previousValue") .removeAttr("aria-invalid"); this.resetElements(b) } , resetElements: function (a) { var b; if (this.settings.unhighlight) for (b = 0; a[b]; b++) this.settings.unhighlight.call(this, a[b], this.settings.errorClass, ""), this.findByName(a[b].name) .removeClass(this.settings.validClass); else a.removeClass(this.settings.errorClass) .removeClass(this.settings.validClass) } , numberOfInvalids: function () { return this.objectLength(this.invalid) } , objectLength: function (a) { var b, c = 0; for (b in a) a[b] && c++; return c } , hideErrors: function () { this.hideThese(this.toHide) } , hideThese: function (a) { a.not(this.containers) .text(""), this.addWrapper(a) .hide() } , valid: function () { return 0 === this.size() } , size: function () { return this.errorList.length } , focusInvalid: function () { if (this.settings.focusInvalid) try { a(this.findLastActive() || this.errorList.length && this.errorList[0].element || []) .filter(":visible") .focus() .trigger("focusin") } catch (b) {} } , findLastActive: function () { var b = this.lastActive; return b && 1 === a.grep(this.errorList, function (a) { return a.element.name === b.name }) .length && b } , elements: function () { var b = this , c = {}; return a(this.currentForm) .find("input, select, textarea, [contenteditable]") .not(":submit, :reset, :image, :disabled") .not(this.settings.ignore) .filter(function () { var d = this.name || a(this) .attr("name"); return !d && b.settings.debug && window.console && console.error("%o has no name assigned", this), this.hasAttribute("contenteditable") && (this.form = a(this) .closest("form")[0]), d in c || !b.objectLength(a(this) .rules()) ? !1 : (c[d] = !0, !0) }) } , clean: function (b) { return a(b)[0] } , errors: function () { var b = this.settings.errorClass.split(" ") .join("."); return a(this.settings.errorElement + "." + b, this.errorContext) } , resetInternals: function () { this.successList = [], this.errorList = [], this.errorMap = {}, this.toShow = a([]), this.toHide = a([]) } , reset: function () { this.resetInternals(), this.currentElements = a([]) } , prepareForm: function () { this.reset(), this.toHide = this.errors() .add(this.containers) } , prepareElement: function (a) { this.reset(), this.toHide = this.errorsFor(a) } , elementValue: function (b) { var c, d, e = a(b) , f = b.type; return "radio" === f || "checkbox" === f ? this.findByName(b.name) .filter(":checked") .val() : "number" === f && "undefined" != typeof b.validity ? b.validity.badInput ? "NaN" : e.val() : (c = b.hasAttribute("contenteditable") ? e.text() : e.val(), "file" === f ? "C:\\fakepath\\" === c.substr(0, 12) ? c.substr(12) : (d = c.lastIndexOf("/"), d >= 0 ? c.substr(d + 1) : (d = c.lastIndexOf("\\"), d >= 0 ? c.substr(d + 1) : c)) : "string" == typeof c ? c.replace(/\r/g, "") : c) } , check: function (b) { b = this.validationTargetFor(this.clean(b)); var c, d, e, f = a(b) .rules() , g = a.map(f, function (a, b) { return b }) .length , h = !1 , i = this.elementValue(b); if ("function" == typeof f.normalizer) { if (i = f.normalizer.call(b, i), "string" != typeof i) throw new TypeError("The normalizer should return a string value."); delete f.normalizer } for (d in f) { e = { method: d , parameters: f[d] }; try { if (c = a.validator.methods[d].call(this, i, b, e.parameters), "dependency-mismatch" === c && 1 === g) { h = !0; continue } if (h = !1, "pending" === c) return void(this.toHide = this.toHide.not(this.errorsFor(b))); if (!c) return this.formatAndAdd(b, e), !1 } catch (j) { throw this.settings.debug && window.console && console.log("Exception occurred when checking element " + b.id + ", check the '" + e.method + "' method.", j), j instanceof TypeError && (j.message += ". Exception occurred when checking element " + b.id + ", check the '" + e.method + "' method."), j } } if (!h) return this.objectLength(f) && this.successList.push(b), !0 } , customDataMessage: function (b, c) { return a(b) .data("msg" + c.charAt(0) .toUpperCase() + c.substring(1) .toLowerCase()) || a(b) .data("msg") } , customMessage: function (a, b) { var c = this.settings.messages[a]; return c && (c.constructor === String ? c : c[b]) } , findDefined: function () { for (var a = 0; a < arguments.length; a++) if (void 0 !== arguments[a]) return arguments[a] } , defaultMessage: function (b, c) { var d = this.findDefined(this.customMessage(b.name, c.method), this.customDataMessage(b, c.method), !this.settings.ignoreTitle && b.title || void 0, a.validator.messages[c.method], "<strong>Warning: No message defined for " + b.name + "</strong>") , e = /\$?\{(\d+)\}/g; return "function" == typeof d ? d = d.call(this, c.parameters, b) : e.test(d) && (d = a.validator.format(d.replace(e, "{$1}"), c.parameters)), d } , formatAndAdd: function (a, b) { var c = this.defaultMessage(a, b); this.errorList.push({ message: c , element: a , method: b.method }), this.errorMap[a.name] = c, this.submitted[a.name] = c } , addWrapper: function (a) { return this.settings.wrapper && (a = a.add(a.parent(this.settings.wrapper))), a } , defaultShowErrors: function () { var a, b, c; for (a = 0; this.errorList[a]; a++) c = this.errorList[a], this.settings.highlight && this.settings.highlight.call(this, c.element, this.settings.errorClass, this.settings.validClass), this.showLabel(c.element, c.message); if (this.errorList.length && (this.toShow = this.toShow.add(this.containers)), this.settings.success) for (a = 0; this.successList[a]; a++) this.showLabel(this.successList[a]); if (this.settings.unhighlight) for (a = 0, b = this.validElements(); b[a]; a++) this.settings.unhighlight.call(this, b[a], this.settings.errorClass, this.settings.validClass); this.toHide = this.toHide.not(this.toShow), this.hideErrors(), this.addWrapper(this.toShow) .show() } , validElements: function () { return this.currentElements.not(this.invalidElements()) } , invalidElements: function () { return a(this.errorList) .map(function () { return this.element }) } , showLabel: function (b, c) { var d, e, f, g, h = this.errorsFor(b) , i = this.idOrName(b) , j = a(b) .attr("aria-describedby"); h.length ? (h.removeClass(this.settings.validClass) .addClass(this.settings.errorClass), h.html(c)) : (h = a("<" + this.settings.errorElement + ">") .attr("id", i + "-error") .addClass(this.settings.errorClass) .html(c || ""), d = h, this.settings.wrapper && (d = h.hide() .show() .wrap("<" + this.settings.wrapper + "/>") .parent()), this.labelContainer.length ? this.labelContainer.append(d) : this.settings.errorPlacement ? this.settings.errorPlacement(d, a(b)) : d.insertAfter(b), h.is("label") ? h.attr("for", i) : 0 === h.parents("label[for='" + this.escapeCssMeta(i) + "']") .length && (f = h.attr("id"), j ? j.match(new RegExp("\\b" + this.escapeCssMeta(f) + "\\b")) || (j += " " + f) : j = f, a(b) .attr("aria-describedby", j), e = this.groups[b.name], e && (g = this, a.each(g.groups, function (b, c) { c === e && a("[name='" + g.escapeCssMeta(b) + "']", g.currentForm) .attr("aria-describedby", h.attr("id")) })))), !c && this.settings.success && (h.text(""), "string" == typeof this.settings.success ? h.addClass(this.settings.success) : this.settings.success(h, b)), this.toShow = this.toShow.add(h) } , errorsFor: function (b) { var c = this.escapeCssMeta(this.idOrName(b)) , d = a(b) .attr("aria-describedby") , e = "label[for='" + c + "'], label[for='" + c + "'] *"; return d && (e = e + ", #" + this.escapeCssMeta(d) .replace(/\s+/g, ", #")), this.errors() .filter(e) } , escapeCssMeta: function (a) { return a.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1") } , idOrName: function (a) { return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name) } , validationTargetFor: function (b) { return this.checkable(b) && (b = this.findByName(b.name)), a(b) .not(this.settings.ignore)[0] } , checkable: function (a) { return /radio|checkbox/i.test(a.type) } , findByName: function (b) { return a(this.currentForm) .find("[name='" + this.escapeCssMeta(b) + "']") } , getLength: function (b, c) { switch (c.nodeName.toLowerCase()) { case "select": return a("option:selected", c) .length; case "input": if (this.checkable(c)) return this.findByName(c.name) .filter(":checked") .length } return b.length } , depend: function (a, b) { return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : !0 } , dependTypes: { "boolean": function (a) { return a } , string: function (b, c) { return !!a(b, c.form) .length } , "function": function (a, b) { return a(b) } } , optional: function (b) { var c = this.elementValue(b); return !a.validator.methods.required.call(this, c, b) && "dependency-mismatch" } , startRequest: function (b) { this.pending[b.name] || (this.pendingRequest++, a(b) .addClass(this.settings.pendingClass), this.pending[b.name] = !0) } , stopRequest: function (b, c) { this.pendingRequest--, this.pendingRequest < 0 && (this.pendingRequest = 0), delete this.pending[b.name], a(b) .removeClass(this.settings.pendingClass), c && 0 === this.pendingRequest && this.formSubmitted && this.form() ? (a(this.currentForm) .submit(), this.formSubmitted = !1) : !c && 0 === this.pendingRequest && this.formSubmitted && (a(this.currentForm) .triggerHandler("invalid-form", [this]), this.formSubmitted = !1) } , previousValue: function (b, c) { return a.data(b, "previousValue") || a.data(b, "previousValue", { old: null , valid: !0 , message: this.defaultMessage(b, { method: c }) }) } , destroy: function () { this.resetForm(), a(this.currentForm) .off(".validate") .removeData("validator") .find(".validate-equalTo-blur") .off(".validate-equalTo") .removeClass("validate-equalTo-blur") } } , classRuleSettings: { required: { required: !0 } , email: { email: !0 } , url: { url: !0 } , date: { date: !0 } , dateISO: { dateISO: !0 } , number: { number: !0 } , digits: { digits: !0 } , creditcard: { creditcard: !0 } } , addClassRules: function (b, c) { b.constructor === String ? this.classRuleSettings[b] = c : a.extend(this.classRuleSettings, b) } , classRules: function (b) { var c = {} , d = a(b) .attr("class"); return d && a.each(d.split(" "), function () { this in a.validator.classRuleSettings && a.extend(c, a.validator.classRuleSettings[this]) }), c } , normalizeAttributeRule: function (a, b, c, d) { /min|max|step/.test(c) && (null === b || /number|range|text/.test(b)) && (d = Number(d), isNaN(d) && (d = void 0)), d || 0 === d ? a[c] = d : b === c && "range" !== b && (a[c] = !0) } , attributeRules: function (b) { var c, d, e = {} , f = a(b) , g = b.getAttribute("type"); for (c in a.validator.methods) "required" === c ? (d = b.getAttribute(c), "" === d && (d = !0), d = !!d) : d = f.attr(c), this.normalizeAttributeRule(e, g, c, d); return e.maxlength && /-1|2147483647|524288/.test(e.maxlength) && delete e.maxlength, e } , dataRules: function (b) { var c, d, e = {} , f = a(b) , g = b.getAttribute("type"); for (c in a.validator.methods) d = f.data("rule" + c.charAt(0) .toUpperCase() + c.substring(1) .toLowerCase()), this.normalizeAttributeRule(e, g, c, d); return e } , staticRules: function (b) { var c = {} , d = a.data(b.form, "validator"); return d.settings.rules && (c = a.validator.normalizeRule(d.settings.rules[b.name]) || {}), c } , normalizeRules: function (b, c) { return a.each(b, function (d, e) { if (e === !1) return void delete b[d]; if (e.param || e.depends) { var f = !0; switch (typeof e.depends) { case "string": f = !!a(e.depends, c.form) .length; break; case "function": f = e.depends.call(c, c) } f ? b[d] = void 0 !== e.param ? e.param : !0 : (a.data(c.form, "validator") .resetElements(a(c)), delete b[d]) } }), a.each(b, function (d, e) { b[d] = a.isFunction(e) && "normalizer" !== d ? e(c) : e }), a.each(["minlength", "maxlength"], function () { b[this] && (b[this] = Number(b[this])) }), a.each(["rangelength", "range"], function () { var c; b[this] && (a.isArray(b[this]) ? b[this] = [Number(b[this][0]), Number(b[this][1])] : "string" == typeof b[this] && (c = b[this].replace(/[\[\]]/g, "") .split(/[\s,]+/), b[this] = [Number(c[0]), Number(c[1])])) }), a.validator.autoCreateRanges && (null != b.min && null != b.max && (b.range = [b.min, b.max], delete b.min, delete b.max), null != b.minlength && null != b.maxlength && (b.rangelength = [b.minlength, b.maxlength], delete b.minlength, delete b.maxlength)), b } , normalizeRule: function (b) { if ("string" == typeof b) { var c = {}; a.each(b.split(/\s/), function () { c[this] = !0 }), b = c } return b } , addMethod: function (b, c, d) { a.validator.methods[b] = c, a.validator.messages[b] = void 0 !== d ? d : a.validator.messages[b], c.length < 3 && a.validator.addClassRules(b, a.validator.normalizeRule(b)) } , methods: { required: function (b, c, d) { if (!this.depend(d, c)) return "dependency-mismatch"; if ("select" === c.nodeName.toLowerCase()) { var e = a(c) .val(); return e && e.length > 0 } return this.checkable(c) ? this.getLength(b, c) > 0 : b.length > 0 } , email: function (a, b) { return this.optional(b) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a) } , url: function (a, b) { return this.optional(b) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a) } , date: function (a, b) { return this.optional(b) || !/Invalid|NaN/.test(new Date(a) .toString()) } , dateISO: function (a, b) { return this.optional(b) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a) } , number: function (a, b) { return this.optional(b) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a) } , digits: function (a, b) { return this.optional(b) || /^\d+$/.test(a) } , minlength: function (b, c, d) { var e = a.isArray(b) ? b.length : this.getLength(b, c); return this.optional(c) || e >= d } , maxlength: function (b, c, d) { var e = a.isArray(b) ? b.length : this.getLength(b, c); return this.optional(c) || d >= e } , rangelength: function (b, c, d) { var e = a.isArray(b) ? b.length : this.getLength(b, c); return this.optional(c) || e >= d[0] && e <= d[1] } , min: function (a, b, c) { return this.optional(b) || a >= c } , max: function (a, b, c) { return this.optional(b) || c >= a } , range: function (a, b, c) { return this.optional(b) || a >= c[0] && a <= c[1] } , step: function (b, c, d) { var e = a(c) .attr("type") , f = "Step attribute on input type " + e + " is not supported." , g = ["text", "number", "range"] , h = new RegExp("\\b" + e + "\\b") , i = e && !h.test(g.join()); if (i) throw new Error(f); return this.optional(c) || b % d === 0 } , equalTo: function (b, c, d) { var e = a(d); return this.settings.onfocusout && e.not(".validate-equalTo-blur") .length && e.addClass("validate-equalTo-blur") .on("blur.validate-equalTo", function () { a(c) .valid() }), b === e.val() } , remote: function (b, c, d, e) { if (this.optional(c)) return "dependency-mismatch"; e = "string" == typeof e && e || "remote"; var f, g, h, i = this.previousValue(c, e); return this.settings.messages[c.name] || (this.settings.messages[c.name] = {}), i.originalMessage = i.originalMessage || this.settings.messages[c.name][e], this.settings.messages[c.name][e] = i.message, d = "string" == typeof d && { url: d } || d, h = a.param(a.extend({ data: b }, d.data)), i.old === h ? i.valid : (i.old = h, f = this, this.startRequest(c), g = {}, g[c.name] = b, a.ajax(a.extend(!0, { mode: "abort" , port: "validate" + c.name , dataType: "json" , data: g , context: f.currentForm , success: function (a) { var d, g, h, j = a === !0 || "true" === a; f.settings.messages[c.name][e] = i.originalMessage, j ? (h = f.formSubmitted, f.resetInternals(), f.toHide = f.errorsFor(c), f.formSubmitted = h, f.successList.push(c), f.invalid[c.name] = !1, f.showErrors()) : (d = {}, g = a || f.defaultMessage(c, { method: e , parameters: b }), d[c.name] = i.message = g, f.invalid[c.name] = !0, f.showErrors(d)), i.valid = j, f.stopRequest(c, j) } }, d)), "pending") } } }); var b, c = {}; a.ajaxPrefilter ? a.ajaxPrefilter(function (a, b, d) { var e = a.port; "abort" === a.mode && (c[e] && c[e].abort(), c[e] = d) }) : (b = a.ajax, a.ajax = function (d) { var e = ("mode" in d ? d : a.ajaxSettings) .mode , f = ("port" in d ? d : a.ajaxSettings) .port; return "abort" === e ? (c[f] && c[f].abort(), c[f] = b.apply(this, arguments), c[f]) : b.apply(this, arguments) }) }); لدي ايضا كود اخر /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2014 Scott Jehl * Licensed under MIT * http://j.mp/respondjs */ ! function (a) { "use strict"; a.matchMedia = a.matchMedia || function (a) { var b, c = a.documentElement , d = c.firstElementChild || c.firstChild , e = a.createElement("body") , f = a.createElement("div"); return f.id = "mq-test-1", f.style.cssText = "position:absolute;top:-100em", e.style.background = "none", e.appendChild(f) , function (a) { return f.innerHTML = '&shy;<style media="' + a + '"> #mq-test-1 { width: 42px; }</style>', c.insertBefore(e, d), b = 42 === f.offsetWidth, c.removeChild(e), { matches: b , media: a } } }(a.document) }(this) , function (a) { "use strict"; function b() { v(!0) } var c = {}; a.respond = c, c.update = function () {}; var d = [] , e = function () { var b = !1; try { b = new a.XMLHttpRequest } catch (c) { b = new a.ActiveXObject("Microsoft.XMLHTTP") } return function () { return b } }() , f = function (a, b) { var c = e(); c && (c.open("GET", a, !0), c.onreadystatechange = function () { 4 !== c.readyState || 200 !== c.status && 304 !== c.status || b(c.responseText) }, 4 !== c.readyState && c.send(null)) } , g = function (a) { return a.replace(c.regex.minmaxwh, "") .match(c.regex.other) }; if (c.ajax = f, c.queue = d, c.unsupportedmq = g, c.regex = { media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi , keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi , comments: /\/\*[^*]*\*+([^/][^*]*\*+)*\//gi , urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g , findStyles: /@media *([^\{]+)\{([\S\s]+?)$/ , only: /(only\s+)?([a-zA-Z]+)\s?/ , minw: /\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/ , maxw: /\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/ , minmaxwh: /\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi , other: /\([^\)]*\)/g }, c.mediaQueriesSupported = a.matchMedia && null !== a.matchMedia("only all") && a.matchMedia("only all") .matches, !c.mediaQueriesSupported) { var h, i, j, k = a.document , l = k.documentElement , m = [] , n = [] , o = [] , p = {} , q = 30 , r = k.getElementsByTagName("head")[0] || l , s = k.getElementsByTagName("base")[0] , t = r.getElementsByTagName("link") , u = function () { var a, b = k.createElement("div") , c = k.body , d = l.style.fontSize , e = c && c.style.fontSize , f = !1; return b.style.cssText = "position:absolute;font-size:1em;width:1em", c || (c = f = k.createElement("body"), c.style.background = "none"), l.style.fontSize = "100%", c.style.fontSize = "100%", c.appendChild(b), f && l.insertBefore(c, l.firstChild), a = b.offsetWidth, f ? l.removeChild(c) : c.removeChild(b), l.style.fontSize = d, e && (c.style.fontSize = e), a = j = parseFloat(a) } , v = function (b) { var c = "clientWidth" , d = l[c] , e = "CSS1Compat" === k.compatMode && d || k.body[c] || d , f = {} , g = t[t.length - 1] , p = (new Date) .getTime(); if (b && h && q > p - h) return a.clearTimeout(i), i = a.setTimeout(v, q), void 0; h = p; for (var s in m) if (m.hasOwnProperty(s)) { var w = m[s] , x = w.minw , y = w.maxw , z = null === x , A = null === y , B = "em"; x && (x = parseFloat(x) * (x.indexOf(B) > -1 ? j || u() : 1)), y && (y = parseFloat(y) * (y.indexOf(B) > -1 ? j || u() : 1)), w.hasquery && (z && A || !(z || e >= x) || !(A || y >= e)) || (f[w.media] || (f[w.media] = []), f[w.media].push(n[w.rules])) } for (var C in o) o.hasOwnProperty(C) && o[C] && o[C].parentNode === r && r.removeChild(o[C]); o.length = 0; for (var D in f) if (f.hasOwnProperty(D)) { var E = k.createElement("style") , F = f[D].join("\n"); E.type = "text/css", E.media = D, r.insertBefore(E, g.nextSibling), E.styleSheet ? E.styleSheet.cssText = F : E.appendChild(k.createTextNode(F)), o.push(E) } } , w = function (a, b, d) { var e = a.replace(c.regex.comments, "") .replace(c.regex.keyframes, "") .match(c.regex.media) , f = e && e.length || 0; b = b.substring(0, b.lastIndexOf("/")); var h = function (a) { return a.replace(c.regex.urls, "$1" + b + "$2$3") } , i = !f && d; b.length && (b += "/"), i && (f = 1); for (var j = 0; f > j; j++) { var k, l, o, p; i ? (k = d, n.push(h(a))) : (k = e[j].match(c.regex.findStyles) && RegExp.$1, n.push(RegExp.$2 && h(RegExp.$2))), o = k.split(","), p = o.length; for (var q = 0; p > q; q++) l = o[q], g(l) || m.push({ media: l.split("(")[0].match(c.regex.only) && RegExp.$2 || "all" , rules: n.length - 1 , hasquery: l.indexOf("(") > -1 , minw: l.match(c.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || "") , maxw: l.match(c.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "") }) } v() } , x = function () { if (d.length) { var b = d.shift(); f(b.href, function (c) { w(c, b.href, b.media), p[b.href] = !0, a.setTimeout(function () { x() }, 0) }) } } , y = function () { for (var b = 0; b < t.length; b++) { var c = t[b] , e = c.href , f = c.media , g = c.rel && "stylesheet" === c.rel.toLowerCase(); e && g && !p[e] && (c.styleSheet && c.styleSheet.rawCssText ? (w(c.styleSheet.rawCssText, e, f), p[e] = !0) : (!/^([a-zA-Z:]*\/\/)/.test(e) && !s || e.replace(RegExp.$1, "") .split("/")[0] === a.location.host) && ("//" === e.substring(0, 2) && (e = a.location.protocol + e), d.push({ href: e , media: f }))) } x() }; y(), c.update = y, c.getEmValue = u, a.addEventListener ? a.addEventListener("resize", b, !1) : a.attachEvent && a.attachEvent("onresize", b) } }(this);
×
×
  • أضف...