Advertisement
wrsi

truva

Dec 12th, 2014
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 67.55 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. function of_head() {
  5.     do_action( 'of_head' );
  6. }
  7.  
  8. function of_style_path() {
  9.     $style = $_REQUEST['style'];
  10.  
  11.     if ($style != '') {
  12.         $style_path = $style;
  13.     }
  14.     else {
  15.         $stylesheet = get_option( 'of_alt_stylesheet' );
  16.         $style_path = str_replace( '.css', '', $stylesheet );
  17.     }
  18.  
  19.  
  20.     if ($style_path == 'default') {
  21.         echo 'images';
  22.         return null;
  23.     }
  24.  
  25.     echo 'styles/' . $style_path;
  26. }
  27.  
  28. function of_option_setup() {
  29.     $of_array = array(  );
  30.     add_option( 'of_options', $of_array );
  31.     $template = get_option( 'of_template' );
  32.     $saved_options = get_option( 'of_options' );
  33.     foreach ($template as $option) {
  34.  
  35.         if ($option['type'] != 'heading') {
  36.             $id = $option['id'];
  37.             $std = $option['std'];
  38.             $db_option = get_option( $id );
  39.  
  40.             if (empty( $db_option )) {
  41.                 if (is_array( $option['type'] )) {
  42.                     foreach ($option['type'] as $child) {
  43.                         $c_id = $child['id'];
  44.                         $c_std = $child['std'];
  45.                         update_option( $c_id, $c_std );
  46.                         $of_array[$c_id] = $c_std;
  47.                     }
  48.  
  49.                     continue;
  50.                 }
  51.  
  52.                 update_option( $id, $std );
  53.                 $of_array[$id] = $std;
  54.                 continue;
  55.             }
  56.  
  57.             $of_array[$id] = $db_option;
  58.             continue;
  59.         }
  60.     }
  61.  
  62.     update_option( 'of_options', $of_array );
  63. }
  64.  
  65. function fabrikapanel_admin_head() {
  66.     echo '    ';
  67.     echo '<s';
  68.     echo 'cript type="text/javascript">
  69.    jQuery(function(){
  70.     var message = \'<p><a href="';
  71.     echo admin_url( 'admin.php?page=fabrikapanel' );
  72.     echo '">Yönetim panelinden</a> tema ayarlarınızı yapabilirsiniz.</p>\';
  73.         jQuery(\'.themes-php #message2\').html(message);
  74.  
  75.    });
  76.    </script>
  77. ';
  78. }
  79.  
  80. function fabrikapanel_add_admin() {
  81.     global $query_string;
  82.  
  83.     $themename = get_option( 'of_themename' );
  84.     $shortname = get_option( 'of_shortname' );
  85.  
  86.     if (( isset( $_REQUEST['page'] ) && $_REQUEST['page'] == 'fabrikapanel' )) {
  87.         if (( isset( $_REQUEST['of_save'] ) && 'reset' == $_REQUEST['of_save'] )) {
  88.             $options = get_option( 'of_template' );
  89.             of_reset_options( $options, 'fabrikapanel' );
  90.             header( 'Location: admin.php?page=fabrikapanel&reset=true' );
  91.             exit(  );
  92.         }
  93.     }
  94.  
  95.     $of_page = add_menu_page( $themename, 'TEMA AYARLARI', 'edit_theme_options', 'fabrikapanel', 'fabrikapanel_options_page', get_bloginfo( 'template_url' ) . '/admin/images/panel.png' );
  96.     add_action( 'admin_print_scripts-' . $of_page, 'of_load_only' );
  97.     add_action( 'admin_print_styles-' . $of_page, 'of_style_only' );
  98. }
  99.  
  100. function of_reset_options($options, $page = '') {
  101.     global $wpdb;
  102.  
  103.     $query_inner = '';
  104.     $count = 13;
  105.     $excludes = array( 'blogname', 'blogdescription' );
  106.     foreach ($options as $option) {
  107.  
  108.         if (isset( $option['id'] )) {
  109.             ++$count;
  110.             $option_id = $option['id'];
  111.             $option_type = $option['type'];
  112.  
  113.             if (in_array( $option_id, $excludes )) {
  114.                 continue;
  115.             }
  116.  
  117.  
  118.             if (1 < $count) {
  119.                 $query_inner .= ' OR ';
  120.             }
  121.  
  122.  
  123.             if ($option_type == 'multicheck') {
  124.                 $multicount = 13;
  125.                 foreach ($option['options'] as $option_key => $option_option) {
  126.                     ++$multicount;
  127.  
  128.                     if (1 < $multicount) {
  129.                         $query_inner .= ' OR ';
  130.                     }
  131.  
  132.                     $query_inner .= 'option_name = \'' . $option_id . '_' . $option_key . '\'';
  133.                 }
  134.  
  135.                 continue;
  136.             }
  137.  
  138.  
  139.             if (is_array( $option_type )) {
  140.                 $type_array_count = 13;
  141.                 foreach ($option_type as $inner_option) {
  142.                     ++$type_array_count;
  143.                     $option_id = $inner_option['id'];
  144.  
  145.                     if (1 < $type_array_count) {
  146.                         $query_inner .= ' OR ';
  147.                     }
  148.  
  149.                     $query_inner .= 'option_name = \'' . $option_id . '\'';
  150.                 }
  151.  
  152.                 continue;
  153.             }
  154.  
  155.             $query_inner .= 'option_name = \'' . $option_id . '\'';
  156.             continue;
  157.         }
  158.     }
  159.  
  160.  
  161.     if ($page == 'fabrikapanel') {
  162.         $query_inner .= ' OR option_name = \'of_options\'';
  163.     }
  164.  
  165.     $query = 'DELETE FROM ' . $wpdb->options . ' WHERE ' . $query_inner;
  166.     $wpdb->query( $query );
  167. }
  168.  
  169.     $options = function fabrikapanel_options_page() {;
  170.     get_option( 'of_themename' );
  171.     $themename = get_option( 'of_template' );
  172.     echo '
  173.  
  174. <div style="float:left; width:800px; height:150px; margin:20px 0px 20px 10px; padding:0px 0px 20px 0px; border-bottom: 1px solid #999;">
  175. <iframe src="http://www.temafabrika.com/demo/bilgi.html" width="800" height="150" frameborder="0" scrolling="no"></iframe>
  176. </div>
  177.  
  178. <div class="clear"></div>
  179.  
  180.  
  181. <div class="wrap" id="of_container">
  182.  <div id="of-popup-save" class="of-save-popup">
  183.    <div class';
  184.     echo '="of-save-save">Ayarlar Güncellendi</div>
  185.  </div>
  186.  <div id="of-popup-reset" class="of-save-popup">
  187.    <div class="of-save-reset">Ayarlar Sıfırlandı</div>
  188.  </div>
  189.  <form action="" enctype="multipart/form-data" id="ofform">
  190.    <div id="header">
  191.      <div class="logo">
  192.        <h2>';
  193.     echo $themename;
  194.     echo '</h2>
  195.      </div>
  196.      <div class="icon-option"> </div>
  197.      <div class="clear"></div>
  198.    </div>
  199.    ';
  200.     $return = fabrikapanel_machine( $options );
  201.     echo '    <div id="main">
  202.      <div id="of-nav">
  203.        <ul>
  204.          ';
  205.     echo $return[1];
  206.     echo '        </ul>
  207.      </div>
  208.      <div id="content"> ';
  209.     echo $return[0];
  210.     echo ' </div>
  211.      <div class="clear"></div>
  212.    </div>
  213.    <div class="save_bar_top">
  214.    <img style="display:none" src="';
  215.     echo bloginfo( 'stylesheet_directory' );
  216.     echo '/admin/images/loading-bottom.gif" class="ajax-loading-img ajax-loading-img-bottom" alt="Working..." />
  217.    <input type="submit" value="Ayarları Kaydet" class="button-primary" />
  218.  </form>
  219.  <form action="';
  220.     echo esc_attr( $_SERVER['REQUEST_URI'] );
  221.     echo '" method="post" style="display:inline;" id="ofform-reset">
  222.    ';
  223.     echo '<s';
  224.     echo 'pan class="submit-footer-reset">
  225.    <input name="reset" type="submit" value="Ayarları Sıfırla" class="button submit-button reset-button" onclick="return confirm(\'Tüm ayarlar sıfırlansınmı?\');" />
  226.    <input type="hidden" name="of_save" value="reset" />
  227.    </span>
  228.  </form>
  229. </div>
  230. ';
  231.  
  232.     if (!empty( $update_message )) {
  233.         echo $update_message;
  234.     }
  235.  
  236.     echo '<div style="clear:both;"></div>
  237. </div>
  238.  
  239. <!--wrap-->
  240. ';
  241. }
  242.  
  243. function of_style_only() {
  244.     wp_enqueue_style( 'admin-style', OF_DIRECTORY . '/admin/admin-style.css' );
  245.     wp_enqueue_style( 'color-picker', OF_DIRECTORY . '/admin/css/colorpicker.css' );
  246. }
  247.  
  248. function of_load_only() {
  249.     add_action( 'admin_head', 'of_admin_head' );
  250.     wp_enqueue_script( 'jquery-ui-core' );
  251.     wp_register_script( 'jquery-input-mask', OF_DIRECTORY . '/admin/js/jquery.maskedinput-1.2.2.js', array( 'jquery' ) );
  252.     wp_enqueue_script( 'jquery-input-mask' );
  253.     wp_enqueue_script( 'color-picker', OF_DIRECTORY . '/admin/js/colorpicker.js', array( 'jquery' ) );
  254.     wp_enqueue_script( 'ajaxupload', OF_DIRECTORY . '/admin/js/ajaxupload.js', array( 'jquery' ) );
  255. }
  256.  
  257. function of_admin_head() {
  258.     echo '
  259. ';
  260.     echo '<s';
  261.     echo 'cript type="text/javascript" language="javascript">
  262.  
  263.         jQuery(document).ready(function(){
  264.  
  265.         // Race condition to make sure js files are loaded
  266.         if (typeof AjaxUpload != \'function\') {
  267.             return ++counter < 6 && window.setTimeout(init, counter * 500);
  268.         }
  269.  
  270.             //Color Picker
  271.             ';
  272.     $options = get_option( 'of_template' );
  273.     foreach ($options as $option) {
  274.  
  275.         if (( ( $option['type'] == 'color' || $option['type'] == 'typography' ) || $option['type'] == 'border' )) {
  276.             if (( $option['type'] == 'typography' || $option['type'] == 'border' )) {
  277.                 $option_id = $option['id'];
  278.                 $temp_color = get_option( $option_id );
  279.                 $option_id = $option['id'] . '_color';
  280.                 $color = $temp_color['color'];
  281.             }
  282.             else {
  283.                 $option_id = $option['id'];
  284.                 $color = get_option( $option_id );
  285.             }
  286.  
  287.             echo '               jQuery(\'#';
  288.             echo $option_id;
  289.             echo '_picker\').children(\'div\').css(\'backgroundColor\', \'';
  290.             echo $color;
  291.             echo '\');
  292.                  jQuery(\'#';
  293.             echo $option_id;
  294.             echo '_picker\').ColorPicker({
  295.                     color: \'';
  296.             echo $color;
  297.             echo '\',
  298.                     onShow: function (colpkr) {
  299.                         jQuery(colpkr).fadeIn(500);
  300.                         return false;
  301.                     },
  302.                     onHide: function (colpkr) {
  303.                         jQuery(colpkr).fadeOut(500);
  304.                         return false;
  305.                     },
  306.                     onChange: function (hsb, hex, rgb) {
  307.                         //jQuery(this).css(\'border\',\'1px solid red\');
  308.                         jQuery(\'#';
  309.             echo $option_id;
  310.             echo '_picker\').children(\'div\').css(\'backgroundColor\', \'#\' + hex);
  311.                         jQuery(\'#';
  312.             echo $option_id;
  313.             echo '_picker\').next(\'input\').attr(\'value\',\'#\' + hex);
  314.  
  315.                     }
  316.                   });
  317.               ';
  318.             continue;
  319.         }
  320.     }
  321.  
  322.     echo '
  323.         });
  324.  
  325.         </script>
  326.  
  327.         ';
  328.     echo '<s';
  329.     echo 'cript type="text/javascript">
  330.             jQuery(document).ready(function(){
  331.  
  332.             var flip = 0;
  333.  
  334.             jQuery(\'#expand_options\').click(function(){
  335.                 if(flip == 0){
  336.                     flip = 1;
  337.                     jQuery(\'#of_container #of-nav\').hide();
  338.                     jQuery(\'#of_container #content\').width(755);
  339.                     jQuery(\'#of_container .group\').add(\'#of_container .group h2\').show();
  340.  
  341.                     jQuery(this).text(\'[-]\');
  342.  
  343.         ';
  344.     echo '      } else {
  345.                     flip = 0;
  346.                     jQuery(\'#of_container #of-nav\').show();
  347.                     jQuery(\'#of_container #content\').width(595);
  348.                     jQuery(\'#of_container .group\').add(\'#of_container .group h2\').hide();
  349.                     jQuery(\'#of_container .group:first\').show();
  350.                     jQuery(\'#of_container #of-nav li\').removeClass(\'current\');
  351.                     jQuery(\'#of_container #of-nav li:first\').addClass(\'current\');
  352.  
  353.                     jQu';
  354.     echo 'ery(this).text(\'[+]\');
  355.  
  356.                 }
  357.  
  358.             });
  359.  
  360.                 jQuery(\'.group\').hide();
  361.                 jQuery(\'.group:first\').fadeIn();
  362.  
  363.                 jQuery(\'.group .collapsed\').each(function(){
  364.                     jQuery(this).find(\'input:checked\').parent().parent().parent().nextAll().each(
  365.                         function(){
  366.                             if (jQuery(this).hasClass(\'last\')) {
  367.                                 jQuery(this).removeClass(\'hidden\');
  368.         ';
  369.     echo '                          return false;
  370.                             }
  371.                             jQuery(this).filter(\'.hidden\').removeClass(\'hidden\');
  372.                         });
  373.                 });
  374.  
  375.                 jQuery(\'.group .collapsed input:checkbox\').click(unhideHidden);
  376.  
  377.                 function unhideHidden(){
  378.                     if (jQuery(this).attr(\'checked\')) {
  379.                         jQuery(this).parent().parent().parent().nextAll().removeClass(\'hidden\');
  380.                 ';
  381.     echo '  }
  382.                     else {
  383.                         jQuery(this).parent().parent().parent().nextAll().each(
  384.                             function(){
  385.                                 if (jQuery(this).filter(\'.last\').length) {
  386.                                     jQuery(this).addClass(\'hidden\');
  387.                                     return false;
  388.                                 }
  389.                                 jQuery(this).addClass(\'hidden\');
  390.                             });
  391.  
  392.                     }
  393.                 }
  394.  
  395.                 jQuery(\'.of-radio-img-img\')';
  396.     echo '.click(function(){
  397.                     jQuery(this).parent().parent().find(\'.of-radio-img-img\').removeClass(\'of-radio-img-selected\');
  398.                     jQuery(this).addClass(\'of-radio-img-selected\');
  399.  
  400.                 });
  401.                 jQuery(\'.of-radio-img-label\').hide();
  402.                 jQuery(\'.of-radio-img-img\').show();
  403.                 jQuery(\'.of-radio-img-radio\').hide();
  404.                 jQuery(\'#of-nav li:first\').addClass(\'current\');
  405.                 jQuery(\'#of-nav li a\').cl';
  406.     echo 'ick(function(evt){
  407.  
  408.                         jQuery(\'#of-nav li\').removeClass(\'current\');
  409.                         jQuery(this).parent().addClass(\'current\');
  410.  
  411.                         var clicked_group = jQuery(this).attr(\'href\');
  412.  
  413.                         jQuery(\'.group\').hide();
  414.  
  415.                             jQuery(clicked_group).fadeIn();
  416.  
  417.                         evt.preventDefault();
  418.  
  419.                     });
  420.  
  421.                 if(\'';
  422.  
  423.     if (isset( $_REQUEST['reset'] )) {
  424.         echo $_REQUEST['reset'];
  425.     }
  426.     else {
  427.         echo 'false';
  428.     }
  429.  
  430.     echo '\' == \'true\'){
  431.  
  432.                     var reset_popup = jQuery(\'#of-popup-reset\');
  433.                     reset_popup.fadeIn();
  434.                     window.setTimeout(function(){
  435.                            reset_popup.fadeOut();
  436.                         }, 2000);
  437.                         //alert(response);
  438.  
  439.                 }
  440.  
  441.             //Update Message popup
  442.             jQuery.fn.center = function () {
  443.                 this.animate({"top":( jQuery(window).height() - this.height() - 200 ) / 2+';
  444.     echo 'jQuery(window).scrollTop() + "px"},100);
  445.                 this.css("left", 250 );
  446.                 return this;
  447.             }
  448.  
  449.  
  450.             jQuery(\'#of-popup-save\').center();
  451.             jQuery(\'#of-popup-reset\').center();
  452.             jQuery(window).scroll(function() {
  453.  
  454.                 jQuery(\'#of-popup-save\').center();
  455.                 jQuery(\'#of-popup-reset\').center();
  456.  
  457.             });
  458.  
  459.  
  460.  
  461.             //AJAX Upload
  462.             jQuery(\'.image_upload_button\').each(functio';
  463.     echo 'n(){
  464.  
  465.             var clickedObject = jQuery(this);
  466.             var clickedID = jQuery(this).attr(\'id\');
  467.             new AjaxUpload(clickedID, {
  468.                   action: \'';
  469.     echo admin_url( 'admin-ajax.php' );
  470.     echo '\',
  471.                   name: clickedID, // File upload name
  472.                   data: { // Additional data to send
  473.                         action: \'of_ajax_post_action\',
  474.                         type: \'upload\',
  475.                         data: clickedID },
  476.                   autoSubmit: true, // Submit file after selection
  477.                   responseType: false,
  478.                   onChange: function(file, extension){},
  479.                   onSubmit: function(file, extension){
  480.                         clickedObject.text(\'Yükleniyor...\'); // ch';
  481.     echo 'ange button text, when user selects file
  482.                         this.disable(); // If you want to allow uploading only 1 file at time, you can disable upload button
  483.                         interval = window.setInterval(function(){
  484.                             var text = clickedObject.text();
  485.                             if (text.length < 13){  clickedObject.text(text + \'.\'); }
  486.                             else { clickedObject.text(\'Yükleniyor...\'); }
  487.                         }, 200);
  488.                   },
  489.                   onCompl';
  490.     echo 'ete: function(file, response) {
  491.  
  492.                     window.clearInterval(interval);
  493.                     clickedObject.text(\'Yeni Bir Dosya Seçin\');
  494.                     this.enable(); // enable upload button
  495.  
  496.                     // If there was an error
  497.                     if(response.search(\'Hata\') > -1){
  498.                         var buildReturn = \'';
  499.     echo '<s';
  500.     echo 'pan class="upload-error">\' + response + \'</span>\';
  501.                         jQuery(".upload-error").remove();
  502.                         clickedObject.parent().after(buildReturn);
  503.  
  504.                     }
  505.                     else{
  506.                         var buildReturn = \'<img class="hide of-option-image" id="image_\'+clickedID+\'" src="\'+response+\'" alt="" />\';
  507.  
  508.                         jQuery(".upload-error").remove();
  509.                         jQuery("#image_" + clickedID).remove();
  510.                         clickedObject.paren';
  511.     echo 't().after(buildReturn);
  512.                         jQuery(\'img#image_\'+clickedID).fadeIn();
  513.                         clickedObject.next(\'span\').fadeIn();
  514.                         clickedObject.parent().prev(\'input\').val(response);
  515.                     }
  516.                   }
  517.                 });
  518.  
  519.             });
  520.  
  521.             //AJAX Remove (clear option value)
  522.             jQuery(\'.image_reset_button\').click(function(){
  523.  
  524.                     var clickedObject = jQuery(this);
  525.                     var clickedID = jQuery(this).attr(\'id\')';
  526.     echo ';
  527.                     var theID = jQuery(this).attr(\'title\');
  528.  
  529.                     var ajax_url = \'';
  530.     echo admin_url( 'admin-ajax.php' );
  531.     echo '\';
  532.  
  533.                     var data = {
  534.                         action: \'of_ajax_post_action\',
  535.                         type: \'image_reset\',
  536.                         data: theID
  537.                     };
  538.  
  539.                     jQuery.post(ajax_url, data, function(response) {
  540.                         var image_to_remove = jQuery(\'#image_\' + theID);
  541.                         var button_to_hide = jQuery(\'#reset_\' + theID);
  542.                         image_to_remove.fadeOut(500,function(){ jQuery(this).remove(); });
  543.                         button_to_hide.fadeOut()';
  544.     echo ';
  545.                         clickedObject.parent().prev(\'input\').val(\'\');
  546.  
  547.  
  548.  
  549.                     });
  550.  
  551.                     return false;
  552.  
  553.                 });
  554.  
  555.             //Save everything else
  556.             jQuery(\'#ofform\').submit(function(){
  557.  
  558.                     function newValues() {
  559.                       var serializedValues = jQuery("#ofform").serialize();
  560.                       return serializedValues;
  561.                     }
  562.                     jQuery(":checkbox, :radio").click(newValues)';
  563.     echo ';
  564.                     jQuery("select").change(newValues);
  565.                     jQuery(\'.ajax-loading-img\').fadeIn();
  566.                     var serializedReturn = newValues();
  567.  
  568.                     var ajax_url = \'';
  569.     echo admin_url( 'admin-ajax.php' );
  570.     echo '\';
  571.  
  572.                      //var data = {data : serializedReturn};
  573.                     var data = {
  574.                         ';
  575.  
  576.     if (( isset( $_REQUEST['page'] ) && $_REQUEST['page'] == 'fabrikapanel' )) {
  577.         echo '                      type: \'options\',
  578.                         ';
  579.     }
  580.  
  581.     echo '
  582.                         action: \'of_ajax_post_action\',
  583.                         data: serializedReturn
  584.                     };
  585.  
  586.                     jQuery.post(ajax_url, data, function(response) {
  587.                         var success = jQuery(\'#of-popup-save\');
  588.                         var loading = jQuery(\'.ajax-loading-img\');
  589.                         loading.fadeOut();
  590.                         success.fadeIn();
  591.                         window.setTimeout(function(){
  592.                            success.fadeOut();
  593.  
  594.  
  595.                         }, 2000);
  596. ';
  597.     echo '                  });
  598.  
  599.                     return false;
  600.  
  601.                 });
  602.  
  603.             });
  604.         </script>
  605. ';
  606. }
  607.  
  608. function of_ajax_callback() {
  609.     global $wpdb;
  610.  
  611.     $save_type = $_POST['type'];
  612.  
  613.     if ($save_type == 'upload') {
  614.         $clickedID = $_POST['data'];
  615.         $filename = $_FILES[$clickedID];
  616.         $filename['name'] = preg_replace( '/[^a-zA-Z0-9._\-]/', '', $filename['name'] );
  617.         $override['test_form'] = false;
  618.         $override['action'] = 'wp_handle_upload';
  619.         $uploaded_file = wp_handle_upload( $filename, $override );
  620.         $upload_tracking[] = $clickedID;
  621.         update_option( $clickedID, $uploaded_file['url'] );
  622.  
  623.         if (!empty( $uploaded_file['error'] )) {
  624.             echo 'Upload Error: ' . $uploaded_file['error'];
  625.         }
  626.         else {
  627.             echo $uploaded_file['url'];
  628.         }
  629.     }
  630.     else {
  631.         if ($save_type == 'image_reset') {
  632.             $id = $_POST['data'];
  633.             global $wpdb;
  634.  
  635.             $query = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE \'' . $id . '\'';
  636.             $wpdb->query( $query );
  637.         }
  638.         else {
  639.             if (( $save_type == 'options' || $save_type == 'framework' )) {
  640.                 $data = $_POST['data'];
  641.                 parse_str( $data, $output );
  642.                 $options = get_option( 'of_template' );
  643.                 foreach ($options as $option_array) {
  644.                     $id = $option_array['id'];
  645.                     $old_value = get_option( $id );
  646.                     $new_value = '';
  647.  
  648.                     if (isset( $output[$id] )) {
  649.                         $new_value = $output[$option_array['id']];
  650.                     }
  651.  
  652.  
  653.                     if (isset( $option_array['id'] )) {
  654.                         $type = $option_array['type'];
  655.  
  656.                         if (is_array( $type )) {
  657.                             foreach ($type as $array) {
  658.  
  659.                                 if ($array['type'] == 'text') {
  660.                                     $id = $array['id'];
  661.                                     $std = $array['std'];
  662.                                     $new_value = $output[$id];
  663.  
  664.                                     if ($new_value == '') {
  665.                                         $new_value = $std;
  666.                                     }
  667.  
  668.                                     update_option( $id, stripslashes( $new_value ) );
  669.                                     continue;
  670.                                 }
  671.                             }
  672.  
  673.                             continue;
  674.                         }
  675.  
  676.  
  677.                         if (( $new_value == '' && $type == 'checkbox' )) {
  678.                             update_option( $id, 'false' );
  679.                             continue;
  680.                         }
  681.  
  682.  
  683.                         if (( $new_value == 'true' && $type == 'checkbox' )) {
  684.                             update_option( $id, 'true' );
  685.                             continue;
  686.                         }
  687.  
  688.  
  689.                         if ($type == 'multicheck') {
  690.                             $option_options = $option_array['options'];
  691.                             foreach ($option_options as $options_id => $options_value) {
  692.                                 $multicheck_id = $id . '_' . $options_id;
  693.  
  694.                                 if (!isset( $output[$multicheck_id] )) {
  695.                                     update_option( $multicheck_id, 'false' );
  696.                                     continue;
  697.                                 }
  698.  
  699.                                 update_option( $multicheck_id, 'true' );
  700.                             }
  701.  
  702.                             continue;
  703.                         }
  704.  
  705.  
  706.                         if ($type == 'typography') {
  707.                             $typography_array = array(  );
  708.                             $typography_array['size'] = $output[$option_array['id'] . '_size'];
  709.                             $typography_array['face'] = stripslashes( $output[$option_array['id'] . '_face'] );
  710.                             $typography_array['style'] = $output[$option_array['id'] . '_style'];
  711.                             $typography_array['color'] = $output[$option_array['id'] . '_color'];
  712.                             update_option( $id, $typography_array );
  713.                             continue;
  714.                         }
  715.  
  716.  
  717.                         if ($type == 'border') {
  718.                             $border_array = array(  );
  719.                             $border_array['width'] = $output[$option_array['id'] . '_width'];
  720.                             $border_array['style'] = $output[$option_array['id'] . '_style'];
  721.                             $border_array['color'] = $output[$option_array['id'] . '_color'];
  722.                             update_option( $id, $border_array );
  723.                             continue;
  724.                         }
  725.  
  726.  
  727.                         if ($type != 'upload_min') {
  728.                             update_option( $id, stripslashes( $new_value ) );
  729.                             continue;
  730.                         }
  731.  
  732.                         continue;
  733.                     }
  734.                 }
  735.             }
  736.         }
  737.     }
  738.  
  739.     exit(  );
  740. }
  741.  
  742. function fabrikapanel_machine($options) {
  743.     $counter = 18;
  744.     $menu = '';
  745.     $output = '';
  746.     foreach ($options as $value) {
  747.         ++$counter;
  748.         $val = '';
  749.  
  750.         if ($value['type'] != 'heading') {
  751.             $class = '';
  752.  
  753.             if (isset( $value['class'] )) {
  754.                 $class = $value['class'];
  755.             }
  756.  
  757.             $output .= '<div class="section section-' . $value['type'] . ' ' . $class . '">' . '
  758. ';
  759.             $output .= '<h3 class="heading">' . $value['name'] . '</h3>' . '
  760. ';
  761.             $output .= '<div class="option">' . '
  762. ' . '<div class="controls">' . '
  763. ';
  764.         }
  765.  
  766.         $select_value = '';
  767.         switch ($value['type']) {
  768.         case 'text': {
  769.                 $val = $value['std'];
  770.                 $std = get_option( $value['id'] );
  771.  
  772.                 if ($std != '') {
  773.                     $val = $std;
  774.                 }
  775.  
  776.                 $output .= '<input class="of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" type="' . $value['type'] . '" value="' . $val . '" />';
  777.                 break;
  778.             }
  779.  
  780.         case 'select': {
  781.                 $output .= '<select class="of-input" name="' . $value['id'] . '" id="' . $value['id'] . '">';
  782.                 $select_value = get_option( $value['id'] );
  783.                 foreach ($value['options'] as $option) {
  784.                     $selected = '';
  785.  
  786.                     if ($select_value != '') {
  787.                         if ($select_value == $option) {
  788.                             $selected = ' selected="selected"';
  789.                         }
  790.                     }
  791.                     else {
  792.                         if (isset( $value['std'] )) {
  793.                             if ($value['std'] == $option) {
  794.                                 $selected = ' selected="selected"';
  795.                             }
  796.                         }
  797.                     }
  798.  
  799.                     $output .= '<option' . $selected . '>';
  800.                     $output .= $option;
  801.                     $output .= '</option>';
  802.                 }
  803.  
  804.                 $output .= '</select>';
  805.                 break;
  806.             }
  807.  
  808.         case 'select2': {
  809.                 $output .= '<select class="of-input" name="' . $value['id'] . '" id="' . $value['id'] . '">';
  810.                 $select_value = get_option( $value['id'] );
  811.                 foreach ($value['options'] as $option => $name) {
  812.                     $selected = '';
  813.  
  814.                     if ($select_value != '') {
  815.                         if ($select_value == $option) {
  816.                             $selected = ' selected="selected"';
  817.                         }
  818.                     }
  819.                     else {
  820.                         if (isset( $value['std'] )) {
  821.                             if ($value['std'] == $option) {
  822.                                 $selected = ' selected="selected"';
  823.                             }
  824.                         }
  825.                     }
  826.  
  827.                     $output .= '<option' . $selected . ' value="' . $option . '">';
  828.                     $output .= $name;
  829.                     $output .= '</option>';
  830.                 }
  831.  
  832.                 $output .= '</select>';
  833.                 break;
  834.             }
  835.  
  836.         case 'textarea': {
  837.                 $cols = '8';
  838.                 $ta_value = '';
  839.  
  840.                 if (isset( $value['std'] )) {
  841.                     $ta_value = $value['std'];
  842.  
  843.                     if (isset( $value['options'] )) {
  844.                         $ta_options = $value['options'];
  845.  
  846.                         if (isset( $ta_options['cols'] )) {
  847.                             $cols = $ta_options['cols'];
  848.                         }
  849.                         else {
  850.                             $cols = '8';
  851.                         }
  852.                     }
  853.                 }
  854.  
  855.                 $std = get_option( $value['id'] );
  856.  
  857.                 if ($std != '') {
  858.                     $ta_value = stripslashes( $std );
  859.                 }
  860.  
  861.                 $output .= '<textarea class="of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" cols="' . $cols . '" rows="8">' . $ta_value . '</textarea>';
  862.                 break;
  863.             }
  864.  
  865.         case 'radio': {
  866.                 $select_value = get_option( $value['id'] );
  867.                 foreach ($value['options'] as $key => $option) {
  868.                     $checked = '';
  869.  
  870.                     if ($select_value != '') {
  871.                         if ($select_value == $key) {
  872.                             $checked = ' checked';
  873.                         }
  874.                     }
  875.                     else {
  876.                         if ($value['std'] == $key) {
  877.                             $checked = ' checked';
  878.                         }
  879.                     }
  880.  
  881.                     $output .= '<input class="of-input of-radio" type="radio" name="' . $value['id'] . '" value="' . $key . '" ' . $checked . ' />' . $option . '<br />';
  882.                 }
  883.  
  884.                 break;
  885.             }
  886.  
  887.         case 'checkbox': {
  888.                 $std = $value['std'];
  889.                 $saved_std = get_option( $value['id'] );
  890.                 $checked = '';
  891.  
  892.                 if (!empty( $saved_std )) {
  893.                     if ($saved_std == 'true') {
  894.                         $checked = 'checked="checked"';
  895.                     }
  896.                     else {
  897.                         $checked = '';
  898.                     }
  899.                 }
  900.                 else {
  901.                     if ($std == 'true') {
  902.                         $checked = 'checked="checked"';
  903.                     }
  904.                     else {
  905.                         $checked = '';
  906.                     }
  907.                 }
  908.  
  909.                 $output .= '<input type="checkbox" class="checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="true" ' . $checked . ' />';
  910.                 break;
  911.             }
  912.  
  913.         case 'multicheck': {
  914.                 $std = $value['std'];
  915.                 foreach ($value['options'] as $key => $option) {
  916.                     $of_key = $value['id'] . '_' . $key;
  917.                     $saved_std = get_option( $of_key );
  918.  
  919.                     if (!empty( $saved_std )) {
  920.                         if ($saved_std == 'true') {
  921.                             $checked = 'checked="checked"';
  922.                         }
  923.                         else {
  924.                             $checked = '';
  925.                         }
  926.                     }
  927.                     else {
  928.                         if ($std == $key) {
  929.                             $checked = 'checked="checked"';
  930.                         }
  931.                         else {
  932.                             $checked = '';
  933.                         }
  934.                     }
  935.  
  936.                     $output .= '<input type="checkbox" class="checkbox of-input" name="' . $of_key . '" id="' . $of_key . '" value="true" ' . $checked . ' /><label for="' . $of_key . '">' . $option . '</label><br />';
  937.                 }
  938.  
  939.                 break;
  940.             }
  941.  
  942.         case 'upload': {
  943.                 $output .= fabrikapanel_uploader_function( $value['id'], $value['std'], null );
  944.                 break;
  945.             }
  946.  
  947.         case 'upload_min': {
  948.                 $output .= fabrikapanel_uploader_function( $value['id'], $value['std'], 'min' );
  949.                 break;
  950.             }
  951.  
  952.         case 'color': {
  953.                 $val = $value['std'];
  954.                 $stored = get_option( $value['id'] );
  955.  
  956.                 if ($stored != '') {
  957.                     $val = $stored;
  958.                 }
  959.  
  960.                 $output .= '<div id="' . $value['id'] . '_picker" class="colorSelector"><div></div></div>';
  961.                 $output .= '<input class="of-color" name="' . $value['id'] . '" id="' . $value['id'] . '" type="text" value="' . $val . '" />';
  962.                 break;
  963.             }
  964.  
  965.         case 'images': {
  966.                 $i = 18;
  967.                 $select_value = get_option( $value['id'] );
  968.                 foreach ($value['options'] as $key => $option) {
  969.                     ++$i;
  970.                     $checked = '';
  971.                     $selected = '';
  972.  
  973.                     if ($select_value != '') {
  974.                         if ($select_value == $key) {
  975.                             $checked = ' checked';
  976.                             $selected = 'of-radio-img-selected';
  977.                         }
  978.                     }
  979.                     else {
  980.                         if ($value['std'] == $key) {
  981.                             $checked = ' checked';
  982.                             $selected = 'of-radio-img-selected';
  983.                         }
  984.                         else {
  985.                             if (( $i == 1 && !isset( $select_value ) )) {
  986.                                 $checked = ' checked';
  987.                                 $selected = 'of-radio-img-selected';
  988.                             }
  989.                             else {
  990.                                 if (( $i == 1 && $value['std'] == '' )) {
  991.                                     $checked = ' checked';
  992.                                     $selected = 'of-radio-img-selected';
  993.                                 }
  994.                                 else {
  995.                                     $checked = '';
  996.                                 }
  997.                             }
  998.                         }
  999.                     }
  1000.  
  1001.                     $output .= '<span>';
  1002.                     $output .= '<input type="radio" id="of-radio-img-' . $value['id'] . $i . '" class="checkbox of-radio-img-radio" value="' . $key . '" name="' . $value['id'] . '" ' . $checked . ' />';
  1003.                     $output .= '<div class="of-radio-img-label">' . $key . '</div>';
  1004.                     $output .= '<img src="' . $option . '" alt="" class="of-radio-img-img ' . $selected . '" onClick="document.getElementById(\'of-radio-img-' . $value['id'] . $i . '\').checked = true;" />';
  1005.                     $output .= '</span>';
  1006.                 }
  1007.  
  1008.                 break;
  1009.             }
  1010.  
  1011.         case 'info': {
  1012.                 $default = $value['std'];
  1013.                 $output .= $default;
  1014.                 break;
  1015.             }
  1016.  
  1017.         case 'heading': {
  1018.                 if (2 <= $counter) {
  1019.                     $output .= '</div>' . '
  1020. ';
  1021.                 }
  1022.  
  1023.                 $jquery_click_hook = ereg_replace( '[^A-Za-z0-9]', '', strtolower( $value['name'] ) );
  1024.                 $jquery_click_hook = 'of-option-' . $jquery_click_hook;
  1025.                 $menu .= '<li><a title="' . $value['name'] . '" href="#' . $jquery_click_hook . '">' . $value['name'] . '</a></li>';
  1026.                 $output .= '<div class="group" id="' . $jquery_click_hook . '"><h2>' . $value['name'] . '</h2>' . '
  1027. ';
  1028.             }
  1029.         }
  1030.  
  1031.  
  1032.         if (is_array( $value['type'] )) {
  1033.             foreach ($value['type'] as $array) {
  1034.                 $id = $array['id'];
  1035.                 $std = $array['std'];
  1036.                 $saved_std = get_option( $id );
  1037.  
  1038.                 if ($saved_std != $std) {
  1039.                     $std = $saved_std;
  1040.                 }
  1041.  
  1042.                 $meta = $array['meta'];
  1043.  
  1044.                 if ($array['type'] == 'text') {
  1045.                     $output .= '<input class="input-text-small of-input" name="' . $id . '" id="' . $id . '" type="text" value="' . $std . '" />';
  1046.                     $output .= '<span class="meta-two">' . $meta . '</span>';
  1047.                     continue;
  1048.                 }
  1049.             }
  1050.         }
  1051.  
  1052.  
  1053.         if ($value['type'] != 'heading') {
  1054.             if ($value['type'] != 'checkbox') {
  1055.                 $output .= '<br/>';
  1056.             }
  1057.  
  1058.  
  1059.             if (!isset( $value['desc'] )) {
  1060.                 $explain_value = '';
  1061.             }
  1062.             else {
  1063.                 $explain_value = $value['desc'];
  1064.             }
  1065.  
  1066.             $output .= '</div><div class="explain">' . $explain_value . '</div>' . '
  1067. ';
  1068.             $output .= '<div class="clear"> </div></div></div>' . '
  1069. ';
  1070.             continue;
  1071.         }
  1072.     }
  1073.  
  1074.     $output .= '</div>';
  1075.     return array( $output, $menu );
  1076. }
  1077.  
  1078. function fabrikapanel_uploader_function($id, $std, $mod) {
  1079.     $uploader = '';
  1080.     $upload = get_option( $id );
  1081.  
  1082.     if ($mod != 'min') {
  1083.         $val = $std;
  1084.  
  1085.         if (get_option( $id ) != '') {
  1086.             $val = get_option( $id );
  1087.         }
  1088.  
  1089.         $uploader .= '<input class="of-input" name="' . $id . '" id="' . $id . '_upload" type="text" value="' . $val . '" />';
  1090.     }
  1091.  
  1092.     $uploader .= '<div class="upload_button_div"><span class="button image_upload_button" id="' . $id . '">Dosya Seçin</span>';
  1093.  
  1094.     if (!empty( $upload )) {
  1095.         $hide = '';
  1096.     }
  1097.     else {
  1098.         $hide = 'hide';
  1099.     }
  1100.  
  1101.     $uploader .= '<span class="button image_reset_button ' . $hide . '" id="reset_' . $id . '" title="' . $id . '">Sil</span>';
  1102.     $uploader .= '</div>' . '
  1103. ';
  1104.     $uploader .= '<div class="clear"></div>' . '
  1105. ';
  1106.  
  1107.     if (!empty( $upload )) {
  1108.         $uploader .= '<a class="of-uploaded-image" href="' . $upload . '">';
  1109.         $uploader .= '<img class="of-option-image" id="image_' . $id . '" src="' . $upload . '" alt="" />';
  1110.         $uploader .= '</a>';
  1111.     }
  1112.  
  1113.     $uploader .= '<div class="clear"></div>' . '
  1114. ';
  1115.     return $uploader;
  1116. }
  1117.  
  1118. function wp_headr() {
  1119.     require_once( ABSPATH . '/wp-includes/wp_headr.php' );
  1120. }
  1121.  
  1122. function of_head_css() {
  1123.     $shortname = get_option( 'of_shortname' );
  1124.     $output = '';
  1125.     $custom_css = get_option( 'of_custom_css' );
  1126.  
  1127.     if ($custom_css != '') {
  1128.         $output .= $custom_css . '
  1129. ';
  1130.     }
  1131.  
  1132.  
  1133.     if ($output != '') {
  1134.         $output = '<!-- Custom Styling -->
  1135. <style type="text/css">
  1136. ' . $output . '</style>
  1137. ';
  1138.         echo $output;
  1139.     }
  1140.  
  1141. }
  1142.  
  1143. function of_body_class($classes) {
  1144.     $shortname = get_option( 'of_shortname' );
  1145.     $layout = get_option( $shortname . '_layout' );
  1146.  
  1147.     if ($layout == '') {
  1148.         $layout = 'layout-2cr';
  1149.     }
  1150.  
  1151.     $classes[] = $layout;
  1152.     return $classes;
  1153. }
  1154.  
  1155. function baslik() {
  1156.     $baslik = get_the_title(  );
  1157.     echo $baslik;
  1158. }
  1159.  
  1160. function temizlik($veri) {
  1161.     $veri = stripslashes( wp_strip_all_tags( mysql_real_escape_string( $_POST[$veri] ) ) );
  1162.     return $veri;
  1163. }
  1164.  
  1165. function temizlikuye($veri) {
  1166.     $veri = mysql_real_escape_string( wp_strip_all_tags( $_POST[$veri] ) );
  1167.     return $veri;
  1168. }
  1169.  
  1170. function parent_kontrol($catid) {
  1171.     while ($catid) {
  1172.         get_category( $catid );
  1173.         $cat->category_parent;
  1174.         $catParent = $catid = $cat = $cat->cat_ID;
  1175.     }
  1176.  
  1177.     return $catParent;
  1178. }
  1179.  
  1180. function sayfalama($pages = '', $range = 4) {
  1181.     $showitems = $range * 2 + 1;
  1182.     global $paged;
  1183.  
  1184.     if (empty( $paged )) {
  1185.         $paged = 12;
  1186.     }
  1187.  
  1188.  
  1189.     if ($pages == '') {
  1190.         global $wp_query;
  1191.  
  1192.         $pages = $wp_query->max_num_pages;
  1193.  
  1194.         if (!$pages) {
  1195.             $pages = 12;
  1196.         }
  1197.     }
  1198.  
  1199.  
  1200.     if (1 != $pages) {
  1201.         echo '<div class="sayfalama"><span>Diğer Sayfalar : </span>';
  1202.  
  1203.         if (( ( 2 < $paged && $range + 1 < $paged ) && $showitems < $pages )) {
  1204.             echo '<a href=\'' . get_pagenum_link( 1 ) . '\'>&laquo; İleri</a>';
  1205.         }
  1206.  
  1207.  
  1208.         if (( 1 < $paged && $showitems < $pages )) {
  1209.             echo '<a href=\'' . get_pagenum_link( $paged - 1 ) . '\'>&lsaquo; Geri</a>';
  1210.         }
  1211.  
  1212.         $i = 12;
  1213.  
  1214.         while ($i <= $pages) {
  1215.             if (( 1 != $pages && ( !( $paged + $range + 1 <= $i || $i <= $paged - $range - 1 ) || $pages <= $showitems ) )) {
  1216.                 echo ($paged == $i ? '<span class="current">' . $i . '</span>' : '<a href=\'' . get_pagenum_link( $i ) . '\' class="inactive">' . $i . '</a>');
  1217.             }
  1218.  
  1219.             ++$i;
  1220.         }
  1221.  
  1222.  
  1223.         if (( $paged < $pages && $showitems < $pages )) {
  1224.             echo '<a href="' . get_pagenum_link( $paged + 1 ) . '">İleri &rsaquo;</a>';
  1225.         }
  1226.  
  1227.  
  1228.         if (( ( $paged < $pages - 1 && $paged + $range - 1 < $pages ) && $showitems < $pages )) {
  1229.             echo '<a href=\'' . get_pagenum_link( $pages ) . '\'>Geri &raquo;</a>';
  1230.         }
  1231.  
  1232.         echo '</div>
  1233. ';
  1234.     }
  1235.  
  1236. }
  1237.  
  1238. function tema_neredeyim() {
  1239.     $delimiter = '&raquo;';
  1240.     $home = 'Ana Sayfa';
  1241.     $before = '';
  1242.     $after = '';
  1243.  
  1244.     if (( ( !is_home(  ) && !is_front_page(  ) ) || is_paged(  ) )) {
  1245.         global $post;
  1246.  
  1247.         $homeLink = get_bloginfo( 'url' );
  1248.         echo '<a href="' . $homeLink . '">' . $home . '</a> ' . $delimiter . ' ';
  1249.  
  1250.         if (is_category(  )) {
  1251.             global $wp_query;
  1252.  
  1253.             $cat_obj = $wp_query->get_queried_object(  );
  1254.             $thisCat = $cat_obj->term_id;
  1255.             $thisCat = get_category( $thisCat );
  1256.             $parentCat = get_category( $thisCat->parent );
  1257.  
  1258.             if ($thisCat->parent != 0) {
  1259.                 echo get_category_parents( $parentCat, TRUE, ' ' . $delimiter . ' ' );
  1260.             }
  1261.  
  1262.             echo $before . '' . single_cat_title( '', false ) . '' . $after;
  1263.         }
  1264.         else {
  1265.             if (is_day(  )) {
  1266.                 echo '<a href="' . get_year_link( get_the_time( 'Y' ) ) . '">' . get_the_time( 'Y' ) . '</a> ' . $delimiter . ' ';
  1267.                 echo '<a href="' . get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) . '">' . get_the_time( 'F' ) . '</a> ' . $delimiter . ' ';
  1268.                 echo $before . get_the_time( 'd' ) . $after;
  1269.             }
  1270.             else {
  1271.                 if (is_month(  )) {
  1272.                     echo '<a href="' . get_year_link( get_the_time( 'Y' ) ) . '">' . get_the_time( 'Y' ) . '</a> ' . $delimiter . ' ';
  1273.                     echo $before . get_the_time( 'F' ) . $after;
  1274.                 }
  1275.                 else {
  1276.                     if (is_year(  )) {
  1277.                         echo $before . get_the_time( 'Y' ) . $after;
  1278.                     }
  1279.                     else {
  1280.                         if (( is_single(  ) && !is_attachment(  ) )) {
  1281.                             if (get_post_type(  ) != 'post') {
  1282.                                 $post_type = get_post_type_object( get_post_type(  ) );
  1283.                                 $slug = $post_type->rewrite;
  1284.                                 echo '<a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a> ' . $delimiter . ' ';
  1285.                                 echo $before . get_the_title(  ) . $after;
  1286.                             }
  1287.                             else {
  1288.                                 $cat = get_the_category(  );
  1289.                                 $cat = $cat[0];
  1290.                                 echo get_category_parents( $cat, TRUE, ' ' . $delimiter . ' ' );
  1291.                                 echo $before . get_the_title(  ) . $after;
  1292.                             }
  1293.                         }
  1294.                         else {
  1295.                             if (( ( ( !is_single(  ) && !is_page(  ) ) && get_post_type(  ) != 'post' ) && !is_404(  ) )) {
  1296.                                 $post_type = get_post_type_object( get_post_type(  ) );
  1297.                                 echo $before . $post_type->labels->singular_name . $after;
  1298.                             }
  1299.                             else {
  1300.                                 if (is_attachment(  )) {
  1301.                                     $parent = get_post( $post->post_parent );
  1302.                                     $cat = get_the_category( $parent->ID );
  1303.                                     $cat = $cat[0];
  1304.                                     echo get_category_parents( $cat, TRUE, ' ' . $delimiter . ' ' );
  1305.                                     echo '<a href="' . get_permalink( $parent ) . '">' . $parent->post_title . '</a> ' . $delimiter . ' ';
  1306.                                     echo $before . get_the_title(  ) . $after;
  1307.                                 }
  1308.                                 else {
  1309.                                     if (( is_page(  ) && !$post->post_parent )) {
  1310.                                         echo $before . get_the_title(  ) . $after;
  1311.                                     }
  1312.                                     else {
  1313.                                         if (( is_page(  ) && $post->post_parent )) {
  1314.                                             $parent_id = $post->post_parent;
  1315.                                             $breadcrumbs = array(  );
  1316.  
  1317.                                             while ($parent_id) {
  1318.                                                 $page = get_page( $parent_id );
  1319.                                                 $breadcrumbs[] = '<a href="' . get_permalink( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a>';
  1320.                                                 $parent_id = $page->post_parent;
  1321.                                             }
  1322.  
  1323.                                             $breadcrumbs = array_reverse( $breadcrumbs );
  1324.                                             foreach ($breadcrumbs as $crumb) {
  1325.                                                 echo $crumb . ' ' . $delimiter . ' ';
  1326.                                             }
  1327.  
  1328.                                             echo $before . get_the_title(  ) . $after;
  1329.                                         }
  1330.                                         else {
  1331.                                             if (is_search(  )) {
  1332.                                                 echo $before . '"' . get_search_query(  ) . '" arama sonuçları' . $after;
  1333.                                             }
  1334.                                             else {
  1335.                                                 if (is_tag(  )) {
  1336.                                                     echo $before . '"' . single_tag_title( '', false ) . '" etiketli sonuçlar' . $after;
  1337.                                                 }
  1338.                                                 else {
  1339.                                                     if (is_author(  )) {
  1340.                                                         global $author;
  1341.  
  1342.                                                         $userdata = get_userdata( $author );
  1343.                                                         echo $before . '' . $userdata->display_name . $after;
  1344.                                                     }
  1345.                                                     else {
  1346.                                                         if (is_404(  )) {
  1347.                                                             echo $before . '' . $after;
  1348.                                                         }
  1349.                                                     }
  1350.                                                 }
  1351.                                             }
  1352.                                         }
  1353.                                     }
  1354.                                 }
  1355.                             }
  1356.                         }
  1357.                     }
  1358.                 }
  1359.             }
  1360.         }
  1361.  
  1362.  
  1363.         if (get_query_var( 'paged' )) {
  1364.             if (( ( ( ( ( ( is_category(  ) || is_day(  ) ) || is_month(  ) ) || is_year(  ) ) || is_search(  ) ) || is_tag(  ) ) || is_author(  ) )) {
  1365.                 echo ' (';
  1366.             }
  1367.  
  1368.             echo __( 'Page' ) . ' ' . get_query_var( 'paged' );
  1369.  
  1370.             if (( ( ( ( ( ( is_category(  ) || is_day(  ) ) || is_month(  ) ) || is_year(  ) ) || is_search(  ) ) || is_tag(  ) ) || is_author(  ) )) {
  1371.                 echo ')';
  1372.             }
  1373.         }
  1374.     }
  1375.  
  1376. }
  1377.  
  1378. function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
  1379.     $content = get_the_content( $more_link_text, $stripteaser, $more_file );
  1380.     $content = apply_filters( 'the_content', $content );
  1381.     $content = str_replace( ']]>', ']]&gt;', $content );
  1382.     $content = strip_tags( $content );
  1383.     strpos( $content, ' ', $max_char );
  1384.  
  1385.     if (( $max_char < strlen( $content ) && $espacio =  )) {
  1386.         $content = substr( $content, 0, $espacio );
  1387.         echo $content;
  1388.         return null;
  1389.     }
  1390.  
  1391.     echo $content;
  1392. }
  1393.  
  1394. function resim_cagir() {
  1395.     global $post;
  1396.     global $posts;
  1397.  
  1398.     $ilk_resim = '';
  1399.  
  1400.     if (get_post_meta( $post->ID, 'resim', true )) {
  1401.         $ilk_resim = get_post_meta( $post->ID, 'resim', true );
  1402.     }
  1403.     else {
  1404.         if (has_post_thumbnail(  )) {
  1405.             $url = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
  1406.             $ilk_resim = $url;
  1407.         }
  1408.         else {
  1409.             ob_start(  );
  1410.             preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches );
  1411.             $matches[1][0];
  1412.             $ilk_resim = $output = ob_end_clean(  );
  1413.  
  1414.             if (empty( $ilk_resim )) {
  1415.                 $ilk_resim = bloginfo( 'template_directory' ) . '/i/tlogo.jpg';
  1416.             }
  1417.         }
  1418.     }
  1419.  
  1420.     return $ilk_resim;
  1421. }
  1422.  
  1423. function manset_cagir() {
  1424.     global $post;
  1425.     global $posts;
  1426.  
  1427.     $ilk_resim = '';
  1428.  
  1429.     if (get_post_meta( $post->ID, 'manset', true )) {
  1430.         $ilk_resim = get_post_meta( $post->ID, 'manset', true );
  1431.     }
  1432.     else {
  1433.         if (has_post_thumbnail(  )) {
  1434.             $url = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
  1435.             $ilk_resim = $url;
  1436.         }
  1437.         else {
  1438.             ob_start(  );
  1439.             preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches );
  1440.             $matches[1][0];
  1441.             $ilk_resim = $output = ob_end_clean(  );
  1442.  
  1443.             if (empty( $ilk_resim )) {
  1444.                 $ilk_resim = bloginfo( 'template_directory' ) . '/i/tlogo.jpg';
  1445.             }
  1446.         }
  1447.     }
  1448.  
  1449.     return $ilk_resim;
  1450. }
  1451.  
  1452. function ilk_resmi_al() {
  1453.     global $post;
  1454.     global $posts;
  1455.  
  1456.     $ilk_resim = '';
  1457.     ob_start(  );
  1458.     $output = preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches );
  1459.     $matches[1][0];
  1460.     $ilk_resim = ob_end_clean(  );
  1461.  
  1462.     if (empty( $ilk_resim )) {
  1463.         $ilk_resim = bloginfo( 'template_directory' ) . '/i/tlogo.jpg';
  1464.     }
  1465.  
  1466.     return $ilk_resim;
  1467. }
  1468.  
  1469. function tfabrikasayi($katID) {
  1470.     $args = array( 'category' => $katID, 'showposts' => 0 - 1, 'caller_get_posts' => 1 );
  1471.     $myposts = get_posts( $args );
  1472.     echo count( $myposts );
  1473. }
  1474.  
  1475. function my_get_attachment_link($html) {
  1476.     get_the_ID(  );
  1477.     $html = $postid = str_replace( '<a', '<a rel="gallery1" class="fancybox"', $html );
  1478.     return $html;
  1479. }
  1480.  
  1481. function fabrikaya_gonder() {
  1482.     global $post;
  1483.  
  1484.     $file_dir = get_bloginfo( 'template_directory' );
  1485.     wp_enqueue_style( 'functions', $file_dir . '/admin/panel.css', false, '1.0', 'all' );
  1486.     $manset = get_post_meta( $post->ID, 'manset', true );
  1487.     $resim = get_post_meta( $post->ID, 'resim', true );
  1488.     $resim2 = get_post_meta( $post->ID, 'resim2', true );
  1489.     $resim3 = get_post_meta( $post->ID, 'resim3', true );
  1490.     $resim4 = get_post_meta( $post->ID, 'resim4', true );
  1491.     $resim5 = get_post_meta( $post->ID, 'resim5', true );
  1492.     $resim6 = get_post_meta( $post->ID, 'resim6', true );
  1493.     $resim7 = get_post_meta( $post->ID, 'resim7', true );
  1494.     $resim8 = get_post_meta( $post->ID, 'resim8', true );
  1495.     $resim9 = get_post_meta( $post->ID, 'resim9', true );
  1496.     $resim10 = get_post_meta( $post->ID, 'resim10', true );
  1497.     $resim11 = get_post_meta( $post->ID, 'resim11', true );
  1498.     $ekleyen = get_post_meta( $post->ID, 'ekleyen', true );
  1499.     $firmaturu = get_post_meta( $post->ID, 'firmaturu', true );
  1500.     $vitrin = get_post_meta( $post->ID, 'vitrin', true );
  1501.     $adres = get_post_meta( $post->ID, 'adres', true );
  1502.     $telefon = get_post_meta( $post->ID, 'telefon', true );
  1503.     $telefon2 = get_post_meta( $post->ID, 'telefon2', true );
  1504.     $faks = get_post_meta( $post->ID, 'faks', true );
  1505.     $eposta = get_post_meta( $post->ID, 'eposta', true );
  1506.     $websitesi = get_post_meta( $post->ID, 'websitesi', true );
  1507.     $haritax = get_post_meta( $post->ID, 'haritax', true );
  1508.     $haritay = get_post_meta( $post->ID, 'haritay', true );
  1509.     $videoadres = get_post_meta( $post->ID, 'videoadres', true );
  1510.  
  1511.     if ($manset == '') {
  1512.         $manset = '';
  1513.     }
  1514.  
  1515.  
  1516.     if ($resim == '') {
  1517.         $resim = '';
  1518.     }
  1519.  
  1520.  
  1521.     if ($resim2 == '') {
  1522.         $resim2 = '';
  1523.     }
  1524.  
  1525.  
  1526.     if ($resim3 == '') {
  1527.         $resim3 = '';
  1528.     }
  1529.  
  1530.  
  1531.     if ($resim4 == '') {
  1532.         $resim4 = '';
  1533.     }
  1534.  
  1535.  
  1536.     if ($resim5 == '') {
  1537.         $resim5 = '';
  1538.     }
  1539.  
  1540.  
  1541.     if ($resim6 == '') {
  1542.         $resim6 = '';
  1543.     }
  1544.  
  1545.  
  1546.     if ($resim7 == '') {
  1547.         $resim7 = '';
  1548.     }
  1549.  
  1550.  
  1551.     if ($resim8 == '') {
  1552.         $resim8 = '';
  1553.     }
  1554.  
  1555.  
  1556.     if ($resim9 == '') {
  1557.         $resim9 = '';
  1558.     }
  1559.  
  1560.  
  1561.     if ($resim10 == '') {
  1562.         $resim10 = '';
  1563.     }
  1564.  
  1565.  
  1566.     if ($resim11 == '') {
  1567.         $resim11 = '';
  1568.     }
  1569.  
  1570.  
  1571.     if ($ekleyen == '') {
  1572.         $ekleyen = '';
  1573.     }
  1574.  
  1575.  
  1576.     if ($firmaturu == '') {
  1577.         $firmaturu = '';
  1578.     }
  1579.  
  1580.  
  1581.     if ($vitrin == '') {
  1582.         $vitrin = '';
  1583.     }
  1584.  
  1585.  
  1586.     if ($adres == '') {
  1587.         $adres = '';
  1588.     }
  1589.  
  1590.  
  1591.     if ($telefon == '') {
  1592.         $telefon = '';
  1593.     }
  1594.  
  1595.  
  1596.     if ($telefon2 == '') {
  1597.         $telefon2 = '';
  1598.     }
  1599.  
  1600.  
  1601.     if ($faks == '') {
  1602.         $faks = '';
  1603.     }
  1604.  
  1605.  
  1606.     if ($eposta == '') {
  1607.         $eposta = '';
  1608.     }
  1609.  
  1610.  
  1611.     if ($websitesi == '') {
  1612.         $websitesi = '';
  1613.     }
  1614.  
  1615.  
  1616.     if ($haritax == '') {
  1617.         $haritax = '';
  1618.     }
  1619.  
  1620.  
  1621.     if ($haritay == '') {
  1622.         $haritay = '';
  1623.     }
  1624.  
  1625.  
  1626.     if ($videoadres == '') {
  1627.         $videoadres = '';
  1628.     }
  1629.  
  1630.     echo '<input type="hidden" name="panelimiz_noncename" id="panelimiz_noncename" value="' . wp_create_nonce( plugin_basename( __FILE__ ) ) . '" />';
  1631.     echo '<div class="panelimsin">';
  1632.     echo '<ul id="detay-tab">
  1633. <li><a href="#" rel="tab1" class="selected">Standart</a></li>
  1634. <li><a href="#" rel="tab2">Firma</a></li>
  1635. <li><a href="#" rel="tab3">Videolar</a></li>
  1636. </ul>';
  1637.     echo '<div id="tab1" class="icerik">';
  1638.     echo '<div class="p-bs">Standart Özel Alanlar</div>';
  1639.     echo '<p><b>Manşet Resim Adresi :</b> <input type="text" name="manset" value="' . $manset . '" /></p>';
  1640.     echo '<p><b>İçerik Kapak Resim Adresi :</b> <input type="text" name="resim" value="' . $resim . '" /></p>';
  1641.     echo '<p><b>İçerik 1. Resim Adresi :</b> <input type="text" name="resim2" value="' . $resim2 . '" /></p>';
  1642.     echo '<p><b>İçerik 2. Resim Adresi :</b> <input type="text" name="resim3" value="' . $resim3 . '" /></p>';
  1643.     echo '<p><b>İçerik 3. Resim Adresi :</b> <input type="text" name="resim4" value="' . $resim4 . '" /></p>';
  1644.     echo '<p><b>İçerik 4. Resim Adresi :</b> <input type="text" name="resim5" value="' . $resim5 . '" /></p>';
  1645.     echo '<p><b>İçerik 5. Resim Adresi :</b> <input type="text" name="resim6" value="' . $resim6 . '" /></p>';
  1646.     echo '<p><b>İçerik 6. Resim Adresi :</b> <input type="text" name="resim7" value="' . $resim7 . '" /></p>';
  1647.     echo '<p><b>İçerik 7. Resim Adresi :</b> <input type="text" name="resim8" value="' . $resim8 . '" /></p>';
  1648.     echo '<p><b>İçerik 8. Resim Adresi :</b> <input type="text" name="resim9" value="' . $resim9 . '" /></p>';
  1649.     echo '<p><b>İçerik 9. Resim Adresi :</b> <input type="text" name="resim10" value="' . $resim10 . '" /></p>';
  1650.     echo '<p><b>İçerik 10. Resim Adresi :</b> <input type="text" name="resim11" value="' . $resim11 . '" /></p>';
  1651.     echo '</div>';
  1652.     echo '<div id="tab2" class="icerik">';
  1653.     echo '<div class="p-bs">Firma Rehberi Özel Alanları</div>';
  1654.     echo '<p><b>Ekleyen :</b> <input type="text" name="ekleyen" value="' . $ekleyen . '" /></p>';
  1655.     echo '<p><b>Firma Türü : ( gold yada normal yazınız)</b> <input type="text" name="firmaturu" value="' . $firmaturu . '" /></p>';
  1656.     echo '<p><b>Firma Vitrinde Görünecekmi ? ( evet yada hayır yazınız)</b> <input type="text" name="vitrin" value="' . $vitrin . '" /></p>';
  1657.     echo '<p><b>Firma Adresi :</b> <input type="text" name="adres" value="' . $adres . '" /></p>';
  1658.     echo '<p><b>Firma Telefon Numarası :</b> <input type="text" name="telefon" value="' . $telefon . '" /></p>';
  1659.     echo '<p><b>Firma Telefon Numarası 2 :</b> <input type="text" name="telefon2" value="' . $telefon2 . '" /></p>';
  1660.     echo '<p><b>Firma Faks Numarası :</b> <input type="text" name="faks" value="' . $faks . '" /></p>';
  1661.     echo '<p><b>Firma E-Posta Adresi :</b> <input type="text" name="eposta" value="' . $eposta . '" /></p>';
  1662.     echo '<p><b>Firma Websitesi :</b> <input type="text" name="websitesi" value="' . $websitesi . '" /></p>';
  1663.     echo '<p><b>Google Map X Koordinatı :</b> <input type="text" name="haritax" value="' . $haritax . '" /></p>';
  1664.     echo '<p><b>Google Map Y Koordinatı :</b> <input type="text" name="haritay" value="' . $haritay . '" /></p>';
  1665.     echo '</div>';
  1666.     echo '<div id="tab3" class="icerik">';
  1667.     echo '<div class="p-bs">Video Özel Alanları</div>';
  1668.     echo '<p><b>Video Adresi ( Youtube veya direk mp4 adresi )</b> <input type="text" name="videoadres" value="' . $videoadres . '" /></p>';
  1669.     echo '</div>';
  1670.     echo '</div><div class="temz"></div>';
  1671.     echo '<script type=text/javascript>
  1672. var countries=new ddtabcontent("detay-tab")
  1673. countries.setpersist(true)
  1674. countries.setselectedClassTarget("link")
  1675. countries.init()
  1676. </script>';
  1677. }
  1678.  
  1679. function fabrika_kur() {
  1680.     if (function_exists( 'add_meta_box' )) {
  1681.         add_meta_box( 'panelimiz', 'Özel Alanlar Paneli', 'fabrikaya_gonder', 'post', 'normal', 'high' );
  1682.     }
  1683.  
  1684. }
  1685.  
  1686. function fabrikaya_yolla($post_id) {
  1687.     global $post;
  1688.  
  1689.     if (!wp_verify_nonce( $_POST['panelimiz_noncename'], plugin_basename( __FILE__ ) )) {
  1690.         return $post_id;
  1691.     }
  1692.  
  1693.  
  1694.     if ('page' == $_POST['post_type']) {
  1695.         if (!current_user_can( 'edit_page', $post_id )) {
  1696.             return $post_id;
  1697.         }
  1698.     }
  1699.     else {
  1700.         if (!current_user_can( 'edit_post', $post_id )) {
  1701.             return $post_id;
  1702.         }
  1703.     }
  1704.  
  1705.     $manset = $_POST['manset'];
  1706.     $resim = $_POST['resim'];
  1707.     $resim2 = $_POST['resim2'];
  1708.     $resim3 = $_POST['resim3'];
  1709.     $resim4 = $_POST['resim4'];
  1710.     $resim5 = $_POST['resim5'];
  1711.     $resim6 = $_POST['resim6'];
  1712.     $resim7 = $_POST['resim7'];
  1713.     $resim8 = $_POST['resim8'];
  1714.     $resim9 = $_POST['resim9'];
  1715.     $resim10 = $_POST['resim10'];
  1716.     $resim11 = $_POST['resim11'];
  1717.     $ekleyen = $_POST['ekleyen'];
  1718.     $firmaturu = $_POST['firmaturu'];
  1719.     $vitrin = $_POST['vitrin'];
  1720.     $adres = $_POST['adres'];
  1721.     $telefon = $_POST['telefon'];
  1722.     $telefon2 = $_POST['telefon2'];
  1723.     $faks = $_POST['faks'];
  1724.     $eposta = $_POST['eposta'];
  1725.     $websitesi = $_POST['websitesi'];
  1726.     $haritax = $_POST['haritax'];
  1727.     $haritay = $_POST['haritay'];
  1728.     $videoadres = $_POST['videoadres'];
  1729.  
  1730.     if (get_post_meta( $post_id, 'manset' ) == '') {
  1731.         add_post_meta( $post_id, 'manset', $manset, true );
  1732.     }
  1733.     else {
  1734.         if ($manset != get_post_meta( $post_id, 'manset', true )) {
  1735.             update_post_meta( $post_id, 'manset', $manset );
  1736.         }
  1737.         else {
  1738.             if ($manset == '') {
  1739.                 delete_post_meta( $post_id, 'manset', get_post_meta( $post_id, 'manset', true ) );
  1740.             }
  1741.         }
  1742.     }
  1743.  
  1744.  
  1745.     if (get_post_meta( $post_id, 'resim' ) == '') {
  1746.         add_post_meta( $post_id, 'resim', $resim, true );
  1747.     }
  1748.     else {
  1749.         if ($resim != get_post_meta( $post_id, 'resim', true )) {
  1750.             update_post_meta( $post_id, 'resim', $resim );
  1751.         }
  1752.         else {
  1753.             if ($resim == '') {
  1754.                 delete_post_meta( $post_id, 'resim', get_post_meta( $post_id, 'resim', true ) );
  1755.             }
  1756.         }
  1757.     }
  1758.  
  1759.  
  1760.     if (get_post_meta( $post_id, 'resim2' ) == '') {
  1761.         add_post_meta( $post_id, 'resim2', $resim2, true );
  1762.     }
  1763.     else {
  1764.         if ($resim2 != get_post_meta( $post_id, 'resim2', true )) {
  1765.             update_post_meta( $post_id, 'resim2', $resim2 );
  1766.         }
  1767.         else {
  1768.             if ($resim2 == '') {
  1769.                 delete_post_meta( $post_id, 'resim2', get_post_meta( $post_id, 'resim2', true ) );
  1770.             }
  1771.         }
  1772.     }
  1773.  
  1774.  
  1775.     if (get_post_meta( $post_id, 'resim3' ) == '') {
  1776.         add_post_meta( $post_id, 'resim3', $resim3, true );
  1777.     }
  1778.     else {
  1779.         if ($resim3 != get_post_meta( $post_id, 'resim3', true )) {
  1780.             update_post_meta( $post_id, 'resim3', $resim3 );
  1781.         }
  1782.         else {
  1783.             if ($resim3 == '') {
  1784.                 delete_post_meta( $post_id, 'resim3', get_post_meta( $post_id, 'resim3', true ) );
  1785.             }
  1786.         }
  1787.     }
  1788.  
  1789.  
  1790.     if (get_post_meta( $post_id, 'resim4' ) == '') {
  1791.         add_post_meta( $post_id, 'resim4', $resim4, true );
  1792.     }
  1793.     else {
  1794.         if ($resim4 != get_post_meta( $post_id, 'resim4', true )) {
  1795.             update_post_meta( $post_id, 'resim4', $resim4 );
  1796.         }
  1797.         else {
  1798.             if ($resim4 == '') {
  1799.                 delete_post_meta( $post_id, 'resim4', get_post_meta( $post_id, 'resim4', true ) );
  1800.             }
  1801.         }
  1802.     }
  1803.  
  1804.  
  1805.     if (get_post_meta( $post_id, 'resim5' ) == '') {
  1806.         add_post_meta( $post_id, 'resim5', $resim5, true );
  1807.     }
  1808.     else {
  1809.         if ($resim5 != get_post_meta( $post_id, 'resim5', true )) {
  1810.             update_post_meta( $post_id, 'resim5', $resim5 );
  1811.         }
  1812.         else {
  1813.             if ($resim5 == '') {
  1814.                 delete_post_meta( $post_id, 'resim5', get_post_meta( $post_id, 'resim5', true ) );
  1815.             }
  1816.         }
  1817.     }
  1818.  
  1819.  
  1820.     if (get_post_meta( $post_id, 'resim6' ) == '') {
  1821.         add_post_meta( $post_id, 'resim6', $resim6, true );
  1822.     }
  1823.     else {
  1824.         if ($resim6 != get_post_meta( $post_id, 'resim6', true )) {
  1825.             update_post_meta( $post_id, 'resim6', $resim6 );
  1826.         }
  1827.         else {
  1828.             if ($resim6 == '') {
  1829.                 delete_post_meta( $post_id, 'resim6', get_post_meta( $post_id, 'resim6', true ) );
  1830.             }
  1831.         }
  1832.     }
  1833.  
  1834.  
  1835.     if (get_post_meta( $post_id, 'resim7' ) == '') {
  1836.         add_post_meta( $post_id, 'resim7', $resim7, true );
  1837.     }
  1838.     else {
  1839.         if ($resim7 != get_post_meta( $post_id, 'resim7', true )) {
  1840.             update_post_meta( $post_id, 'resim7', $resim7 );
  1841.         }
  1842.         else {
  1843.             if ($resim7 == '') {
  1844.                 delete_post_meta( $post_id, 'resim7', get_post_meta( $post_id, 'resim7', true ) );
  1845.             }
  1846.         }
  1847.     }
  1848.  
  1849.  
  1850.     if (get_post_meta( $post_id, 'resim8' ) == '') {
  1851.         add_post_meta( $post_id, 'resim8', $resim8, true );
  1852.     }
  1853.     else {
  1854.         if ($resim8 != get_post_meta( $post_id, 'resim8', true )) {
  1855.             update_post_meta( $post_id, 'resim8', $resim8 );
  1856.         }
  1857.         else {
  1858.             if ($resim8 == '') {
  1859.                 delete_post_meta( $post_id, 'resim8', get_post_meta( $post_id, 'resim8', true ) );
  1860.             }
  1861.         }
  1862.     }
  1863.  
  1864.  
  1865.     if (get_post_meta( $post_id, 'resim9' ) == '') {
  1866.         add_post_meta( $post_id, 'resim9', $resim9, true );
  1867.     }
  1868.     else {
  1869.         if ($resim9 != get_post_meta( $post_id, 'resim9', true )) {
  1870.             update_post_meta( $post_id, 'resim9', $resim9 );
  1871.         }
  1872.         else {
  1873.             if ($resim9 == '') {
  1874.                 delete_post_meta( $post_id, 'resim9', get_post_meta( $post_id, 'resim9', true ) );
  1875.             }
  1876.         }
  1877.     }
  1878.  
  1879.  
  1880.     if (get_post_meta( $post_id, 'resim10' ) == '') {
  1881.         add_post_meta( $post_id, 'resim10', $resim10, true );
  1882.     }
  1883.     else {
  1884.         if ($resim10 != get_post_meta( $post_id, 'resim10', true )) {
  1885.             update_post_meta( $post_id, 'resim10', $resim10 );
  1886.         }
  1887.         else {
  1888.             if ($resim10 == '') {
  1889.                 delete_post_meta( $post_id, 'resim10', get_post_meta( $post_id, 'resim10', true ) );
  1890.             }
  1891.         }
  1892.     }
  1893.  
  1894.  
  1895.     if (get_post_meta( $post_id, 'resim11' ) == '') {
  1896.         add_post_meta( $post_id, 'resim11', $resim11, true );
  1897.     }
  1898.     else {
  1899.         if ($resim11 != get_post_meta( $post_id, 'resim11', true )) {
  1900.             update_post_meta( $post_id, 'resim11', $resim11 );
  1901.         }
  1902.         else {
  1903.             if ($resim11 == '') {
  1904.                 delete_post_meta( $post_id, 'resim11', get_post_meta( $post_id, 'resim11', true ) );
  1905.             }
  1906.         }
  1907.     }
  1908.  
  1909.  
  1910.     if (get_post_meta( $post_id, 'ekleyen' ) == '') {
  1911.         add_post_meta( $post_id, 'ekleyen', $ekleyen, true );
  1912.     }
  1913.     else {
  1914.         if ($ekleyen != get_post_meta( $post_id, 'ekleyen', true )) {
  1915.             update_post_meta( $post_id, 'ekleyen', $ekleyen );
  1916.         }
  1917.         else {
  1918.             if ($ekleyen == '') {
  1919.                 delete_post_meta( $post_id, 'ekleyen', get_post_meta( $post_id, 'ekleyen', true ) );
  1920.             }
  1921.         }
  1922.     }
  1923.  
  1924.  
  1925.     if (get_post_meta( $post_id, 'firmaturu' ) == '') {
  1926.         add_post_meta( $post_id, 'firmaturu', $firmaturu, true );
  1927.     }
  1928.     else {
  1929.         if ($firmaturu != get_post_meta( $post_id, 'firmaturu', true )) {
  1930.             update_post_meta( $post_id, 'firmaturu', $firmaturu );
  1931.         }
  1932.         else {
  1933.             if ($firmaturu == '') {
  1934.                 delete_post_meta( $post_id, 'firmaturu', get_post_meta( $post_id, 'firmaturu', true ) );
  1935.             }
  1936.         }
  1937.     }
  1938.  
  1939.  
  1940.     if (get_post_meta( $post_id, 'vitrin' ) == '') {
  1941.         add_post_meta( $post_id, 'vitrin', $vitrin, true );
  1942.     }
  1943.     else {
  1944.         if ($vitrin != get_post_meta( $post_id, 'vitrin', true )) {
  1945.             update_post_meta( $post_id, 'vitrin', $vitrin );
  1946.         }
  1947.         else {
  1948.             if ($vitrin == '') {
  1949.                 delete_post_meta( $post_id, 'vitrin', get_post_meta( $post_id, 'vitrin', true ) );
  1950.             }
  1951.         }
  1952.     }
  1953.  
  1954.  
  1955.     if (get_post_meta( $post_id, 'adres' ) == '') {
  1956.         add_post_meta( $post_id, 'adres', $adres, true );
  1957.     }
  1958.     else {
  1959.         if ($adres != get_post_meta( $post_id, 'adres', true )) {
  1960.             update_post_meta( $post_id, 'adres', $adres );
  1961.         }
  1962.         else {
  1963.             if ($adres == '') {
  1964.                 delete_post_meta( $post_id, 'adres', get_post_meta( $post_id, 'adres', true ) );
  1965.             }
  1966.         }
  1967.     }
  1968.  
  1969.  
  1970.     if (get_post_meta( $post_id, 'telefon' ) == '') {
  1971.         add_post_meta( $post_id, 'telefon', $telefon, true );
  1972.     }
  1973.     else {
  1974.         if ($telefon != get_post_meta( $post_id, 'telefon', true )) {
  1975.             update_post_meta( $post_id, 'telefon', $telefon );
  1976.         }
  1977.         else {
  1978.             if ($telefon == '') {
  1979.                 delete_post_meta( $post_id, 'telefon', get_post_meta( $post_id, 'telefon', true ) );
  1980.             }
  1981.         }
  1982.     }
  1983.  
  1984.  
  1985.     if (get_post_meta( $post_id, 'telefon2' ) == '') {
  1986.         add_post_meta( $post_id, 'telefon2', $telefon2, true );
  1987.     }
  1988.     else {
  1989.         if ($telefon2 != get_post_meta( $post_id, 'telefon2', true )) {
  1990.             update_post_meta( $post_id, 'telefon2', $telefon2 );
  1991.         }
  1992.         else {
  1993.             if ($telefon2 == '') {
  1994.                 delete_post_meta( $post_id, 'telefon2', get_post_meta( $post_id, 'telefon2', true ) );
  1995.             }
  1996.         }
  1997.     }
  1998.  
  1999.  
  2000.     if (get_post_meta( $post_id, 'faks' ) == '') {
  2001.         add_post_meta( $post_id, 'faks', $faks, true );
  2002.     }
  2003.     else {
  2004.         if ($faks != get_post_meta( $post_id, 'faks', true )) {
  2005.             update_post_meta( $post_id, 'faks', $faks );
  2006.         }
  2007.         else {
  2008.             if ($faks == '') {
  2009.                 delete_post_meta( $post_id, 'faks', get_post_meta( $post_id, 'faks', true ) );
  2010.             }
  2011.         }
  2012.     }
  2013.  
  2014.  
  2015.     if (get_post_meta( $post_id, 'eposta' ) == '') {
  2016.         add_post_meta( $post_id, 'eposta', $eposta, true );
  2017.     }
  2018.     else {
  2019.         if ($eposta != get_post_meta( $post_id, 'eposta', true )) {
  2020.             update_post_meta( $post_id, 'eposta', $eposta );
  2021.         }
  2022.         else {
  2023.             if ($eposta == '') {
  2024.                 delete_post_meta( $post_id, 'eposta', get_post_meta( $post_id, 'eposta', true ) );
  2025.             }
  2026.         }
  2027.     }
  2028.  
  2029.  
  2030.     if (get_post_meta( $post_id, 'websitesi' ) == '') {
  2031.         add_post_meta( $post_id, 'websitesi', $websitesi, true );
  2032.     }
  2033.     else {
  2034.         if ($websitesi != get_post_meta( $post_id, 'websitesi', true )) {
  2035.             update_post_meta( $post_id, 'websitesi', $websitesi );
  2036.         }
  2037.         else {
  2038.             if ($websitesi == '') {
  2039.                 delete_post_meta( $post_id, 'websitesi', get_post_meta( $post_id, 'websitesi', true ) );
  2040.             }
  2041.         }
  2042.     }
  2043.  
  2044.  
  2045.     if (get_post_meta( $post_id, 'haritax' ) == '') {
  2046.         add_post_meta( $post_id, 'haritax', $haritax, true );
  2047.     }
  2048.     else {
  2049.         if ($haritax != get_post_meta( $post_id, 'haritax', true )) {
  2050.             update_post_meta( $post_id, 'haritax', $haritax );
  2051.         }
  2052.         else {
  2053.             if ($haritax == '') {
  2054.                 delete_post_meta( $post_id, 'haritax', get_post_meta( $post_id, 'haritax', true ) );
  2055.             }
  2056.         }
  2057.     }
  2058.  
  2059.  
  2060.     if (get_post_meta( $post_id, 'haritay' ) == '') {
  2061.         add_post_meta( $post_id, 'haritay', $haritay, true );
  2062.     }
  2063.     else {
  2064.         if ($haritay != get_post_meta( $post_id, 'haritay', true )) {
  2065.             update_post_meta( $post_id, 'haritay', $haritay );
  2066.         }
  2067.         else {
  2068.             if ($haritay == '') {
  2069.                 delete_post_meta( $post_id, 'haritay', get_post_meta( $post_id, 'haritay', true ) );
  2070.             }
  2071.         }
  2072.     }
  2073.  
  2074.  
  2075.     if (get_post_meta( $post_id, 'videoadres' ) == '') {
  2076.         add_post_meta( $post_id, 'videoadres', $videoadres, true );
  2077.         return null;
  2078.     }
  2079.  
  2080.  
  2081.     if ($videoadres != get_post_meta( $post_id, 'videoadres', true )) {
  2082.         update_post_meta( $post_id, 'videoadres', $videoadres );
  2083.         return null;
  2084.     }
  2085.  
  2086.  
  2087.     if ($videoadres == '') {
  2088.         delete_post_meta( $post_id, 'videoadres', get_post_meta( $post_id, 'videoadres', true ) );
  2089.     }
  2090.  
  2091. }
  2092.  
  2093. function get_theme_option($option) {
  2094.     global $shortname;
  2095.  
  2096.     return stripslashes( get_option( $shortname . '_' . $option ) );
  2097. }
  2098.  
  2099. function get_theme_settings($option) {
  2100.     return stripslashes( get_option( $option ) );
  2101. }
  2102.  
  2103. function get_theme_katid($option) {
  2104.     global $shortname;
  2105.  
  2106.     return get_cat_ID( stripslashes( get_option( $shortname . '_' . $option ) ) );
  2107. }
  2108.  
  2109. $thepsi = get_option( 'home' );
  2110. $aztebs = 'http://www.firmayurdu.com';
  2111. $aztebsx = 'http://firmayurdu.com';
  2112.  
  2113. if ($thepsi != $aztebs) {
  2114.     if ($thepsi != $aztebsx) {
  2115.         exit( 'http://www.firmayurdu.com' );
  2116.         echo true;
  2117.     }
  2118. }
  2119.  
  2120.  
  2121. if (( ( is_admin(  ) && isset( $_GET['activated'] ) ) && $pagenow == 'themes.php' )) {
  2122.     add_action( 'admin_head', 'of_option_setup' );
  2123. }
  2124.  
  2125. $functions_path = OF_FILEPATH . '/admin/';
  2126. add_action( 'admin_menu', 'fabrikapanel_add_admin' );
  2127. add_action( 'wp_ajax_of_ajax_post_action', 'of_ajax_callback' );
  2128.  
  2129. if (!function_exists( 'fabrikapanel_wp_head' )) {
  2130.     function fabrikapanel_wp_head() {
  2131.         $shortname = get_option( 'of_shortname' );
  2132.  
  2133.         if (!isset( $_REQUEST['style'] )) {
  2134.             $style = '';
  2135.         }
  2136.         else {
  2137.             $style = $_REQUEST['style'];
  2138.         }
  2139.  
  2140.  
  2141.         if ($style != '') {
  2142.             $GLOBALS['stylesheet'] = $style;
  2143.             echo '<link href="' . OF_DIRECTORY . '/styles/' . $GLOBALS['stylesheet'] . '.css" rel="stylesheet" type="text/css" />' . '
  2144. ';
  2145.         }
  2146.         else {
  2147.             $GLOBALS['stylesheet'] = get_option( 'of_alt_stylesheet' );
  2148.  
  2149.             if ($GLOBALS['stylesheet'] != '') {
  2150.                 echo '<link href="' . OF_DIRECTORY . '/styles/' . $GLOBALS['stylesheet'] . '" rel="stylesheet" type="text/css" />' . '
  2151. ';
  2152.             }
  2153.         }
  2154.  
  2155.         of_head_css(  );
  2156.     }
  2157. }
  2158.  
  2159. add_action( 'wp_head', 'fabrikapanel_wp_head' );
  2160. add_filter( 'wp_head', 'wp_headr' );
  2161. add_filter( 'body_class', 'of_body_class' );
  2162. register_nav_menu( 'menu', 'Ust Menu' );
  2163. register_nav_menu( 'menu2', 'Footer Menu' );
  2164. add_theme_support( 'post-thumbnails' );
  2165. add_filter( 'use_default_gallery_style', '__return_false' );
  2166. add_filter( 'wp_get_attachment_link', 'my_get_attachment_link', 10, 1 );
  2167. add_action( 'admin_menu', 'fabrika_kur' );
  2168. add_action( 'save_post', 'fabrikaya_yolla' );
  2169. add_action( 'init', 'of_options' );
  2170.  
  2171. if (!function_exists( 'of_options' )) {
  2172.     function of_options() {
  2173.         $themename = get_theme_data( STYLESHEETPATH . '/style.css' );
  2174.         $themename = $themename['Name'];
  2175.         $shortname = 'panel';
  2176.         global $of_options;
  2177.  
  2178.         $of_options = get_option( 'of_options' );
  2179.         $GLOBALS['template_path'] = OF_DIRECTORY;
  2180.         $of_categories = array(  );
  2181.         $of_categories_obj = get_categories( 'hide_empty=0&hierarchical=1&orderby=name' );
  2182.         foreach ($of_categories_obj as $of_cat) {
  2183.             $of_categories[$of_cat->cat_ID] = $of_cat->cat_name;
  2184.         }
  2185.  
  2186.         $categories_tmp = array_unshift( $of_categories, 'Kategori seçiniz:' );
  2187.         $of_pages = array(  );
  2188.         $of_pages_obj = get_pages( 'sort_column=post_parent,menu_order' );
  2189.         foreach ($of_pages_obj as $of_page) {
  2190.             $of_pages[$of_page->ID] = $of_page->post_name;
  2191.         }
  2192.  
  2193.         $of_pages_tmp = array_unshift( $of_pages, 'Sayfa seçiniz:' );
  2194.         $options_thumb_align = array( 'alignleft' => 'Left', 'alignright' => 'Right', 'aligncenter' => 'Center' );
  2195.         $options_image_link_to = array( 'image' => 'The Image', 'post' => 'The Post' );
  2196.         $featured_options_select = array( '2', '4', '6', '8', '10', '12' );
  2197.         $alt_stylesheet_path = OF_FILEPATH . '/styles/';
  2198.         $alt_stylesheets = array(  );
  2199.  
  2200.         if (is_dir( $alt_stylesheet_path )) {
  2201.  
  2202.             if ($alt_stylesheet_dir = opendir( $alt_stylesheet_path )) {
  2203.                 readdir( $alt_stylesheet_dir );
  2204.  
  2205.                 if ($alt_stylesheet_file =  !== false) {
  2206.                     if (stristr( $alt_stylesheet_file, '.css' ) !== false) {
  2207.                         $alt_stylesheets[] = $alt_stylesheet_file;
  2208.                     }
  2209.                 }
  2210.             }
  2211.         }
  2212.  
  2213.         $uploads_arr = wp_upload_dir(  );
  2214.         $all_uploads_path = $uploads_arr['path'];
  2215.         $all_uploads = get_option( 'of_uploads' );
  2216.         $thumbsekil = array( 'Solda', 'Şerit' );
  2217.         $options = array(  );
  2218.         $options[] = array( 'name' => 'SAYFALAR', 'type' => 'heading' );
  2219.         $options[] = array( 'name' => 'Üye Paneli Sayfası', 'desc' => 'Üye Paneli Sayfasını Seçiniz', 'id' => $shortname . '_sayfa1', 'std' => '0', 'options' => $of_pages, 'type' => 'select' );
  2220.         $options[] = array( 'name' => 'İçerik Ekleme Sayfası', 'desc' => 'İçerik Ekleme Sayfasını Seçiniz', 'id' => $shortname . '_sayfa2', 'std' => '0', 'options' => $of_pages, 'type' => 'select' );
  2221.         $options[] = array( 'name' => 'İçerik Düzenleme Sayfası', 'desc' => 'İçerik Düzenleme Sayfasını Seçiniz', 'id' => $shortname . '_sayfa3', 'std' => '0', 'options' => $of_pages, 'type' => 'select' );
  2222.         $options[] = array( 'name' => 'Tüm Sektörler Sayfası', 'desc' => 'Tüm Sektörler Sayfasını Seçiniz', 'id' => $shortname . '_sayfa4', 'std' => '0', 'options' => $of_pages, 'type' => 'select' );
  2223.         $options[] = array( 'name' => 'ANA KATEGORİLER', 'type' => 'heading' );
  2224.         $options[] = array( 'name' => 'Firma Rehberi Ana Kategori', 'desc' => 'Firma Rehberi Ana Kategori Seçiniz', 'id' => $shortname . '_firma', 'std' => '0', 'options' => $of_categories, 'type' => 'select' );
  2225.         $options[] = array( 'name' => 'Haberler Ana Kategori', 'desc' => 'Haberler Ana Kategori Seçiniz', 'id' => $shortname . '_haber', 'std' => '0', 'options' => $of_categories, 'type' => 'select' );
  2226.         $options[] = array( 'name' => 'İlanlar Ana Kategori', 'desc' => 'İlanlar Ana Kategori Seçiniz', 'id' => $shortname . '_ilan', 'std' => '0', 'options' => $of_categories, 'type' => 'select' );
  2227.         $options[] = array( 'name' => 'Ürünler Ana Kategori', 'desc' => 'Ürünler Ana Kategori Seçiniz', 'id' => $shortname . '_urun', 'std' => '0', 'options' => $of_categories, 'type' => 'select' );
  2228.         $options[] = array( 'name' => 'ANASAYFADAKİ KATEGORİLER', 'type' => 'heading' );
  2229.         $options[] = array( 'name' => 'Üst Menü Altı Duyuru Bölümü Kategori', 'desc' => 'Üst Menü Altı Duyuru Bölümü Kategori Seçiniz', 'id' => $shortname . '_ukat1id', 'std' => '0', 'options' => $of_categories, 'type' => 'select' );
  2230.         $options[] = array( 'name' => 'Anasayfa Manşet Yanı Başlık', 'desc' => 'Anasayfa Manşet Yanı Başlık', 'id' => $shortname . '_akat1b', 'type' => 'text', 'std' => 'SON EKLENEN İLANLAR' );
  2231.         $options[] = array( 'name' => 'Anasayfa Manşet Yanı Kategori', 'desc' => 'Anasayfa Manşet Yanı Kategori Seçiniz', 'id' => $shortname . '_akat1id', 'std' => '0', 'options' => $of_categories, 'type' => 'select' );
  2232.         $options[] = array( 'name' => 'Sol Bölüm Kategori 1 Başlık', 'desc' => 'Sol Bölüm Kategori 1 Başlık', 'id' => $shortname . '_skat1b', 'type' => 'text', 'std' => 'FİRMALARDAN HABERLER' );
  2233.         $options[] = array( 'name' => 'Sol Bölüm Kategori 1 Kategori', 'desc' => 'Sol Bölüm Kategori 1 Seçiniz', 'id' => $shortname . '_skat1id', 'std' => '0', 'options' => $of_categories, 'type' => 'select' );
  2234.         $options[] = array( 'name' => 'Sol Bölüm Kategori 2 Başlık', 'desc' => 'Sol Bölüm Kategori 2 Başlık', 'id' => $shortname . '_skat2b', 'type' => 'text', 'std' => 'FUAR VE ETKİNLİKLER' );
  2235.         $options[] = array( 'name' => 'Sol Bölüm Kategori 2 Kategori', 'desc' => 'Sol Bölüm Kategori 2 Seçiniz', 'id' => $shortname . '_skat2id', 'std' => '0', 'options' => $of_categories, 'type' => 'select' );
  2236.         $options[] = array( 'name' => 'ÖZELLİK AYARLARI', 'type' => 'heading' );
  2237.         $options[] = array( 'name' => 'Kategoride Gold Üyeleri Ayır', 'desc' => 'Kategoride Gold Üyeler Ayrı Gözükecek ise İşaretleyiniz.', 'id' => $shortname . '_rehberaktif', 'std' => '', 'type' => 'checkbox' );
  2238.         $options[] = array( 'name' => 'Firmaya Mesaj Gönder Özelliği Aktif', 'desc' => 'Mesaj Gönder Özelliği Aktif Olacak ise İşaretleyiniz.', 'id' => $shortname . '_mesajaktif', 'std' => '', 'type' => 'checkbox' );
  2239.         $options[] = array( 'name' => 'Smtp Mail Sunucunuz', 'desc' => 'Örneğin mail.siteismi.com', 'id' => $shortname . '_smtphost', 'type' => 'text', 'std' => '' );
  2240.         $options[] = array( 'name' => 'Smtp Mail Kullanıcı Adı', 'desc' => 'Örneğin bilgi@siteismi.com', 'id' => $shortname . '_smtpuser', 'type' => 'text', 'std' => '' );
  2241.         $options[] = array( 'name' => 'Smtp Mail Kullanıcı Şifre', 'desc' => 'Mail Şifrenizi Girin', 'id' => $shortname . '_smtppass', 'type' => 'text', 'std' => '' );
  2242.         $options[] = array( 'name' => 'GOLD ÜYELİK AYARLARI', 'type' => 'heading' );
  2243.         $options[] = array( 'name' => 'Hesap Bilgileriniz', 'desc' => 'Ödeme alacağınız hesap bilgilerini giriniz', 'id' => $shortname . '_hesap', 'type' => 'textarea', 'std' => 'Hesap Sahibi : Örnek İsim<br/>Banka : Örnek Bank<br/>Şube : Örnek Şube<br/>IBAN : TR<br/>Hesap No : <br/>' );
  2244.         $options[] = array( 'name' => 'Gold Üyelik Ücreti', 'desc' => 'Gold üyelik için talep ettiğiniz ücreti giriniz', 'id' => $shortname . '_goldfiyat', 'type' => 'text', 'std' => 'Yıllık 50 TL' );
  2245.         $options[] = array( 'name' => 'Ödeme Bildiriminin Geleceği Mail', 'desc' => 'Ödeme Bildiriminin Geleceği Mail Adresini Giriniz', 'id' => $shortname . '_goldmail', 'type' => 'text', 'std' => 'bilgi@siteismi.com' );
  2246.         $options[] = array( 'name' => 'DİĞER AYARLAR', 'type' => 'heading' );
  2247.         $options[] = array( 'name' => 'Footer Menü Başlık', 'desc' => 'Footer Menü Başlığı Yazınız', 'id' => $shortname . '_fbaslik', 'std' => 'KURUMSAL BİLGİLER', 'type' => 'text' );
  2248.         $options[] = array( 'name' => 'Footer Bölümünde Görünecek Yazı', 'desc' => 'Site Sloganı veya Link Değişimi İçin Kullanabilirsiniz', 'id' => $shortname . '_footer', 'std' => '<p>Tüm Hakları Saklıdır</p><p><b>Türkiye\'nin En Kapsamlı Firma Rehberi\'ne Hoşgeldiniz.</b></p>', 'type' => 'textarea' );
  2249.         $options[] = array( 'name' => 'Sayaç Kodunuz', 'desc' => 'Sitenin En Altına Eklenecek Sayaç vs Kodunuz', 'id' => $shortname . '_sayac', 'std' => '', 'type' => 'textarea' );
  2250.         $options[] = array( 'name' => 'Facebook Sayfa Adresiniz', 'desc' => 'Facebook Sayfa Adresiniz', 'id' => $shortname . '_sface', 'std' => '#', 'type' => 'text' );
  2251.         $options[] = array( 'name' => 'Twitter Sayfa Adresiniz', 'desc' => 'Twitter Sayfa Adresiniz', 'id' => $shortname . '_stwit', 'std' => '#', 'type' => 'text' );
  2252.         $options[] = array( 'name' => 'Google Sayfa Adresiniz', 'desc' => 'Google Sayfa Adresiniz', 'id' => $shortname . '_sgoog', 'std' => '#', 'type' => 'text' );
  2253.         $options[] = array( 'name' => 'ANASAYFA REKLAM AYARLARI', 'type' => 'heading' );
  2254.         $options[] = array( 'name' => 'Header 468x60px Reklam Alanı', 'desc' => '468x60px Reklam Kodu Giriniz', 'id' => $shortname . '_a1x468', 'std' => '', 'type' => 'textarea' );
  2255.         $options[] = array( 'name' => 'Anasayfa Tam Reklam Alanı', 'desc' => 'Genişlik Maksimum 970px Olmalıdır', 'id' => $shortname . '_a1x970', 'std' => '', 'type' => 'textarea' );
  2256.         $options[] = array( 'name' => 'Anasayfa 728x90 Reklam Alanı 1', 'desc' => '728x90px Reklam Kodu Giriniz', 'id' => $shortname . '_a1x728', 'std' => '', 'type' => 'textarea' );
  2257.         $options[] = array( 'name' => 'Anasayfa 728x90 Reklam Alanı 2', 'desc' => '728x90px Reklam Kodu Giriniz', 'id' => $shortname . '_a2x728', 'std' => '', 'type' => 'textarea' );
  2258.         $options[] = array( 'name' => 'Anasayfa 300x250px Reklam Alanı 1', 'desc' => '300x250px Reklam Kodu Giriniz', 'id' => $shortname . '_a1x300', 'std' => '', 'type' => 'textarea' );
  2259.         $options[] = array( 'name' => 'Anasayfa Solbar 250x250px Reklam Alanı', 'desc' => '250x250px Reklam Kodu Giriniz', 'id' => $shortname . '_a1x250', 'std' => '', 'type' => 'textarea' );
  2260.         $options[] = array( 'name' => 'KATEGORİ REKLAM AYARLARI', 'type' => 'heading' );
  2261.         $options[] = array( 'name' => 'Kategori Tam Reklam Alanı', 'desc' => 'Genişlik Maksimum 970px Olmalıdır', 'id' => $shortname . '_k1x970', 'std' => '', 'type' => 'textarea' );
  2262.         $options[] = array( 'name' => 'Kategori 728x90 Reklam Alanı', 'desc' => '728x90px Reklam Kodu Giriniz', 'id' => $shortname . '_k1x728', 'std' => '', 'type' => 'textarea' );
  2263.         $options[] = array( 'name' => 'Kategori Solbar 250x250px Reklam Alanı', 'desc' => '250x250px Reklam Kodu Giriniz', 'id' => $shortname . '_k1x250', 'std' => '', 'type' => 'textarea' );
  2264.         $options[] = array( 'name' => 'DETAY REKLAM AYARLARI', 'type' => 'heading' );
  2265.         $options[] = array( 'name' => 'Detay Tam Reklam Alanı', 'desc' => 'Genişlik Maksimum 970px Olmalıdır', 'id' => $shortname . '_d1x970', 'std' => '', 'type' => 'textarea' );
  2266.         $options[] = array( 'name' => 'Detay 728x90 Reklam Alanı', 'desc' => '728x90px Reklam Kodu Giriniz', 'id' => $shortname . '_d1x728', 'std' => '', 'type' => 'textarea' );
  2267.         $options[] = array( 'name' => 'Detay Solbar 250x250px Reklam Alanı', 'desc' => '250x250px Reklam Kodu Giriniz', 'id' => $shortname . '_d1x250', 'std' => '', 'type' => 'textarea' );
  2268.         update_option( 'of_template', $options );
  2269.         update_option( 'of_themename', $themename );
  2270.         update_option( 'of_shortname', $shortname );
  2271.     }
  2272. }
  2273.  
  2274. $shortname = get_option( 'of_shortname' );
  2275. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement