@@ -49,13 +49,13 @@ |
||
49 | 49 | </h4> |
50 | 50 | <?php |
51 | 51 | if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'fw') { |
52 | - echo "<p class=\"error_msg\"> " . INVALID_USER_FPW_MSG . " </p>"; |
|
52 | + echo "<p class=\"error_msg\"> ".INVALID_USER_FPW_MSG." </p>"; |
|
53 | 53 | } elseif (isset($_REQUEST['logemsg']) && $_REQUEST['logemsg'] == 1) { |
54 | - echo "<p class=\"error_msg\"> " . INVALID_USER_PW_MSG . " </p>"; |
|
54 | + echo "<p class=\"error_msg\"> ".INVALID_USER_PW_MSG." </p>"; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | if (isset($_REQUEST['checkemail']) && $_REQUEST['checkemail'] == 'confirm') |
58 | - echo '<p class="sucess_msg">' . PW_SEND_CONFIRM_MSG . '</p>'; |
|
58 | + echo '<p class="sucess_msg">'.PW_SEND_CONFIRM_MSG.'</p>'; |
|
59 | 59 | |
60 | 60 | ?> |
61 | 61 | <form name="cus_loginform" id="cus_loginform" action="<?php echo esc_url(geodir_curPageURL()); ?>" |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | if ($redirect) { |
23 | 23 | ?> |
24 | 24 | <script type="text/javascript"> |
25 | - window.location.href = '<?php echo geodir_login_url();?>'; |
|
25 | + window.location.href = '<?php echo geodir_login_url(); ?>'; |
|
26 | 26 | </script> |
27 | 27 | <?php |
28 | 28 | } else |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); |
48 | 48 | exit(); |
49 | 49 | } else { |
50 | - wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); |
|
50 | + wp_redirect('https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); |
|
51 | 51 | exit(); |
52 | 52 | } |
53 | 53 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @param string $message Login message. |
61 | 61 | */ |
62 | 62 | $message = apply_filters('login_message', $message); |
63 | - if (!empty($message)) echo $message . "\n"; |
|
63 | + if (!empty($message)) echo $message."\n"; |
|
64 | 64 | |
65 | 65 | } |
66 | 66 | |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | |
209 | 209 | wp_set_password($new_pass, $user->ID); |
210 | 210 | update_user_meta($user->ID, 'default_password_nag', true); //Set up the Password change nag. |
211 | - $message = '<p><b>' . __('Your login Information :', 'geodirectory') . '</b></p>'; |
|
212 | - $message .= '<p>' . sprintf(__('Username: %s', 'geodirectory'), $user->user_login) . "</p>"; |
|
213 | - $message .= '<p>' . sprintf(__('Password: %s', 'geodirectory'), $new_pass) . "</p>"; |
|
211 | + $message = '<p><b>'.__('Your login Information :', 'geodirectory').'</b></p>'; |
|
212 | + $message .= '<p>'.sprintf(__('Username: %s', 'geodirectory'), $user->user_login)."</p>"; |
|
213 | + $message .= '<p>'.sprintf(__('Password: %s', 'geodirectory'), $new_pass)."</p>"; |
|
214 | 214 | //$message .= '<p>You can login to : <a href="'.home_url().'/?ptype=login' . "\">Login</a> or the URL is : ".home_url()."/?ptype=login</p>"; |
215 | 215 | //$message .= '<p>Thank You,<br> '.get_option('blogname').'</p>'; |
216 | 216 | $user_email = $user_data->user_email; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | $message = apply_filters('password_reset_message', $message, $new_pass); |
238 | 238 | //geodir_sendEmail($fromEmail,$fromEmailName,$user_email,$user_name,$title,$message,$extra='');///forgot password email |
239 | - geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $user_name, $title, $message, $extra = '', 'forgot_password', $post_id = '', $user->ID);///forgot password email |
|
239 | + geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $user_name, $title, $message, $extra = '', 'forgot_password', $post_id = '', $user->ID); ///forgot password email |
|
240 | 240 | |
241 | 241 | return true; |
242 | 242 | } |
@@ -390,13 +390,13 @@ discard block |
||
390 | 390 | ///////REGISTRATION EMAIL START////// |
391 | 391 | $fromEmail = geodir_get_site_email_id(); |
392 | 392 | $fromEmailName = get_site_emailName(); |
393 | - $message = __('<p><b>' . __('Your login Information :', 'geodirectory') . '</b></p> |
|
394 | -<p>' . __('Username:', 'geodirectory') . ' ' . $user_login . '</p> |
|
395 | -<p>' . __('Password:', 'geodirectory') . ' ' . $user_pass . '</p>'); |
|
393 | + $message = __('<p><b>'.__('Your login Information :', 'geodirectory').'</b></p> |
|
394 | +<p>' . __('Username:', 'geodirectory').' '.$user_login.'</p> |
|
395 | +<p>' . __('Password:', 'geodirectory').' '.$user_pass.'</p>'); |
|
396 | 396 | |
397 | 397 | /////////////customer email////////////// |
398 | 398 | //geodir_sendEmail($fromEmail,$fromEmailName,$user_email,$userName,$subject,$client_message,$extra='');///To client email |
399 | - geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $userName, '', $message, '', 'registration', '', $user_id);/// registration email |
|
399 | + geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $userName, '', $message, '', 'registration', '', $user_id); /// registration email |
|
400 | 400 | //////REGISTRATION EMAIL END//////// |
401 | 401 | } |
402 | 402 | |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | $action = 'resetpass'; |
428 | 428 | |
429 | 429 | // validate action so as to default to the login screen |
430 | - if (!in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) && false === has_filter('login_form_' . $action)) |
|
430 | + if (!in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) && false === has_filter('login_form_'.$action)) |
|
431 | 431 | $action = 'login'; |
432 | 432 | |
433 | 433 | nocache_headers(); |
@@ -437,8 +437,8 @@ discard block |
||
437 | 437 | $_SERVER['PHP_SELF'] = str_replace($_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF']); |
438 | 438 | |
439 | 439 | $schema = (isset($_SERVER['HTTPS']) && geodir_strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://'; |
440 | - if (dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != home_url()) |
|
441 | - update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'])); |
|
440 | + if (dirname($schema.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']) != home_url()) |
|
441 | + update_option('siteurl', dirname($schema.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'])); |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | //Set a cookie now to see if they are supported by the browser. |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | * |
454 | 454 | * @since 1.0.0 |
455 | 455 | */ |
456 | - do_action('login_form_' . $action); |
|
456 | + do_action('login_form_'.$action); |
|
457 | 457 | |
458 | 458 | $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); |
459 | 459 | |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | * @since 1.0.0 |
494 | 494 | */ |
495 | 495 | do_action('lost_password'); |
496 | - $message = '<div class="sucess_msg">' . ENTER_USER_EMAIL_NEW_PW_MSG . '</div>'; |
|
496 | + $message = '<div class="sucess_msg">'.ENTER_USER_EMAIL_NEW_PW_MSG.'</div>'; |
|
497 | 497 | $user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : ''; |
498 | 498 | |
499 | 499 | break; |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | exit(); |
508 | 508 | } |
509 | 509 | |
510 | - wp_redirect(geodir_login_url(array('error'=>'invalidkey','action'=>'lostpassword'))); |
|
510 | + wp_redirect(geodir_login_url(array('error'=>'invalidkey', 'action'=>'lostpassword'))); |
|
511 | 511 | exit(); |
512 | 512 | |
513 | 513 | break; |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | |
683 | 683 | if (is_wp_error($user)) { |
684 | 684 | if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], 'ptype=property_submit') && $_POST['log'] != '' && $_POST['pwd'] != '') { |
685 | - wp_redirect($_SERVER['HTTP_REFERER'] . '&emsg=1'); |
|
685 | + wp_redirect($_SERVER['HTTP_REFERER'].'&emsg=1'); |
|
686 | 686 | } |
687 | 687 | } |
688 | 688 | if (!is_wp_error($user)) { |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | |
711 | 711 | // Some parts of this script use the main login form to display a message |
712 | 712 | if (isset($_GET['loggedout']) && TRUE == $_GET['loggedout']) { |
713 | - $successmsg = '<div class="sucess_msg">' . YOU_ARE_LOGED_OUT_MSG . '</div>'; |
|
713 | + $successmsg = '<div class="sucess_msg">'.YOU_ARE_LOGED_OUT_MSG.'</div>'; |
|
714 | 714 | } elseif (isset($_GET['registration']) && 'disabled' == $_GET['registration']) { |
715 | 715 | $successmsg = USER_REG_NOT_ALLOW_MSG; |
716 | 716 | } elseif (isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail']) { |
@@ -723,9 +723,9 @@ discard block |
||
723 | 723 | |
724 | 724 | if ((isset($_POST['log']) && $_POST['log'] != '' && $errors) || ((!isset($_POST['log']) || $_POST['log'] == '') && isset($_REQUEST['testcookie']) && $_REQUEST['testcookie'])) { |
725 | 725 | if (isset($_REQUEST['pagetype']) && $_REQUEST['pagetype'] != '') { |
726 | - wp_redirect($_REQUEST['pagetype'] . '&emsg=1'); |
|
726 | + wp_redirect($_REQUEST['pagetype'].'&emsg=1'); |
|
727 | 727 | } else { |
728 | - wp_redirect(geodir_login_url(array('logemsg'=>'1','redirect_to'=>urlencode($_REQUEST['redirect_to'])))); |
|
728 | + wp_redirect(geodir_login_url(array('logemsg'=>'1', 'redirect_to'=>urlencode($_REQUEST['redirect_to'])))); |
|
729 | 729 | } |
730 | 730 | gd_die(); |
731 | 731 | } |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | */ |
25 | 25 | |
26 | 26 | $config = array( |
27 | - 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | - 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | - 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | - 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | - 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | - 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
27 | + 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | + 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | + 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | + 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | + 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | + 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
33 | 33 | 'use_with_theme' => true //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). |
34 | 34 | ); |
35 | 35 | |
@@ -38,18 +38,18 @@ discard block |
||
38 | 38 | * Initiate your meta box |
39 | 39 | */ |
40 | 40 | $my_meta = new Tax_Meta_Class($config); |
41 | - $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | - $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | - $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
41 | + $my_meta->addWysiwyg($prefix.'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | + $my_meta->addImage($prefix.'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | + $my_meta->addImage($prefix.'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
44 | 44 | /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML |
45 | 45 | |
46 | - $my_meta->addSelect($prefix . 'cat_schema', |
|
46 | + $my_meta->addSelect($prefix.'cat_schema', |
|
47 | 47 | /* |
48 | 48 | * Allows you to add/filter the cat schema types. |
49 | 49 | * |
50 | 50 | * @since 1.5.7 |
51 | 51 | */ |
52 | - apply_filters('geodir_cat_schemas',array( |
|
52 | + apply_filters('geodir_cat_schemas', array( |
|
53 | 53 | '' => __('Default (LocalBusiness)', 'geodirectory'), |
54 | 54 | 'AccountingService' => 'AccountingService', |
55 | 55 | 'Attorney' => 'Attorney', |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | 'WholesaleStore' => 'WholesaleStore', |
142 | 142 | 'Winery' => 'Winery' |
143 | 143 | )), |
144 | - array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2'))); |
|
144 | + array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory')."", 'std' => array('selectkey2'))); |
|
145 | 145 | |
146 | 146 | /*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , 'geodirectory'), |
147 | 147 | 'random'=>__('Random','geodirectory'), |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | if (!empty($gd_taxonomies)) { |
180 | 180 | foreach ($gd_taxonomies as $gd_taxonomy) { |
181 | 181 | |
182 | - add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2); |
|
183 | - add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3); |
|
182 | + add_filter('manage_edit-'.$gd_taxonomy.'_columns', 'addCat_column', 10, 2); |
|
183 | + add_action('manage_'.$gd_taxonomy.'_custom_column', 'manage_category_custom_fields', 10, 3); |
|
184 | 184 | |
185 | 185 | } |
186 | 186 | } |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | |
215 | 215 | $file_info = pathinfo($term_icon_url['src']); |
216 | 216 | |
217 | - if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
217 | + if (isset($file_info['dirname']) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
218 | 218 | $sub_dir = $file_info['dirname']; |
219 | - else{$sub_dir = '';} |
|
219 | + else {$sub_dir = ''; } |
|
220 | 220 | |
221 | 221 | $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
222 | 222 | $uploads_baseurl = $uploads['baseurl']; |
@@ -226,10 +226,10 @@ discard block |
||
226 | 226 | |
227 | 227 | $sub_dir = str_replace($uploads_baseurl, '', $sub_dir); |
228 | 228 | |
229 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
229 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
230 | 230 | |
231 | - $term_icon_url['src'] = $uploads_url . '/' . $file_name; |
|
232 | - echo '<img src="' . $term_icon_url['src'] . '" />'; |
|
231 | + $term_icon_url['src'] = $uploads_url.'/'.$file_name; |
|
232 | + echo '<img src="'.$term_icon_url['src'].'" />'; |
|
233 | 233 | |
234 | 234 | } |
235 | 235 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if ($column_name == 'cat_default_img') { |
238 | 238 | $cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img'); |
239 | 239 | if ($cat_default_img != '') |
240 | - echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
240 | + echo '<img src="'.$cat_default_img['src'].'" style="max-height:60px;max-width:60px;"/>'; |
|
241 | 241 | |
242 | 242 | } |
243 | 243 | } |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | jQuery("#addtag iframe").contents().find("body").html(''); |
269 | 269 | jQuery('#addtag [rel="ct_cat_default_img"]').removeClass('at-delete_image_button').addClass('at-upload_image_button'); |
270 | 270 | jQuery('#addtag [rel="ct_cat_icon"]').removeClass('at-delete_image_button').addClass('at-upload_image_button'); |
271 | - jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image','geodirectory');?>'); |
|
272 | - jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image','geodirectory');?>'); |
|
271 | + jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image', 'geodirectory'); ?>'); |
|
272 | + jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image', 'geodirectory'); ?>'); |
|
273 | 273 | } |
274 | 274 | }, 1000); |
275 | 275 |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $this->add_missed_values(); |
114 | 114 | if (isset($meta_box['use_with_theme'])) |
115 | 115 | if ($meta_box['use_with_theme'] === true) { |
116 | - $this->SelfPath = get_stylesheet_directory_uri() . '/library/cat-meta'; |
|
116 | + $this->SelfPath = get_stylesheet_directory_uri().'/library/cat-meta'; |
|
117 | 117 | } elseif ($meta_box['use_with_theme'] === false) { |
118 | 118 | $this->SelfPath = plugins_url('cat-meta-functions', plugin_basename(dirname(__FILE__))); |
119 | 119 | } else { |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $li = "<li id='item_{$attachment_id}'>"; |
263 | 263 | $li .= "<img src='{$attachment['url']}' alt='image_{$attachment_id}' />"; |
264 | 264 | //$li .= "<a title='" . __( 'Delete this image' ) . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'>" . __( 'Delete' ) . "</a>"; |
265 | - $li .= "<a title='" . __('Remove this image', 'geodirectory') . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'><img src='" . $this->SelfPath . "/images/delete-16.png' alt='" . __('Remove', 'geodirectory') . "' /></a>"; |
|
265 | + $li .= "<a title='".__('Remove this image', 'geodirectory')."' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'><img src='".$this->SelfPath."/images/delete-16.png' alt='".__('Remove', 'geodirectory')."' /></a>"; |
|
266 | 266 | $li .= "<input type='hidden' name='{$id}[]' value='{$attachment_id}' />"; |
267 | 267 | $li .= "</li>"; |
268 | 268 | $html .= $li; |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $attachment_id = isset($_GET['attachment_id']) ? intval($_GET['attachment_id']) : 0; |
336 | 336 | $ok = false; |
337 | 337 | if (strpos($field_id, '[') === false) { |
338 | - check_admin_referer("at-delete-mupload_" . urldecode($field_id)); |
|
338 | + check_admin_referer("at-delete-mupload_".urldecode($field_id)); |
|
339 | 339 | if ($term_id > 0) |
340 | 340 | $this->delete_tax_meta($term_id, $field_id); |
341 | 341 | //$ok = wp_delete_attachment( $attachment_id ); |
@@ -423,8 +423,8 @@ discard block |
||
423 | 423 | |
424 | 424 | if ($this->has_field('date') && $this->is_edit_page()) { |
425 | 425 | // Enqueu JQuery UI, use proper version. |
426 | - wp_enqueue_style('tmc-jquery-ui-css', 'http://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css'); |
|
427 | - wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery')); |
|
426 | + wp_enqueue_style('tmc-jquery-ui-css', 'http://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/themes/base/jquery-ui.css'); |
|
427 | + wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/jquery-ui.min.js', array('jquery')); |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | } |
@@ -441,8 +441,8 @@ discard block |
||
441 | 441 | if ($this->has_field('time') && $this->is_edit_page()) { |
442 | 442 | |
443 | 443 | // Enqueu JQuery UI, use proper version. |
444 | - wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css', array(), false, true); |
|
445 | - wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery'), false, true); |
|
444 | + wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/themes/base/jquery-ui.css', array(), false, true); |
|
445 | + wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/jquery-ui.min.js', array('jquery'), false, true); |
|
446 | 446 | wp_enqueue_script('at-timepicker', 'https://github.com/trentrichardson/jQuery-Timepicker-Addon/raw/master/jquery-ui-timepicker-addon.js', array('tmc-jquery-ui'), false, true); |
447 | 447 | |
448 | 448 | } |
@@ -462,13 +462,13 @@ discard block |
||
462 | 462 | if (!empty($this->_meta_box['pages'])) { |
463 | 463 | foreach ($this->_meta_box['pages'] as $page) { |
464 | 464 | //add fields to edit form |
465 | - add_action($page . '_edit_form_fields', array(&$this, 'show_edit_form')); |
|
465 | + add_action($page.'_edit_form_fields', array(&$this, 'show_edit_form')); |
|
466 | 466 | //add fields to add new form |
467 | - add_action($page . '_add_form_fields', array(&$this, 'show_new_form')); |
|
467 | + add_action($page.'_add_form_fields', array(&$this, 'show_new_form')); |
|
468 | 468 | // this saves the edit fields |
469 | - add_action('edited_' . $page, array(&$this, 'save'), 10, 2); |
|
469 | + add_action('edited_'.$page, array(&$this, 'save'), 10, 2); |
|
470 | 470 | // this saves the add fields |
471 | - add_action('created_' . $page, array(&$this, 'save'), 10, 2); |
|
471 | + add_action('created_'.$page, array(&$this, 'save'), 10, 2); |
|
472 | 472 | } |
473 | 473 | } |
474 | 474 | |
@@ -517,13 +517,13 @@ discard block |
||
517 | 517 | $meta = is_array($meta) ? array_map('esc_attr', $meta) : esc_attr($meta); |
518 | 518 | |
519 | 519 | if ($field['validate_func']) { |
520 | - echo '<tr class="form-field form-required ' . $field['style'] . '">'; |
|
520 | + echo '<tr class="form-field form-required '.$field['style'].'">'; |
|
521 | 521 | } else { |
522 | - echo '<tr class="form-field ' . $field['style'] . '">'; |
|
522 | + echo '<tr class="form-field '.$field['style'].'">'; |
|
523 | 523 | } |
524 | 524 | |
525 | 525 | // Call Separated methods for displaying each type of field. |
526 | - call_user_func(array(&$this, 'show_field_' . $field['type']), $field, $meta); |
|
526 | + call_user_func(array(&$this, 'show_field_'.$field['type']), $field, $meta); |
|
527 | 527 | echo '</tr>'; |
528 | 528 | } |
529 | 529 | echo '</table>'; |
@@ -550,14 +550,14 @@ discard block |
||
550 | 550 | foreach ($meta as $me) { |
551 | 551 | //for labling toggles |
552 | 552 | $mmm = $me[$field['fields'][0]['id']]; |
553 | - echo '<div class="at-repater-block">' . $mmm . '<br/><table class="repeater-table" style="display: none;">'; |
|
553 | + echo '<div class="at-repater-block">'.$mmm.'<br/><table class="repeater-table" style="display: none;">'; |
|
554 | 554 | if ($field['inline']) { |
555 | 555 | echo '<tr class="at-inline" VALIGN="top">'; |
556 | 556 | } |
557 | 557 | foreach ($field['fields'] as $f) { |
558 | 558 | //reset var $id for repeater |
559 | 559 | $id = ''; |
560 | - $id = $field['id'] . '[' . $c . '][' . $f['id'] . ']'; |
|
560 | + $id = $field['id'].'['.$c.']['.$f['id'].']'; |
|
561 | 561 | $m = $me[$f['id']]; |
562 | 562 | $m = ($m !== '') ? $m : $f['std']; |
563 | 563 | if ('image' != $f['type'] && $f['type'] != 'repeater') |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | if (!$field['inline']) { |
568 | 568 | echo '<tr>'; |
569 | 569 | } |
570 | - call_user_func(array(&$this, 'show_field_' . $f['type']), $f, $m); |
|
570 | + call_user_func(array(&$this, 'show_field_'.$f['type']), $f, $m); |
|
571 | 571 | if (!$field['inline']) { |
572 | 572 | echo '</tr>'; |
573 | 573 | } |
@@ -578,18 +578,18 @@ discard block |
||
578 | 578 | echo '</table> |
579 | 579 | <span class="at-re-toggle"><img src="'; |
580 | 580 | if ($this->_Local_images) { |
581 | - echo $plugin_path . '/images/edit.png'; |
|
581 | + echo $plugin_path.'/images/edit.png'; |
|
582 | 582 | } else { |
583 | 583 | echo 'http://i.imgur.com/ka0E2.png'; |
584 | 584 | } |
585 | 585 | echo '" alt="Edit" title="Edit"/></span> |
586 | 586 | <img src="'; |
587 | 587 | if ($this->_Local_images) { |
588 | - echo $plugin_path . '/images/remove.png'; |
|
588 | + echo $plugin_path.'/images/remove.png'; |
|
589 | 589 | } else { |
590 | 590 | echo 'http://i.imgur.com/g8Duj.png'; |
591 | 591 | } |
592 | - echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>'; |
|
592 | + echo '" alt="'.__('Remove', 'geodirectory').'" title="'.__('Remove', 'geodirectory').'" id="remove-'.$field['id'].'"></div>'; |
|
593 | 593 | $c = $c + 1; |
594 | 594 | |
595 | 595 | } |
@@ -598,11 +598,11 @@ discard block |
||
598 | 598 | |
599 | 599 | echo '<img src="'; |
600 | 600 | if ($this->_Local_images) { |
601 | - echo $plugin_path . '/images/add.png'; |
|
601 | + echo $plugin_path.'/images/add.png'; |
|
602 | 602 | } else { |
603 | 603 | echo 'http://i.imgur.com/w5Tuc.png'; |
604 | 604 | } |
605 | - echo '" alt="' . __('Add', 'geodirectory') . '" title="' . __('Add', 'geodirectory') . '" id="add-' . $field['id'] . '"><br/></div>'; |
|
605 | + echo '" alt="'.__('Add', 'geodirectory').'" title="'.__('Add', 'geodirectory').'" id="add-'.$field['id'].'"><br/></div>'; |
|
606 | 606 | |
607 | 607 | //create all fields once more for js function and catch with object buffer |
608 | 608 | ob_start(); |
@@ -613,12 +613,12 @@ discard block |
||
613 | 613 | foreach ($field['fields'] as $f) { |
614 | 614 | //reset var $id for repeater |
615 | 615 | $id = ''; |
616 | - $id = $field['id'] . '[CurrentCounter][' . $f['id'] . ']'; |
|
616 | + $id = $field['id'].'[CurrentCounter]['.$f['id'].']'; |
|
617 | 617 | $f['id'] = $id; |
618 | 618 | if (!$field['inline']) { |
619 | 619 | echo '<tr>'; |
620 | 620 | } |
621 | - call_user_func(array(&$this, 'show_field_' . $f['type']), $f, ''); |
|
621 | + call_user_func(array(&$this, 'show_field_'.$f['type']), $f, ''); |
|
622 | 622 | if (!$field['inline']) { |
623 | 623 | echo '</tr>'; |
624 | 624 | } |
@@ -628,24 +628,24 @@ discard block |
||
628 | 628 | } |
629 | 629 | echo '</table><img src="'; |
630 | 630 | if ($this->_Local_images) { |
631 | - echo $plugin_path . '/images/remove.png'; |
|
631 | + echo $plugin_path.'/images/remove.png'; |
|
632 | 632 | } else { |
633 | 633 | echo 'http://i.imgur.com/g8Duj.png'; |
634 | 634 | } |
635 | - echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>'; |
|
636 | - $counter = 'countadd_' . $field['id']; |
|
635 | + echo '" alt="'.__('Remove', 'geodirectory').'" title="'.__('Remove', 'geodirectory').'" id="remove-'.$field['id'].'"></div>'; |
|
636 | + $counter = 'countadd_'.$field['id']; |
|
637 | 637 | $js_code = ob_get_clean(); |
638 | 638 | $js_code = str_replace("'", "\"", $js_code); |
639 | - $js_code = str_replace("CurrentCounter", "' + " . $counter . " + '", $js_code); |
|
639 | + $js_code = str_replace("CurrentCounter", "' + ".$counter." + '", $js_code); |
|
640 | 640 | echo '<script> |
641 | 641 | jQuery(document).ready(function() { |
642 | - var ' . $counter . ' = ' . $c . '; |
|
643 | - jQuery("#add-' . $field['id'] . '").live(\'click\', function() { |
|
644 | - ' . $counter . ' = ' . $counter . ' + 1; |
|
645 | - jQuery(this).before(\'' . $js_code . '\'); |
|
642 | + var ' . $counter.' = '.$c.'; |
|
643 | + jQuery("#add-' . $field['id'].'").live(\'click\', function() { |
|
644 | + ' . $counter.' = '.$counter.' + 1; |
|
645 | + jQuery(this).before(\'' . $js_code.'\'); |
|
646 | 646 | update_repeater_fields(); |
647 | 647 | }); |
648 | - jQuery("#remove-' . $field['id'] . '").live(\'click\', function() { |
|
648 | + jQuery("#remove-' . $field['id'].'").live(\'click\', function() { |
|
649 | 649 | jQuery(this).parent().remove(); |
650 | 650 | }); |
651 | 651 | }); |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | public function show_field_paragraph($field) |
773 | 773 | { |
774 | 774 | //$this->show_field_begin( $field, $meta ); |
775 | - echo '<p>' . $field['value'] . '</p>'; |
|
775 | + echo '<p>'.$field['value'].'</p>'; |
|
776 | 776 | //$this->show_field_end( $field, $meta ); |
777 | 777 | } |
778 | 778 | |
@@ -803,12 +803,12 @@ discard block |
||
803 | 803 | { |
804 | 804 | |
805 | 805 | if (!is_array($meta)) |
806 | - $meta = (array)$meta; |
|
806 | + $meta = (array) $meta; |
|
807 | 807 | |
808 | 808 | $this->show_field_begin($field, $meta); |
809 | - echo "<select class='at-select' name='{$field['id']}" . ($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'") . ">"; |
|
809 | + echo "<select class='at-select' name='{$field['id']}".($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'").">"; |
|
810 | 810 | foreach ($field['options'] as $key => $value) { |
811 | - echo "<option value='{$key}'" . selected(in_array($key, $meta), true, false) . ">{$value}</option>"; |
|
811 | + echo "<option value='{$key}'".selected(in_array($key, $meta), true, false).">{$value}</option>"; |
|
812 | 812 | } |
813 | 813 | echo "</select>"; |
814 | 814 | $this->show_field_end($field, $meta); |
@@ -827,11 +827,11 @@ discard block |
||
827 | 827 | { |
828 | 828 | |
829 | 829 | if (!is_array($meta)) |
830 | - $meta = (array)$meta; |
|
830 | + $meta = (array) $meta; |
|
831 | 831 | |
832 | 832 | $this->show_field_begin($field, $meta); |
833 | 833 | foreach ($field['options'] as $key => $value) { |
834 | - echo "<input type='radio' class='at-radio' name='{$field['id']}' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> <span class='at-radio-label'>{$value}</span>"; |
|
834 | + echo "<input type='radio' class='at-radio' name='{$field['id']}' value='{$key}'".checked(in_array($key, $meta), true, false)." /> <span class='at-radio-label'>{$value}</span>"; |
|
835 | 835 | } |
836 | 836 | $this->show_field_end($field, $meta); |
837 | 837 | } |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | { |
849 | 849 | |
850 | 850 | $this->show_field_begin($field, $meta); |
851 | - echo "<input type='checkbox' class='rw-checkbox' name='{$field['id']}' id='{$field['id']}'" . checked(!empty($meta), true, false) . " /> {$field['desc']}"; |
|
851 | + echo "<input type='checkbox' class='rw-checkbox' name='{$field['id']}' id='{$field['id']}'".checked(!empty($meta), true, false)." /> {$field['desc']}"; |
|
852 | 852 | $this->show_field_end($field, $meta); |
853 | 853 | } |
854 | 854 | |
@@ -890,18 +890,18 @@ discard block |
||
890 | 890 | global $post; |
891 | 891 | |
892 | 892 | if (!is_array($meta)) |
893 | - $meta = (array)$meta; |
|
893 | + $meta = (array) $meta; |
|
894 | 894 | |
895 | 895 | $this->show_field_begin($field, $meta); |
896 | 896 | echo "{$field['desc']}<br />"; |
897 | 897 | |
898 | 898 | if (!empty($meta)) { |
899 | 899 | $nonce = wp_create_nonce('at_ajax_delete'); |
900 | - echo '<div style="margin-bottom: 10px"><strong>' . __('Uploaded files', 'geodirectory') . '</strong></div>'; |
|
900 | + echo '<div style="margin-bottom: 10px"><strong>'.__('Uploaded files', 'geodirectory').'</strong></div>'; |
|
901 | 901 | echo '<ol class="at-upload">'; |
902 | 902 | foreach ($meta as $att) { |
903 | 903 | // if (wp_attachment_is_image($att)) continue; // what's image uploader for? |
904 | - echo "<li>" . wp_get_attachment_link($att, '', false, false, ' ') . " (<a class='at-delete-file' href='#' rel='{$nonce}|{$post->ID}|{$field['id']}|{$att}'>" . __('Remove', 'geodirectory') . "</a>)</li>"; |
|
904 | + echo "<li>".wp_get_attachment_link($att, '', false, false, ' ')." (<a class='at-delete-file' href='#' rel='{$nonce}|{$post->ID}|{$field['id']}|{$att}'>".__('Remove', 'geodirectory')."</a>)</li>"; |
|
905 | 905 | } |
906 | 906 | echo '</ol>'; |
907 | 907 | } |
@@ -909,13 +909,13 @@ discard block |
||
909 | 909 | // show form upload |
910 | 910 | |
911 | 911 | echo "<div class='at-file-upload-label'>"; |
912 | - echo "<strong>" . __('Upload new files', 'geodirectory') . "</strong>"; |
|
912 | + echo "<strong>".__('Upload new files', 'geodirectory')."</strong>"; |
|
913 | 913 | echo "</div>"; |
914 | 914 | echo "<div class='new-files'>"; |
915 | 915 | echo "<div class='file-input'>"; |
916 | 916 | echo "<input type='file' name='{$field['id']}[]' />"; |
917 | 917 | echo "</div><!-- End .file-input -->"; |
918 | - echo "<a class='at-add-file button' href='#'>" . __('Add more files', 'geodirectory') . "</a>"; |
|
918 | + echo "<a class='at-add-file button' href='#'>".__('Add more files', 'geodirectory')."</a>"; |
|
919 | 919 | echo "</div><!-- End .new-files -->"; |
920 | 920 | echo "</td>"; |
921 | 921 | $this->show_field_end($field, $meta); |
@@ -932,7 +932,7 @@ discard block |
||
932 | 932 | public function show_field_image($field, $meta) |
933 | 933 | { |
934 | 934 | $this->show_field_begin($field, $meta); |
935 | - $html = wp_nonce_field("at-delete-mupload_{$field['id']}", "nonce-delete-mupload_" . $field['id'], false, false); |
|
935 | + $html = wp_nonce_field("at-delete-mupload_{$field['id']}", "nonce-delete-mupload_".$field['id'], false, false); |
|
936 | 936 | if (is_array($meta)) { |
937 | 937 | if (isset($meta[0]) && is_array($meta[0])) |
938 | 938 | $meta = $meta[0]; |
@@ -958,20 +958,20 @@ discard block |
||
958 | 958 | |
959 | 959 | $sub_dir = str_replace($uploads_baseurl, '', $sub_dir); |
960 | 960 | |
961 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
961 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
962 | 962 | |
963 | - $meta['src'] = $uploads_url . '/' . $file_name; |
|
963 | + $meta['src'] = $uploads_url.'/'.$file_name; |
|
964 | 964 | |
965 | 965 | |
966 | - $html .= "<span class='mupload_img_holder'><img src='" . $meta['src'] . "' style='max-height: 150px;max-width: 150px;' /></span>"; |
|
967 | - $html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='" . $meta['id'] . "' />"; |
|
968 | - $html .= "<input type='hidden' class='" . $field['id'] . "[src]' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='" . $meta['src'] . "' />"; |
|
969 | - $html .= "<input class='at-delete_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Remove Image', 'geodirectory') . "' />"; |
|
966 | + $html .= "<span class='mupload_img_holder'><img src='".$meta['src']."' style='max-height: 150px;max-width: 150px;' /></span>"; |
|
967 | + $html .= "<input type='hidden' name='".$field['id']."[id]' id='".$field['id']."[id]' value='".$meta['id']."' />"; |
|
968 | + $html .= "<input type='hidden' class='".$field['id']."[src]' name='".$field['id']."[src]' id='".$field['id']."[src]' value='".$meta['src']."' />"; |
|
969 | + $html .= "<input class='at-delete_image_button' type='button' rel='".$field['id']."' value='".__('Remove Image', 'geodirectory')."' />"; |
|
970 | 970 | } else { |
971 | 971 | $html .= "<span class='mupload_img_holder'></span>"; |
972 | - $html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='' />"; |
|
973 | - $html .= "<input class='" . $field['id'] . "[src]' style='position:absolute;left:-500px;width:50px;' type='text' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='' />"; |
|
974 | - $html .= "<input class='at-upload_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Upload Image', 'geodirectory') . "' />"; |
|
972 | + $html .= "<input type='hidden' name='".$field['id']."[id]' id='".$field['id']."[id]' value='' />"; |
|
973 | + $html .= "<input class='".$field['id']."[src]' style='position:absolute;left:-500px;width:50px;' type='text' name='".$field['id']."[src]' id='".$field['id']."[src]' value='' />"; |
|
974 | + $html .= "<input class='at-upload_image_button' type='button' rel='".$field['id']."' value='".__('Upload Image', 'geodirectory')."' />"; |
|
975 | 975 | } |
976 | 976 | echo $html; |
977 | 977 | $this->show_field_end($field, $meta); |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | |
996 | 996 | echo "<input class='at-color' type='text' name='{$field['id']}' id='{$field['id']}' value='{$meta}' size='8' />"; |
997 | 997 | // echo "<a href='#' class='at-color-select button' rel='{$field['id']}'>" . __( 'Select a color' ) . "</a>"; |
998 | - echo "<input type='button' class='at-color-select button' rel='{$field['id']}' value='" . __('Select a color', 'geodirectory') . "'/>"; |
|
998 | + echo "<input type='button' class='at-color-select button' rel='{$field['id']}' value='".__('Select a color', 'geodirectory')."'/>"; |
|
999 | 999 | echo "<div style='display:none' class='at-color-picker' rel='{$field['id']}'></div>"; |
1000 | 1000 | $this->show_field_end($field, $meta); |
1001 | 1001 | |
@@ -1013,14 +1013,14 @@ discard block |
||
1013 | 1013 | { |
1014 | 1014 | |
1015 | 1015 | if (!is_array($meta)) |
1016 | - $meta = (array)$meta; |
|
1016 | + $meta = (array) $meta; |
|
1017 | 1017 | |
1018 | 1018 | $this->show_field_begin($field, $meta); |
1019 | 1019 | |
1020 | 1020 | $html = array(); |
1021 | 1021 | |
1022 | 1022 | foreach ($field['options'] as $key => $value) { |
1023 | - $html[] = "<input type='checkbox' class='at-checkbox_list' name='{$field['id']}[]' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> {$value}"; |
|
1023 | + $html[] = "<input type='checkbox' class='at-checkbox_list' name='{$field['id']}[]' value='{$key}'".checked(in_array($key, $meta), true, false)." /> {$value}"; |
|
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | echo implode('<br />', $html); |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | { |
1074 | 1074 | global $post; |
1075 | 1075 | |
1076 | - if (!is_array($meta)) $meta = (array)$meta; |
|
1076 | + if (!is_array($meta)) $meta = (array) $meta; |
|
1077 | 1077 | $this->show_field_begin($field, $meta); |
1078 | 1078 | $options = $field['options']; |
1079 | 1079 | $posts = get_posts($options['args']); |
@@ -1081,13 +1081,13 @@ discard block |
||
1081 | 1081 | // checkbox_list |
1082 | 1082 | if ('checkbox_list' == $options['type']) { |
1083 | 1083 | foreach ($posts as $p) { |
1084 | - echo "<input type='checkbox' name='{$field['id']}[]' value='$p->ID'" . checked(in_array($p->ID, $meta), true, false) . " /> $p->post_title<br/>"; |
|
1084 | + echo "<input type='checkbox' name='{$field['id']}[]' value='$p->ID'".checked(in_array($p->ID, $meta), true, false)." /> $p->post_title<br/>"; |
|
1085 | 1085 | } |
1086 | 1086 | } // select |
1087 | 1087 | else { |
1088 | - echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">"; |
|
1088 | + echo "<select name='{$field['id']}".($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'").">"; |
|
1089 | 1089 | foreach ($posts as $p) { |
1090 | - echo "<option value='$p->ID'" . selected(in_array($p->ID, $meta), true, false) . ">$p->post_title</option>"; |
|
1090 | + echo "<option value='$p->ID'".selected(in_array($p->ID, $meta), true, false).">$p->post_title</option>"; |
|
1091 | 1091 | } |
1092 | 1092 | echo "</select>"; |
1093 | 1093 | } |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | { |
1112 | 1112 | global $post; |
1113 | 1113 | |
1114 | - if (!is_array($meta)) $meta = (array)$meta; |
|
1114 | + if (!is_array($meta)) $meta = (array) $meta; |
|
1115 | 1115 | $this->show_field_begin($field, $meta); |
1116 | 1116 | $options = $field['options']; |
1117 | 1117 | $terms = get_terms($options['taxonomy'], $options['args']); |
@@ -1119,13 +1119,13 @@ discard block |
||
1119 | 1119 | // checkbox_list |
1120 | 1120 | if ('checkbox_list' == $options['type']) { |
1121 | 1121 | foreach ($terms as $term) { |
1122 | - echo "<input type='checkbox' name='{$field['id']}[]' value='$term->slug'" . checked(in_array($term->slug, $meta), true, false) . " /> $term->name<br/>"; |
|
1122 | + echo "<input type='checkbox' name='{$field['id']}[]' value='$term->slug'".checked(in_array($term->slug, $meta), true, false)." /> $term->name<br/>"; |
|
1123 | 1123 | } |
1124 | 1124 | } // select |
1125 | 1125 | else { |
1126 | - echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">"; |
|
1126 | + echo "<select name='{$field['id']}".($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'").">"; |
|
1127 | 1127 | foreach ($terms as $term) { |
1128 | - echo "<option value='$term->slug'" . selected(in_array($term->slug, $meta), true, false) . ">$term->name</option>"; |
|
1128 | + echo "<option value='$term->slug'".selected(in_array($term->slug, $meta), true, false).">$term->name</option>"; |
|
1129 | 1129 | } |
1130 | 1130 | echo "</select>"; |
1131 | 1131 | } |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | |
1182 | 1182 | //$old_filename = $upload_dir['path'].'/'.$old_filename; |
1183 | 1183 | |
1184 | - $new_filename = $upload_dir['path'] . '/' . 'cat_icon_' . $term_id . '.png'; |
|
1184 | + $new_filename = $upload_dir['path'].'/'.'cat_icon_'.$term_id.'.png'; |
|
1185 | 1185 | |
1186 | 1186 | /*rename($old_filename, $new_filename); |
1187 | 1187 | |
@@ -1223,9 +1223,9 @@ discard block |
||
1223 | 1223 | if ($type != "paragraph") { |
1224 | 1224 | |
1225 | 1225 | // Call defined method to save meta value, if there's no methods, call common one. |
1226 | - $save_func = 'save_field_' . $type; |
|
1226 | + $save_func = 'save_field_'.$type; |
|
1227 | 1227 | if (method_exists($this, $save_func)) { |
1228 | - call_user_func(array(&$this, 'save_field_' . $type), $term_id, $field, $old, $new); |
|
1228 | + call_user_func(array(&$this, 'save_field_'.$type), $term_id, $field, $old, $new); |
|
1229 | 1229 | } else { |
1230 | 1230 | $this->save_field($term_id, $field, $old, $new); |
1231 | 1231 | } |
@@ -1370,7 +1370,7 @@ discard block |
||
1370 | 1370 | if (!is_wp_error($id)) { |
1371 | 1371 | |
1372 | 1372 | wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
1373 | - add_post_meta($term_id, $name, $id, false); // save file's url in meta fields |
|
1373 | + add_post_meta($term_id, $name, $id, false); // save file's url in meta fields |
|
1374 | 1374 | |
1375 | 1375 | } // End if |
1376 | 1376 | |
@@ -1415,7 +1415,7 @@ discard block |
||
1415 | 1415 | if (!is_wp_error($id)) { |
1416 | 1416 | |
1417 | 1417 | wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
1418 | - return $id; // return file's url in meta fields |
|
1418 | + return $id; // return file's url in meta fields |
|
1419 | 1419 | } // End if |
1420 | 1420 | } // End foreach |
1421 | 1421 | } |
@@ -1430,9 +1430,9 @@ discard block |
||
1430 | 1430 | { |
1431 | 1431 | |
1432 | 1432 | // Default values for meta box |
1433 | - $this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array)$this->_meta_box); |
|
1433 | + $this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array) $this->_meta_box); |
|
1434 | 1434 | |
1435 | - if(is_array($this->_fields)) { |
|
1435 | + if (is_array($this->_fields)) { |
|
1436 | 1436 | // Default values for fields |
1437 | 1437 | foreach ($this->_fields as &$field) { |
1438 | 1438 | $multiple = in_array($field['type'], array('checkbox_list', 'file', 'image')); |
@@ -1452,7 +1452,7 @@ discard block |
||
1452 | 1452 | */ |
1453 | 1453 | public function has_field($type) |
1454 | 1454 | { |
1455 | - if(is_array($this->_fields)) { |
|
1455 | + if (is_array($this->_fields)) { |
|
1456 | 1456 | foreach ($this->_fields as $field) { |
1457 | 1457 | if ($type == $field['type']) |
1458 | 1458 | return true; |
@@ -2020,12 +2020,12 @@ discard block |
||
2020 | 2020 | $post_type = $taxObject->object_type[0]; |
2021 | 2021 | } |
2022 | 2022 | |
2023 | - if($post_type=='post'){$post_type='';} |
|
2024 | - if($post_type){$post_type = $post_type.'_';} |
|
2023 | + if ($post_type == 'post') {$post_type = ''; } |
|
2024 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2025 | 2025 | |
2026 | 2026 | $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id; |
2027 | 2027 | |
2028 | - $m = get_option('tax_meta_' . $post_type . $t_id); |
|
2028 | + $m = get_option('tax_meta_'.$post_type.$t_id); |
|
2029 | 2029 | if (isset($m[$key])) { |
2030 | 2030 | return $m[$key]; |
2031 | 2031 | } else { |
@@ -2042,15 +2042,15 @@ discard block |
||
2042 | 2042 | $post_type = $taxObject->object_type[0]; |
2043 | 2043 | } |
2044 | 2044 | |
2045 | - if($post_type=='post'){$post_type='';} |
|
2046 | - if($post_type){$post_type = $post_type.'_';} |
|
2045 | + if ($post_type == 'post') {$post_type = ''; } |
|
2046 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2047 | 2047 | |
2048 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
2048 | + $m = get_option('tax_meta_'.$post_type.$term_id); |
|
2049 | 2049 | |
2050 | 2050 | if (isset($m[$key])) { |
2051 | 2051 | unset($m[$key]); |
2052 | 2052 | } |
2053 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
2053 | + update_option('tax_meta_'.$post_type.$term_id, $m); |
|
2054 | 2054 | } |
2055 | 2055 | |
2056 | 2056 | //update meta |
@@ -2062,13 +2062,13 @@ discard block |
||
2062 | 2062 | $post_type = $taxObject->object_type[0]; |
2063 | 2063 | } |
2064 | 2064 | |
2065 | - if($post_type=='post'){$post_type='';} |
|
2066 | - if($post_type){$post_type = $post_type.'_';} |
|
2065 | + if ($post_type == 'post') {$post_type = ''; } |
|
2066 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2067 | 2067 | |
2068 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
2068 | + $m = get_option('tax_meta_'.$post_type.$term_id); |
|
2069 | 2069 | |
2070 | 2070 | $m[$key] = $value; |
2071 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
2071 | + update_option('tax_meta_'.$post_type.$term_id, $m); |
|
2072 | 2072 | |
2073 | 2073 | /** |
2074 | 2074 | * Called after the tax meta is updated. |
@@ -2103,12 +2103,12 @@ discard block |
||
2103 | 2103 | $post_type = $taxObject->object_type[0]; |
2104 | 2104 | } |
2105 | 2105 | |
2106 | - if($post_type=='post'){$post_type='';} |
|
2107 | - if($post_type){$post_type = $post_type.'_';} |
|
2106 | + if ($post_type == 'post') {$post_type = ''; } |
|
2107 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2108 | 2108 | |
2109 | 2109 | $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id; |
2110 | 2110 | |
2111 | - $m = get_option('tax_meta_' . $post_type . $t_id); |
|
2111 | + $m = get_option('tax_meta_'.$post_type.$t_id); |
|
2112 | 2112 | if (isset($m[$key])) { |
2113 | 2113 | return $m[$key]; |
2114 | 2114 | } else { |
@@ -2125,15 +2125,15 @@ discard block |
||
2125 | 2125 | $taxObject = get_taxonomy($_REQUEST['taxonomy']); |
2126 | 2126 | $post_type = $taxObject->object_type[0]; |
2127 | 2127 | |
2128 | - if($post_type=='post'){$post_type='';} |
|
2129 | - if($post_type){$post_type = $post_type.'_';} |
|
2128 | + if ($post_type == 'post') {$post_type = ''; } |
|
2129 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2130 | 2130 | |
2131 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
2131 | + $m = get_option('tax_meta_'.$post_type.$term_id); |
|
2132 | 2132 | |
2133 | 2133 | if (isset($m[$key])) { |
2134 | 2134 | unset($m[$key]); |
2135 | 2135 | } |
2136 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
2136 | + update_option('tax_meta_'.$post_type.$term_id, $m); |
|
2137 | 2137 | } |
2138 | 2138 | } |
2139 | 2139 | |
@@ -2147,13 +2147,13 @@ discard block |
||
2147 | 2147 | $post_type = $taxObject->object_type[0]; |
2148 | 2148 | } |
2149 | 2149 | |
2150 | - if($post_type=='post'){$post_type='';} |
|
2151 | - if($post_type){$post_type = $post_type.'_';} |
|
2150 | + if ($post_type == 'post') {$post_type = ''; } |
|
2151 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2152 | 2152 | |
2153 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
2153 | + $m = get_option('tax_meta_'.$post_type.$term_id); |
|
2154 | 2154 | |
2155 | 2155 | $m[$key] = $value; |
2156 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
2156 | + update_option('tax_meta_'.$post_type.$term_id, $m); |
|
2157 | 2157 | |
2158 | 2158 | /** This action is documented in geodirectory-functions/cat-meta-functions/Tax-meta-class.php */ |
2159 | 2159 | do_action('gd_tax_meta_updated', false, true, $term_id, $post_type); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | function geodir_get_admin_option_form($current_tab) |
64 | 64 | { |
65 | - geodir_admin_option_form($current_tab);// defined in admin template tags.php |
|
65 | + geodir_admin_option_form($current_tab); // defined in admin template tags.php |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | add_action('geodir_update_options_compatibility_settings', 'geodir_update_options_compatibility_settings'); |
71 | 71 | add_action('geodir_update_options_default_location_settings', 'geodir_location_form_submit'); |
72 | 72 | add_action('geodir_before_admin_panel', 'geodir_before_admin_panel'); // this function is in admin_functions.php |
73 | -add_action('geodir_before_update_options', 'geodir_before_update_options',10,2); |
|
73 | +add_action('geodir_before_update_options', 'geodir_before_update_options', 10, 2); |
|
74 | 74 | |
75 | 75 | //add_action('geodir_before_admin_panel', 'geodir_autoinstall_admin_header'); |
76 | 76 | |
@@ -226,9 +226,9 @@ discard block |
||
226 | 226 | |
227 | 227 | // Filter-Payment-Manager |
228 | 228 | |
229 | - add_meta_box('geodir_post_images', $post_typename . ' ' . __('Attachments', 'geodirectory'), 'geodir_post_attachments', $geodir_posttype, 'side'); |
|
229 | + add_meta_box('geodir_post_images', $post_typename.' '.__('Attachments', 'geodirectory'), 'geodir_post_attachments', $geodir_posttype, 'side'); |
|
230 | 230 | |
231 | - add_meta_box('geodir_post_info', $post_typename . ' ' . __('Information', 'geodirectory'), 'geodir_post_info_setting', $geodir_posttype, 'normal', 'high'); |
|
231 | + add_meta_box('geodir_post_info', $post_typename.' '.__('Information', 'geodirectory'), 'geodir_post_info_setting', $geodir_posttype, 'normal', 'high'); |
|
232 | 232 | |
233 | 233 | // no need of this box as all fields moved to main information box |
234 | 234 | //add_meta_box( 'geodir_post_addinfo', $post_typename. ' ' .__('Additional Information' , 'geodirectory'), 'geodir_post_addinfo_setting', $geodir_posttype,'normal', 'high' ); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | } |
239 | 239 | |
240 | -add_action('save_post', 'geodir_post_information_save',10,2); |
|
240 | +add_action('save_post', 'geodir_post_information_save', 10, 2); |
|
241 | 241 | |
242 | 242 | |
243 | 243 | |
@@ -264,10 +264,10 @@ discard block |
||
264 | 264 | |
265 | 265 | $gd_taxonomy = geodir_get_taxonomies($geodir_post_type); |
266 | 266 | |
267 | - if(!empty($gd_taxonomy)) { |
|
267 | + if (!empty($gd_taxonomy)) { |
|
268 | 268 | foreach ($gd_taxonomy as $tax) { |
269 | 269 | |
270 | - remove_meta_box($tax . 'div', $geodir_post_type, 'normal'); |
|
270 | + remove_meta_box($tax.'div', $geodir_post_type, 'normal'); |
|
271 | 271 | |
272 | 272 | } |
273 | 273 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | global $wpdb; |
417 | 417 | $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place'; |
418 | 418 | ?> |
419 | - <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/> |
|
419 | + <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type; ?>"/> |
|
420 | 420 | <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>"/> |
421 | 421 | <ul> |
422 | 422 | <?php |
@@ -427,18 +427,18 @@ discard block |
||
427 | 427 | |
428 | 428 | $check_html_variable = $wpdb->get_var( |
429 | 429 | $wpdb->prepare( |
430 | - "SELECT htmlvar_name FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name = %s AND post_type = %s AND field_type=%s", |
|
430 | + "SELECT htmlvar_name FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE htmlvar_name = %s AND post_type = %s AND field_type=%s", |
|
431 | 431 | array($val['htmlvar_name'], $listing_type, $val['field_type']) |
432 | 432 | ) |
433 | 433 | ); |
434 | 434 | |
435 | 435 | $display = $check_html_variable ? ' style="display:none;"' : ''; |
436 | 436 | ?> |
437 | - <li <?php echo $display;?>> |
|
438 | - <a id="gt-<?php echo $val['field_type'];?>-_-<?php echo $val['htmlvar_name'];?>" |
|
439 | - title="<?php echo $val['site_title'];?>" |
|
440 | - class="gt-draggable-form-items gt-<?php echo $val['field_type'];?> geodir-sort-<?php echo $val['htmlvar_name'];?>" |
|
441 | - href="javascript:void(0);"><b></b><?php _e($val['site_title'], 'geodirectory');?></a> |
|
437 | + <li <?php echo $display; ?>> |
|
438 | + <a id="gt-<?php echo $val['field_type']; ?>-_-<?php echo $val['htmlvar_name']; ?>" |
|
439 | + title="<?php echo $val['site_title']; ?>" |
|
440 | + class="gt-draggable-form-items gt-<?php echo $val['field_type']; ?> geodir-sort-<?php echo $val['htmlvar_name']; ?>" |
|
441 | + href="javascript:void(0);"><b></b><?php _e($val['site_title'], 'geodirectory'); ?></a> |
|
442 | 442 | </li> |
443 | 443 | <?php |
444 | 444 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | <?php |
464 | 464 | global $wpdb; |
465 | 465 | |
466 | - $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type = %s AND field_type != 'address' ORDER BY sort_order ASC", array($listing_type))); |
|
466 | + $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE post_type = %s AND field_type != 'address' ORDER BY sort_order ASC", array($listing_type))); |
|
467 | 467 | |
468 | 468 | if (!empty($fields)) { |
469 | 469 | foreach ($fields as $field) { |
@@ -492,39 +492,39 @@ discard block |
||
492 | 492 | { |
493 | 493 | $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place'; |
494 | 494 | ?> |
495 | - <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/> |
|
495 | + <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type; ?>"/> |
|
496 | 496 | <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>"/> |
497 | 497 | <ul class="full"> |
498 | - <li><a id="gt-fieldset" class="gt-draggable-form-items gt-fieldset" href="javascript:void(0);"><?php _e('Fieldset', 'geodirectory');?></a></li> |
|
498 | + <li><a id="gt-fieldset" class="gt-draggable-form-items gt-fieldset" href="javascript:void(0);"><?php _e('Fieldset', 'geodirectory'); ?></a></li> |
|
499 | 499 | </ul> |
500 | 500 | <ul> |
501 | 501 | <li><a id="gt-text" class="gt-draggable-form-items gt-text" |
502 | - href="javascript:void(0);"><b></b><?php _e('Text', 'geodirectory');?></a></li> |
|
502 | + href="javascript:void(0);"><b></b><?php _e('Text', 'geodirectory'); ?></a></li> |
|
503 | 503 | <li><a id="gt-datepicker" class="gt-draggable-form-items gt-datepicker" |
504 | - href="javascript:void(0);"><b></b><?php _e('Date', 'geodirectory');?></a></li> |
|
504 | + href="javascript:void(0);"><b></b><?php _e('Date', 'geodirectory'); ?></a></li> |
|
505 | 505 | <li><a id="gt-textarea" class="gt-draggable-form-items gt-textarea" |
506 | - href="javascript:void(0);"><b></b><?php _e('Textarea', 'geodirectory');?></a></li> |
|
506 | + href="javascript:void(0);"><b></b><?php _e('Textarea', 'geodirectory'); ?></a></li> |
|
507 | 507 | <li><a id="gt-time" class="gt-draggable-form-items gt-time" |
508 | - href="javascript:void(0);"><b></b><?php _e('Time', 'geodirectory');?></a></li> |
|
508 | + href="javascript:void(0);"><b></b><?php _e('Time', 'geodirectory'); ?></a></li> |
|
509 | 509 | <li><a id="gt-checkbox" class="gt-draggable-form-items gt-checkbox" |
510 | - href="javascript:void(0);"><b></b><?php _e('Checkbox', 'geodirectory');?></a></li> |
|
510 | + href="javascript:void(0);"><b></b><?php _e('Checkbox', 'geodirectory'); ?></a></li> |
|
511 | 511 | <li><a id="gt-phone" class="gt-draggable-form-items gt-phone" |
512 | - href="javascript:void(0);"><b></b><?php _e('Phone', 'geodirectory');?></a></li> |
|
512 | + href="javascript:void(0);"><b></b><?php _e('Phone', 'geodirectory'); ?></a></li> |
|
513 | 513 | <li><a id="gt-radio" class="gt-draggable-form-items gt-radio" |
514 | - href="javascript:void(0);"><b></b><?php _e('Radio', 'geodirectory');?></a></li> |
|
514 | + href="javascript:void(0);"><b></b><?php _e('Radio', 'geodirectory'); ?></a></li> |
|
515 | 515 | <li><a id="gt-email" class="gt-draggable-form-items gt-email" |
516 | - href="javascript:void(0);"><b></b><?php _e('Email', 'geodirectory');?></a></li> |
|
516 | + href="javascript:void(0);"><b></b><?php _e('Email', 'geodirectory'); ?></a></li> |
|
517 | 517 | <li><a id="gt-select" class="gt-draggable-form-items gt-select" |
518 | - href="javascript:void(0);"><b></b><?php _e('Select', 'geodirectory');?></a></li> |
|
519 | - <!--<li><a id="gt-taxonomy" class="gt-draggable-form-items gt-select" href="javascript:void(0);"><b></b><?php _e('Taxonomy', 'geodirectory');?></a></li>--> |
|
518 | + href="javascript:void(0);"><b></b><?php _e('Select', 'geodirectory'); ?></a></li> |
|
519 | + <!--<li><a id="gt-taxonomy" class="gt-draggable-form-items gt-select" href="javascript:void(0);"><b></b><?php _e('Taxonomy', 'geodirectory'); ?></a></li>--> |
|
520 | 520 | <li><a id="gt-multiselect" class="gt-draggable-form-items gt-multiselect" |
521 | - href="javascript:void(0);"><b></b><?php _e('Multi Select', 'geodirectory');?></a></li> |
|
521 | + href="javascript:void(0);"><b></b><?php _e('Multi Select', 'geodirectory'); ?></a></li> |
|
522 | 522 | <li><a id="gt-url" class="gt-draggable-form-items gt-url" |
523 | - href="javascript:void(0);"><b></b><?php _e('URL', 'geodirectory');?></a></li> |
|
523 | + href="javascript:void(0);"><b></b><?php _e('URL', 'geodirectory'); ?></a></li> |
|
524 | 524 | <li><a id="gt-html" class="gt-draggable-form-items gt-html" |
525 | - href="javascript:void(0);"><b></b><?php _e('HTML', 'geodirectory');?></a></li> |
|
525 | + href="javascript:void(0);"><b></b><?php _e('HTML', 'geodirectory'); ?></a></li> |
|
526 | 526 | <li><a id="gt-file" class="gt-draggable-form-items gt-file" |
527 | - href="javascript:void(0);"><b></b><?php _e('File Upload', 'geodirectory');?></a></li> |
|
527 | + href="javascript:void(0);"><b></b><?php _e('File Upload', 'geodirectory'); ?></a></li> |
|
528 | 528 | |
529 | 529 | </ul> |
530 | 530 | |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | <ul class="core"> |
549 | 549 | <?php |
550 | 550 | global $wpdb; |
551 | - $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type = %s ORDER BY sort_order ASC", array($listing_type))); |
|
551 | + $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type = %s ORDER BY sort_order ASC", array($listing_type))); |
|
552 | 552 | |
553 | 553 | if (!empty($fields)) { |
554 | 554 | foreach ($fields as $field) { |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | |
636 | 636 | switch ($sub_tab) { |
637 | 637 | case 'custom_fields': |
638 | - $note = sprintf(__('Click on any box below to add a field of that type on add %s listing form. You must be use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type));; |
|
638 | + $note = sprintf(__('Click on any box below to add a field of that type on add %s listing form. You must be use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type)); ; |
|
639 | 639 | break; |
640 | 640 | |
641 | 641 | case 'sorting_options': |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | |
690 | 690 | switch ($sub_tab) { |
691 | 691 | case 'custom_fields': |
692 | - $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type));; |
|
692 | + $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type)); ; |
|
693 | 693 | break; |
694 | 694 | |
695 | 695 | case 'sorting_options': |
@@ -716,8 +716,8 @@ discard block |
||
716 | 716 | |
717 | 717 | if (!get_option('geodir_remove_unnecessary_fields')) { |
718 | 718 | |
719 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $plugin_prefix . "gd_place_detail WHERE field = 'categories'")) |
|
720 | - $wpdb->query("ALTER TABLE `" . $plugin_prefix . "gd_place_detail` DROP `categories`"); |
|
719 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$plugin_prefix."gd_place_detail WHERE field = 'categories'")) |
|
720 | + $wpdb->query("ALTER TABLE `".$plugin_prefix."gd_place_detail` DROP `categories`"); |
|
721 | 721 | |
722 | 722 | update_option('geodir_remove_unnecessary_fields', '1'); |
723 | 723 | |
@@ -745,14 +745,14 @@ discard block |
||
745 | 745 | case 'diagnosis' : |
746 | 746 | if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '') |
747 | 747 | $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']); |
748 | - call_user_func('geodir_diagnose_' . $diagnose_this); |
|
748 | + call_user_func('geodir_diagnose_'.$diagnose_this); |
|
749 | 749 | exit(); |
750 | 750 | break; |
751 | 751 | |
752 | 752 | case 'diagnosis-fix' : |
753 | 753 | if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '') |
754 | 754 | $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']); |
755 | - call_user_func('geodir_diagnose_' . $diagnose_this); |
|
755 | + call_user_func('geodir_diagnose_'.$diagnose_this); |
|
756 | 756 | exit(); |
757 | 757 | break; |
758 | 758 | } |
@@ -777,50 +777,50 @@ discard block |
||
777 | 777 | { |
778 | 778 | global $wpdb; |
779 | 779 | //$filter_arr['output_str'] .='###'.$table.'###'; |
780 | - if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0) { |
|
781 | - $filter_arr['output_str'] .= "<li>" . __('ERROR: You did not follow instructions! Now you will need to contact support to manually fix things.', 'geodirectory') . "</li>"; |
|
780 | + if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak2'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") > 0) { |
|
781 | + $filter_arr['output_str'] .= "<li>".__('ERROR: You did not follow instructions! Now you will need to contact support to manually fix things.', 'geodirectory')."</li>"; |
|
782 | 782 | $filter_arr['is_error_during_diagnose'] = true; |
783 | 783 | |
784 | - } elseif ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) { |
|
785 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s_ms_bak table found', 'geodirectory'), $tabel_name) . "</li>"; |
|
784 | + } elseif ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") > 0) { |
|
785 | + $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: %s_ms_bak table found', 'geodirectory'), $tabel_name)."</li>"; |
|
786 | 786 | $filter_arr['is_error_during_diagnose'] = true; |
787 | - $filter_arr['output_str'] .= "<li>" . __('IMPORTANT: This can be caused by out of date core or addons, please update core + addons before trying the fix OR YOU WILL HAVE A BAD TIME!', 'geodirectory') . "</li>"; |
|
787 | + $filter_arr['output_str'] .= "<li>".__('IMPORTANT: This can be caused by out of date core or addons, please update core + addons before trying the fix OR YOU WILL HAVE A BAD TIME!', 'geodirectory')."</li>"; |
|
788 | 788 | $filter_arr['is_error_during_diagnose'] = true; |
789 | 789 | |
790 | 790 | if ($fix) { |
791 | - $ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $table . "_ms_bak");// get backup table count |
|
792 | - $new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table");// get new table count |
|
791 | + $ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$table."_ms_bak"); // get backup table count |
|
792 | + $new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."$table"); // get new table count |
|
793 | 793 | |
794 | 794 | if ($ms_bak_count == $new_table_count) {// if they are the same count rename to bak2 |
795 | 795 | //$filter_arr['output_str'] .= "<li>".sprintf( __('-->PROBLEM: %s table count is the same as new table, contact support' , 'geodirectory'), $table )."</li>" ; |
796 | 796 | |
797 | - $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename bak table to new table |
|
797 | + $wpdb->query("RENAME TABLE ".$table."_ms_bak TO ".$table."_ms_bak2"); // rename bak table to new table |
|
798 | 798 | |
799 | - if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) { |
|
800 | - $filter_arr['output_str'] .= "<li>" . __('-->FIXED: Renamed and backed up the tables', 'geodirectory') . "</li>"; |
|
799 | + if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") == 0) { |
|
800 | + $filter_arr['output_str'] .= "<li>".__('-->FIXED: Renamed and backed up the tables', 'geodirectory')."</li>"; |
|
801 | 801 | } else { |
802 | - $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>"; |
|
802 | + $filter_arr['output_str'] .= "<li>".__('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory')."</li>"; |
|
803 | 803 | } |
804 | 804 | |
805 | 805 | } elseif ($ms_bak_count > $new_table_count) {//if backup is greater then restore it |
806 | 806 | |
807 | - $wpdb->query("RENAME TABLE " . $wpdb->prefix . "$table TO " . $table . "_ms_bak2");// rename new table to bak2 |
|
808 | - $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $wpdb->prefix . "$table");// rename bak table to new table |
|
807 | + $wpdb->query("RENAME TABLE ".$wpdb->prefix."$table TO ".$table."_ms_bak2"); // rename new table to bak2 |
|
808 | + $wpdb->query("RENAME TABLE ".$table."_ms_bak TO ".$wpdb->prefix."$table"); // rename bak table to new table |
|
809 | 809 | |
810 | - if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") && $wpdb->query("SHOW TABLES LIKE '$table'") == 0) { |
|
811 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: restored largest table %s', 'geodirectory'), $table) . "</li>"; |
|
810 | + if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") && $wpdb->query("SHOW TABLES LIKE '$table'") == 0) { |
|
811 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: restored largest table %s', 'geodirectory'), $table)."</li>"; |
|
812 | 812 | } else { |
813 | - $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>"; |
|
813 | + $filter_arr['output_str'] .= "<li>".__('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory')."</li>"; |
|
814 | 814 | } |
815 | 815 | |
816 | 816 | } elseif ($new_table_count > $ms_bak_count) {// we cant do much so rename the table to stop errors |
817 | 817 | |
818 | - $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename ms_bak table to ms_bak2 |
|
818 | + $wpdb->query("RENAME TABLE ".$table."_ms_bak TO ".$table."_ms_bak2"); // rename ms_bak table to ms_bak2 |
|
819 | 819 | |
820 | - if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) { |
|
821 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: table %s_ms_bak renamed and backed up', 'geodirectory'), $table) . "</li>"; |
|
820 | + if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") == 0) { |
|
821 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: table %s_ms_bak renamed and backed up', 'geodirectory'), $table)."</li>"; |
|
822 | 822 | } else { |
823 | - $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>"; |
|
823 | + $filter_arr['output_str'] .= "<li>".__('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory')."</li>"; |
|
824 | 824 | } |
825 | 825 | |
826 | 826 | } |
@@ -828,54 +828,54 @@ discard block |
||
828 | 828 | } |
829 | 829 | |
830 | 830 | |
831 | - } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) { |
|
832 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: Two %s tables found', 'geodirectory'), $tabel_name) . "</li>"; |
|
831 | + } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") > 0) { |
|
832 | + $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: Two %s tables found', 'geodirectory'), $tabel_name)."</li>"; |
|
833 | 833 | $filter_arr['is_error_during_diagnose'] = true; |
834 | 834 | |
835 | 835 | if ($fix) { |
836 | 836 | if ($wpdb->get_var("SELECT COUNT(*) FROM $table") == 0) {// if first table is empty just delete it |
837 | 837 | if ($wpdb->query("DROP TABLE IF EXISTS $table")) { |
838 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $table) . "</li>"; |
|
838 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $table)."</li>"; |
|
839 | 839 | } else { |
840 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $table) . "</li>"; |
|
840 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $table)."</li>"; |
|
841 | 841 | } |
842 | 842 | |
843 | - } elseif ($wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table") == 0) {// if main table is empty but original is not, delete main and rename original |
|
844 | - if ($wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "$table")) { |
|
845 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $wpdb->prefix . $table) . "</li>"; |
|
843 | + } elseif ($wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."$table") == 0) {// if main table is empty but original is not, delete main and rename original |
|
844 | + if ($wpdb->query("DROP TABLE IF EXISTS ".$wpdb->prefix."$table")) { |
|
845 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $wpdb->prefix.$table)."</li>"; |
|
846 | 846 | } else { |
847 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $wpdb->prefix . $table) . "</li>"; |
|
847 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $wpdb->prefix.$table)."</li>"; |
|
848 | 848 | } |
849 | - if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) { |
|
850 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>"; |
|
849 | + if ($wpdb->query("RENAME TABLE $table TO ".$wpdb->prefix."$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) { |
|
850 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>"; |
|
851 | 851 | } else { |
852 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>"; |
|
852 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>"; |
|
853 | 853 | } |
854 | 854 | } else {// else rename the original table to _ms_bak |
855 | - if ($wpdb->query("RENAME TABLE $table TO " . $table . "_ms_bak") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) { |
|
856 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table contained info so we renamed %s to %s incase it is needed in future', 'geodirectory'), $table, $table . "_ms_bak") . "</li>"; |
|
855 | + if ($wpdb->query("RENAME TABLE $table TO ".$table."_ms_bak") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) { |
|
856 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Table contained info so we renamed %s to %s incase it is needed in future', 'geodirectory'), $table, $table."_ms_bak")."</li>"; |
|
857 | 857 | } else { |
858 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Table %s could not be renamed to %s, this table has info so may need to be reviewed manually in the DB', 'geodirectory'), $table, $table . "_ms_bak") . "</li>"; |
|
858 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Table %s could not be renamed to %s, this table has info so may need to be reviewed manually in the DB', 'geodirectory'), $table, $table."_ms_bak")."</li>"; |
|
859 | 859 | } |
860 | 860 | } |
861 | 861 | } |
862 | 862 | |
863 | - } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) { |
|
864 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table not converted', 'geodirectory'), $tabel_name) . "</li>"; |
|
863 | + } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") == 0) { |
|
864 | + $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: %s table not converted', 'geodirectory'), $tabel_name)."</li>"; |
|
865 | 865 | $filter_arr['is_error_during_diagnose'] = true; |
866 | 866 | |
867 | 867 | if ($fix) { |
868 | 868 | // if original table exists but new does not, rename |
869 | - if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) { |
|
870 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>"; |
|
869 | + if ($wpdb->query("RENAME TABLE $table TO ".$wpdb->prefix."$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) { |
|
870 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>"; |
|
871 | 871 | } else { |
872 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>"; |
|
872 | + $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>"; |
|
873 | 873 | } |
874 | 874 | |
875 | 875 | } |
876 | 876 | |
877 | - } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") == 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) { |
|
878 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table does not exist', 'geodirectory'), $tabel_name) . "</li>"; |
|
877 | + } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") == 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") == 0) { |
|
878 | + $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: %s table does not exist', 'geodirectory'), $tabel_name)."</li>"; |
|
879 | 879 | $filter_arr['is_error_during_diagnose'] = true; |
880 | 880 | |
881 | 881 | if ($fix) { |
@@ -889,11 +889,11 @@ discard block |
||
889 | 889 | delete_option('geodir_custom_posts_db_version'); |
890 | 890 | delete_option('geodir_reviewratings_db_version'); |
891 | 891 | delete_option('geodiradvancesearch_db_version'); |
892 | - $filter_arr['output_str'] .= "<li>" . __('-->TRY: Please refresh page to run table install functions', 'geodirectory') . "</li>"; |
|
892 | + $filter_arr['output_str'] .= "<li>".__('-->TRY: Please refresh page to run table install functions', 'geodirectory')."</li>"; |
|
893 | 893 | } |
894 | 894 | |
895 | 895 | } else { |
896 | - $filter_arr['output_str'] .= "<li>" . sprintf(__('%s table converted correctly', 'geodirectory'), $tabel_name) . "</li>"; |
|
896 | + $filter_arr['output_str'] .= "<li>".sprintf(__('%s table converted correctly', 'geodirectory'), $tabel_name)."</li>"; |
|
897 | 897 | } |
898 | 898 | return $filter_arr; |
899 | 899 | } |
@@ -922,23 +922,23 @@ discard block |
||
922 | 922 | if (!empty($all_postypes)) { |
923 | 923 | foreach ($all_postypes as $key) { |
924 | 924 | // update each GD CPT |
925 | - $posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
925 | + $posts = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."geodir_".$key."_detail d"); |
|
926 | 926 | |
927 | 927 | if (!empty($posts)) { |
928 | 928 | |
929 | 929 | foreach ($posts as $p) { |
930 | 930 | $p->post_type = $key; |
931 | - $raw_tags = wp_get_object_terms($p->post_id, $p->post_type . '_tags', array('fields' => 'names')); |
|
931 | + $raw_tags = wp_get_object_terms($p->post_id, $p->post_type.'_tags', array('fields' => 'names')); |
|
932 | 932 | if (empty($raw_tags)) { |
933 | 933 | $post_tags = ''; |
934 | 934 | } else { |
935 | 935 | $post_tags = implode(",", $raw_tags); |
936 | 936 | } |
937 | - $tablename = $plugin_prefix . $p->post_type . '_detail'; |
|
938 | - $wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET post_tags=%s WHERE post_id =%d", $post_tags, $p->post_id)); |
|
937 | + $tablename = $plugin_prefix.$p->post_type.'_detail'; |
|
938 | + $wpdb->query($wpdb->prepare("UPDATE ".$tablename." SET post_tags=%s WHERE post_id =%d", $post_tags, $p->post_id)); |
|
939 | 939 | |
940 | 940 | } |
941 | - $output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>"; |
|
941 | + $output_str .= "<li>".$key.__(': Done', 'geodirectory')."</li>"; |
|
942 | 942 | } |
943 | 943 | |
944 | 944 | } |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | |
948 | 948 | if ($is_error_during_diagnose) { |
949 | 949 | $info_div_class = "geodir_problem_info"; |
950 | - $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />"; |
|
950 | + $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />"; |
|
951 | 951 | } else { |
952 | 952 | $info_div_class = "geodir_noproblem_info"; |
953 | 953 | $fix_button_txt = ''; |
@@ -984,29 +984,29 @@ discard block |
||
984 | 984 | if (!empty($all_postypes)) { |
985 | 985 | foreach ($all_postypes as $key) { |
986 | 986 | // update each GD CTP |
987 | - $posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d WHERE d." . $key . "category='' "); |
|
987 | + $posts = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."geodir_".$key."_detail d WHERE d.".$key."category='' "); |
|
988 | 988 | |
989 | 989 | if (!empty($posts)) { |
990 | 990 | |
991 | 991 | foreach ($posts as $p) { |
992 | 992 | $p->post_type = $key; |
993 | - $raw_cats = wp_get_object_terms($p->post_id, $p->post_type . 'category', array('fields' => 'ids')); |
|
993 | + $raw_cats = wp_get_object_terms($p->post_id, $p->post_type.'category', array('fields' => 'ids')); |
|
994 | 994 | |
995 | 995 | if (empty($raw_cats)) { |
996 | 996 | $post_categories = get_post_meta($p->post_id, 'post_categories', true); |
997 | 997 | |
998 | - if (!empty($post_categories) && !empty($post_categories[$p->post_type . 'category'])) { |
|
999 | - $post_categories[$p->post_type . 'category'] = str_replace("d:", "", $post_categories[$p->post_type . 'category']); |
|
1000 | - foreach (explode(",", $post_categories[$p->post_type . 'category']) as $cat_part) { |
|
998 | + if (!empty($post_categories) && !empty($post_categories[$p->post_type.'category'])) { |
|
999 | + $post_categories[$p->post_type.'category'] = str_replace("d:", "", $post_categories[$p->post_type.'category']); |
|
1000 | + foreach (explode(",", $post_categories[$p->post_type.'category']) as $cat_part) { |
|
1001 | 1001 | if (is_numeric($cat_part)) { |
1002 | - $raw_cats[] = (int)$cat_part; |
|
1002 | + $raw_cats[] = (int) $cat_part; |
|
1003 | 1003 | } |
1004 | 1004 | } |
1005 | 1005 | |
1006 | 1006 | } |
1007 | 1007 | |
1008 | 1008 | if (!empty($raw_cats)) { |
1009 | - $term_taxonomy_ids = wp_set_object_terms($p->post_id, $raw_cats, $p->post_type . 'category'); |
|
1009 | + $term_taxonomy_ids = wp_set_object_terms($p->post_id, $raw_cats, $p->post_type.'category'); |
|
1010 | 1010 | |
1011 | 1011 | } |
1012 | 1012 | |
@@ -1016,14 +1016,14 @@ discard block |
||
1016 | 1016 | if (empty($raw_cats)) { |
1017 | 1017 | $post_cats = ''; |
1018 | 1018 | } else { |
1019 | - $post_cats = ',' . implode(",", $raw_cats) . ','; |
|
1019 | + $post_cats = ','.implode(",", $raw_cats).','; |
|
1020 | 1020 | } |
1021 | - $tablename = $plugin_prefix . $p->post_type . '_detail'; |
|
1022 | - $wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET " . $p->post_type . "category=%s WHERE post_id =%d", $post_cats, $p->post_id)); |
|
1021 | + $tablename = $plugin_prefix.$p->post_type.'_detail'; |
|
1022 | + $wpdb->query($wpdb->prepare("UPDATE ".$tablename." SET ".$p->post_type."category=%s WHERE post_id =%d", $post_cats, $p->post_id)); |
|
1023 | 1023 | } |
1024 | 1024 | |
1025 | 1025 | } |
1026 | - $output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>"; |
|
1026 | + $output_str .= "<li>".$key.__(': Done', 'geodirectory')."</li>"; |
|
1027 | 1027 | |
1028 | 1028 | } |
1029 | 1029 | |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | |
1032 | 1032 | if ($is_error_during_diagnose) { |
1033 | 1033 | $info_div_class = "geodir_problem_info"; |
1034 | - $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />"; |
|
1034 | + $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />"; |
|
1035 | 1035 | } else { |
1036 | 1036 | $info_div_class = "geodir_noproblem_info"; |
1037 | 1037 | $fix_button_txt = ''; |
@@ -1084,15 +1084,15 @@ discard block |
||
1084 | 1084 | if (!empty($ver_arr)) { |
1085 | 1085 | foreach ($ver_arr as $key => $val) { |
1086 | 1086 | if (delete_option($val)) { |
1087 | - $output_str .= "<li>" . $key . __(' Version: Deleted', 'geodirectory') . "</li>"; |
|
1087 | + $output_str .= "<li>".$key.__(' Version: Deleted', 'geodirectory')."</li>"; |
|
1088 | 1088 | } else { |
1089 | - $output_str .= "<li>" . $key . __(' Version: Not Found', 'geodirectory') . "</li>"; |
|
1089 | + $output_str .= "<li>".$key.__(' Version: Not Found', 'geodirectory')."</li>"; |
|
1090 | 1090 | } |
1091 | 1091 | |
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | if ($output_str) { |
1095 | - $output_str .= "<li><strong>" . __(' Upgrade/install scripts will run on next page reload.', 'geodirectory') . "</strong></li>"; |
|
1095 | + $output_str .= "<li><strong>".__(' Upgrade/install scripts will run on next page reload.', 'geodirectory')."</strong></li>"; |
|
1096 | 1096 | } |
1097 | 1097 | |
1098 | 1098 | } |
@@ -1129,43 +1129,43 @@ discard block |
||
1129 | 1129 | $output_str = ''; |
1130 | 1130 | |
1131 | 1131 | // check review locations |
1132 | - if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE post_city='' OR post_city IS NULL OR post_latitude='' OR post_latitude IS NULL")) { |
|
1133 | - $output_str .= "<li>" . __('Review locations missing or broken', 'geodirectory') . "</li>"; |
|
1132 | + if ($wpdb->get_results("SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE post_city='' OR post_city IS NULL OR post_latitude='' OR post_latitude IS NULL")) { |
|
1133 | + $output_str .= "<li>".__('Review locations missing or broken', 'geodirectory')."</li>"; |
|
1134 | 1134 | $is_error_during_diagnose = true; |
1135 | 1135 | |
1136 | 1136 | if ($fix) { |
1137 | 1137 | if (geodir_fix_review_location()) { |
1138 | - $output_str .= "<li><strong>" . __('-->FIXED: Review locations fixed', 'geodirectory') . "</strong></li>"; |
|
1138 | + $output_str .= "<li><strong>".__('-->FIXED: Review locations fixed', 'geodirectory')."</strong></li>"; |
|
1139 | 1139 | } else { |
1140 | - $output_str .= "<li><strong>" . __('-->FAILED: Review locations fix failed', 'geodirectory') . "</strong></li>"; |
|
1140 | + $output_str .= "<li><strong>".__('-->FAILED: Review locations fix failed', 'geodirectory')."</strong></li>"; |
|
1141 | 1141 | } |
1142 | 1142 | } |
1143 | 1143 | |
1144 | 1144 | } else { |
1145 | - $output_str .= "<li>" . __('Review locations ok', 'geodirectory') . "</li>"; |
|
1145 | + $output_str .= "<li>".__('Review locations ok', 'geodirectory')."</li>"; |
|
1146 | 1146 | } |
1147 | 1147 | |
1148 | 1148 | // check review content |
1149 | - if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_content IS NULL")) { |
|
1150 | - $output_str .= "<li>" . __('Review content missing or broken', 'geodirectory') . "</li>"; |
|
1149 | + if ($wpdb->get_results("SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE comment_content IS NULL")) { |
|
1150 | + $output_str .= "<li>".__('Review content missing or broken', 'geodirectory')."</li>"; |
|
1151 | 1151 | $is_error_during_diagnose = true; |
1152 | 1152 | |
1153 | 1153 | if ($fix) { |
1154 | 1154 | if (geodir_fix_review_content()) { |
1155 | - $output_str .= "<li><strong>" . __('-->FIXED: Review content fixed', 'geodirectory') . "</strong></li>"; |
|
1155 | + $output_str .= "<li><strong>".__('-->FIXED: Review content fixed', 'geodirectory')."</strong></li>"; |
|
1156 | 1156 | } else { |
1157 | - $output_str .= "<li><strong>" . __('-->FAILED: Review content fix failed', 'geodirectory') . "</strong></li>"; |
|
1157 | + $output_str .= "<li><strong>".__('-->FAILED: Review content fix failed', 'geodirectory')."</strong></li>"; |
|
1158 | 1158 | } |
1159 | 1159 | } |
1160 | 1160 | |
1161 | 1161 | } else { |
1162 | - $output_str .= "<li>" . __('Review content ok', 'geodirectory') . "</li>"; |
|
1162 | + $output_str .= "<li>".__('Review content ok', 'geodirectory')."</li>"; |
|
1163 | 1163 | } |
1164 | 1164 | |
1165 | 1165 | |
1166 | 1166 | if ($is_error_during_diagnose) { |
1167 | 1167 | $info_div_class = "geodir_problem_info"; |
1168 | - $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />"; |
|
1168 | + $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />"; |
|
1169 | 1169 | } else { |
1170 | 1170 | $info_div_class = "geodir_noproblem_info"; |
1171 | 1171 | $fix_button_txt = ''; |
@@ -1229,7 +1229,7 @@ discard block |
||
1229 | 1229 | |
1230 | 1230 | if ($is_error_during_diagnose) { |
1231 | 1231 | $info_div_class = "geodir_problem_info"; |
1232 | - $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='multisite_conversion' />"; |
|
1232 | + $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='multisite_conversion' />"; |
|
1233 | 1233 | } else { |
1234 | 1234 | $info_div_class = "geodir_noproblem_info"; |
1235 | 1235 | $fix_button_txt = ''; |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | else { |
1264 | 1264 | $page_found = $wpdb->get_var( |
1265 | 1265 | $wpdb->prepare( |
1266 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", |
|
1266 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s LIMIT 1;", |
|
1267 | 1267 | array($slug) |
1268 | 1268 | ) |
1269 | 1269 | ); |
@@ -1309,18 +1309,18 @@ discard block |
||
1309 | 1309 | ////////////////////////////////// |
1310 | 1310 | $option_value = get_option('geodir_home_page'); |
1311 | 1311 | $page = get_post($option_value); |
1312 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';} |
|
1312 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; } |
|
1313 | 1313 | |
1314 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
1315 | - $output_str .= "<li>" . __('GD Home page exists with proper setting.', 'geodirectory') . "</li>"; |
|
1314 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
1315 | + $output_str .= "<li>".__('GD Home page exists with proper setting.', 'geodirectory')."</li>"; |
|
1316 | 1316 | else { |
1317 | 1317 | $is_error_during_diagnose = true; |
1318 | - $output_str .= "<li><strong>" . __('GD Home page is missing.', 'geodirectory') . "</strong></li>"; |
|
1318 | + $output_str .= "<li><strong>".__('GD Home page is missing.', 'geodirectory')."</strong></li>"; |
|
1319 | 1319 | if ($fix) { |
1320 | 1320 | if (geodir_fix_virtual_page('gd-home', __('GD Home page', 'geodirectory'), $page_found, 'geodir_home_page')) { |
1321 | - $output_str .= "<li><strong>" . __('-->FIXED: GD Home page fixed', 'geodirectory') . "</strong></li>"; |
|
1321 | + $output_str .= "<li><strong>".__('-->FIXED: GD Home page fixed', 'geodirectory')."</strong></li>"; |
|
1322 | 1322 | } else { |
1323 | - $output_str .= "<li><strong>" . __('-->FAILED: GD Home page fix failed', 'geodirectory') . "</strong></li>"; |
|
1323 | + $output_str .= "<li><strong>".__('-->FAILED: GD Home page fix failed', 'geodirectory')."</strong></li>"; |
|
1324 | 1324 | } |
1325 | 1325 | } |
1326 | 1326 | } |
@@ -1334,18 +1334,18 @@ discard block |
||
1334 | 1334 | ////////////////////////////////// |
1335 | 1335 | $option_value = get_option('geodir_add_listing_page'); |
1336 | 1336 | $page = get_post($option_value); |
1337 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';} |
|
1337 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; } |
|
1338 | 1338 | |
1339 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
1340 | - $output_str .= "<li>" . __('Add Listing page exists with proper setting.', 'geodirectory') . "</li>"; |
|
1339 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
1340 | + $output_str .= "<li>".__('Add Listing page exists with proper setting.', 'geodirectory')."</li>"; |
|
1341 | 1341 | else { |
1342 | 1342 | $is_error_during_diagnose = true; |
1343 | - $output_str .= "<li><strong>" . __('Add Listing page is missing.', 'geodirectory') . "</strong></li>"; |
|
1343 | + $output_str .= "<li><strong>".__('Add Listing page is missing.', 'geodirectory')."</strong></li>"; |
|
1344 | 1344 | if ($fix) { |
1345 | 1345 | if (geodir_fix_virtual_page('add-listing', __('Add Listing', 'geodirectory'), $page_found, 'geodir_add_listing_page')) { |
1346 | - $output_str .= "<li><strong>" . __('-->FIXED: Add Listing page fixed', 'geodirectory') . "</strong></li>"; |
|
1346 | + $output_str .= "<li><strong>".__('-->FIXED: Add Listing page fixed', 'geodirectory')."</strong></li>"; |
|
1347 | 1347 | } else { |
1348 | - $output_str .= "<li><strong>" . __('-->FAILED: Add Listing page fix failed', 'geodirectory') . "</strong></li>"; |
|
1348 | + $output_str .= "<li><strong>".__('-->FAILED: Add Listing page fix failed', 'geodirectory')."</strong></li>"; |
|
1349 | 1349 | } |
1350 | 1350 | } |
1351 | 1351 | } |
@@ -1360,18 +1360,18 @@ discard block |
||
1360 | 1360 | ////////////////////////////////// |
1361 | 1361 | $option_value = get_option('geodir_preview_page'); |
1362 | 1362 | $page = get_post($option_value); |
1363 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';} |
|
1363 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; } |
|
1364 | 1364 | |
1365 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
1366 | - $output_str .= "<li>" . __('Listing Preview page exists with proper setting.', 'geodirectory') . "</li>"; |
|
1365 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
1366 | + $output_str .= "<li>".__('Listing Preview page exists with proper setting.', 'geodirectory')."</li>"; |
|
1367 | 1367 | else { |
1368 | 1368 | $is_error_during_diagnose = true; |
1369 | - $output_str .= "<li><strong>" . __('Listing Preview page is missing.', 'geodirectory') . "</strong></li>"; |
|
1369 | + $output_str .= "<li><strong>".__('Listing Preview page is missing.', 'geodirectory')."</strong></li>"; |
|
1370 | 1370 | if ($fix) { |
1371 | 1371 | if (geodir_fix_virtual_page('listing-preview', __('Listing Preview', 'geodirectory'), $page_found, 'geodir_preview_page')) { |
1372 | - $output_str .= "<li><strong>" . __('-->FIXED: Listing Preview page fixed', 'geodirectory') . "</strong></li>"; |
|
1372 | + $output_str .= "<li><strong>".__('-->FIXED: Listing Preview page fixed', 'geodirectory')."</strong></li>"; |
|
1373 | 1373 | } else { |
1374 | - $output_str .= "<li><strong>" . __('-->FAILED: Listing Preview page fix failed', 'geodirectory') . "</strong></li>"; |
|
1374 | + $output_str .= "<li><strong>".__('-->FAILED: Listing Preview page fix failed', 'geodirectory')."</strong></li>"; |
|
1375 | 1375 | } |
1376 | 1376 | } |
1377 | 1377 | } |
@@ -1385,18 +1385,18 @@ discard block |
||
1385 | 1385 | ////////////////////////////////// |
1386 | 1386 | $option_value = get_option('geodir_success_page'); |
1387 | 1387 | $page = get_post($option_value); |
1388 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';} |
|
1388 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; } |
|
1389 | 1389 | |
1390 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
1391 | - $output_str .= "<li>" . __('Listing Success page exists with proper setting.', 'geodirectory') . "</li>"; |
|
1390 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
1391 | + $output_str .= "<li>".__('Listing Success page exists with proper setting.', 'geodirectory')."</li>"; |
|
1392 | 1392 | else { |
1393 | 1393 | $is_error_during_diagnose = true; |
1394 | - $output_str .= "<li><strong>" . __('Listing Success page is missing.', 'geodirectory') . "</strong></li>"; |
|
1394 | + $output_str .= "<li><strong>".__('Listing Success page is missing.', 'geodirectory')."</strong></li>"; |
|
1395 | 1395 | if ($fix) { |
1396 | 1396 | if (geodir_fix_virtual_page('listing-success', __('Listing Success', 'geodirectory'), $page_found, 'geodir_success_page')) { |
1397 | - $output_str .= "<li><strong>" . __('-->FIXED: Listing Success page fixed', 'geodirectory') . "</strong></li>"; |
|
1397 | + $output_str .= "<li><strong>".__('-->FIXED: Listing Success page fixed', 'geodirectory')."</strong></li>"; |
|
1398 | 1398 | } else { |
1399 | - $output_str .= "<li><strong>" . __('-->FAILED: Listing Success page fix failed', 'geodirectory') . "</strong></li>"; |
|
1399 | + $output_str .= "<li><strong>".__('-->FAILED: Listing Success page fix failed', 'geodirectory')."</strong></li>"; |
|
1400 | 1400 | } |
1401 | 1401 | } |
1402 | 1402 | } |
@@ -1410,18 +1410,18 @@ discard block |
||
1410 | 1410 | ////////////////////////////////// |
1411 | 1411 | $option_value = get_option('geodir_info_page'); |
1412 | 1412 | $page = get_post($option_value); |
1413 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';} |
|
1413 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; } |
|
1414 | 1414 | |
1415 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
1416 | - $output_str .= "<li>" . __('Info page exists with proper setting.', 'geodirectory') . "</li>"; |
|
1415 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
1416 | + $output_str .= "<li>".__('Info page exists with proper setting.', 'geodirectory')."</li>"; |
|
1417 | 1417 | else { |
1418 | 1418 | $is_error_during_diagnose = true; |
1419 | - $output_str .= "<li><strong>" . __('Info page is missing.', 'geodirectory') . "</strong></li>"; |
|
1419 | + $output_str .= "<li><strong>".__('Info page is missing.', 'geodirectory')."</strong></li>"; |
|
1420 | 1420 | if ($fix) { |
1421 | 1421 | if (geodir_fix_virtual_page('gd-info', __('Info', 'geodirectory'), $page_found, 'geodir_info_page')) { |
1422 | - $output_str .= "<li><strong>" . __('-->FIXED: Info page fixed', 'geodirectory') . "</strong></li>"; |
|
1422 | + $output_str .= "<li><strong>".__('-->FIXED: Info page fixed', 'geodirectory')."</strong></li>"; |
|
1423 | 1423 | } else { |
1424 | - $output_str .= "<li><strong>" . __('-->FAILED: Info page fix failed', 'geodirectory') . "</strong></li>"; |
|
1424 | + $output_str .= "<li><strong>".__('-->FAILED: Info page fix failed', 'geodirectory')."</strong></li>"; |
|
1425 | 1425 | } |
1426 | 1426 | } |
1427 | 1427 | } |
@@ -1435,18 +1435,18 @@ discard block |
||
1435 | 1435 | ////////////////////////////////// |
1436 | 1436 | $option_value = get_option('geodir_login_page'); |
1437 | 1437 | $page = get_post($option_value); |
1438 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';} |
|
1438 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; } |
|
1439 | 1439 | |
1440 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
1441 | - $output_str .= "<li>" . __('Login page exists with proper setting.', 'geodirectory') . "</li>"; |
|
1440 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
1441 | + $output_str .= "<li>".__('Login page exists with proper setting.', 'geodirectory')."</li>"; |
|
1442 | 1442 | else { |
1443 | 1443 | $is_error_during_diagnose = true; |
1444 | - $output_str .= "<li><strong>" . __('Login page is missing.', 'geodirectory') . "</strong></li>"; |
|
1444 | + $output_str .= "<li><strong>".__('Login page is missing.', 'geodirectory')."</strong></li>"; |
|
1445 | 1445 | if ($fix) { |
1446 | 1446 | if (geodir_fix_virtual_page('gd-login', __('Login', 'geodirectory'), $page_found, 'geodir_login_page')) { |
1447 | - $output_str .= "<li><strong>" . __('-->FIXED: Login page fixed', 'geodirectory') . "</strong></li>"; |
|
1447 | + $output_str .= "<li><strong>".__('-->FIXED: Login page fixed', 'geodirectory')."</strong></li>"; |
|
1448 | 1448 | } else { |
1449 | - $output_str .= "<li><strong>" . __('-->FAILED: Login page fix failed', 'geodirectory') . "</strong></li>"; |
|
1449 | + $output_str .= "<li><strong>".__('-->FAILED: Login page fix failed', 'geodirectory')."</strong></li>"; |
|
1450 | 1450 | } |
1451 | 1451 | } |
1452 | 1452 | } |
@@ -1460,18 +1460,18 @@ discard block |
||
1460 | 1460 | ////////////////////////////////// |
1461 | 1461 | $option_value = get_option('geodir_location_page'); |
1462 | 1462 | $page = get_post($option_value); |
1463 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';} |
|
1463 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; } |
|
1464 | 1464 | |
1465 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
1466 | - $output_str .= "<li>" . __('Location page exists with proper setting.', 'geodirectory') . "</li>"; |
|
1465 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
1466 | + $output_str .= "<li>".__('Location page exists with proper setting.', 'geodirectory')."</li>"; |
|
1467 | 1467 | else { |
1468 | 1468 | $is_error_during_diagnose = true; |
1469 | - $output_str .= "<li><strong>" . __('Location page is missing.', 'geodirectory') . "</strong></li>"; |
|
1469 | + $output_str .= "<li><strong>".__('Location page is missing.', 'geodirectory')."</strong></li>"; |
|
1470 | 1470 | if ($fix) { |
1471 | 1471 | if (geodir_fix_virtual_page('location', __('Location', 'geodirectory'), $page_found, 'geodir_location_page')) { |
1472 | - $output_str .= "<li><strong>" . __('-->FIXED: Location page fixed', 'geodirectory') . "</strong></li>"; |
|
1472 | + $output_str .= "<li><strong>".__('-->FIXED: Location page fixed', 'geodirectory')."</strong></li>"; |
|
1473 | 1473 | } else { |
1474 | - $output_str .= "<li><strong>" . __('-->FAILED: Location page fix failed', 'geodirectory') . "</strong></li>"; |
|
1474 | + $output_str .= "<li><strong>".__('-->FAILED: Location page fix failed', 'geodirectory')."</strong></li>"; |
|
1475 | 1475 | } |
1476 | 1476 | } |
1477 | 1477 | } |
@@ -1480,13 +1480,13 @@ discard block |
||
1480 | 1480 | /* Diagnose Location Page Ends */ |
1481 | 1481 | //////////////////////////////// |
1482 | 1482 | |
1483 | - $page_chk_arr = array('output_str'=>$output_str,'is_error_during_diagnose'=>$is_error_during_diagnose ); |
|
1483 | + $page_chk_arr = array('output_str'=>$output_str, 'is_error_during_diagnose'=>$is_error_during_diagnose); |
|
1484 | 1484 | /** |
1485 | 1485 | * This action is called at the end of the GD Tools page check function. |
1486 | 1486 | * |
1487 | 1487 | * @since 1.5.2 |
1488 | 1488 | */ |
1489 | - $page_chk_arr = apply_filters('geodir_diagnose_default_pages',$page_chk_arr); |
|
1489 | + $page_chk_arr = apply_filters('geodir_diagnose_default_pages', $page_chk_arr); |
|
1490 | 1490 | |
1491 | 1491 | $output_str = $page_chk_arr['output_str']; |
1492 | 1492 | $is_error_during_diagnose = $page_chk_arr['is_error_during_diagnose']; |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | flush_rewrite_rules(); |
1497 | 1497 | } |
1498 | 1498 | $info_div_class = "geodir_problem_info"; |
1499 | - $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='default_pages' />"; |
|
1499 | + $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='default_pages' />"; |
|
1500 | 1500 | } else { |
1501 | 1501 | $info_div_class = "geodir_noproblem_info"; |
1502 | 1502 | $fix_button_txt = ''; |
@@ -1523,10 +1523,10 @@ discard block |
||
1523 | 1523 | $output_str = ''; |
1524 | 1524 | |
1525 | 1525 | if ($is_error_during_diagnose) { |
1526 | - $output_str .= "<li>" . __('Fail to load custom fields in to file for translation, please check file permission:', 'geodirectory') . ' ' . geodir_plugin_path() . '/db-language.php' . "</li>"; |
|
1526 | + $output_str .= "<li>".__('Fail to load custom fields in to file for translation, please check file permission:', 'geodirectory').' '.geodir_plugin_path().'/db-language.php'."</li>"; |
|
1527 | 1527 | $info_div_class = "geodir_problem_info"; |
1528 | 1528 | } else { |
1529 | - $output_str .= "<li>" . __('Load custom fields in to file for translation: ok', 'geodirectory') . "</li>"; |
|
1529 | + $output_str .= "<li>".__('Load custom fields in to file for translation: ok', 'geodirectory')."</li>"; |
|
1530 | 1530 | $info_div_class = "geodir_noproblem_info"; |
1531 | 1531 | $fix_button_txt = ''; |
1532 | 1532 | } |
@@ -1568,17 +1568,17 @@ discard block |
||
1568 | 1568 | global $wpdb, $wp_query, $plugin_prefix; |
1569 | 1569 | |
1570 | 1570 | if (is_admin() && !empty($wp_query->query_vars) && !empty($wp_query->query_vars['is_geodir_loop']) && !empty($wp_query->query_vars['orderby']) && $wp_query->query_vars['orderby'] == 'expire' && !empty($wp_query->query_vars['post_type']) && in_array($wp_query->query_vars['post_type'], geodir_get_posttypes()) && !empty($wp_query->query_vars['orderby']) && isset($clauses['join']) && isset($clauses['orderby']) && isset($clauses['fields'])) { |
1571 | - $table = $plugin_prefix . $wp_query->query_vars['post_type'] . '_detail'; |
|
1571 | + $table = $plugin_prefix.$wp_query->query_vars['post_type'].'_detail'; |
|
1572 | 1572 | |
1573 | - $join = $clauses['join'] . ' INNER JOIN ' . $table . ' AS gd_posts ON (gd_posts.post_id = ' . $wpdb->posts . '.ID)'; |
|
1573 | + $join = $clauses['join'].' INNER JOIN '.$table.' AS gd_posts ON (gd_posts.post_id = '.$wpdb->posts.'.ID)'; |
|
1574 | 1574 | $clauses['join'] = $join; |
1575 | 1575 | |
1576 | - $fields = $clauses['fields'] != '' ? $clauses['fields'] . ', ' : ''; |
|
1576 | + $fields = $clauses['fields'] != '' ? $clauses['fields'].', ' : ''; |
|
1577 | 1577 | $fields .= 'IF(UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), 253402300799) AS gd_expire'; |
1578 | 1578 | $clauses['fields'] = $fields; |
1579 | 1579 | |
1580 | 1580 | $order = !empty($wp_query->query_vars['order']) ? $wp_query->query_vars['order'] : 'ASC'; |
1581 | - $orderby = 'gd_expire ' . $order; |
|
1581 | + $orderby = 'gd_expire '.$order; |
|
1582 | 1582 | $clauses['orderby'] = $orderby; |
1583 | 1583 | } |
1584 | 1584 | return $clauses; |
@@ -1621,7 +1621,7 @@ discard block |
||
1621 | 1621 | global $current_user; |
1622 | 1622 | $upload_dir = wp_upload_dir(); |
1623 | 1623 | |
1624 | - $file = $upload_dir['path'] . '/temp_' . $current_user->data->ID . '/geodir_tmp.csv'; |
|
1624 | + $file = $upload_dir['path'].'/temp_'.$current_user->data->ID.'/geodir_tmp.csv'; |
|
1625 | 1625 | $handle = fopen($file, 'w'); |
1626 | 1626 | |
1627 | 1627 | fwrite($handle, $input); |
@@ -1666,7 +1666,7 @@ discard block |
||
1666 | 1666 | $uploads_dir = $uploads['path']; |
1667 | 1667 | $image_name_arr = explode('/', $filename); |
1668 | 1668 | $filename = end($image_name_arr); |
1669 | - $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
1669 | + $target_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename; |
|
1670 | 1670 | $return = array(); |
1671 | 1671 | $return['file'] = $uploadedFile; |
1672 | 1672 | $return['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory'); |
@@ -1683,8 +1683,8 @@ discard block |
||
1683 | 1683 | |
1684 | 1684 | if (($handle = fopen($target_path, "r")) !== FALSE) { |
1685 | 1685 | while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { |
1686 | - if(is_array($data) && !empty($data)) { |
|
1687 | - $file[] = '"' . implode('","', $data) . '"'; |
|
1686 | + if (is_array($data) && !empty($data)) { |
|
1687 | + $file[] = '"'.implode('","', $data).'"'; |
|
1688 | 1688 | } |
1689 | 1689 | } |
1690 | 1690 | fclose($handle); |
@@ -1801,10 +1801,10 @@ discard block |
||
1801 | 1801 | $tag_arr = explode(',', $post_tags); |
1802 | 1802 | } |
1803 | 1803 | |
1804 | - $table = $plugin_prefix . $buffer[5] . '_detail'; // check table in database |
|
1804 | + $table = $plugin_prefix.$buffer[5].'_detail'; // check table in database |
|
1805 | 1805 | |
1806 | 1806 | $error = ''; |
1807 | - if ($wpdb->get_var("SHOW TABLES LIKE '" . $table . "'") != $table) { |
|
1807 | + if ($wpdb->get_var("SHOW TABLES LIKE '".$table."'") != $table) { |
|
1808 | 1808 | $invalid_post_type++; |
1809 | 1809 | continue; |
1810 | 1810 | } |
@@ -1830,7 +1830,7 @@ discard block |
||
1830 | 1830 | if ($buffer[$c] != '0' && $buffer[$c] != '') { |
1831 | 1831 | $submitdata = date('Y-m-d'); |
1832 | 1832 | |
1833 | - $gd_post_info['expire_date'] = date('Y-m-d', strtotime($submitdata . "+" . addslashes($buffer[$c]) . " days")); |
|
1833 | + $gd_post_info['expire_date'] = date('Y-m-d', strtotime($submitdata."+".addslashes($buffer[$c])." days")); |
|
1834 | 1834 | } else { |
1835 | 1835 | $gd_post_info['expire_date'] = 'Never'; |
1836 | 1836 | } |
@@ -1858,7 +1858,7 @@ discard block |
||
1858 | 1858 | |
1859 | 1859 | // Post status |
1860 | 1860 | if ($customKeyarray[$c] == 'post_status') { |
1861 | - $post_status = sanitize_key( $buffer[$c] ); |
|
1861 | + $post_status = sanitize_key($buffer[$c]); |
|
1862 | 1862 | } |
1863 | 1863 | } |
1864 | 1864 | |
@@ -1876,8 +1876,8 @@ discard block |
||
1876 | 1876 | |
1877 | 1877 | // Default post status |
1878 | 1878 | $default_status = 'publish'; |
1879 | - $post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status; |
|
1880 | - $post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status; |
|
1879 | + $post_status = !empty($post_status) ? sanitize_key($post_status) : $default_status; |
|
1880 | + $post_status = !empty($wp_post_statuses) && !isset($wp_post_statuses[$post_status]) ? $default_status : $post_status; |
|
1881 | 1881 | |
1882 | 1882 | $my_post['post_title'] = $post_title; |
1883 | 1883 | $my_post['post_content'] = $post_desc; |
@@ -1921,7 +1921,7 @@ discard block |
||
1921 | 1921 | $payment_info = array(); |
1922 | 1922 | $package_info = array(); |
1923 | 1923 | |
1924 | - $package_info = (array)geodir_post_package_info($package_info, '', $buffer[5]); |
|
1924 | + $package_info = (array) geodir_post_package_info($package_info, '', $buffer[5]); |
|
1925 | 1925 | $package_id = ''; |
1926 | 1926 | if (isset($gd_post_info['package_id']) && $gd_post_info['package_id'] != '') { |
1927 | 1927 | $package_id = $gd_post_info['package_id']; |
@@ -1931,7 +1931,7 @@ discard block |
||
1931 | 1931 | $payment_info['package_id'] = $package_info['pid']; |
1932 | 1932 | |
1933 | 1933 | if (isset($package_info['alive_days']) && $package_info['alive_days'] != 0) { |
1934 | - $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['alive_days'] . " days")); |
|
1934 | + $payment_info['expire_date'] = date('Y-m-d', strtotime("+".$package_info['alive_days']." days")); |
|
1935 | 1935 | } else { |
1936 | 1936 | $payment_info['expire_date'] = 'Never'; |
1937 | 1937 | } |
@@ -1943,7 +1943,7 @@ discard block |
||
1943 | 1943 | |
1944 | 1944 | $post_type = get_post_type($last_postid); |
1945 | 1945 | |
1946 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
1946 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
1947 | 1947 | |
1948 | 1948 | geodir_save_post_info($last_postid, $gd_post_info); |
1949 | 1949 | |
@@ -1964,7 +1964,7 @@ discard block |
||
1964 | 1964 | $attachment['post_id'] = $last_postid; |
1965 | 1965 | $attachment['title'] = $img_name_arr[0]; |
1966 | 1966 | $attachment['content'] = ''; |
1967 | - $attachment['file'] = $sub_dir . '/' . $image_name; |
|
1967 | + $attachment['file'] = $sub_dir.'/'.$image_name; |
|
1968 | 1968 | $attachment['mime_type'] = $uploaded_file_type; |
1969 | 1969 | $attachment['menu_order'] = $menu_order; |
1970 | 1970 | $attachment['is_featured'] = 0; |
@@ -1973,15 +1973,15 @@ discard block |
||
1973 | 1973 | |
1974 | 1974 | foreach ($attachment as $key => $val) { |
1975 | 1975 | if ($val != '') |
1976 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
1976 | + $attachment_set .= $key." = '".$val."', "; |
|
1977 | 1977 | } |
1978 | 1978 | $attachment_set = trim($attachment_set, ", "); |
1979 | 1979 | |
1980 | - $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set); |
|
1980 | + $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set); |
|
1981 | 1981 | |
1982 | 1982 | if ($menu_order == 1) { |
1983 | 1983 | $post_type = get_post_type($last_postid); |
1984 | - $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($sub_dir . '/' . $image_name, $last_postid))); |
|
1984 | + $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($sub_dir.'/'.$image_name, $last_postid))); |
|
1985 | 1985 | } |
1986 | 1986 | $menu_order++; |
1987 | 1987 | } |
@@ -2022,11 +2022,11 @@ discard block |
||
2022 | 2022 | } |
2023 | 2023 | |
2024 | 2024 | // Add the tab in left sidebar menu fro import & export page. |
2025 | -add_filter( 'geodir_settings_tabs_array', 'geodir_import_export_tab', 94 ); |
|
2025 | +add_filter('geodir_settings_tabs_array', 'geodir_import_export_tab', 94); |
|
2026 | 2026 | |
2027 | 2027 | // Handle ajax request for import/export. |
2028 | -add_action( 'wp_ajax_geodir_import_export', 'geodir_ajax_import_export' ); |
|
2029 | -add_action( 'wp_ajax_nopriv_geodir_import_exportn', 'geodir_ajax_import_export' ); |
|
2028 | +add_action('wp_ajax_geodir_import_export', 'geodir_ajax_import_export'); |
|
2029 | +add_action('wp_ajax_nopriv_geodir_import_exportn', 'geodir_ajax_import_export'); |
|
2030 | 2030 | |
2031 | 2031 | |
2032 | 2032 | /** |
@@ -2037,40 +2037,40 @@ discard block |
||
2037 | 2037 | * @param $post_id int $post_id The post ID of the post being saved. |
2038 | 2038 | * @param $post object $post The post object of the post being saved. |
2039 | 2039 | */ |
2040 | -function geodir_update_location_prefix($post_id,$post){ |
|
2041 | - if($post->post_type=='page' && $post->post_name && $post_id==get_option('geodir_location_page')){ |
|
2042 | - update_option('geodir_location_prefix',$post->post_name); |
|
2040 | +function geodir_update_location_prefix($post_id, $post) { |
|
2041 | + if ($post->post_type == 'page' && $post->post_name && $post_id == get_option('geodir_location_page')) { |
|
2042 | + update_option('geodir_location_prefix', $post->post_name); |
|
2043 | 2043 | } |
2044 | 2044 | |
2045 | 2045 | } |
2046 | 2046 | |
2047 | -add_action('save_post', 'geodir_update_location_prefix',10,2); |
|
2047 | +add_action('save_post', 'geodir_update_location_prefix', 10, 2); |
|
2048 | 2048 | |
2049 | -add_action( 'wp_ajax_geodir_ga_callback', 'geodir_ga_callback' ); |
|
2049 | +add_action('wp_ajax_geodir_ga_callback', 'geodir_ga_callback'); |
|
2050 | 2050 | |
2051 | -function geodir_ga_callback(){ |
|
2051 | +function geodir_ga_callback() { |
|
2052 | 2052 | |
2053 | -if(isset($_REQUEST['code']) && $_REQUEST['code']) { |
|
2053 | +if (isset($_REQUEST['code']) && $_REQUEST['code']) { |
|
2054 | 2054 | $oAuthURL = "https://www.googleapis.com/oauth2/v3/token?"; |
2055 | 2055 | $code = "code=".$_REQUEST['code']; |
2056 | 2056 | $grant_type = "&grant_type=authorization_code"; |
2057 | - $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback"; |
|
2057 | + $redirect_uri = "&redirect_uri=".admin_url('admin-ajax.php')."?action=geodir_ga_callback"; |
|
2058 | 2058 | $client_id = "&client_id=".get_option('geodir_ga_client_id'); |
2059 | 2059 | $client_secret = "&client_secret=".get_option('geodir_ga_client_secret'); |
2060 | 2060 | |
2061 | - $auth_url = $oAuthURL . $code . $redirect_uri . $grant_type . $client_id .$client_secret; |
|
2061 | + $auth_url = $oAuthURL.$code.$redirect_uri.$grant_type.$client_id.$client_secret; |
|
2062 | 2062 | |
2063 | 2063 | $response = wp_remote_post($auth_url, array('timeout' => 15)); |
2064 | 2064 | |
2065 | 2065 | //print_r($response); |
2066 | 2066 | |
2067 | - $error_msg = __('Something went wrong','geodirectory'); |
|
2068 | - if(!empty($response['response']['code']) && $response['response']['code']==200){ |
|
2067 | + $error_msg = __('Something went wrong', 'geodirectory'); |
|
2068 | + if (!empty($response['response']['code']) && $response['response']['code'] == 200) { |
|
2069 | 2069 | |
2070 | 2070 | $parts = json_decode($response['body']); |
2071 | 2071 | //print_r($parts); |
2072 | - if(!isset($parts->access_token)){echo $error_msg." - #1";exit;} |
|
2073 | - else{ |
|
2072 | + if (!isset($parts->access_token)) {echo $error_msg." - #1"; exit; } |
|
2073 | + else { |
|
2074 | 2074 | |
2075 | 2075 | update_option('gd_ga_access_token', $parts->access_token); |
2076 | 2076 | update_option('gd_ga_refresh_token', $parts->refresh_token); |
@@ -2079,25 +2079,25 @@ discard block |
||
2079 | 2079 | |
2080 | 2080 | |
2081 | 2081 | } |
2082 | - elseif(!empty($response['response']['code'])) { |
|
2082 | + elseif (!empty($response['response']['code'])) { |
|
2083 | 2083 | $parts = json_decode($response['body']); |
2084 | 2084 | |
2085 | - if(isset($parts->error)){ |
|
2086 | - echo $parts->error.": ".$parts->error_description;exit; |
|
2087 | - }else{ |
|
2088 | - echo $error_msg." - #2";exit; |
|
2085 | + if (isset($parts->error)) { |
|
2086 | + echo $parts->error.": ".$parts->error_description; exit; |
|
2087 | + } else { |
|
2088 | + echo $error_msg." - #2"; exit; |
|
2089 | 2089 | } |
2090 | 2090 | |
2091 | - }else{ |
|
2091 | + } else { |
|
2092 | 2092 | |
2093 | - echo $error_msg." - #3";exit; |
|
2093 | + echo $error_msg." - #3"; exit; |
|
2094 | 2094 | |
2095 | 2095 | } |
2096 | 2096 | } |
2097 | 2097 | exit; |
2098 | 2098 | } |
2099 | 2099 | |
2100 | -add_filter( 'icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4 ); |
|
2100 | +add_filter('icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4); |
|
2101 | 2101 | |
2102 | 2102 | if (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'permalink_settings') { |
2103 | 2103 | add_action('geodir_before_admin_panel', 'geodir_wpml_permalink_setting_notice'); |