Test Failed
Push — master ( 4eb591...3e14b5 )
by Stiofan
20:20
created
geodirectory-functions/compatibility/Multi_News.php 3 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,8 +126,10 @@
 block discarded – undo
126 126
     $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
127 127
     if (preg_match_all("/$regexp/siU", $crums, $matches)) {
128 128
         return $matches[0];
129
-    } else return '';
130
-}
129
+    } else {
130
+    	return '';
131
+    }
132
+    }
131 133
 
132 134
 
133 135
 /**
Please login to merge, or discard this patch.
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -16,36 +16,36 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function multi_news_action_calls()
18 18
 {
19
-    // REMOVE BREADCRUMB
20
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
-
27
-    //ADD BREADCRUMS
28
-    add_action('geodir_detail_before_main_content', 'gd_mn_replace_breadcrums', 20);
29
-    add_action('geodir_listings_before_main_content', 'gd_mn_replace_breadcrums', 20);
30
-    add_action('geodir_author_before_main_content', 'gd_mn_replace_breadcrums', 20);
31
-    add_action('geodir_search_before_main_content', 'gd_mn_replace_breadcrums', 20);
32
-    //add_action('geodir_home_before_main_content', 'gd_mn_replace_breadcrums', 20);
33
-    add_action('geodir_location_before_main_content', 'gd_mn_replace_breadcrums', 20);
34
-
35
-
36
-    // fix breadcrums
37
-    add_filter('breadcrumbs_plus_items', 'gd_breadcrumbs_plus_items', 1);
38
-
39
-    // REMOVE PAGE TITLES
40
-    remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
41
-    // remove_action( 'geodir_add_listing_page_title', 'geodir_action_add_listing_page_title',10);
42
-    remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
43
-    remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
44
-    remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
45
-
46
-
47
-    add_action('geodir_wrapper_content_open', 'gd_mn_extra_wrap', 30, 1);
48
-    add_action('geodir_wrapper_content_close', 'gd_mn_extra_wrap_end', 3, 1);
19
+	// REMOVE BREADCRUMB
20
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
+
27
+	//ADD BREADCRUMS
28
+	add_action('geodir_detail_before_main_content', 'gd_mn_replace_breadcrums', 20);
29
+	add_action('geodir_listings_before_main_content', 'gd_mn_replace_breadcrums', 20);
30
+	add_action('geodir_author_before_main_content', 'gd_mn_replace_breadcrums', 20);
31
+	add_action('geodir_search_before_main_content', 'gd_mn_replace_breadcrums', 20);
32
+	//add_action('geodir_home_before_main_content', 'gd_mn_replace_breadcrums', 20);
33
+	add_action('geodir_location_before_main_content', 'gd_mn_replace_breadcrums', 20);
34
+
35
+
36
+	// fix breadcrums
37
+	add_filter('breadcrumbs_plus_items', 'gd_breadcrumbs_plus_items', 1);
38
+
39
+	// REMOVE PAGE TITLES
40
+	remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
41
+	// remove_action( 'geodir_add_listing_page_title', 'geodir_action_add_listing_page_title',10);
42
+	remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
43
+	remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
44
+	remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
45
+
46
+
47
+	add_action('geodir_wrapper_content_open', 'gd_mn_extra_wrap', 30, 1);
48
+	add_action('geodir_wrapper_content_close', 'gd_mn_extra_wrap_end', 3, 1);
49 49
 }
50 50
 
51 51
 /**
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
  */
58 58
 function gd_mn_extra_wrap($page)
59 59
 {
60
-    if ($page == 'add-listing-page') {
61
-        echo '<div class="site-content page-wrap">';
62
-    } elseif ($page == 'signup-page') {
63
-        echo '</div><div class="section full-width-section" style="float: left;width:100%;">';
64
-    }
60
+	if ($page == 'add-listing-page') {
61
+		echo '<div class="site-content page-wrap">';
62
+	} elseif ($page == 'signup-page') {
63
+		echo '</div><div class="section full-width-section" style="float: left;width:100%;">';
64
+	}
65 65
 
66 66
 }
67 67
 
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function gd_mn_extra_wrap_end($page)
77 77
 {
78
-    if ($page == 'add-listing-page') {
79
-        echo '</div>';
80
-    }
78
+	if ($page == 'add-listing-page') {
79
+		echo '</div>';
80
+	}
81 81
 
82 82
 }
83 83
 
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
 function gd_mn_replace_breadcrums()
92 92
 {
93 93
 
94
-    if (mom_option('breadcrumb') != 0) { ?>
94
+	if (mom_option('breadcrumb') != 0) { ?>
95 95
         <?php if (mom_option('cats_bread')) {
96
-            $cclass = '';
97
-            if (mom_option('cat_slider') == false) {
98
-                $cclass = 'post-crumbs ';
99
-            }
100
-            ?>
96
+			$cclass = '';
97
+			if (mom_option('cat_slider') == false) {
98
+				$cclass = 'post-crumbs ';
99
+			}
100
+			?>
101 101
             <div class="<?php echo $cclass; ?>entry-crumbs" xmlns:v="http://rdf.data-vocabulary.org/#">
102 102
 
103 103
                 <?php mom_breadcrumb(); ?>
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function gd_get_breadcrum_links()
121 121
 {
122
-    ob_start();
123
-    geodir_breadcrumb();
124
-    $crums = ob_get_contents();
125
-    ob_get_clean();
126
-    $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
127
-    if (preg_match_all("/$regexp/siU", $crums, $matches)) {
128
-        return $matches[0];
129
-    } else return '';
122
+	ob_start();
123
+	geodir_breadcrumb();
124
+	$crums = ob_get_contents();
125
+	ob_get_clean();
126
+	$regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
127
+	if (preg_match_all("/$regexp/siU", $crums, $matches)) {
128
+		return $matches[0];
129
+	} else return '';
130 130
 }
131 131
 
132 132
 
@@ -140,30 +140,30 @@  discard block
 block discarded – undo
140 140
  */
141 141
 function gd_breadcrumbs_plus_items($items)
142 142
 {   //print_r($items);exit;
143
-    $bits = array();
144
-    $pieces = gd_get_breadcrum_links();
145
-    //unset($pieces[0]);
146
-    $bits = $pieces;
143
+	$bits = array();
144
+	$pieces = gd_get_breadcrum_links();
145
+	//unset($pieces[0]);
146
+	$bits = $pieces;
147 147
 
148
-    $title = $items['last'];
149
-    if (is_page_geodir_home() || geodir_is_page('location')) {
148
+	$title = $items['last'];
149
+	if (is_page_geodir_home() || geodir_is_page('location')) {
150 150
 
151
-    } elseif (geodir_is_page('listing')) {
151
+	} elseif (geodir_is_page('listing')) {
152 152
 
153
-    } elseif (geodir_is_page('detail')) {
154
-        ob_start();
155
-        geodir_action_page_title();
156
-        $title = ob_get_contents();
157
-        ob_end_clean();
158
-    } elseif (geodir_is_page('search')) {
159
-    } elseif (geodir_is_page('author')) {
160
-    }
153
+	} elseif (geodir_is_page('detail')) {
154
+		ob_start();
155
+		geodir_action_page_title();
156
+		$title = ob_get_contents();
157
+		ob_end_clean();
158
+	} elseif (geodir_is_page('search')) {
159
+	} elseif (geodir_is_page('author')) {
160
+	}
161 161
 
162
-    $title = strip_tags($title);
163
-    $items = gd_breadcrumbs_plus_items_add($items, $bits, $title);
162
+	$title = strip_tags($title);
163
+	$items = gd_breadcrumbs_plus_items_add($items, $bits, $title);
164 164
 
165 165
 
166
-    return $items;
166
+	return $items;
167 167
 }
168 168
 
169 169
 
@@ -179,28 +179,28 @@  discard block
 block discarded – undo
179 179
  */
180 180
 function gd_breadcrumbs_plus_items_add($items, $bits, $last)
181 181
 {
182
-    //$pieces = explode("</div>", $items[0]);
183
-    if (is_array($bits)) {
184
-        $items = array();
185
-        $pieces = '';
186
-        foreach ($bits as $bit) {
187
-            $pieces .= $bit;
188
-        }
189
-        $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>";
190
-        if (isset($last) && $last) {
191
-            $items['last'] = $last;
192
-        }
193
-    }
194
-
195
-    //print_r($items);
196
-    return $items;
182
+	//$pieces = explode("</div>", $items[0]);
183
+	if (is_array($bits)) {
184
+		$items = array();
185
+		$pieces = '';
186
+		foreach ($bits as $bit) {
187
+			$pieces .= $bit;
188
+		}
189
+		$items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>";
190
+		if (isset($last) && $last) {
191
+			$items['last'] = $last;
192
+		}
193
+	}
194
+
195
+	//print_r($items);
196
+	return $items;
197 197
 
198 198
 }
199 199
 
200 200
 add_filter('geodir_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1);
201 201
 add_filter('geodir_location_switcher_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1);
202 202
 function gd_multinews_mobile_menu_caret($html){
203
-    $html .= '<i class="responsive-caret"></i>';
204
-    return $html;
203
+	$html .= '<i class="responsive-caret"></i>';
204
+	return $html;
205 205
 
206 206
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         foreach ($bits as $bit) {
187 187
             $pieces .= $bit;
188 188
         }
189
-        $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>";
189
+        $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">'.$pieces."</div>";
190 190
         if (isset($last) && $last) {
191 191
             $items['last'] = $last;
192 192
         }
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
 
198 198
 }
199 199
 
200
-add_filter('geodir_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1);
201
-add_filter('geodir_location_switcher_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1);
202
-function gd_multinews_mobile_menu_caret($html){
200
+add_filter('geodir_menu_after_sub_ul', 'gd_multinews_mobile_menu_caret', 10, 1);
201
+add_filter('geodir_location_switcher_menu_after_sub_ul', 'gd_multinews_mobile_menu_caret', 10, 1);
202
+function gd_multinews_mobile_menu_caret($html) {
203 203
     $html .= '<i class="responsive-caret"></i>';
204 204
     return $html;
205 205
 
Please login to merge, or discard this patch.
geodirectory-functions/geodir-class-session.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly.
3
-if (!defined( 'ABSPATH' ) ) exit;
3
+if (!defined( 'ABSPATH' ) ) {
4
+	exit;
5
+}
4 6
 
5 7
 /**
6 8
  * Geodir_Session Class.
Please login to merge, or discard this patch.
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly.
3
-if (!defined( 'ABSPATH' ) ) exit;
3
+if (!defined('ABSPATH')) exit;
4 4
 
5 5
 /**
6 6
  * Geodir_Session Class.
@@ -46,44 +46,44 @@  discard block
 block discarded – undo
46 46
 	public function __construct() {
47 47
 		$this->use_php_sessions = $this->use_php_sessions();
48 48
 
49
-		if ( $this->use_php_sessions ) {
50
-			if ( is_multisite() ) {
51
-				$this->prefix = '_' . get_current_blog_id();
49
+		if ($this->use_php_sessions) {
50
+			if (is_multisite()) {
51
+				$this->prefix = '_'.get_current_blog_id();
52 52
 			}
53 53
 
54 54
 			// Use PHP SESSION (must be enabled via the GEODIR_USE_PHP_SESSIONS constant)
55
-			add_action( 'init', array( $this, 'maybe_start_session' ), -2 );
55
+			add_action('init', array($this, 'maybe_start_session'), -2);
56 56
 		} else {
57 57
 			// Use WP_Session (default)
58
-			if ( !defined( 'WP_SESSION_COOKIE' ) ) {
59
-				define( 'WP_SESSION_COOKIE', 'geodir_wp_session' );
58
+			if (!defined('WP_SESSION_COOKIE')) {
59
+				define('WP_SESSION_COOKIE', 'geodir_wp_session');
60 60
 			}
61 61
 
62
-			if ( !class_exists( 'Recursive_ArrayAccess' ) ) {
63
-				require_once GEODIRECTORY_PLUGIN_DIR . 'geodirectory-functions/wp-session/class-recursive-arrayaccess.php';
62
+			if (!class_exists('Recursive_ArrayAccess')) {
63
+				require_once GEODIRECTORY_PLUGIN_DIR.'geodirectory-functions/wp-session/class-recursive-arrayaccess.php';
64 64
 			}
65 65
             
66
-			if ( !class_exists( 'WP_Session_Utils' ) ) {
67
-				require_once GEODIRECTORY_PLUGIN_DIR . 'geodirectory-functions/wp-session/class-wp-session-utils.php';
66
+			if (!class_exists('WP_Session_Utils')) {
67
+				require_once GEODIRECTORY_PLUGIN_DIR.'geodirectory-functions/wp-session/class-wp-session-utils.php';
68 68
 			}
69 69
             
70
-			if ( defined( 'WP_CLI' ) && WP_CLI && !class_exists( 'WP_Session_Command' ) ) {
71
-				require_once GEODIRECTORY_PLUGIN_DIR . 'geodirectory-functions/wp-session/wp-cli.php';
70
+			if (defined('WP_CLI') && WP_CLI && !class_exists('WP_Session_Command')) {
71
+				require_once GEODIRECTORY_PLUGIN_DIR.'geodirectory-functions/wp-session/wp-cli.php';
72 72
 			}
73 73
 
74
-			if ( !class_exists( 'WP_Session' ) ) {
75
-				require_once GEODIRECTORY_PLUGIN_DIR . 'geodirectory-functions/wp-session/class-wp-session.php';
76
-				require_once GEODIRECTORY_PLUGIN_DIR . 'geodirectory-functions/wp-session/wp-session.php';
74
+			if (!class_exists('WP_Session')) {
75
+				require_once GEODIRECTORY_PLUGIN_DIR.'geodirectory-functions/wp-session/class-wp-session.php';
76
+				require_once GEODIRECTORY_PLUGIN_DIR.'geodirectory-functions/wp-session/wp-session.php';
77 77
 			}
78 78
 
79
-			add_filter( 'wp_session_expiration_variant', array( $this, 'set_expiration_variant_time' ), 99999 );
80
-			add_filter( 'wp_session_expiration', array( $this, 'set_expiration_time' ), 99999 );
79
+			add_filter('wp_session_expiration_variant', array($this, 'set_expiration_variant_time'), 99999);
80
+			add_filter('wp_session_expiration', array($this, 'set_expiration_time'), 99999);
81 81
 		}
82 82
 
83
-		if ( empty( $this->session ) && ! $this->use_php_sessions ) {
84
-			add_action( 'plugins_loaded', array( $this, 'init' ), -1 );
83
+		if (empty($this->session) && !$this->use_php_sessions) {
84
+			add_action('plugins_loaded', array($this, 'init'), -1);
85 85
 		} else {
86
-			add_action( 'init', array( $this, 'init' ), -1 );
86
+			add_action('init', array($this, 'init'), -1);
87 87
 		}
88 88
 	}
89 89
 
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 	 * @return void
96 96
 	 */
97 97
 	public function init() {
98
-		if ( $this->use_php_sessions ) {
99
-			$this->session = isset( $_SESSION['gd' . $this->prefix ] ) && is_array( $_SESSION['gd' . $this->prefix ] ) ? $_SESSION['gd' . $this->prefix ] : array();
98
+		if ($this->use_php_sessions) {
99
+			$this->session = isset($_SESSION['gd'.$this->prefix]) && is_array($_SESSION['gd'.$this->prefix]) ? $_SESSION['gd'.$this->prefix] : array();
100 100
 		} else {
101 101
 			$this->session = WP_Session::get_instance();
102 102
 		}
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
 	 * @return string Session ID
113 113
 	 */
114 114
 	public function get_id() {
115
-		if ( $this->use_php_sessions ) {
116
-			$session_id = !empty( $_SESSION ) && function_exists( 'session_id' ) ? session_id() : NULL;
115
+		if ($this->use_php_sessions) {
116
+			$session_id = !empty($_SESSION) && function_exists('session_id') ? session_id() : NULL;
117 117
 		} else {
118
-			$session_id = !empty( $this->session ) && isset( $this->session->session_id ) ? $this->session->session_id : NULL;
118
+			$session_id = !empty($this->session) && isset($this->session->session_id) ? $this->session->session_id : NULL;
119 119
 		}
120 120
 		return $session_id;
121 121
 	}
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 	 * @param string $key Session key
129 129
 	 * @return string Session variable
130 130
 	 */
131
-	public function get( $key ) {
132
-		$key = sanitize_key( $key );
133
-		return isset( $this->session[ $key ] ) ? maybe_unserialize( $this->session[ $key ] ) : false;
131
+	public function get($key) {
132
+		$key = sanitize_key($key);
133
+		return isset($this->session[$key]) ? maybe_unserialize($this->session[$key]) : false;
134 134
 	}
135 135
 
136 136
 	/**
@@ -142,20 +142,20 @@  discard block
 block discarded – undo
142 142
 	 * @param integer $value Session variable
143 143
 	 * @return string Session variable
144 144
 	 */
145
-	public function set( $key, $value ) {
146
-		$key = sanitize_key( $key );
145
+	public function set($key, $value) {
146
+		$key = sanitize_key($key);
147 147
 
148
-		if ( is_array( $value ) ) {
149
-			$this->session[ $key ] = maybe_serialize( $value );
148
+		if (is_array($value)) {
149
+			$this->session[$key] = maybe_serialize($value);
150 150
 		} else {
151
-			$this->session[ $key ] = $value;
151
+			$this->session[$key] = $value;
152 152
 		}
153 153
 
154
-		if ( $this->use_php_sessions ) {
155
-			$_SESSION['gd' . $this->prefix ] = $this->session;
154
+		if ($this->use_php_sessions) {
155
+			$_SESSION['gd'.$this->prefix] = $this->session;
156 156
 		}
157 157
 
158
-		return $this->session[ $key ];
158
+		return $this->session[$key];
159 159
 	}
160 160
 	
161 161
 	/**
@@ -167,29 +167,29 @@  discard block
 block discarded – undo
167 167
 	 * @param integer $value Session variable.
168 168
 	 * @return string Session variable.
169 169
 	 */
170
-	public function un_set( $key ) {
171
-		if ( empty( $key ) ) {
170
+	public function un_set($key) {
171
+		if (empty($key)) {
172 172
 			return false;
173 173
 		}
174 174
 		
175
-		if ( is_array( $key ) ) {
175
+		if (is_array($key)) {
176 176
 			foreach ($key as $index) {
177
-				$index = sanitize_key( $index );
177
+				$index = sanitize_key($index);
178 178
 			
179
-				if ( $index && isset( $this->session[ $index ] ) ) {
180
-					unset( $this->session[ $index ] );
179
+				if ($index && isset($this->session[$index])) {
180
+					unset($this->session[$index]);
181 181
 				}
182 182
 			}
183 183
 		} else {
184
-			$key = sanitize_key( $key );
184
+			$key = sanitize_key($key);
185 185
 			
186
-			if ( isset( $this->session[ $key ] ) ) {
187
-				unset( $this->session[ $key ] );
186
+			if (isset($this->session[$key])) {
187
+				unset($this->session[$key]);
188 188
 			}
189 189
 		}
190 190
 
191
-		if ( $this->use_php_sessions ) {
192
-			$_SESSION['gd' . $this->prefix ] = $this->session;
191
+		if ($this->use_php_sessions) {
192
+			$_SESSION['gd'.$this->prefix] = $this->session;
193 193
 		}
194 194
 
195 195
 		return true;
@@ -204,14 +204,14 @@  discard block
 block discarded – undo
204 204
 	 * @param integer $value Session variable.
205 205
 	 * @return string Session variable.
206 206
 	 */
207
-	public function is_set( $key ) {
208
-		$key = sanitize_key( $key );
207
+	public function is_set($key) {
208
+		$key = sanitize_key($key);
209 209
 		
210
-		if ( empty( $key ) ) {
210
+		if (empty($key)) {
211 211
 			return false;
212 212
 		}
213 213
 
214
-		if ( isset( $this->session[ $key ] ) ) {
214
+		if (isset($this->session[$key])) {
215 215
 			return true;
216 216
 		}
217 217
 
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 	 * @param int $exp Default expiration (1 hour)
227 227
 	 * @return int
228 228
 	 */
229
-	public function set_expiration_variant_time( $exp ) {
230
-		return ( 30 * 60 * 23 );
229
+	public function set_expiration_variant_time($exp) {
230
+		return (30 * 60 * 23);
231 231
 	}
232 232
 
233 233
 	/**
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
 	 * @param int $exp Default expiration (1 hour)
239 239
 	 * @return int
240 240
 	 */
241
-	public function set_expiration_time( $exp ) {
242
-		return ( 30 * 60 * 24 );
241
+	public function set_expiration_time($exp) {
242
+		return (30 * 60 * 24);
243 243
 	}
244 244
 
245 245
 	/**
@@ -257,18 +257,18 @@  discard block
 block discarded – undo
257 257
 		$ret = false;
258 258
 
259 259
 		// If the database variable is already set, no need to run autodetection
260
-		$geodir_use_php_sessions = (bool)get_option( 'geodir_use_php_sessions' );
260
+		$geodir_use_php_sessions = (bool) get_option('geodir_use_php_sessions');
261 261
 
262
-		if (!$geodir_use_php_sessions ) {
262
+		if (!$geodir_use_php_sessions) {
263 263
 			// Attempt to detect if the server supports PHP sessions
264
-			if ( function_exists( 'session_start' ) && ! ini_get( 'safe_mode' ) ) {
265
-				$this->set( 'geodir_use_php_sessions', 1 );
264
+			if (function_exists('session_start') && !ini_get('safe_mode')) {
265
+				$this->set('geodir_use_php_sessions', 1);
266 266
 				
267
-				if ( $this->get( 'geodir_use_php_sessions' ) ) {
267
+				if ($this->get('geodir_use_php_sessions')) {
268 268
 					$ret = true;
269 269
 
270 270
 					// Set the database option
271
-					update_option( 'geodir_use_php_sessions', true );
271
+					update_option('geodir_use_php_sessions', true);
272 272
 				}
273 273
 			}
274 274
 		} else {
@@ -276,20 +276,20 @@  discard block
 block discarded – undo
276 276
 		}
277 277
 
278 278
 		// Enable or disable PHP Sessions based on the GEODIR_USE_PHP_SESSIONS constant
279
-		if ( defined( 'GEODIR_USE_PHP_SESSIONS' ) && GEODIR_USE_PHP_SESSIONS ) {
279
+		if (defined('GEODIR_USE_PHP_SESSIONS') && GEODIR_USE_PHP_SESSIONS) {
280 280
 			$ret = true;
281
-		} else if ( defined( 'GEODIR_USE_PHP_SESSIONS' ) && ! GEODIR_USE_PHP_SESSIONS ) {
281
+		} else if (defined('GEODIR_USE_PHP_SESSIONS') && !GEODIR_USE_PHP_SESSIONS) {
282 282
 			$ret = false;
283 283
 		}
284 284
 
285
-		return (bool) apply_filters( 'geodir_use_php_sessions', $ret );
285
+		return (bool) apply_filters('geodir_use_php_sessions', $ret);
286 286
 	}
287 287
 
288 288
 	/**
289 289
 	 * Starts a new session if one hasn't started yet.
290 290
 	 */
291 291
 	public function maybe_start_session() {
292
-		if ( !session_id() && !headers_sent() ) {
292
+		if (!session_id() && !headers_sent()) {
293 293
 			session_start();
294 294
 		}
295 295
 	}
Please login to merge, or discard this patch.
geodirectory-functions/template_functions.php 3 patches
Braces   +58 added lines, -26 removed lines patch added patch discarded remove patch
@@ -47,16 +47,19 @@  discard block
 block discarded – undo
47 47
 
48 48
             if ($listing_page_id != '' && (is_page($listing_page_id) || ($is_wpml && !empty($wp->query_vars['page_id']))) && isset($_REQUEST['listing_type'])
49 49
                 && in_array($_REQUEST['listing_type'], geodir_get_posttypes())
50
-            )
51
-                $post_type = sanitize_text_field($_REQUEST['listing_type']);
50
+            ) {
51
+                            $post_type = sanitize_text_field($_REQUEST['listing_type']);
52
+            }
52 53
             if (empty($post_type) && !isset($_REQUEST['pid'])) {
53 54
                 $pagename = $wp->query_vars['pagename'];
54 55
                 $post_types = geodir_get_posttypes();
55
-                if (!empty($post_types))
56
-                    $post_type = $post_types[0];
56
+                if (!empty($post_types)) {
57
+                                    $post_type = $post_types[0];
58
+                }
57 59
 					
58
-				if($sc_post_type != '' )
59
-					$post_type = $sc_post_type;
60
+				if($sc_post_type != '' ) {
61
+									$post_type = $sc_post_type;
62
+				}
60 63
 				
61 64
                 if ($is_wpml && !empty($wp->query_vars['page_id'])) {
62 65
 					wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type)));
@@ -71,14 +74,16 @@  discard block
 block discarded – undo
71 74
             $success_page_id = geodir_success_page_id();
72 75
             if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type'])
73 76
                 && in_array($_REQUEST['listing_type'], geodir_get_posttypes())
74
-            )
75
-                $post_type = sanitize_text_field($_REQUEST['listing_type']);
77
+            ) {
78
+                            $post_type = sanitize_text_field($_REQUEST['listing_type']);
79
+            }
76 80
             return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php"));
77 81
             break;
78 82
         case 'detail':
79 83
         case 'preview':
80
-            if (in_array(get_post_type(), geodir_get_posttypes()))
81
-                $post_type = get_post_type();
84
+            if (in_array(get_post_type(), geodir_get_posttypes())) {
85
+                            $post_type = get_post_type();
86
+            }
82 87
             return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php"));
83 88
             break;
84 89
         case 'listing':
@@ -184,7 +189,9 @@  discard block
 block discarded – undo
184 189
 
185 190
         $template = geodir_locate_template('signup');
186 191
 
187
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
192
+        if (!$template) {
193
+        	$template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
194
+        }
188 195
 
189 196
         /**
190 197
          * Filter the signup template path.
@@ -202,7 +209,9 @@  discard block
 block discarded – undo
202 209
 
203 210
             $template = geodir_locate_template('information');
204 211
 
205
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
212
+            if (!$template) {
213
+            	$template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
214
+            }
206 215
             /**
207 216
              * Filter the information template path.
208 217
              *
@@ -219,7 +228,9 @@  discard block
 block discarded – undo
219 228
             if (!$is_current_user_owner) {
220 229
                 $template = geodir_locate_template('information');
221 230
 
222
-                if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
231
+                if (!$template) {
232
+                	$template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
233
+                }
223 234
                 /**
224 235
                  * Filter the information template path.
225 236
                  *
@@ -241,7 +252,9 @@  discard block
 block discarded – undo
241 252
 
242 253
         $template = geodir_locate_template('add-listing');
243 254
 
244
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php';
255
+        if (!$template) {
256
+        	$template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php';
257
+        }
245 258
         /**
246 259
          * Filter the add listing template path.
247 260
          *
@@ -258,7 +271,9 @@  discard block
 block discarded – undo
258 271
 
259 272
         $template = geodir_locate_template('preview');
260 273
 
261
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
274
+        if (!$template) {
275
+        	$template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
276
+        }
262 277
         /**
263 278
          * Filter the preview template path.
264 279
          *
@@ -274,7 +289,9 @@  discard block
 block discarded – undo
274 289
 
275 290
         $template = geodir_locate_template('success');
276 291
 
277
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php';
292
+        if (!$template) {
293
+        	$template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php';
294
+        }
278 295
         /**
279 296
          * Filter the success template path.
280 297
          *
@@ -289,7 +306,9 @@  discard block
 block discarded – undo
289 306
 
290 307
         $template = geodir_locate_template('detail');
291 308
 
292
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
309
+        if (!$template) {
310
+        	$template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
311
+        }
293 312
         /**
294 313
          * Filter the detail template path.
295 314
          *
@@ -304,7 +323,9 @@  discard block
 block discarded – undo
304 323
 
305 324
         $template = geodir_locate_template('listing');
306 325
 
307
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php';
326
+        if (!$template) {
327
+        	$template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php';
328
+        }
308 329
         /**
309 330
          * Filter the listing template path.
310 331
          *
@@ -319,7 +340,9 @@  discard block
 block discarded – undo
319 340
 
320 341
         $template = geodir_locate_template('search');
321 342
 
322
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php';
343
+        if (!$template) {
344
+        	$template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php';
345
+        }
323 346
         /**
324 347
          * Filter the search template path.
325 348
          *
@@ -334,7 +357,9 @@  discard block
 block discarded – undo
334 357
 
335 358
         $template = geodir_locate_template('author');
336 359
 
337
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php';
360
+        if (!$template) {
361
+        	$template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php';
362
+        }
338 363
         /**
339 364
          * Filter the author template path.
340 365
          *
@@ -355,7 +380,9 @@  discard block
 block discarded – undo
355 380
 
356 381
             $template = geodir_locate_template('geodir-home');
357 382
 
358
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php';
383
+            if (!$template) {
384
+            	$template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php';
385
+            }
359 386
             /**
360 387
              * Filter the home page template path.
361 388
              *
@@ -368,7 +395,9 @@  discard block
 block discarded – undo
368 395
 
369 396
             $template = geodir_locate_template('location');
370 397
 
371
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php';
398
+            if (!$template) {
399
+            	$template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php';
400
+            }
372 401
             /**
373 402
              * Filter the location template path.
374 403
              *
@@ -377,8 +406,9 @@  discard block
 block discarded – undo
377 406
              */
378 407
             return $template = apply_filters('geodir_template_location', $template);
379 408
 
380
-        } else
381
-            return $template;
409
+        } else {
410
+                    return $template;
411
+        }
382 412
 
383 413
     }
384 414
 
@@ -432,8 +462,10 @@  discard block
 block discarded – undo
432 462
          * @since 1.0.0
433 463
          */
434 464
         include($template);
435
-    else:
436
-        locate_template(array("geodirectory/" . $template_name), true, false);
465
+    else {
466
+    	:
467
+        locate_template(array("geodirectory/" . $template_name), true, false);
468
+    }
437 469
     endif;
438 470
 
439 471
 }
Please login to merge, or discard this patch.
Indentation   +349 added lines, -349 removed lines patch added patch discarded remove patch
@@ -19,18 +19,18 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_locate_template($template = '')
21 21
 {
22
-    global $post_type, $wp, $post;
23
-    $fields = array();
22
+	global $post_type, $wp, $post;
23
+	$fields = array();
24 24
 
25
-    switch ($template):
26
-        case 'signup':
27
-            return $template = locate_template(array("geodirectory/geodir-signup.php"));
28
-            break;
29
-        case 'add-listing':
25
+	switch ($template):
26
+		case 'signup':
27
+			return $template = locate_template(array("geodirectory/geodir-signup.php"));
28
+			break;
29
+		case 'add-listing':
30 30
 
31
-            $sc_post_type = '';
31
+			$sc_post_type = '';
32 32
 			if (is_page() && isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
33
-                $listing_page_id = $post->ID;
33
+				$listing_page_id = $post->ID;
34 34
 				
35 35
 				$regex_pattern = get_shortcode_regex();
36 36
 				preg_match('/'.$regex_pattern.'/s', $post->post_content, $regex_matches);
@@ -39,100 +39,100 @@  discard block
 block discarded – undo
39 39
 					$shortcode_atts = shortcode_parse_atts($regex_matches[3]);
40 40
 					$sc_post_type = !empty($shortcode_atts) && isset($shortcode_atts['listing_type']) && !empty($shortcode_atts['listing_type']) ? $shortcode_atts['listing_type'] : '';
41 41
 				}
42
-            } else {
43
-                $listing_page_id = geodir_add_listing_page_id();
44
-            }
42
+			} else {
43
+				$listing_page_id = geodir_add_listing_page_id();
44
+			}
45 45
 			
46 46
 			$is_wpml = function_exists('icl_object_id') ? true : false;
47 47
 
48
-            if ($listing_page_id != '' && (is_page($listing_page_id) || ($is_wpml && !empty($wp->query_vars['page_id']))) && isset($_REQUEST['listing_type'])
49
-                && in_array($_REQUEST['listing_type'], geodir_get_posttypes())
50
-            )
51
-                $post_type = sanitize_text_field($_REQUEST['listing_type']);
52
-            if (empty($post_type) && !isset($_REQUEST['pid'])) {
53
-                $pagename = $wp->query_vars['pagename'];
54
-                $post_types = geodir_get_posttypes();
55
-                if (!empty($post_types))
56
-                    $post_type = $post_types[0];
48
+			if ($listing_page_id != '' && (is_page($listing_page_id) || ($is_wpml && !empty($wp->query_vars['page_id']))) && isset($_REQUEST['listing_type'])
49
+				&& in_array($_REQUEST['listing_type'], geodir_get_posttypes())
50
+			)
51
+				$post_type = sanitize_text_field($_REQUEST['listing_type']);
52
+			if (empty($post_type) && !isset($_REQUEST['pid'])) {
53
+				$pagename = $wp->query_vars['pagename'];
54
+				$post_types = geodir_get_posttypes();
55
+				if (!empty($post_types))
56
+					$post_type = $post_types[0];
57 57
 					
58 58
 				if($sc_post_type != '' )
59 59
 					$post_type = $sc_post_type;
60 60
 				
61
-                if ($is_wpml && !empty($wp->query_vars['page_id'])) {
61
+				if ($is_wpml && !empty($wp->query_vars['page_id'])) {
62 62
 					wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type)));
63 63
 				} else {
64 64
 					wp_redirect(trailingslashit(get_site_url()) . $pagename . '/?listing_type=' . $post_type);
65 65
 				}
66
-                gd_die();
67
-            }
68
-            return $template = locate_template(array("geodirectory/add-{$post_type}.php", "geodirectory/add-listing.php"));
69
-            break;
70
-        case 'success':
71
-            $success_page_id = geodir_success_page_id();
72
-            if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type'])
73
-                && in_array($_REQUEST['listing_type'], geodir_get_posttypes())
74
-            )
75
-                $post_type = sanitize_text_field($_REQUEST['listing_type']);
76
-            return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php"));
77
-            break;
78
-        case 'detail':
79
-        case 'preview':
80
-            if (in_array(get_post_type(), geodir_get_posttypes()))
81
-                $post_type = get_post_type();
82
-            return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php"));
83
-            break;
84
-        case 'listing':
85
-            $templates = array();
86
-            if (is_post_type_archive() && in_array(get_post_type(), geodir_get_posttypes())) {
87
-                $post_type = get_post_type();
88
-                $templates[] = "geodirectory/archive-$post_type.php";
89
-            }
90
-
91
-
92
-            if (is_tax() && geodir_get_taxonomy_posttype()) {
93
-                $query_obj = get_queried_object();
94
-                $curr_taxonomy = isset($query_obj->taxonomy) ? $query_obj->taxonomy : '';
95
-                $curr_term = isset($query_obj->slug) ? $query_obj->slug : '';
96
-                $templates[] = "geodirectory/taxonomy-$curr_taxonomy-$curr_term.php";
97
-                $templates[] = "geodirectory/taxonomy-$curr_taxonomy.php";
98
-            }
99
-
100
-            $templates[] = "geodirectory/geodir-listing.php";
101
-
102
-            return $template = locate_template($templates);
103
-            break;
104
-        case 'information':
105
-            return $template = locate_template(array("geodirectory/geodir-information.php"));
106
-            break;
107
-        case 'author':
108
-            return $template = locate_template(array("geodirectory/geodir-author.php"));
109
-            break;
110
-        case 'search':
111
-            return $template = locate_template(array("geodirectory/geodir-search.php"));
112
-            break;
113
-        case 'location':
114
-            return $template = locate_template(array("geodirectory/geodir-location.php"));
115
-            break;
116
-        case 'geodir-home':
117
-            return $template = locate_template(array("geodirectory/geodir-home.php"));
118
-            break;
119
-        case 'listing-listview':
120
-            $template = locate_template(array("geodirectory/listing-listview.php"));
121
-            if (!$template) {
122
-                $template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php';
123
-            }
124
-            return $template;
125
-            break;
126
-        case 'widget-listing-listview':
127
-            $template = locate_template(array("geodirectory/widget-listing-listview.php"));
128
-            if (!$template) {
129
-                $template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php';
130
-            }
131
-            return $template;
132
-            break;
133
-    endswitch;
134
-
135
-    return false;
66
+				gd_die();
67
+			}
68
+			return $template = locate_template(array("geodirectory/add-{$post_type}.php", "geodirectory/add-listing.php"));
69
+			break;
70
+		case 'success':
71
+			$success_page_id = geodir_success_page_id();
72
+			if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type'])
73
+				&& in_array($_REQUEST['listing_type'], geodir_get_posttypes())
74
+			)
75
+				$post_type = sanitize_text_field($_REQUEST['listing_type']);
76
+			return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php"));
77
+			break;
78
+		case 'detail':
79
+		case 'preview':
80
+			if (in_array(get_post_type(), geodir_get_posttypes()))
81
+				$post_type = get_post_type();
82
+			return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php"));
83
+			break;
84
+		case 'listing':
85
+			$templates = array();
86
+			if (is_post_type_archive() && in_array(get_post_type(), geodir_get_posttypes())) {
87
+				$post_type = get_post_type();
88
+				$templates[] = "geodirectory/archive-$post_type.php";
89
+			}
90
+
91
+
92
+			if (is_tax() && geodir_get_taxonomy_posttype()) {
93
+				$query_obj = get_queried_object();
94
+				$curr_taxonomy = isset($query_obj->taxonomy) ? $query_obj->taxonomy : '';
95
+				$curr_term = isset($query_obj->slug) ? $query_obj->slug : '';
96
+				$templates[] = "geodirectory/taxonomy-$curr_taxonomy-$curr_term.php";
97
+				$templates[] = "geodirectory/taxonomy-$curr_taxonomy.php";
98
+			}
99
+
100
+			$templates[] = "geodirectory/geodir-listing.php";
101
+
102
+			return $template = locate_template($templates);
103
+			break;
104
+		case 'information':
105
+			return $template = locate_template(array("geodirectory/geodir-information.php"));
106
+			break;
107
+		case 'author':
108
+			return $template = locate_template(array("geodirectory/geodir-author.php"));
109
+			break;
110
+		case 'search':
111
+			return $template = locate_template(array("geodirectory/geodir-search.php"));
112
+			break;
113
+		case 'location':
114
+			return $template = locate_template(array("geodirectory/geodir-location.php"));
115
+			break;
116
+		case 'geodir-home':
117
+			return $template = locate_template(array("geodirectory/geodir-home.php"));
118
+			break;
119
+		case 'listing-listview':
120
+			$template = locate_template(array("geodirectory/listing-listview.php"));
121
+			if (!$template) {
122
+				$template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php';
123
+			}
124
+			return $template;
125
+			break;
126
+		case 'widget-listing-listview':
127
+			$template = locate_template(array("geodirectory/widget-listing-listview.php"));
128
+			if (!$template) {
129
+				$template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php';
130
+			}
131
+			return $template;
132
+			break;
133
+	endswitch;
134
+
135
+	return false;
136 136
 
137 137
 }
138 138
 
@@ -151,255 +151,255 @@  discard block
 block discarded – undo
151 151
 function geodir_template_loader($template)
152 152
 {
153 153
 
154
-    global $wp_query;
155
-
156
-    /**
157
-     * Filter the custom page list.
158
-     *
159
-     * @since 1.0.0
160
-     */
161
-    $geodir_custom_page_list = apply_filters('geodir_set_custom_pages', array(
162
-        'geodir_signup_page' =>
163
-            apply_filters('geodir_set_custom_signup_page', false),
164
-        'geodir_add_listing_page' =>
165
-            apply_filters('geodir_set_custom_add_listing_page', false),
166
-        'geodir_preview_page' =>
167
-            apply_filters('geodir_set_custom_preview_page', false),
168
-        'geodir_listing_success_page' =>
169
-            apply_filters('geodir_set_custom_listing_success_page', false),
170
-        'geodir_listing_detail_page' =>
171
-            apply_filters('geodir_set_custom_listing_detail_page', false),
172
-        'geodir_listing_page' =>
173
-            apply_filters('geodir_set_custom_listing_page', false),
174
-        'geodir_search_page' =>
175
-            apply_filters('geodir_set_custom_search_page', false),
176
-        'geodir_author_page' =>
177
-            apply_filters('geodir_set_custom_author_page', false),
178
-        'geodir_home_map_page' =>
179
-            apply_filters('geodir_set_custom_home_map_page', false)
180
-    ));
181
-
182
-
183
-    if (geodir_is_page('login') || $geodir_custom_page_list['geodir_signup_page']) {
184
-
185
-        $template = geodir_locate_template('signup');
186
-
187
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
188
-
189
-        /**
190
-         * Filter the signup template path.
191
-         *
192
-         * @since 1.0.0
193
-         * @param string $template The template path.
194
-         */
195
-        return $template = apply_filters('geodir_template_signup', $template);
196
-    }
197
-
198
-    if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) {
199
-        if (!geodir_is_default_location_set()) {
200
-            global $information;
201
-            $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>');
202
-
203
-            $template = geodir_locate_template('information');
204
-
205
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
206
-            /**
207
-             * Filter the information template path.
208
-             *
209
-             * @since 1.0.0
210
-             * @param string $template The template path.
211
-             */
212
-            return $template = apply_filters('geodir_template_information', $template);
213
-        }
214
-        // check if pid exists in the record if yes then check if this post belongs to the user who is logged in.
215
-        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
216
-            /// WPML
217
-            if (geodir_is_wpml() && $duplicate_of = wpml_get_master_post_from_duplicate((int)$_GET['pid'])) {
218
-                global $sitepress;
154
+	global $wp_query;
155
+
156
+	/**
157
+	 * Filter the custom page list.
158
+	 *
159
+	 * @since 1.0.0
160
+	 */
161
+	$geodir_custom_page_list = apply_filters('geodir_set_custom_pages', array(
162
+		'geodir_signup_page' =>
163
+			apply_filters('geodir_set_custom_signup_page', false),
164
+		'geodir_add_listing_page' =>
165
+			apply_filters('geodir_set_custom_add_listing_page', false),
166
+		'geodir_preview_page' =>
167
+			apply_filters('geodir_set_custom_preview_page', false),
168
+		'geodir_listing_success_page' =>
169
+			apply_filters('geodir_set_custom_listing_success_page', false),
170
+		'geodir_listing_detail_page' =>
171
+			apply_filters('geodir_set_custom_listing_detail_page', false),
172
+		'geodir_listing_page' =>
173
+			apply_filters('geodir_set_custom_listing_page', false),
174
+		'geodir_search_page' =>
175
+			apply_filters('geodir_set_custom_search_page', false),
176
+		'geodir_author_page' =>
177
+			apply_filters('geodir_set_custom_author_page', false),
178
+		'geodir_home_map_page' =>
179
+			apply_filters('geodir_set_custom_home_map_page', false)
180
+	));
181
+
182
+
183
+	if (geodir_is_page('login') || $geodir_custom_page_list['geodir_signup_page']) {
184
+
185
+		$template = geodir_locate_template('signup');
186
+
187
+		if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
188
+
189
+		/**
190
+		 * Filter the signup template path.
191
+		 *
192
+		 * @since 1.0.0
193
+		 * @param string $template The template path.
194
+		 */
195
+		return $template = apply_filters('geodir_template_signup', $template);
196
+	}
197
+
198
+	if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) {
199
+		if (!geodir_is_default_location_set()) {
200
+			global $information;
201
+			$information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>');
202
+
203
+			$template = geodir_locate_template('information');
204
+
205
+			if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
206
+			/**
207
+			 * Filter the information template path.
208
+			 *
209
+			 * @since 1.0.0
210
+			 * @param string $template The template path.
211
+			 */
212
+			return $template = apply_filters('geodir_template_information', $template);
213
+		}
214
+		// check if pid exists in the record if yes then check if this post belongs to the user who is logged in.
215
+		if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
216
+			/// WPML
217
+			if (geodir_is_wpml() && $duplicate_of = wpml_get_master_post_from_duplicate((int)$_GET['pid'])) {
218
+				global $sitepress;
219 219
                 
220
-                $lang_of_duplicate = geodir_get_language_for_element($duplicate_of, 'post_' . get_post_type($duplicate_of));
221
-                $sitepress->switch_lang($lang_of_duplicate, true);
220
+				$lang_of_duplicate = geodir_get_language_for_element($duplicate_of, 'post_' . get_post_type($duplicate_of));
221
+				$sitepress->switch_lang($lang_of_duplicate, true);
222 222
         
223
-                $redirect_to = get_permalink(geodir_add_listing_page_id());
224
-                $_GET['pid'] = $duplicate_of;
225
-                if (!empty($_GET)) {
226
-                    $redirect_to = add_query_arg($_GET, $redirect_to);
227
-                }
228
-                wp_redirect($redirect_to);
229
-                exit;
230
-            }
231
-            /// WPML
223
+				$redirect_to = get_permalink(geodir_add_listing_page_id());
224
+				$_GET['pid'] = $duplicate_of;
225
+				if (!empty($_GET)) {
226
+					$redirect_to = add_query_arg($_GET, $redirect_to);
227
+				}
228
+				wp_redirect($redirect_to);
229
+				exit;
230
+			}
231
+			/// WPML
232 232
             
233
-            global $information;
234
-            $information = __('This listing does not belong to your account, please check the listing id carefully.', 'geodirectory');
235
-            $is_current_user_owner = geodir_listing_belong_to_current_user();
236
-            if (!$is_current_user_owner) {
237
-                $template = geodir_locate_template('information');
238
-
239
-                if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
240
-                /**
241
-                 * Filter the information template path.
242
-                 *
243
-                 * @since 1.0.0
244
-                 * @param string $template The template path.
245
-                 */
246
-                return $template = apply_filters('geodir_template_information', $template);
247
-            }
233
+			global $information;
234
+			$information = __('This listing does not belong to your account, please check the listing id carefully.', 'geodirectory');
235
+			$is_current_user_owner = geodir_listing_belong_to_current_user();
236
+			if (!$is_current_user_owner) {
237
+				$template = geodir_locate_template('information');
238
+
239
+				if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
240
+				/**
241
+				 * Filter the information template path.
242
+				 *
243
+				 * @since 1.0.0
244
+				 * @param string $template The template path.
245
+				 */
246
+				return $template = apply_filters('geodir_template_information', $template);
247
+			}
248
+
248 249
 
250
+		}
249 251
 
250
-        }
252
+		//geodir_is_login(true);
253
+		global $current_user;
254
+		if (!$current_user->ID) {
255
+			wp_redirect(geodir_login_url(array('redirect_add_listing'=>urlencode(geodir_curPageURL()))), 302);
256
+			exit;
257
+		}
251 258
 
252
-        //geodir_is_login(true);
253
-        global $current_user;
254
-        if (!$current_user->ID) {
255
-            wp_redirect(geodir_login_url(array('redirect_add_listing'=>urlencode(geodir_curPageURL()))), 302);
256
-            exit;
257
-        }
259
+		$template = geodir_locate_template('add-listing');
258 260
 
259
-        $template = geodir_locate_template('add-listing');
260
-
261
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php';
262
-        /**
263
-         * Filter the add listing template path.
264
-         *
265
-         * @since 1.0.0
266
-         * @param string $template The template path.
267
-         */
268
-        return $template = apply_filters('geodir_template_add_listing', $template);
269
-    }
261
+		if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php';
262
+		/**
263
+		 * Filter the add listing template path.
264
+		 *
265
+		 * @since 1.0.0
266
+		 * @param string $template The template path.
267
+		 */
268
+		return $template = apply_filters('geodir_template_add_listing', $template);
269
+	}
270 270
 
271 271
 
272
-    if (geodir_is_page('preview') || $geodir_custom_page_list['geodir_preview_page']) {
273
-        global $preview;
274
-        $preview = true;
272
+	if (geodir_is_page('preview') || $geodir_custom_page_list['geodir_preview_page']) {
273
+		global $preview;
274
+		$preview = true;
275 275
 
276
-        $template = geodir_locate_template('preview');
276
+		$template = geodir_locate_template('preview');
277 277
 
278
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
279
-        /**
280
-         * Filter the preview template path.
281
-         *
282
-         * @since 1.0.0
283
-         * @param string $template The template path.
284
-         */
285
-        return $template = apply_filters('geodir_template_preview', $template);
278
+		if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
279
+		/**
280
+		 * Filter the preview template path.
281
+		 *
282
+		 * @since 1.0.0
283
+		 * @param string $template The template path.
284
+		 */
285
+		return $template = apply_filters('geodir_template_preview', $template);
286 286
 
287
-    }
287
+	}
288 288
 
289 289
 
290
-    if (geodir_is_page('listing-success') || $geodir_custom_page_list['geodir_listing_success_page']) {
290
+	if (geodir_is_page('listing-success') || $geodir_custom_page_list['geodir_listing_success_page']) {
291 291
 
292
-        $template = geodir_locate_template('success');
292
+		$template = geodir_locate_template('success');
293 293
 
294
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php';
295
-        /**
296
-         * Filter the success template path.
297
-         *
298
-         * @since 1.0.0
299
-         * @param string $template The template path.
300
-         */
301
-        return $template = apply_filters('geodir_template_success', $template);
294
+		if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php';
295
+		/**
296
+		 * Filter the success template path.
297
+		 *
298
+		 * @since 1.0.0
299
+		 * @param string $template The template path.
300
+		 */
301
+		return $template = apply_filters('geodir_template_success', $template);
302 302
 
303
-    }
303
+	}
304 304
 
305
-    if (geodir_is_page('detail') || $geodir_custom_page_list['geodir_listing_detail_page']) {
305
+	if (geodir_is_page('detail') || $geodir_custom_page_list['geodir_listing_detail_page']) {
306 306
 
307
-        $template = geodir_locate_template('detail');
307
+		$template = geodir_locate_template('detail');
308 308
 
309
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
310
-        /**
311
-         * Filter the detail template path.
312
-         *
313
-         * @since 1.0.0
314
-         * @param string $template The template path.
315
-         */
316
-        return $template = apply_filters('geodir_template_detail', $template);
309
+		if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
310
+		/**
311
+		 * Filter the detail template path.
312
+		 *
313
+		 * @since 1.0.0
314
+		 * @param string $template The template path.
315
+		 */
316
+		return $template = apply_filters('geodir_template_detail', $template);
317 317
 
318
-    }
318
+	}
319 319
 
320
-    if (geodir_is_page('listing') || $geodir_custom_page_list['geodir_listing_page']) {
320
+	if (geodir_is_page('listing') || $geodir_custom_page_list['geodir_listing_page']) {
321 321
 
322
-        $template = geodir_locate_template('listing');
322
+		$template = geodir_locate_template('listing');
323 323
 
324
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php';
325
-        /**
326
-         * Filter the listing template path.
327
-         *
328
-         * @since 1.0.0
329
-         * @param string $template The template path.
330
-         */
331
-        return $template = apply_filters('geodir_template_listing', $template);
324
+		if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php';
325
+		/**
326
+		 * Filter the listing template path.
327
+		 *
328
+		 * @since 1.0.0
329
+		 * @param string $template The template path.
330
+		 */
331
+		return $template = apply_filters('geodir_template_listing', $template);
332 332
 
333
-    }
333
+	}
334 334
 
335
-    if (geodir_is_page('search') || $geodir_custom_page_list['geodir_search_page']) {
335
+	if (geodir_is_page('search') || $geodir_custom_page_list['geodir_search_page']) {
336 336
 
337
-        $template = geodir_locate_template('search');
337
+		$template = geodir_locate_template('search');
338 338
 
339
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php';
340
-        /**
341
-         * Filter the search template path.
342
-         *
343
-         * @since 1.0.0
344
-         * @param string $template The template path.
345
-         */
346
-        return $template = apply_filters('geodir_template_search', $template);
339
+		if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php';
340
+		/**
341
+		 * Filter the search template path.
342
+		 *
343
+		 * @since 1.0.0
344
+		 * @param string $template The template path.
345
+		 */
346
+		return $template = apply_filters('geodir_template_search', $template);
347 347
 
348
-    }
348
+	}
349 349
 
350
-    if (geodir_is_page('author') || $geodir_custom_page_list['geodir_author_page']) {
350
+	if (geodir_is_page('author') || $geodir_custom_page_list['geodir_author_page']) {
351 351
 
352
-        $template = geodir_locate_template('author');
352
+		$template = geodir_locate_template('author');
353 353
 
354
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php';
355
-        /**
356
-         * Filter the author template path.
357
-         *
358
-         * @since 1.0.0
359
-         * @param string $template The template path.
360
-         */
361
-        return $template = apply_filters('geodir_template_author', $template);
354
+		if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php';
355
+		/**
356
+		 * Filter the author template path.
357
+		 *
358
+		 * @since 1.0.0
359
+		 * @param string $template The template path.
360
+		 */
361
+		return $template = apply_filters('geodir_template_author', $template);
362 362
 
363
-    }
363
+	}
364 364
 
365
-    if ( geodir_is_page('home') || geodir_is_page('location')) {
365
+	if ( geodir_is_page('home') || geodir_is_page('location')) {
366 366
 
367
-        global $post, $wp_query;
367
+		global $post, $wp_query;
368 368
 
369
-        if (geodir_is_page('home') || ('page' == get_option('show_on_front') && isset($post->ID) && $post->ID == get_option('page_on_front'))
370
-            || (is_home() && !$wp_query->is_posts_page)
371
-        ) {
369
+		if (geodir_is_page('home') || ('page' == get_option('show_on_front') && isset($post->ID) && $post->ID == get_option('page_on_front'))
370
+			|| (is_home() && !$wp_query->is_posts_page)
371
+		) {
372 372
 
373
-            $template = geodir_locate_template('geodir-home');
373
+			$template = geodir_locate_template('geodir-home');
374 374
 
375
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php';
376
-            /**
377
-             * Filter the home page template path.
378
-             *
379
-             * @since 1.0.0
380
-             * @param string $template The template path.
381
-             */
382
-            return $template = apply_filters('geodir_template_homepage', $template);
375
+			if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php';
376
+			/**
377
+			 * Filter the home page template path.
378
+			 *
379
+			 * @since 1.0.0
380
+			 * @param string $template The template path.
381
+			 */
382
+			return $template = apply_filters('geodir_template_homepage', $template);
383 383
 
384
-        } elseif (geodir_is_page('location')) {
384
+		} elseif (geodir_is_page('location')) {
385 385
 
386
-            $template = geodir_locate_template('location');
386
+			$template = geodir_locate_template('location');
387 387
 
388
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php';
389
-            /**
390
-             * Filter the location template path.
391
-             *
392
-             * @since 1.0.0
393
-             * @param string $template The template path.
394
-             */
395
-            return $template = apply_filters('geodir_template_location', $template);
388
+			if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php';
389
+			/**
390
+			 * Filter the location template path.
391
+			 *
392
+			 * @since 1.0.0
393
+			 * @param string $template The template path.
394
+			 */
395
+			return $template = apply_filters('geodir_template_location', $template);
396 396
 
397
-        } else
398
-            return $template;
397
+		} else
398
+			return $template;
399 399
 
400
-    }
400
+	}
401 401
 
402
-    return $template;
402
+	return $template;
403 403
 }
404 404
 
405 405
 /**
@@ -414,44 +414,44 @@  discard block
 block discarded – undo
414 414
  */
415 415
 function geodir_get_template_part($slug = '', $name = NULL)
416 416
 {
417
-    global $geodirectory, $post;
418
-    /**
419
-     * Called at the start for the geodir_get_template_part() function.
420
-     *
421
-     * Used dynamic hook name: geodir_get_template_part_{$slug}
422
-     *
423
-     * @since 1.0.0
424
-     * @package GeoDirectory
425
-     * @param string $slug The template slug.
426
-     * @param string $name The template name.
427
-     */
428
-    do_action("geodir_get_template_part_{$slug}", $slug, $name);
429
-    $templates = array();
430
-    $name = (string)$name;
431
-    if ('' !== $name) {
432
-        $template_name = "{$slug}-{$name}.php";
433
-
434
-    } else {
435
-        $template_name = "{$slug}.php";
436
-    }
437
-
438
-    if (!locate_template(array("geodirectory/" . $template_name))) :
439
-        /**
440
-         * Filter the template part with slug and name.
441
-         *
442
-         * @since 1.0.0
443
-         * @param string $template_name The template name.
444
-         */
445
-        $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name);
446
-        /**
447
-         * Includes the template part with slug and name.
448
-         *
449
-         * @since 1.0.0
450
-         */
451
-        include($template);
452
-    else:
453
-        locate_template(array("geodirectory/" . $template_name), true, false);
454
-    endif;
417
+	global $geodirectory, $post;
418
+	/**
419
+	 * Called at the start for the geodir_get_template_part() function.
420
+	 *
421
+	 * Used dynamic hook name: geodir_get_template_part_{$slug}
422
+	 *
423
+	 * @since 1.0.0
424
+	 * @package GeoDirectory
425
+	 * @param string $slug The template slug.
426
+	 * @param string $name The template name.
427
+	 */
428
+	do_action("geodir_get_template_part_{$slug}", $slug, $name);
429
+	$templates = array();
430
+	$name = (string)$name;
431
+	if ('' !== $name) {
432
+		$template_name = "{$slug}-{$name}.php";
433
+
434
+	} else {
435
+		$template_name = "{$slug}.php";
436
+	}
437
+
438
+	if (!locate_template(array("geodirectory/" . $template_name))) :
439
+		/**
440
+		 * Filter the template part with slug and name.
441
+		 *
442
+		 * @since 1.0.0
443
+		 * @param string $template_name The template name.
444
+		 */
445
+		$template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name);
446
+		/**
447
+		 * Includes the template part with slug and name.
448
+		 *
449
+		 * @since 1.0.0
450
+		 */
451
+		include($template);
452
+	else:
453
+		locate_template(array("geodirectory/" . $template_name), true, false);
454
+	endif;
455 455
 
456 456
 }
457 457
 
@@ -467,23 +467,23 @@  discard block
 block discarded – undo
467 467
  */
468 468
 function geodir_core_post_view_extra_class($class, $all_postypes = '')
469 469
 {
470
-    global $post;
470
+	global $post;
471 471
 
472
-    if (!$all_postypes) {
473
-        $all_postypes = geodir_get_posttypes();
474
-    }
472
+	if (!$all_postypes) {
473
+		$all_postypes = geodir_get_posttypes();
474
+	}
475 475
 
476
-    $gdp_post_id = !empty($post) && isset($post->ID) ? $post->ID : NULL;
477
-    $gdp_post_type = $gdp_post_id > 0 && isset($post->post_type) ? $post->post_type : NULL;
478
-    $gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL;
476
+	$gdp_post_id = !empty($post) && isset($post->ID) ? $post->ID : NULL;
477
+	$gdp_post_type = $gdp_post_id > 0 && isset($post->post_type) ? $post->post_type : NULL;
478
+	$gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL;
479 479
 
480
-    if ($gdp_post_id && $gdp_post_type) {
481
-        $append_class = 'gd-post-' . $gdp_post_type;
482
-        $append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : '';
483
-        $class = $class != '' ? $class . ' ' . $append_class : $append_class;
484
-    }
480
+	if ($gdp_post_id && $gdp_post_type) {
481
+		$append_class = 'gd-post-' . $gdp_post_type;
482
+		$append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : '';
483
+		$class = $class != '' ? $class . ' ' . $append_class : $append_class;
484
+	}
485 485
 
486
-    return $class;
486
+	return $class;
487 487
 }
488 488
 
489 489
 /**
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
  * @param bool $favorite Listing Optional. Are favorite listings results? Default: false.
498 498
  */
499 499
 function geodir_display_message_not_found_on_listing($template_listview = 'listing-listview', $favorite = false) {
500
-    if ($favorite) {
500
+	if ($favorite) {
501 501
 		$message = __('No favorite listings found which match your selection.', 'geodirectory');
502 502
 	} else {
503 503
 		$message = __('No listings found which match your selection.', 'geodirectory');
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -55,13 +55,13 @@  discard block
 block discarded – undo
55 55
                 if (!empty($post_types))
56 56
                     $post_type = $post_types[0];
57 57
 					
58
-				if($sc_post_type != '' )
58
+				if ($sc_post_type != '')
59 59
 					$post_type = $sc_post_type;
60 60
 				
61 61
                 if ($is_wpml && !empty($wp->query_vars['page_id'])) {
62 62
 					wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type)));
63 63
 				} else {
64
-					wp_redirect(trailingslashit(get_site_url()) . $pagename . '/?listing_type=' . $post_type);
64
+					wp_redirect(trailingslashit(get_site_url()).$pagename.'/?listing_type='.$post_type);
65 65
 				}
66 66
                 gd_die();
67 67
             }
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
         case 'listing-listview':
120 120
             $template = locate_template(array("geodirectory/listing-listview.php"));
121 121
             if (!$template) {
122
-                $template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php';
122
+                $template = geodir_plugin_path().'/geodirectory-templates/listing-listview.php';
123 123
             }
124 124
             return $template;
125 125
             break;
126 126
         case 'widget-listing-listview':
127 127
             $template = locate_template(array("geodirectory/widget-listing-listview.php"));
128 128
             if (!$template) {
129
-                $template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php';
129
+                $template = geodir_plugin_path().'/geodirectory-templates/widget-listing-listview.php';
130 130
             }
131 131
             return $template;
132 132
             break;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
         $template = geodir_locate_template('signup');
186 186
 
187
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
187
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-signup.php';
188 188
 
189 189
         /**
190 190
          * Filter the signup template path.
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
     if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) {
199 199
         if (!geodir_is_default_location_set()) {
200 200
             global $information;
201
-            $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>');
201
+            $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\''.admin_url('admin.php?page=geodirectory&tab=default_location_settings').'\'>', '</a>');
202 202
 
203 203
             $template = geodir_locate_template('information');
204 204
 
205
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
205
+            if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php';
206 206
             /**
207 207
              * Filter the information template path.
208 208
              *
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
         // check if pid exists in the record if yes then check if this post belongs to the user who is logged in.
215 215
         if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
216 216
             /// WPML
217
-            if (geodir_is_wpml() && $duplicate_of = wpml_get_master_post_from_duplicate((int)$_GET['pid'])) {
217
+            if (geodir_is_wpml() && $duplicate_of = wpml_get_master_post_from_duplicate((int) $_GET['pid'])) {
218 218
                 global $sitepress;
219 219
                 
220
-                $lang_of_duplicate = geodir_get_language_for_element($duplicate_of, 'post_' . get_post_type($duplicate_of));
220
+                $lang_of_duplicate = geodir_get_language_for_element($duplicate_of, 'post_'.get_post_type($duplicate_of));
221 221
                 $sitepress->switch_lang($lang_of_duplicate, true);
222 222
         
223 223
                 $redirect_to = get_permalink(geodir_add_listing_page_id());
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
             if (!$is_current_user_owner) {
237 237
                 $template = geodir_locate_template('information');
238 238
 
239
-                if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
239
+                if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php';
240 240
                 /**
241 241
                  * Filter the information template path.
242 242
                  *
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
         $template = geodir_locate_template('add-listing');
260 260
 
261
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php';
261
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/add-listing.php';
262 262
         /**
263 263
          * Filter the add listing template path.
264 264
          *
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
         $template = geodir_locate_template('preview');
277 277
 
278
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
278
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-detail.php';
279 279
         /**
280 280
          * Filter the preview template path.
281 281
          *
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
         $template = geodir_locate_template('success');
293 293
 
294
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php';
294
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-success.php';
295 295
         /**
296 296
          * Filter the success template path.
297 297
          *
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 
307 307
         $template = geodir_locate_template('detail');
308 308
 
309
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
309
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-detail.php';
310 310
         /**
311 311
          * Filter the detail template path.
312 312
          *
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
         $template = geodir_locate_template('listing');
323 323
 
324
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php';
324
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-listing.php';
325 325
         /**
326 326
          * Filter the listing template path.
327 327
          *
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 
337 337
         $template = geodir_locate_template('search');
338 338
 
339
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php';
339
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-search.php';
340 340
         /**
341 341
          * Filter the search template path.
342 342
          *
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 
352 352
         $template = geodir_locate_template('author');
353 353
 
354
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php';
354
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-author.php';
355 355
         /**
356 356
          * Filter the author template path.
357 357
          *
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 
363 363
     }
364 364
 
365
-    if ( geodir_is_page('home') || geodir_is_page('location')) {
365
+    if (geodir_is_page('home') || geodir_is_page('location')) {
366 366
 
367 367
         global $post, $wp_query;
368 368
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 
373 373
             $template = geodir_locate_template('geodir-home');
374 374
 
375
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php';
375
+            if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-home.php';
376 376
             /**
377 377
              * Filter the home page template path.
378 378
              *
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 
386 386
             $template = geodir_locate_template('location');
387 387
 
388
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php';
388
+            if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-location.php';
389 389
             /**
390 390
              * Filter the location template path.
391 391
              *
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
      */
428 428
     do_action("geodir_get_template_part_{$slug}", $slug, $name);
429 429
     $templates = array();
430
-    $name = (string)$name;
430
+    $name = (string) $name;
431 431
     if ('' !== $name) {
432 432
         $template_name = "{$slug}-{$name}.php";
433 433
 
@@ -435,14 +435,14 @@  discard block
 block discarded – undo
435 435
         $template_name = "{$slug}.php";
436 436
     }
437 437
 
438
-    if (!locate_template(array("geodirectory/" . $template_name))) :
438
+    if (!locate_template(array("geodirectory/".$template_name))) :
439 439
         /**
440 440
          * Filter the template part with slug and name.
441 441
          *
442 442
          * @since 1.0.0
443 443
          * @param string $template_name The template name.
444 444
          */
445
-        $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name);
445
+        $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path().'/geodirectory-templates/'.$template_name);
446 446
         /**
447 447
          * Includes the template part with slug and name.
448 448
          *
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
          */
451 451
         include($template);
452 452
     else:
453
-        locate_template(array("geodirectory/" . $template_name), true, false);
453
+        locate_template(array("geodirectory/".$template_name), true, false);
454 454
     endif;
455 455
 
456 456
 }
@@ -478,9 +478,9 @@  discard block
 block discarded – undo
478 478
     $gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL;
479 479
 
480 480
     if ($gdp_post_id && $gdp_post_type) {
481
-        $append_class = 'gd-post-' . $gdp_post_type;
481
+        $append_class = 'gd-post-'.$gdp_post_type;
482 482
         $append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : '';
483
-        $class = $class != '' ? $class . ' ' . $append_class : $append_class;
483
+        $class = $class != '' ? $class.' '.$append_class : $append_class;
484 484
     }
485 485
 
486 486
     return $class;
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 	 */
513 513
 	$message = apply_filters('geodir_message_listing_not_found', $message, $template_listview, $favorite);
514 514
 	
515
-	echo '<li class="no-listing">' . $message . '</li>';
515
+	echo '<li class="no-listing">'.$message.'</li>';
516 516
 }
517 517
 
518 518
 /**
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 function geodir_convert_listing_view_class($columns = '') {
542 542
 	$class = '';
543 543
 	
544
-	switch ((int)$columns) {
544
+	switch ((int) $columns) {
545 545
 		case 1:
546 546
 			$class = '';
547 547
 		break;
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 		$html .= '<option value=""></option>';
607 607
 		if (!empty($star_texts) && is_array($star_texts)) {
608 608
 			foreach ($star_texts as $i => $text) {
609
-				$html .= '<option ' . selected((int)($i + 1), (int)$default, false) . ' value="' . (int)($i + 1) . '">' . $text . '</option>';
609
+				$html .= '<option '.selected((int) ($i + 1), (int) $default, false).' value="'.(int) ($i + 1).'">'.$text.'</option>';
610 610
 			}
611 611
 		} else {
612 612
 			$html .= '<option value="1">1</option>';
@@ -635,14 +635,14 @@  discard block
 block discarded – undo
635 635
 function geodir_font_awesome_rating_stars_html($html, $rating, $star_count = 5) {
636 636
 	if (get_option('geodir_reviewrating_enable_font_awesome') == '1') {
637 637
 		$rating = min($rating, $star_count);
638
-		$full_stars = floor( $rating );
639
-		$half_stars = ceil( $rating - $full_stars );
638
+		$full_stars = floor($rating);
639
+		$half_stars = ceil($rating - $full_stars);
640 640
 		$empty_stars = $star_count - $full_stars - $half_stars;
641 641
 		
642 642
 		$html = '<div class="gd-star-rating gd-fa-star-rating">';
643
-		$html .= str_repeat( '<i class="fa fa-star gd-full-star"></i>', $full_stars );
644
-		$html .= str_repeat( '<i class="fa fa-star-o fa-star-half-full gd-half-star"></i>', $half_stars );
645
-		$html .= str_repeat( '<i class="fa fa-star-o gd-empty-star"></i>', $empty_stars);
643
+		$html .= str_repeat('<i class="fa fa-star gd-full-star"></i>', $full_stars);
644
+		$html .= str_repeat('<i class="fa fa-star-o fa-star-half-full gd-half-star"></i>', $half_stars);
645
+		$html .= str_repeat('<i class="fa fa-star-o gd-empty-star"></i>', $empty_stars);
646 646
 		$html .= '</div>';
647 647
 	}
648 648
 
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 		$full_color = get_option('geodir_reviewrating_fa_full_rating_color', '#757575');
662 662
 		if ($full_color != '#757575') {
663 663
 			echo '<style type="text/css">.br-theme-fontawesome-stars .br-widget a.br-active:after,.br-theme-fontawesome-stars .br-widget a.br-selected:after,
664
-			.gd-star-rating i.fa {color:' . stripslashes($full_color) . '!important;}</style>';
664
+			.gd-star-rating i.fa {color:' . stripslashes($full_color).'!important;}</style>';
665 665
 		}
666 666
 	}
667 667
 }
668 668
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-templates/preview-success.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
     <?php
16 16
 
17 17
 
18
-    global $wpdb;
18
+	global $wpdb;
19 19
 
20
-    $post_id = $_REQUEST['pid'];
21
-    $post_info = get_post($post_id);
20
+	$post_id = $_REQUEST['pid'];
21
+	$post_info = get_post($post_id);
22 22
 
23
-    $posted_date = $post_info->post_date;
24
-    $productlink = get_permalink($post_id);
25
-    $siteName = get_bloginfo('name');
26
-    $siteurl = home_url();
27
-    $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
23
+	$posted_date = $post_info->post_date;
24
+	$productlink = get_permalink($post_id);
25
+	$siteName = get_bloginfo('name');
26
+	$siteurl = home_url();
27
+	$siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
28 28
 
29
-    $loginurl = geodir_login_url();
30
-    $loginurl_link = '<a href="' . $loginurl . '">login</a>';
29
+	$loginurl = geodir_login_url();
30
+	$loginurl_link = '<a href="' . $loginurl . '">login</a>';
31 31
 
32
-    $post_author = $post_info->post_author;
32
+	$post_author = $post_info->post_author;
33 33
 
34
-    $user_info = get_userdata($post_author);
35
-    $username = $user_info->user_login;
36
-    $user_email = $user_info->user_email;
34
+	$user_info = get_userdata($post_author);
35
+	$username = $user_info->user_login;
36
+	$user_email = $user_info->user_email;
37 37
 
38
-    $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
38
+	$message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
39 39
 
40
-    /*
40
+	/*
41 41
      * Filter the success page message before variable replacements.
42 42
      *
43 43
      * @since 1.5.7
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
      * @param object $post_info Post object.
46 46
      * @param object $user_info User object.
47 47
      */
48
-    $message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
48
+	$message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
49 49
 
50
-    $search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
51
-    $replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date);
52
-    $message = str_replace($search_array, $replace_array, $message);
50
+	$search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
51
+	$replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date);
52
+	$message = str_replace($search_array, $replace_array, $message);
53 53
 
54
-    /*
54
+	/*
55 55
      * Filter the success page message after variable replacements.
56 56
      *
57 57
      * @since 1.5.7
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
      * @param object $post_info Post object.
60 60
      * @param object $user_info User object.
61 61
      */
62
-    $message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
62
+	$message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
63 63
 
64 64
 
65 65
 
66
-    ?>
66
+	?>
67 67
 
68 68
     <?php
69 69
 
70
-    /*
70
+	/*
71 71
      * Action called before the success page message wrapper.
72 72
      *
73 73
      * @since 1.5.7
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
      * @param object $post_info Post object.
76 76
      * @param object $user_info User object.
77 77
      */
78
-    do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
79
-    echo '<h5 class="geodir_information">';
80
-    echo $message;
81
-    echo '</h5>';
82
-    /*
78
+	do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
79
+	echo '<h5 class="geodir_information">';
80
+	echo $message;
81
+	echo '</h5>';
82
+	/*
83 83
      * Action called after the success page message wrapper.
84 84
      *
85 85
      * @since 1.5.7
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
      * @param object $post_info Post object.
88 88
      * @param object $user_info User object.
89 89
      */
90
-    do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
90
+	do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
91 91
 
92
-    ?>
92
+	?>
93 93
 
94 94
 </div>
95 95
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
     $productlink = get_permalink($post_id);
25 25
     $siteName = get_bloginfo('name');
26 26
     $siteurl = home_url();
27
-    $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
27
+    $siteurl_link = '<a href="'.$siteurl.'">'.$siteurl.'</a>';
28 28
 
29 29
     $loginurl = geodir_login_url();
30
-    $loginurl_link = '<a href="' . $loginurl . '">login</a>';
30
+    $loginurl_link = '<a href="'.$loginurl.'">login</a>';
31 31
 
32 32
     $post_author = $post_info->post_author;
33 33
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     $username = $user_info->user_login;
36 36
     $user_email = $user_info->user_email;
37 37
 
38
-    $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
38
+    $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')), 'geodirectory'));
39 39
 
40 40
     /*
41 41
      * Filter the success page message before variable replacements.
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @param object $post_info Post object.
46 46
      * @param object $user_info User object.
47 47
      */
48
-    $message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
48
+    $message = apply_filters('geodir_success_page_msg_before_var_replace', $message, $post_info, $user_info);
49 49
 
50 50
     $search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
51 51
     $replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      * @param object $post_info Post object.
60 60
      * @param object $user_info User object.
61 61
      */
62
-    $message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
62
+    $message = apply_filters('geodir_success_page_msg_after_var_replace', $message, $post_info, $user_info);
63 63
 
64 64
 
65 65
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * @param object $post_info Post object.
76 76
      * @param object $user_info User object.
77 77
      */
78
-    do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
78
+    do_action('geodir_before_success_page_msg_wrapper', $message, $post_info, $user_info);
79 79
     echo '<h5 class="geodir_information">';
80 80
     echo $message;
81 81
     echo '</h5>';
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      * @param object $post_info Post object.
88 88
      * @param object $user_info User object.
89 89
      */
90
-    do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
90
+    do_action('geodir_after_success_page_msg_wrapper', $message, $post_info, $user_info);
91 91
 
92 92
     ?>
93 93
 
Please login to merge, or discard this patch.
geodirectory-widgets/geodirectory_bestof_widget.php 3 patches
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -356,10 +356,11 @@  discard block
 block discarded – undo
356 356
         $instance['character_count'] = $new_instance['character_count'];
357 357
         $instance['tab_layout'] = $new_instance['tab_layout'];
358 358
         $instance['excerpt_type'] = $new_instance['excerpt_type'];
359
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
360
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
361
-        else
362
-            $instance['add_location_filter'] = '0';
359
+        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') {
360
+                    $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
361
+        } else {
362
+                    $instance['add_location_filter'] = '0';
363
+        }
363 364
         $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
364 365
         return $instance;
365 366
     }
@@ -510,7 +511,10 @@  discard block
 block discarded – undo
510 511
             <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
511 512
                 <?php _e('Enable Location Filter:', 'geodirectory');?>
512 513
                 <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
513
-                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
514
+                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) {
515
+	echo 'checked="checked"';
516
+}
517
+?>
514 518
                        value="1"/>
515 519
             </label>
516 520
         </p>
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
          * @param string $instance ['tab_layout'] Best of widget tab layout name.
52 52
          */
53 53
         $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']);
54
-        echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">';
54
+        echo '<div class="bestof-widget-tab-layout '.$tab_layout.'">';
55 55
         echo $before_widget;
56 56
         $loc_terms = geodir_get_current_location_terms();
57 57
         if (!empty($loc_terms)) {
58
-            $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
58
+            $cur_location = ' : '.geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
59 59
         } else {
60 60
             $cur_location = '';
61 61
         }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
          *
77 77
          * @param string $instance ['title'] The widget title.
78 78
          */
79
-        $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
79
+        $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name').$cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
80 80
 
81 81
         /**
82 82
          * Filter the post type.
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         }
203 203
 
204 204
 
205
-        echo $before_title . __($title,'geodirectory') . $after_title;
205
+        echo $before_title.__($title, 'geodirectory').$after_title;
206 206
 
207 207
         //term navigation - start
208 208
         echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
214 214
 
215 215
             if ($is_dropdown) {
216
-                $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">';
216
+                $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="'.esc_attr(__('Select Category', 'geodirectory')).'">';
217 217
             } else {
218 218
                 $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
219 219
                 $nav_html .= '<dt></dt>';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                     }
231 231
                     if ($is_dropdown) {
232 232
                         $selected = ($cat_count == 1) ? 'selected="selected"' : '';
233
-                        $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
233
+                        $nav_html .= '<option '.$selected.' value="'.$cat->term_id.'">'.geodir_ucwords($cat->name).'</option>';
234 234
                     } else {
235 235
                         if ($cat_count == 1) {
236 236
                             $nav_html .= '<dd class="geodir-tab-active">';
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
                             $nav_html .= '<dd class="">';
239 239
                         }
240 240
                         $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : '';
241
-                        $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">';
242
-                        $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>';
241
+                        $nav_html .= '<a data-termid="'.$cat->term_id.'" href="'.get_term_link($cat, $cat->taxonomy).'">';
242
+                        $nav_html .= '<img alt="'.$cat->name.' icon" class="bestof-cat-icon" src="'.$term_icon_url.'"/>';
243 243
                         $nav_html .= '<span>';
244 244
                         $nav_html .= geodir_ucwords($cat->name);
245 245
                         $nav_html .= '<small>';
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                             if ($num_reviews == 0) {
249 249
                                 $reviews = __('No Reviews', 'geodirectory');
250 250
                             } elseif ($num_reviews > 1) {
251
-                                $reviews = $num_reviews . __(' Reviews', 'geodirectory');
251
+                                $reviews = $num_reviews.__(' Reviews', 'geodirectory');
252 252
                             } else {
253 253
                                 $reviews = __('1 Review', 'geodirectory');
254 254
                             }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
                  */
322 322
                 $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
323 323
 
324
-                echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
324
+                echo '<h3 class="bestof-cat-title">'.wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name).'<a href="'.esc_url($view_all_link).'">'.__("View all", 'geodirectory').'</a></h3>';
325 325
             }
326 326
             if ($excerpt_type == 'show-reviews') {
327 327
                 add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
      */
379 379
     public function form($instance)
380 380
     {
381
-        $instance = wp_parse_args((array)$instance,
381
+        $instance = wp_parse_args((array) $instance,
382 382
             array(
383 383
                 'title' => '',
384 384
                 'post_type' => '',
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
         ?>
405 405
         <p>
406
-            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
406
+            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
407 407
 
408 408
                 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
409 409
                        name="<?php echo $this->get_field_name('title'); ?>" type="text"
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 
414 414
         <p>
415 415
             <label
416
-                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
416
+                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?>
417 417
 
418 418
                 <?php $postypes = geodir_get_posttypes();
419 419
                 /**
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         <p>
446 446
 
447 447
             <label
448
-                for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory');?>
448
+                for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?>
449 449
 
450 450
                 <input class="widefat" id="<?php echo $this->get_field_id('post_limit'); ?>"
451 451
                        name="<?php echo $this->get_field_name('post_limit'); ?>" type="text"
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
         <p>
457 457
 
458 458
             <label
459
-                for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory');?>
459
+                for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory'); ?>
460 460
 
461 461
                 <input class="widefat" id="<?php echo $this->get_field_id('categ_limit'); ?>"
462 462
                        name="<?php echo $this->get_field_name('categ_limit'); ?>" type="text"
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 
467 467
         <p>
468 468
             <label
469
-                for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?>
469
+                for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?>
470 470
                 <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>"
471 471
                        name="<?php echo $this->get_field_name('character_count'); ?>" type="text"
472 472
                        value="<?php echo esc_attr($character_count); ?>"/>
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
         </p>
475 475
         <p>
476 476
             <label
477
-                for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory');?>
477
+                for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory'); ?>
478 478
 
479 479
                 <select class="widefat" id="<?php echo $this->get_field_id('tab_layout'); ?>"
480 480
                         name="<?php echo $this->get_field_name('tab_layout'); ?>">
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 
496 496
         <p>
497 497
             <label
498
-                for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory');?>
498
+                for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory'); ?>
499 499
 
500 500
                 <select class="widefat" id="<?php echo $this->get_field_id('excerpt_type'); ?>"
501 501
                         name="<?php echo $this->get_field_name('excerpt_type'); ?>">
@@ -512,9 +512,9 @@  discard block
 block discarded – undo
512 512
 
513 513
         <p>
514 514
             <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
515
-                <?php _e('Enable Location Filter:', 'geodirectory');?>
515
+                <?php _e('Enable Location Filter:', 'geodirectory'); ?>
516 516
                 <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
517
-                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
517
+                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?>
518 518
                        value="1"/>
519 519
             </label>
520 520
         </p>
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
         /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
663 663
         $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
664 664
 
665
-        echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
665
+        echo '<h3 class="bestof-cat-title">'.wp_sprintf(__('Best of %s', 'geodirectory'), $term->name).'<a href="'.esc_url($view_all_link).'">'.__("View all", 'geodirectory').'</a></h3>';
666 666
     }
667 667
     if ($excerpt_type == 'show-reviews') {
668 668
         add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
Please login to merge, or discard this patch.
Indentation   +519 added lines, -519 removed lines patch added patch discarded remove patch
@@ -14,282 +14,282 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class geodir_bestof_widget extends WP_Widget
16 16
 {
17
-    /**
18
-     * Register the best of widget with WordPress.
19
-     *
20
-     * @since 1.3.9
21
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
-     */
23
-    public function __construct()
24
-    {
25
-        $widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory'));
26
-        parent::__construct(
27
-            'bestof_widget', // Base ID
28
-            __('GD > Best of widget', 'geodirectory'), // Name
29
-            $widget_ops// Args
30
-        );
31
-    }
32
-
33
-    /**
34
-     * Front-end display content for best of widget.
35
-     *
36
-     * @since 1.3.9
37
-     * @since 1.5.1 Added filter to view all link.
38
-     * @since 1.5.1 Declare function public.
39
-     *
40
-     * @param array $args Widget arguments.
41
-     * @param array $instance Saved values from database.
42
-     */
43
-    public function widget($args, $instance)
44
-    {
45
-        extract($args);
46
-        /**
47
-         * Filter the best of widget tab layout.
48
-         *
49
-         * @since 1.3.9
50
-         *
51
-         * @param string $instance ['tab_layout'] Best of widget tab layout name.
52
-         */
53
-        $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']);
54
-        echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">';
55
-        echo $before_widget;
56
-        $loc_terms = geodir_get_current_location_terms();
57
-        if (!empty($loc_terms)) {
58
-            $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
59
-        } else {
60
-            $cur_location = '';
61
-        }
62
-
63
-        /**
64
-         * Filter the current location name.
65
-         *
66
-         * @since 1.3.9
67
-         *
68
-         * @param string $cur_location Current location name.
69
-         */
70
-        $cur_location = apply_filters('bestof_widget_cur_location', $cur_location);
71
-
72
-        /**
73
-         * Filter the widget title.
74
-         *
75
-         * @since 1.3.9
76
-         *
77
-         * @param string $instance ['title'] The widget title.
78
-         */
79
-        $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
80
-
81
-        /**
82
-         * Filter the post type.
83
-         *
84
-         * @since 1.3.9
85
-         *
86
-         * @param string $instance ['post_type'] The post type.
87
-         */
88
-        $post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']);
89
-
90
-        /**
91
-         * Filter the excerpt type.
92
-         *
93
-         * @since 1.5.4
94
-         *
95
-         * @param string $instance ['excerpt_type'] The excerpt type.
96
-         */
97
-        $excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']);
98
-
99
-
100
-        /**
101
-         * Filter the listing limit.
102
-         *
103
-         * @since 1.3.9
104
-         *
105
-         * @param int $instance ['post_limit'] No. of posts to display.
106
-         */
107
-        $post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']);
108
-
109
-        /**
110
-         * Filter the category limit.
111
-         *
112
-         * @since 1.3.9
113
-         *
114
-         * @param int $instance ['categ_limit'] No. of categories to display.
115
-         */
116
-        $categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']);
117
-        $use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
118
-
119
-        /**
120
-         * Filter the use of location filter.
121
-         *
122
-         * @since 1.3.9
123
-         *
124
-         * @param int|bool $instance ['add_location_filter'] Filter listings using current location.
125
-         */
126
-        $add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']);
127
-
128
-        // set post type to current viewing post type
129
-        if ($use_viewing_post_type) {
130
-            $current_post_type = geodir_get_current_posttype();
131
-            if ($current_post_type != '' && $current_post_type != $post_type) {
132
-                $post_type = $current_post_type;
133
-            }
134
-        }
135
-
136
-        if (isset($instance['character_count'])) {
137
-            /**
138
-             * Filter the widget's excerpt character count.
139
-             *
140
-             * @since 1.3.9
141
-             *
142
-             * @param int $instance ['character_count'] Excerpt character count.
143
-             */
144
-            $character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']);
145
-        } else {
146
-            $character_count = '';
147
-        }
148
-
149
-        $category_taxonomy = geodir_get_taxonomies($post_type);
150
-
151
-        $term_args = array(
152
-            'hide_empty' => true,
153
-            'parent' => 0
154
-        );
155
-
156
-        $term_args = apply_filters('bestof_widget_term_args', $term_args);
157
-
158
-        if (is_tax()) {
159
-            $taxonomy = get_query_var('taxonomy');
160
-            $cur_term = get_query_var('term');
161
-            $term_data = get_term_by('name', $cur_term, $taxonomy);
162
-            $term_args['parent'] = $term_data->term_id;
163
-        }
164
-
165
-        $terms = get_terms($category_taxonomy[0], $term_args);
166
-
167
-        $term_reviews = geodir_count_reviews_by_terms();
168
-        $a_terms = array();
169
-        foreach ($terms as $term) {
170
-
171
-
172
-            if ($term->count > 0) {
173
-                if (isset($term_reviews[$term->term_id])) {
174
-                    $term->review_count = $term_reviews[$term->term_id];
175
-                } else {
176
-                    $term->review_count = '0';
177
-                }
178
-
179
-                $a_terms[] = $term;
180
-            }
181
-
182
-        }
183
-
184
-
185
-        $terms = apply_filters('bestof_widget_sort_terms', geodir_sort_terms($a_terms, 'review_count'), $a_terms);
186
-
187
-        $query_args = array(
188
-            'posts_per_page' => $post_limit,
189
-            'is_geodir_loop' => true,
190
-            'post_type' => $post_type,
191
-            'gd_location' => $add_location_filter ? true : false,
192
-            'order_by' => 'high_review'
193
-        );
194
-        if ($character_count >= 0) {
195
-            $query_args['excerpt_length'] = $character_count;
196
-        }
197
-
198
-        $layout = array();
199
-        if ($tab_layout == 'bestof-tabs-as-dropdown') {
200
-            $layout[] = $tab_layout;
201
-        } else {
202
-            $layout[] = 'bestof-tabs-as-dropdown';
203
-            $layout[] = $tab_layout;
204
-        }
205
-
206
-
207
-        echo $before_title . __($title,'geodirectory') . $after_title;
208
-
209
-        //term navigation - start
210
-        echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
211
-
212
-        $final_html = '';
213
-        foreach ($layout as $tab_layout) {
214
-            $nav_html = '';
215
-            $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
216
-
217
-            if ($is_dropdown) {
218
-                $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">';
219
-            } else {
220
-                $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
221
-                $nav_html .= '<dt></dt>';
222
-            }
223
-
224
-
225
-            $term_icon = geodir_get_term_icon();
226
-            $cat_count = 0;
227
-            if (!empty($terms)) {
228
-                foreach ($terms as $cat) {
229
-                    $cat_count++;
230
-                    if ($cat_count > $categ_limit) {
231
-                        break;
232
-                    }
233
-                    if ($is_dropdown) {
234
-                        $selected = ($cat_count == 1) ? 'selected="selected"' : '';
235
-                        $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
236
-                    } else {
237
-                        if ($cat_count == 1) {
238
-                            $nav_html .= '<dd class="geodir-tab-active">';
239
-                        } else {
240
-                            $nav_html .= '<dd class="">';
241
-                        }
242
-                        $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : '';
243
-                        $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">';
244
-                        $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>';
245
-                        $nav_html .= '<span>';
246
-                        $nav_html .= geodir_ucwords($cat->name);
247
-                        $nav_html .= '<small>';
248
-                        if (isset($cat->review_count)) {
249
-                            $num_reviews = $cat->review_count;
250
-                            if ($num_reviews == 0) {
251
-                                $reviews = __('No Reviews', 'geodirectory');
252
-                            } elseif ($num_reviews > 1) {
253
-                                $reviews = $num_reviews . __(' Reviews', 'geodirectory');
254
-                            } else {
255
-                                $reviews = __('1 Review', 'geodirectory');
256
-                            }
257
-                            $nav_html .= $reviews;
258
-                        }
259
-                        $nav_html .= '</small>';
260
-                        $nav_html .= '</span>';
261
-                        $nav_html .= '</a>';
262
-                        $nav_html .= '</dd>';
263
-                    }
264
-                }
265
-            }
266
-
267
-            if ($is_dropdown) {
268
-                $nav_html .= '</select>';
269
-            } else {
270
-                $nav_html .= '</dl>';
271
-            }
272
-            $final_html .= $nav_html;
273
-        }
274
-        if ($terms) {
275
-            echo $final_html;
276
-        }
277
-        echo '</div>';
278
-        //term navigation - end
279
-
280
-        //first term listings by default - start
281
-        $first_term = '';
282
-        if ($terms) {
283
-            $first_term = $terms[0];
284
-            $tax_query = array(
285
-                'taxonomy' => $category_taxonomy[0],
286
-                'field' => 'id',
287
-                'terms' => $first_term->term_id
288
-            );
289
-            $query_args['tax_query'] = array($tax_query);
290
-        }
291
-
292
-        ?>
17
+	/**
18
+	 * Register the best of widget with WordPress.
19
+	 *
20
+	 * @since 1.3.9
21
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
+	 */
23
+	public function __construct()
24
+	{
25
+		$widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory'));
26
+		parent::__construct(
27
+			'bestof_widget', // Base ID
28
+			__('GD > Best of widget', 'geodirectory'), // Name
29
+			$widget_ops// Args
30
+		);
31
+	}
32
+
33
+	/**
34
+	 * Front-end display content for best of widget.
35
+	 *
36
+	 * @since 1.3.9
37
+	 * @since 1.5.1 Added filter to view all link.
38
+	 * @since 1.5.1 Declare function public.
39
+	 *
40
+	 * @param array $args Widget arguments.
41
+	 * @param array $instance Saved values from database.
42
+	 */
43
+	public function widget($args, $instance)
44
+	{
45
+		extract($args);
46
+		/**
47
+		 * Filter the best of widget tab layout.
48
+		 *
49
+		 * @since 1.3.9
50
+		 *
51
+		 * @param string $instance ['tab_layout'] Best of widget tab layout name.
52
+		 */
53
+		$tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']);
54
+		echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">';
55
+		echo $before_widget;
56
+		$loc_terms = geodir_get_current_location_terms();
57
+		if (!empty($loc_terms)) {
58
+			$cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
59
+		} else {
60
+			$cur_location = '';
61
+		}
62
+
63
+		/**
64
+		 * Filter the current location name.
65
+		 *
66
+		 * @since 1.3.9
67
+		 *
68
+		 * @param string $cur_location Current location name.
69
+		 */
70
+		$cur_location = apply_filters('bestof_widget_cur_location', $cur_location);
71
+
72
+		/**
73
+		 * Filter the widget title.
74
+		 *
75
+		 * @since 1.3.9
76
+		 *
77
+		 * @param string $instance ['title'] The widget title.
78
+		 */
79
+		$title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
80
+
81
+		/**
82
+		 * Filter the post type.
83
+		 *
84
+		 * @since 1.3.9
85
+		 *
86
+		 * @param string $instance ['post_type'] The post type.
87
+		 */
88
+		$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']);
89
+
90
+		/**
91
+		 * Filter the excerpt type.
92
+		 *
93
+		 * @since 1.5.4
94
+		 *
95
+		 * @param string $instance ['excerpt_type'] The excerpt type.
96
+		 */
97
+		$excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']);
98
+
99
+
100
+		/**
101
+		 * Filter the listing limit.
102
+		 *
103
+		 * @since 1.3.9
104
+		 *
105
+		 * @param int $instance ['post_limit'] No. of posts to display.
106
+		 */
107
+		$post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']);
108
+
109
+		/**
110
+		 * Filter the category limit.
111
+		 *
112
+		 * @since 1.3.9
113
+		 *
114
+		 * @param int $instance ['categ_limit'] No. of categories to display.
115
+		 */
116
+		$categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']);
117
+		$use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
118
+
119
+		/**
120
+		 * Filter the use of location filter.
121
+		 *
122
+		 * @since 1.3.9
123
+		 *
124
+		 * @param int|bool $instance ['add_location_filter'] Filter listings using current location.
125
+		 */
126
+		$add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']);
127
+
128
+		// set post type to current viewing post type
129
+		if ($use_viewing_post_type) {
130
+			$current_post_type = geodir_get_current_posttype();
131
+			if ($current_post_type != '' && $current_post_type != $post_type) {
132
+				$post_type = $current_post_type;
133
+			}
134
+		}
135
+
136
+		if (isset($instance['character_count'])) {
137
+			/**
138
+			 * Filter the widget's excerpt character count.
139
+			 *
140
+			 * @since 1.3.9
141
+			 *
142
+			 * @param int $instance ['character_count'] Excerpt character count.
143
+			 */
144
+			$character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']);
145
+		} else {
146
+			$character_count = '';
147
+		}
148
+
149
+		$category_taxonomy = geodir_get_taxonomies($post_type);
150
+
151
+		$term_args = array(
152
+			'hide_empty' => true,
153
+			'parent' => 0
154
+		);
155
+
156
+		$term_args = apply_filters('bestof_widget_term_args', $term_args);
157
+
158
+		if (is_tax()) {
159
+			$taxonomy = get_query_var('taxonomy');
160
+			$cur_term = get_query_var('term');
161
+			$term_data = get_term_by('name', $cur_term, $taxonomy);
162
+			$term_args['parent'] = $term_data->term_id;
163
+		}
164
+
165
+		$terms = get_terms($category_taxonomy[0], $term_args);
166
+
167
+		$term_reviews = geodir_count_reviews_by_terms();
168
+		$a_terms = array();
169
+		foreach ($terms as $term) {
170
+
171
+
172
+			if ($term->count > 0) {
173
+				if (isset($term_reviews[$term->term_id])) {
174
+					$term->review_count = $term_reviews[$term->term_id];
175
+				} else {
176
+					$term->review_count = '0';
177
+				}
178
+
179
+				$a_terms[] = $term;
180
+			}
181
+
182
+		}
183
+
184
+
185
+		$terms = apply_filters('bestof_widget_sort_terms', geodir_sort_terms($a_terms, 'review_count'), $a_terms);
186
+
187
+		$query_args = array(
188
+			'posts_per_page' => $post_limit,
189
+			'is_geodir_loop' => true,
190
+			'post_type' => $post_type,
191
+			'gd_location' => $add_location_filter ? true : false,
192
+			'order_by' => 'high_review'
193
+		);
194
+		if ($character_count >= 0) {
195
+			$query_args['excerpt_length'] = $character_count;
196
+		}
197
+
198
+		$layout = array();
199
+		if ($tab_layout == 'bestof-tabs-as-dropdown') {
200
+			$layout[] = $tab_layout;
201
+		} else {
202
+			$layout[] = 'bestof-tabs-as-dropdown';
203
+			$layout[] = $tab_layout;
204
+		}
205
+
206
+
207
+		echo $before_title . __($title,'geodirectory') . $after_title;
208
+
209
+		//term navigation - start
210
+		echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
211
+
212
+		$final_html = '';
213
+		foreach ($layout as $tab_layout) {
214
+			$nav_html = '';
215
+			$is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
216
+
217
+			if ($is_dropdown) {
218
+				$nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">';
219
+			} else {
220
+				$nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
221
+				$nav_html .= '<dt></dt>';
222
+			}
223
+
224
+
225
+			$term_icon = geodir_get_term_icon();
226
+			$cat_count = 0;
227
+			if (!empty($terms)) {
228
+				foreach ($terms as $cat) {
229
+					$cat_count++;
230
+					if ($cat_count > $categ_limit) {
231
+						break;
232
+					}
233
+					if ($is_dropdown) {
234
+						$selected = ($cat_count == 1) ? 'selected="selected"' : '';
235
+						$nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
236
+					} else {
237
+						if ($cat_count == 1) {
238
+							$nav_html .= '<dd class="geodir-tab-active">';
239
+						} else {
240
+							$nav_html .= '<dd class="">';
241
+						}
242
+						$term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : '';
243
+						$nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">';
244
+						$nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>';
245
+						$nav_html .= '<span>';
246
+						$nav_html .= geodir_ucwords($cat->name);
247
+						$nav_html .= '<small>';
248
+						if (isset($cat->review_count)) {
249
+							$num_reviews = $cat->review_count;
250
+							if ($num_reviews == 0) {
251
+								$reviews = __('No Reviews', 'geodirectory');
252
+							} elseif ($num_reviews > 1) {
253
+								$reviews = $num_reviews . __(' Reviews', 'geodirectory');
254
+							} else {
255
+								$reviews = __('1 Review', 'geodirectory');
256
+							}
257
+							$nav_html .= $reviews;
258
+						}
259
+						$nav_html .= '</small>';
260
+						$nav_html .= '</span>';
261
+						$nav_html .= '</a>';
262
+						$nav_html .= '</dd>';
263
+					}
264
+				}
265
+			}
266
+
267
+			if ($is_dropdown) {
268
+				$nav_html .= '</select>';
269
+			} else {
270
+				$nav_html .= '</dl>';
271
+			}
272
+			$final_html .= $nav_html;
273
+		}
274
+		if ($terms) {
275
+			echo $final_html;
276
+		}
277
+		echo '</div>';
278
+		//term navigation - end
279
+
280
+		//first term listings by default - start
281
+		$first_term = '';
282
+		if ($terms) {
283
+			$first_term = $terms[0];
284
+			$tax_query = array(
285
+				'taxonomy' => $category_taxonomy[0],
286
+				'field' => 'id',
287
+				'terms' => $first_term->term_id
288
+			);
289
+			$query_args['tax_query'] = array($tax_query);
290
+		}
291
+
292
+		?>
293 293
         <input type="hidden" id="bestof_widget_post_type" name="bestof_widget_post_type"
294 294
                value="<?php echo $post_type; ?>">
295 295
         <input type="hidden" id="bestof_widget_excerpt_type" name="bestof_widget_excerpt_type"
@@ -300,110 +300,110 @@  discard block
 block discarded – undo
300 300
                value="<?php echo $category_taxonomy[0]; ?>">
301 301
         <input type="hidden" id="bestof_widget_location_filter" name="bestof_widget_location_filter"
302 302
                value="<?php if ($add_location_filter) {
303
-                   echo 1;
304
-               } else {
305
-                   echo 0;
306
-               } ?>">
303
+				   echo 1;
304
+			   } else {
305
+				   echo 0;
306
+			   } ?>">
307 307
         <input type="hidden" id="bestof_widget_char_count" name="bestof_widget_char_count"
308 308
                value="<?php echo $character_count; ?>">
309 309
         <div class="geo-bestof-contentwrap geodir-tabs-content" style="position: relative; z-index: 0;">
310 310
             <p id="geodir-bestof-loading" class="geodir-bestof-loading"><i class="fa fa-cog fa-spin"></i></p>
311 311
             <?php
312
-            echo '<div id="geodir-bestof-places">';
313
-            if ($terms) {
314
-                $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy));
315
-                /**
316
-                 * Filter the page link to view all lisitngs.
317
-                 *
318
-                 * @since 1.5.1
319
-                 *
320
-                 * @param array $view_all_link View all listings page link.
321
-                 * @param array $post_type The Post type.
322
-                 * @param array $first_term The category term object.
323
-                 */
324
-                $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
325
-
326
-                echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
327
-            }
328
-            if ($excerpt_type == 'show-reviews') {
329
-                add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
330
-            }
331
-            geodir_bestof_places_by_term($query_args);
332
-            if ($excerpt_type == 'show-reviews') {
333
-                remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
334
-            }
335
-            echo "</div>";
336
-            ?>
312
+			echo '<div id="geodir-bestof-places">';
313
+			if ($terms) {
314
+				$view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy));
315
+				/**
316
+				 * Filter the page link to view all lisitngs.
317
+				 *
318
+				 * @since 1.5.1
319
+				 *
320
+				 * @param array $view_all_link View all listings page link.
321
+				 * @param array $post_type The Post type.
322
+				 * @param array $first_term The category term object.
323
+				 */
324
+				$view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
325
+
326
+				echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
327
+			}
328
+			if ($excerpt_type == 'show-reviews') {
329
+				add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
330
+			}
331
+			geodir_bestof_places_by_term($query_args);
332
+			if ($excerpt_type == 'show-reviews') {
333
+				remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
334
+			}
335
+			echo "</div>";
336
+			?>
337 337
         </div>
338 338
         <?php //first term listings by default - end
339
-        ?>
339
+		?>
340 340
         <?php echo $after_widget;
341
-        echo "</div>";
342
-    }
343
-
344
-    /**
345
-     * Sanitize best of widget form values as they are saved.
346
-     *
347
-     * @since 1.3.9
348
-     * @since 1.5.1 Declare function public.
349
-     *
350
-     * @param array $new_instance Values just sent to be saved.
351
-     * @param array $old_instance Previously saved values from database.
352
-     *
353
-     * @return array Updated safe values to be saved.
354
-     */
355
-    public function update($new_instance, $old_instance)
356
-    {
357
-        $instance = $old_instance;
358
-        $instance['title'] = strip_tags($new_instance['title']);
359
-        $instance['post_type'] = strip_tags($new_instance['post_type']);
360
-        $instance['post_limit'] = strip_tags($new_instance['post_limit']);
361
-        $instance['categ_limit'] = strip_tags($new_instance['categ_limit']);
362
-        $instance['character_count'] = $new_instance['character_count'];
363
-        $instance['tab_layout'] = $new_instance['tab_layout'];
364
-        $instance['excerpt_type'] = $new_instance['excerpt_type'];
365
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
366
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
367
-        else
368
-            $instance['add_location_filter'] = '0';
369
-        $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
370
-        return $instance;
371
-    }
372
-
373
-    /**
374
-     * Back-end best of widget settings form.
375
-     *
376
-     * @since 1.3.9
377
-     * @since 1.5.1 Declare function public.
378
-     *
379
-     * @param array $instance Previously saved values from database.
380
-     */
381
-    public function form($instance)
382
-    {
383
-        $instance = wp_parse_args((array)$instance,
384
-            array(
385
-                'title' => '',
386
-                'post_type' => '',
387
-                'post_limit' => '5',
388
-                'categ_limit' => '3',
389
-                'character_count' => '20',
390
-                'add_location_filter' => '1',
391
-                'tab_layout' => 'bestof-tabs-on-top',
392
-                'excerpt_type' => 'show-desc',
393
-                'use_viewing_post_type' => ''
394
-            )
395
-        );
396
-        $title = strip_tags($instance['title']);
397
-        $post_type = strip_tags($instance['post_type']);
398
-        $post_limit = strip_tags($instance['post_limit']);
399
-        $categ_limit = strip_tags($instance['categ_limit']);
400
-        $character_count = strip_tags($instance['character_count']);
401
-        $tab_layout = strip_tags($instance['tab_layout']);
402
-        $excerpt_type = strip_tags($instance['excerpt_type']);
403
-        $add_location_filter = strip_tags($instance['add_location_filter']);
404
-        $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
405
-
406
-        ?>
341
+		echo "</div>";
342
+	}
343
+
344
+	/**
345
+	 * Sanitize best of widget form values as they are saved.
346
+	 *
347
+	 * @since 1.3.9
348
+	 * @since 1.5.1 Declare function public.
349
+	 *
350
+	 * @param array $new_instance Values just sent to be saved.
351
+	 * @param array $old_instance Previously saved values from database.
352
+	 *
353
+	 * @return array Updated safe values to be saved.
354
+	 */
355
+	public function update($new_instance, $old_instance)
356
+	{
357
+		$instance = $old_instance;
358
+		$instance['title'] = strip_tags($new_instance['title']);
359
+		$instance['post_type'] = strip_tags($new_instance['post_type']);
360
+		$instance['post_limit'] = strip_tags($new_instance['post_limit']);
361
+		$instance['categ_limit'] = strip_tags($new_instance['categ_limit']);
362
+		$instance['character_count'] = $new_instance['character_count'];
363
+		$instance['tab_layout'] = $new_instance['tab_layout'];
364
+		$instance['excerpt_type'] = $new_instance['excerpt_type'];
365
+		if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
366
+			$instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
367
+		else
368
+			$instance['add_location_filter'] = '0';
369
+		$instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
370
+		return $instance;
371
+	}
372
+
373
+	/**
374
+	 * Back-end best of widget settings form.
375
+	 *
376
+	 * @since 1.3.9
377
+	 * @since 1.5.1 Declare function public.
378
+	 *
379
+	 * @param array $instance Previously saved values from database.
380
+	 */
381
+	public function form($instance)
382
+	{
383
+		$instance = wp_parse_args((array)$instance,
384
+			array(
385
+				'title' => '',
386
+				'post_type' => '',
387
+				'post_limit' => '5',
388
+				'categ_limit' => '3',
389
+				'character_count' => '20',
390
+				'add_location_filter' => '1',
391
+				'tab_layout' => 'bestof-tabs-on-top',
392
+				'excerpt_type' => 'show-desc',
393
+				'use_viewing_post_type' => ''
394
+			)
395
+		);
396
+		$title = strip_tags($instance['title']);
397
+		$post_type = strip_tags($instance['post_type']);
398
+		$post_limit = strip_tags($instance['post_limit']);
399
+		$categ_limit = strip_tags($instance['categ_limit']);
400
+		$character_count = strip_tags($instance['character_count']);
401
+		$tab_layout = strip_tags($instance['tab_layout']);
402
+		$excerpt_type = strip_tags($instance['excerpt_type']);
403
+		$add_location_filter = strip_tags($instance['add_location_filter']);
404
+		$use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
405
+
406
+		?>
407 407
         <p>
408 408
             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
409 409
 
@@ -418,14 +418,14 @@  discard block
 block discarded – undo
418 418
                 for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
419 419
 
420 420
                 <?php $postypes = geodir_get_posttypes();
421
-                /**
422
-                 * Filter the post types to display in widget.
423
-                 *
424
-                 * @since 1.3.9
425
-                 *
426
-                 * @param array $postypes Post types array.
427
-                 */
428
-                $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
421
+				/**
422
+				 * Filter the post types to display in widget.
423
+				 *
424
+				 * @since 1.3.9
425
+				 *
426
+				 * @param array $postypes Post types array.
427
+				 */
428
+				$postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
429 429
 
430 430
                 <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?>"
431 431
                         name="<?php echo $this->get_field_name('post_type'); ?>"
@@ -434,9 +434,9 @@  discard block
 block discarded – undo
434 434
                     <?php foreach ($postypes as $postypes_obj) { ?>
435 435
 
436 436
                         <option <?php if ($post_type == $postypes_obj) {
437
-                            echo 'selected="selected"';
438
-                        } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
439
-                            echo geodir_utf8_ucfirst($extvalue[1]); ?></option>
437
+							echo 'selected="selected"';
438
+						} ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
439
+							echo geodir_utf8_ucfirst($extvalue[1]); ?></option>
440 440
 
441 441
                     <?php } ?>
442 442
 
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
                         name="<?php echo $this->get_field_name('tab_layout'); ?>">
483 483
 
484 484
                     <option <?php if ($tab_layout == 'bestof-tabs-on-top') {
485
-                        echo 'selected="selected"';
486
-                    } ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option>
485
+						echo 'selected="selected"';
486
+					} ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option>
487 487
                     <option <?php if ($tab_layout == 'bestof-tabs-on-left') {
488
-                        echo 'selected="selected"';
489
-                    } ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option>
488
+						echo 'selected="selected"';
489
+					} ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option>
490 490
                     <option <?php if ($tab_layout == 'bestof-tabs-as-dropdown') {
491
-                        echo 'selected="selected"';
492
-                    } ?>
491
+						echo 'selected="selected"';
492
+					} ?>
493 493
                         value="bestof-tabs-as-dropdown"><?php _e('Tabs as Dropdown', 'geodirectory'); ?></option>
494 494
                 </select>
495 495
             </label>
@@ -503,11 +503,11 @@  discard block
 block discarded – undo
503 503
                         name="<?php echo $this->get_field_name('excerpt_type'); ?>">
504 504
 
505 505
                     <option <?php if ($excerpt_type == 'show-desc') {
506
-                        echo 'selected="selected"';
507
-                    } ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option>
506
+						echo 'selected="selected"';
507
+					} ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option>
508 508
                     <option <?php if ($excerpt_type == 'show-reviews') {
509
-                        echo 'selected="selected"';
510
-                    } ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option>
509
+						echo 'selected="selected"';
510
+					} ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option>
511 511
                 </select>
512 512
             </label>
513 513
         </p>
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
                 for="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"><?php _e('Use current viewing post type:', 'geodirectory'); ?>
527 527
                 <input type="checkbox" id="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"
528 528
                        name="<?php echo $this->get_field_name('use_viewing_post_type'); ?>" <?php if ($use_viewing_post_type) {
529
-                    echo 'checked="checked"';
530
-                } ?>  value="1"/>
529
+					echo 'checked="checked"';
530
+				} ?>  value="1"/>
531 531
             </label>
532 532
         </p>
533 533
     <?php
534
-    }
534
+	}
535 535
 } // class geodir_bestof_widget
536 536
 
537 537
 register_widget('geodir_bestof_widget');
@@ -551,68 +551,68 @@  discard block
 block discarded – undo
551 551
  */
552 552
 function geodir_bestof_places_by_term($query_args)
553 553
 {
554
-    global $gd_session;
555
-
556
-    /**
557
-     * This action called before querying widget listings.
558
-     *
559
-     * @since 1.0.0
560
-     */
561
-    do_action('geodir_bestof_get_widget_listings_before');
562
-
563
-    $widget_listings = geodir_get_widget_listings($query_args);
564
-
565
-    /**
566
-     * This action called after querying widget listings.
567
-     *
568
-     * @since 1.0.0
569
-     */
570
-    do_action('geodir_bestof_get_widget_listings_after');
571
-
572
-    $character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : '';
573
-
574
-    if (!isset($character_count)) {
575
-        /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
576
-        $character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count);
577
-    }
578
-
579
-    /** This filter is documented in geodirectory-functions/general_functions.php */
580
-    $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
581
-
582
-    global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing;
583
-    $current_post = $post;
584
-    $current_map_jason = $map_jason;
585
-    $current_map_canvas_arr = $map_canvas_arr;
586
-    $current_grid_view = $gridview_columns_widget;
587
-    $gridview_columns_widget = null;
588
-
589
-    $gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false;
590
-    $gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : '';
591
-
592
-    $gd_session->set('gd_listing_view', '1');
593
-    $geodir_is_widget_listing = true;
594
-
595
-    /**
596
-     * Includes the template for the listing listview.
597
-     *
598
-     * @since 1.3.9
599
-     */
600
-    include($template);
601
-
602
-    $geodir_is_widget_listing = false;
603
-
604
-    $GLOBALS['post'] = $current_post;
605
-    if (!empty($current_post)) {
606
-        setup_postdata($current_post);
607
-    }
608
-    if ($gd_listing_view_set) { // Set back previous value
609
-        $gd_session->set('gd_listing_view', $gd_listing_view_old);
610
-    } else {
611
-        $gd_session->un_set('gd_listing_view');
612
-    }
613
-    $map_jason = $current_map_jason;
614
-    $map_canvas_arr = $current_map_canvas_arr;
615
-    $gridview_columns_widget = $current_grid_view;
554
+	global $gd_session;
555
+
556
+	/**
557
+	 * This action called before querying widget listings.
558
+	 *
559
+	 * @since 1.0.0
560
+	 */
561
+	do_action('geodir_bestof_get_widget_listings_before');
562
+
563
+	$widget_listings = geodir_get_widget_listings($query_args);
564
+
565
+	/**
566
+	 * This action called after querying widget listings.
567
+	 *
568
+	 * @since 1.0.0
569
+	 */
570
+	do_action('geodir_bestof_get_widget_listings_after');
571
+
572
+	$character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : '';
573
+
574
+	if (!isset($character_count)) {
575
+		/** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
576
+		$character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count);
577
+	}
578
+
579
+	/** This filter is documented in geodirectory-functions/general_functions.php */
580
+	$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
581
+
582
+	global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing;
583
+	$current_post = $post;
584
+	$current_map_jason = $map_jason;
585
+	$current_map_canvas_arr = $map_canvas_arr;
586
+	$current_grid_view = $gridview_columns_widget;
587
+	$gridview_columns_widget = null;
588
+
589
+	$gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false;
590
+	$gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : '';
591
+
592
+	$gd_session->set('gd_listing_view', '1');
593
+	$geodir_is_widget_listing = true;
594
+
595
+	/**
596
+	 * Includes the template for the listing listview.
597
+	 *
598
+	 * @since 1.3.9
599
+	 */
600
+	include($template);
601
+
602
+	$geodir_is_widget_listing = false;
603
+
604
+	$GLOBALS['post'] = $current_post;
605
+	if (!empty($current_post)) {
606
+		setup_postdata($current_post);
607
+	}
608
+	if ($gd_listing_view_set) { // Set back previous value
609
+		$gd_session->set('gd_listing_view', $gd_listing_view_old);
610
+	} else {
611
+		$gd_session->un_set('gd_listing_view');
612
+	}
613
+	$map_jason = $current_map_jason;
614
+	$map_canvas_arr = $current_map_canvas_arr;
615
+	$gridview_columns_widget = $current_grid_view;
616 616
 }
617 617
 
618 618
 //Ajax functions
@@ -629,51 +629,51 @@  discard block
 block discarded – undo
629 629
  */
630 630
 function geodir_bestof_callback()
631 631
 {
632
-    check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce');
633
-    //set variables
634
-    $post_type = strip_tags(esc_sql($_POST['post_type']));
635
-    $post_limit = strip_tags(esc_sql($_POST['post_limit']));
636
-    $character_count = strip_tags(esc_sql($_POST['char_count']));
637
-    $taxonomy = strip_tags(esc_sql($_POST['taxonomy']));
638
-    $add_location_filter = strip_tags(esc_sql($_POST['add_location_filter']));
639
-    $term_id = strip_tags(esc_sql($_POST['term_id']));
640
-    $excerpt_type = strip_tags(esc_sql($_POST['excerpt_type']));
641
-
642
-    $query_args = array(
643
-        'posts_per_page' => $post_limit,
644
-        'is_geodir_loop' => true,
645
-        'post_type' => $post_type,
646
-        'gd_location' => $add_location_filter ? true : false,
647
-        'order_by' => 'high_review'
648
-    );
649
-
650
-    if ($character_count >= 0) {
651
-        $query_args['excerpt_length'] = $character_count;
652
-    }
653
-
654
-    $tax_query = array(
655
-        'taxonomy' => $taxonomy,
656
-        'field' => 'id',
657
-        'terms' => $term_id
658
-    );
659
-
660
-    $query_args['tax_query'] = array($tax_query);
661
-    if ($term_id && $taxonomy) {
662
-        $term = get_term_by('id', $term_id, $taxonomy);
663
-        $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term));
664
-        /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
665
-        $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
666
-
667
-        echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
668
-    }
669
-    if ($excerpt_type == 'show-reviews') {
670
-        add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
671
-    }
672
-    geodir_bestof_places_by_term($query_args);
673
-    if ($excerpt_type == 'show-reviews') {
674
-        remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
675
-    }
676
-    gd_die();
632
+	check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce');
633
+	//set variables
634
+	$post_type = strip_tags(esc_sql($_POST['post_type']));
635
+	$post_limit = strip_tags(esc_sql($_POST['post_limit']));
636
+	$character_count = strip_tags(esc_sql($_POST['char_count']));
637
+	$taxonomy = strip_tags(esc_sql($_POST['taxonomy']));
638
+	$add_location_filter = strip_tags(esc_sql($_POST['add_location_filter']));
639
+	$term_id = strip_tags(esc_sql($_POST['term_id']));
640
+	$excerpt_type = strip_tags(esc_sql($_POST['excerpt_type']));
641
+
642
+	$query_args = array(
643
+		'posts_per_page' => $post_limit,
644
+		'is_geodir_loop' => true,
645
+		'post_type' => $post_type,
646
+		'gd_location' => $add_location_filter ? true : false,
647
+		'order_by' => 'high_review'
648
+	);
649
+
650
+	if ($character_count >= 0) {
651
+		$query_args['excerpt_length'] = $character_count;
652
+	}
653
+
654
+	$tax_query = array(
655
+		'taxonomy' => $taxonomy,
656
+		'field' => 'id',
657
+		'terms' => $term_id
658
+	);
659
+
660
+	$query_args['tax_query'] = array($tax_query);
661
+	if ($term_id && $taxonomy) {
662
+		$term = get_term_by('id', $term_id, $taxonomy);
663
+		$view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term));
664
+		/** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
665
+		$view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
666
+
667
+		echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
668
+	}
669
+	if ($excerpt_type == 'show-reviews') {
670
+		add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
671
+	}
672
+	geodir_bestof_places_by_term($query_args);
673
+	if ($excerpt_type == 'show-reviews') {
674
+		remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
675
+	}
676
+	gd_die();
677 677
 }
678 678
 
679 679
 //Javascript
@@ -686,8 +686,8 @@  discard block
 block discarded – undo
686 686
  */
687 687
 function geodir_bestof_js()
688 688
 {
689
-    $ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
690
-    ?>
689
+	$ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
690
+	?>
691 691
     <script type="text/javascript">
692 692
         jQuery(document).ready(function () {
693 693
             jQuery('.geodir-bestof-cat-list a, #geodir_bestof_tab_dd').on("click change", function (e) {
@@ -766,18 +766,18 @@  discard block
 block discarded – undo
766 766
 
767 767
 function best_of_show_review_in_excerpt($excerpt)
768 768
 {
769
-    global $wpdb, $post;
770
-    $review_table = GEODIR_REVIEW_TABLE;
771
-    $request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1";
772
-    $comments = $wpdb->get_results($request);
773
-
774
-    if ($comments) {
775
-        foreach ($comments as $comment) {
776
-            // Set the extra comment info needed.
777
-            $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
778
-            $comment_content = $comment_extra->comment_content;
779
-            $excerpt = strip_tags($comment_content);
780
-        }
781
-    }
782
-    return $excerpt;
769
+	global $wpdb, $post;
770
+	$review_table = GEODIR_REVIEW_TABLE;
771
+	$request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1";
772
+	$comments = $wpdb->get_results($request);
773
+
774
+	if ($comments) {
775
+		foreach ($comments as $comment) {
776
+			// Set the extra comment info needed.
777
+			$comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
778
+			$comment_content = $comment_extra->comment_content;
779
+			$excerpt = strip_tags($comment_content);
780
+		}
781
+	}
782
+	return $excerpt;
783 783
 }
784 784
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-widgets/geodirectory_popular_widget.php 3 patches
Braces   +37 added lines, -14 removed lines patch added patch discarded remove patch
@@ -190,10 +190,11 @@  discard block
 block discarded – undo
190 190
         $instance['listing_width'] = strip_tags($new_instance['listing_width']);
191 191
         $instance['list_sort'] = strip_tags($new_instance['list_sort']);
192 192
         $instance['character_count'] = $new_instance['character_count'];
193
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
194
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
195
-        else
196
-            $instance['add_location_filter'] = '0';
193
+        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') {
194
+                    $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
195
+        } else {
196
+                    $instance['add_location_filter'] = '0';
197
+        }
197 198
 
198 199
         $instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0;
199 200
         $instance['show_special_only'] = isset($new_instance['show_special_only']) && $new_instance['show_special_only'] ? 1 : 0;
@@ -319,8 +320,9 @@  discard block
 block discarded – undo
319 320
 
320 321
                 $all_postypes = geodir_get_posttypes();
321 322
 
322
-                if (!in_array($post_type, $all_postypes))
323
-                    $post_type = 'gd_place';
323
+                if (!in_array($post_type, $all_postypes)) {
324
+                                    $post_type = 'gd_place';
325
+                }
324 326
 
325 327
                 $category_taxonomy = geodir_get_taxonomies($post_type);
326 328
                 $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
@@ -335,8 +337,9 @@  discard block
 block discarded – undo
335 337
                     } ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
336 338
                     <?php foreach ($categories as $category_obj) {
337 339
                         $selected = '';
338
-                        if (is_array($category) && in_array($category_obj->term_id, $category))
339
-                            echo $selected = 'selected="selected"';
340
+                        if (is_array($category) && in_array($category_obj->term_id, $category)) {
341
+                                                    echo $selected = 'selected="selected"';
342
+                        }
340 343
 
341 344
                         ?>
342 345
 
@@ -350,7 +353,12 @@  discard block
 block discarded – undo
350 353
 
351 354
                 <input type="hidden" name="<?php echo $this->get_field_name('category_title'); ?>"
352 355
                        id="<?php echo $this->get_field_id('category_title'); ?>"
353
-                       value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory');?>"/>
356
+                       value="<?php if ($category_title != '') {
357
+	echo $category_title;
358
+} else {
359
+	echo __('All', 'geodirectory');
360
+}
361
+?>"/>
354 362
 
355 363
             </label>
356 364
         </p>
@@ -453,7 +461,10 @@  discard block
 block discarded – undo
453 461
             <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
454 462
                 <?php _e('Enable Location Filter:', 'geodirectory');?>
455 463
                 <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
456
-                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
464
+                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) {
465
+	echo 'checked="checked"';
466
+}
467
+?>
457 468
                        value="1"/>
458 469
             </label>
459 470
         </p>
@@ -461,7 +472,10 @@  discard block
 block discarded – undo
461 472
             <label for="<?php echo $this->get_field_id('show_featured_only'); ?>">
462 473
                 <?php _e('Show only featured listings:', 'geodirectory');?> <input type="checkbox"
463 474
                                                                                             id="<?php echo $this->get_field_id('show_featured_only'); ?>"
464
-                                                                                            name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"';?>
475
+                                                                                            name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) {
476
+	echo 'checked="checked"';
477
+}
478
+?>
465 479
                                                                                             value="1"/>
466 480
             </label>
467 481
         </p>
@@ -469,7 +483,10 @@  discard block
 block discarded – undo
469 483
             <label for="<?php echo $this->get_field_id('show_special_only'); ?>">
470 484
                 <?php _e('Show only listings with special offers:', 'geodirectory');?> <input type="checkbox"
471 485
                                                                                                        id="<?php echo $this->get_field_id('show_special_only'); ?>"
472
-                                                                                                       name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"';?>
486
+                                                                                                       name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) {
487
+	echo 'checked="checked"';
488
+}
489
+?>
473 490
                                                                                                        value="1"/>
474 491
             </label>
475 492
         </p>
@@ -477,7 +494,10 @@  discard block
 block discarded – undo
477 494
             <label for="<?php echo $this->get_field_id('with_pics_only'); ?>">
478 495
                 <?php _e('Show only listings with pics:', 'geodirectory');?> <input type="checkbox"
479 496
                                                                                              id="<?php echo $this->get_field_id('with_pics_only'); ?>"
480
-                                                                                             name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"';?>
497
+                                                                                             name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) {
498
+	echo 'checked="checked"';
499
+}
500
+?>
481 501
                                                                                              value="1"/>
482 502
             </label>
483 503
         </p>
@@ -485,7 +505,10 @@  discard block
 block discarded – undo
485 505
             <label for="<?php echo $this->get_field_id('with_videos_only'); ?>">
486 506
                 <?php _e('Show only listings with videos:', 'geodirectory');?> <input type="checkbox"
487 507
                                                                                                id="<?php echo $this->get_field_id('with_videos_only'); ?>"
488
-                                                                                               name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"';?>
508
+                                                                                               name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) {
509
+	echo 'checked="checked"';
510
+}
511
+?>
489 512
                                                                                                value="1"/>
490 513
             </label>
491 514
         </p>
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         //save the widget
62 62
         $instance = $old_instance;
63 63
         $instance['title'] = strip_tags($new_instance['title']);
64
-        $category_limit = (int)$new_instance['category_limit'];
64
+        $category_limit = (int) $new_instance['category_limit'];
65 65
         $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15;
66 66
         $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : '';
67 67
         $instance['parent_only'] = !empty($new_instance['parent_only']) ? true : false;
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
     public function form($instance) 
82 82
     {
83 83
         //widgetform in backend
84
-        $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
84
+        $instance = wp_parse_args((array) $instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
85 85
 
86 86
         $title = strip_tags($instance['title']);
87
-        $category_limit = (int)$instance['category_limit'];
87
+        $category_limit = (int) $instance['category_limit'];
88 88
         $category_limit = $category_limit > 0 ? $category_limit : 15;
89 89
         $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : '';
90
-        $parent_only = !empty($instance['parent_only']) ? true: false;
90
+        $parent_only = !empty($instance['parent_only']) ? true : false;
91 91
         
92 92
         $post_type_options = geodir_get_posttypes('options');
93 93
         ?>
@@ -97,23 +97,23 @@  discard block
 block discarded – undo
97 97
             </label>
98 98
         </p>
99 99
         <p>
100
-            <label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Default post type to use (if not set by page)', 'geodirectory');?>
100
+            <label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Default post type to use (if not set by page)', 'geodirectory'); ?>
101 101
                 <select class="widefat" id="<?php echo $this->get_field_id('default_post_type'); ?>" name="<?php echo $this->get_field_name('default_post_type'); ?>">
102 102
                 <?php foreach ($post_type_options as $name => $title) { ?>
103
-                    <option value="<?php echo $name;?>" <?php selected($name, $default_post_type);?>><?php echo $title; ?></option>
103
+                    <option value="<?php echo $name; ?>" <?php selected($name, $default_post_type); ?>><?php echo $title; ?></option>
104 104
                 <?php } ?>
105 105
                 </select>
106 106
             </label>
107 107
         </p>
108 108
         <p>
109 109
             <label for="<?php echo $this->get_field_id('category_limit'); ?>"><?php _e('Customize categories count to appear by default:', 'geodirectory'); ?>
110
-                <input class="widefat" id="<?php echo $this->get_field_id('category_limit'); ?>" name="<?php echo $this->get_field_name('category_limit'); ?>" type="text" value="<?php echo (int)esc_attr($category_limit); ?>"/>
110
+                <input class="widefat" id="<?php echo $this->get_field_id('category_limit'); ?>" name="<?php echo $this->get_field_name('category_limit'); ?>" type="text" value="<?php echo (int) esc_attr($category_limit); ?>"/>
111 111
                 <p class="description" style="padding:0"><?php _e('After categories count reaches this limit option More Categories / Less Categoris will be displayed to show/hide categories. Default: 15', 'geodirectory'); ?></p>
112 112
             </label>
113 113
         </p>
114 114
         <p>
115
-            <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('parent_only'); ?>" name="<?php echo $this->get_field_name('parent_only'); ?>"<?php checked( $parent_only ); ?> value="1" />
116
-            <label for="<?php echo $this->get_field_id('parent_only'); ?>"><?php _e( 'Show parent categories only', 'geodirectory' ); ?></label>
115
+            <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('parent_only'); ?>" name="<?php echo $this->get_field_name('parent_only'); ?>"<?php checked($parent_only); ?> value="1" />
116
+            <label for="<?php echo $this->get_field_id('parent_only'); ?>"><?php _e('Show parent categories only', 'geodirectory'); ?></label>
117 117
         </p>
118 118
     <?php
119 119
     }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	public function form($instance)
216 216
     {
217 217
         //widgetform in backend
218
-        $instance = wp_parse_args((array)$instance,
218
+        $instance = wp_parse_args((array) $instance,
219 219
             array('title' => '',
220 220
                 'post_type' => '',
221 221
                 'category' => array(),
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
         ?>
267 267
 
268 268
         <p>
269
-            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
269
+            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
270 270
                 <small>(%posttype_singular_label% ,
271
-                    %posttype_plural_label% <?php _e('can be used', 'geodirectory');?>)
271
+                    %posttype_plural_label% <?php _e('can be used', 'geodirectory'); ?>)
272 272
                 </small>
273 273
 
274 274
                 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
         <p>
281 281
             <label
282
-                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
282
+                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?>
283 283
 
284 284
                 <?php $postypes = geodir_get_posttypes();
285 285
 				/**
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 
312 312
         <p id="post_type_cats">
313 313
             <label
314
-                for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory');?>
314
+                for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory'); ?>
315 315
 
316 316
                 <?php
317 317
 
@@ -350,14 +350,14 @@  discard block
 block discarded – undo
350 350
 
351 351
                 <input type="hidden" name="<?php echo $this->get_field_name('category_title'); ?>"
352 352
                        id="<?php echo $this->get_field_id('category_title'); ?>"
353
-                       value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory');?>"/>
353
+                       value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory'); ?>"/>
354 354
 
355 355
             </label>
356 356
         </p>
357 357
 
358 358
         <p>
359 359
             <label
360
-                for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory');?>
360
+                for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory'); ?>
361 361
 
362 362
                 <select class="widefat" id="<?php echo $this->get_field_id('list_sort'); ?>"
363 363
                         name="<?php echo $this->get_field_name('list_sort'); ?>">
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
         <p>
394 394
 
395 395
             <label
396
-                for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory');?>
396
+                for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?>
397 397
 
398 398
                 <input class="widefat" id="<?php echo $this->get_field_id('post_number'); ?>"
399 399
                        name="<?php echo $this->get_field_name('post_number'); ?>" type="text"
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
         <p>
405 405
             <label for="<?php echo $this->get_field_id('layout'); ?>">
406
-                <?php _e('Layout:', 'geodirectory');?>
406
+                <?php _e('Layout:', 'geodirectory'); ?>
407 407
                 <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>"
408 408
                         name="<?php echo $this->get_field_name('layout'); ?>">
409 409
                     <option <?php if ($layout == 'gridview_onehalf') {
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
         <p>
434 434
             <label
435
-                for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory');?>
435
+                for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory'); ?>
436 436
 
437 437
                 <input class="widefat" id="<?php echo $this->get_field_id('listing_width'); ?>"
438 438
                        name="<?php echo $this->get_field_name('listing_width'); ?>" type="text"
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 
443 443
         <p>
444 444
             <label
445
-                for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?>
445
+                for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?>
446 446
                 <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>"
447 447
                        name="<?php echo $this->get_field_name('character_count'); ?>" type="text"
448 448
                        value="<?php echo esc_attr($character_count); ?>"/>
@@ -451,41 +451,41 @@  discard block
 block discarded – undo
451 451
 
452 452
         <p>
453 453
             <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
454
-                <?php _e('Enable Location Filter:', 'geodirectory');?>
454
+                <?php _e('Enable Location Filter:', 'geodirectory'); ?>
455 455
                 <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
456
-                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
456
+                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?>
457 457
                        value="1"/>
458 458
             </label>
459 459
         </p>
460 460
         <p>
461 461
             <label for="<?php echo $this->get_field_id('show_featured_only'); ?>">
462
-                <?php _e('Show only featured listings:', 'geodirectory');?> <input type="checkbox"
462
+                <?php _e('Show only featured listings:', 'geodirectory'); ?> <input type="checkbox"
463 463
                                                                                             id="<?php echo $this->get_field_id('show_featured_only'); ?>"
464
-                                                                                            name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"';?>
464
+                                                                                            name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"'; ?>
465 465
                                                                                             value="1"/>
466 466
             </label>
467 467
         </p>
468 468
         <p>
469 469
             <label for="<?php echo $this->get_field_id('show_special_only'); ?>">
470
-                <?php _e('Show only listings with special offers:', 'geodirectory');?> <input type="checkbox"
470
+                <?php _e('Show only listings with special offers:', 'geodirectory'); ?> <input type="checkbox"
471 471
                                                                                                        id="<?php echo $this->get_field_id('show_special_only'); ?>"
472
-                                                                                                       name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"';?>
472
+                                                                                                       name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"'; ?>
473 473
                                                                                                        value="1"/>
474 474
             </label>
475 475
         </p>
476 476
         <p>
477 477
             <label for="<?php echo $this->get_field_id('with_pics_only'); ?>">
478
-                <?php _e('Show only listings with pics:', 'geodirectory');?> <input type="checkbox"
478
+                <?php _e('Show only listings with pics:', 'geodirectory'); ?> <input type="checkbox"
479 479
                                                                                              id="<?php echo $this->get_field_id('with_pics_only'); ?>"
480
-                                                                                             name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"';?>
480
+                                                                                             name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"'; ?>
481 481
                                                                                              value="1"/>
482 482
             </label>
483 483
         </p>
484 484
         <p>
485 485
             <label for="<?php echo $this->get_field_id('with_videos_only'); ?>">
486
-                <?php _e('Show only listings with videos:', 'geodirectory');?> <input type="checkbox"
486
+                <?php _e('Show only listings with videos:', 'geodirectory'); ?> <input type="checkbox"
487 487
                                                                                                id="<?php echo $this->get_field_id('with_videos_only'); ?>"
488
-                                                                                               name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"';?>
488
+                                                                                               name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"'; ?>
489 489
                                                                                                value="1"/>
490 490
             </label>
491 491
         </p>
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 
532 532
             }
533 533
 
534
-            <?php if(is_active_widget( false, false, $this->id_base, true )){ ?>
534
+            <?php if (is_active_widget(false, false, $this->id_base, true)) { ?>
535 535
             var post_type = jQuery('#<?php echo $this->get_field_id('post_type'); ?>').val();
536 536
 
537 537
             <?php } ?>
Please login to merge, or discard this patch.
Indentation   +204 added lines, -204 removed lines patch added patch discarded remove patch
@@ -14,83 +14,83 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class geodir_popular_post_category extends WP_Widget
16 16
 {
17
-    /**
18
-     * Register the popular post category widget.
19
-     *
20
-     * @since 1.0.0
21
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
-     */
23
-    public function __construct() {
24
-        $widget_ops = array('classname' => 'geodir_popular_post_category', 'description' => __('GD > Popular Post Category', 'geodirectory'));
25
-        parent::__construct(
26
-            'popular_post_category', // Base ID
27
-            __('GD > Popular Post Category', 'geodirectory'), // Name
28
-            $widget_ops// Args
29
-        );
30
-    }
31
-
32
-    /**
33
-     * Front-end display content for popular post category widget.
34
-     *
35
-     * @since 1.0.0
36
-     * @since 1.5.1 Declare function public.
37
-     *
38
-     * @param array $args     Widget arguments.
39
-     * @param array $instance Saved values from database.
40
-     */
41
-    public function widget($args, $instance)
42
-    {
43
-        geodir_popular_post_category_output($args, $instance);
44
-    }
45
-
46
-    /**
47
-     * Sanitize popular post category widget form values as they are saved.
48
-     *
49
-     * @since 1.0.0
50
-     * @since 1.5.1 Declare function public.
51
-     * @since 1.5.1 Added default_post_type parameter.
52
-     * @since 1.6.9 Added parent_only parameter.
53
-     *
54
-     * @param array $new_instance Values just sent to be saved.
55
-     * @param array $old_instance Previously saved values from database.
56
-     *
57
-     * @return array Updated safe values to be saved.
58
-     */ 
59
-    public function update($new_instance, $old_instance)
60
-    {
61
-        //save the widget
62
-        $instance = $old_instance;
63
-        $instance['title'] = strip_tags($new_instance['title']);
64
-        $category_limit = (int)$new_instance['category_limit'];
65
-        $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15;
66
-        $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : '';
67
-        $instance['parent_only'] = !empty($new_instance['parent_only']) ? true : false;
68
-        return $instance;
69
-    }
70
-
71
-    /**
72
-     * Back-end popular post category widget settings form.
73
-     *
74
-     * @since 1.0.0
75
-     * @since 1.5.1 Declare function public.
76
-     * @since 1.5.1 Added option to set default post type.
77
-     * @since 1.6.9 Added option to show parent categories only.
78
-     *
79
-     * @param array $instance Previously saved values from database.
80
-     */
81
-    public function form($instance) 
82
-    {
83
-        //widgetform in backend
84
-        $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
85
-
86
-        $title = strip_tags($instance['title']);
87
-        $category_limit = (int)$instance['category_limit'];
88
-        $category_limit = $category_limit > 0 ? $category_limit : 15;
89
-        $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : '';
90
-        $parent_only = !empty($instance['parent_only']) ? true: false;
17
+	/**
18
+	 * Register the popular post category widget.
19
+	 *
20
+	 * @since 1.0.0
21
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
+	 */
23
+	public function __construct() {
24
+		$widget_ops = array('classname' => 'geodir_popular_post_category', 'description' => __('GD > Popular Post Category', 'geodirectory'));
25
+		parent::__construct(
26
+			'popular_post_category', // Base ID
27
+			__('GD > Popular Post Category', 'geodirectory'), // Name
28
+			$widget_ops// Args
29
+		);
30
+	}
31
+
32
+	/**
33
+	 * Front-end display content for popular post category widget.
34
+	 *
35
+	 * @since 1.0.0
36
+	 * @since 1.5.1 Declare function public.
37
+	 *
38
+	 * @param array $args     Widget arguments.
39
+	 * @param array $instance Saved values from database.
40
+	 */
41
+	public function widget($args, $instance)
42
+	{
43
+		geodir_popular_post_category_output($args, $instance);
44
+	}
45
+
46
+	/**
47
+	 * Sanitize popular post category widget form values as they are saved.
48
+	 *
49
+	 * @since 1.0.0
50
+	 * @since 1.5.1 Declare function public.
51
+	 * @since 1.5.1 Added default_post_type parameter.
52
+	 * @since 1.6.9 Added parent_only parameter.
53
+	 *
54
+	 * @param array $new_instance Values just sent to be saved.
55
+	 * @param array $old_instance Previously saved values from database.
56
+	 *
57
+	 * @return array Updated safe values to be saved.
58
+	 */ 
59
+	public function update($new_instance, $old_instance)
60
+	{
61
+		//save the widget
62
+		$instance = $old_instance;
63
+		$instance['title'] = strip_tags($new_instance['title']);
64
+		$category_limit = (int)$new_instance['category_limit'];
65
+		$instance['category_limit'] = $category_limit > 0 ? $category_limit : 15;
66
+		$instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : '';
67
+		$instance['parent_only'] = !empty($new_instance['parent_only']) ? true : false;
68
+		return $instance;
69
+	}
70
+
71
+	/**
72
+	 * Back-end popular post category widget settings form.
73
+	 *
74
+	 * @since 1.0.0
75
+	 * @since 1.5.1 Declare function public.
76
+	 * @since 1.5.1 Added option to set default post type.
77
+	 * @since 1.6.9 Added option to show parent categories only.
78
+	 *
79
+	 * @param array $instance Previously saved values from database.
80
+	 */
81
+	public function form($instance) 
82
+	{
83
+		//widgetform in backend
84
+		$instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
85
+
86
+		$title = strip_tags($instance['title']);
87
+		$category_limit = (int)$instance['category_limit'];
88
+		$category_limit = $category_limit > 0 ? $category_limit : 15;
89
+		$default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : '';
90
+		$parent_only = !empty($instance['parent_only']) ? true: false;
91 91
         
92
-        $post_type_options = geodir_get_posttypes('options');
93
-        ?>
92
+		$post_type_options = geodir_get_posttypes('options');
93
+		?>
94 94
         <p>
95 95
             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
96 96
                 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>"/>
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             <label for="<?php echo $this->get_field_id('parent_only'); ?>"><?php _e( 'Show parent categories only', 'geodirectory' ); ?></label>
117 117
         </p>
118 118
     <?php
119
-    }
119
+	}
120 120
 } // class geodir_popular_post_category
121 121
 
122 122
 register_widget('geodir_popular_post_category');
@@ -130,40 +130,40 @@  discard block
 block discarded – undo
130 130
 class geodir_popular_postview extends WP_Widget
131 131
 {
132 132
 
133
-    /**
133
+	/**
134 134
 	 * Register the popular posts widget.
135 135
 	 *
136 136
 	 * @since 1.0.0
137
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
137
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
138 138
 	 */
139
-    public function __construct() {
140
-        $widget_ops = array('classname' => 'geodir_popular_post_view', 'description' => __('GD > Popular Post View', 'geodirectory'));
141
-        parent::__construct(
142
-            'popular_post_view', // Base ID
143
-            __('GD > Popular Post View', 'geodirectory'), // Name
144
-            $widget_ops// Args
145
-        );
146
-    }
139
+	public function __construct() {
140
+		$widget_ops = array('classname' => 'geodir_popular_post_view', 'description' => __('GD > Popular Post View', 'geodirectory'));
141
+		parent::__construct(
142
+			'popular_post_view', // Base ID
143
+			__('GD > Popular Post View', 'geodirectory'), // Name
144
+			$widget_ops// Args
145
+		);
146
+	}
147 147
 
148 148
 	/**
149 149
 	 * Front-end display content for popular posts widget.
150 150
 	 *
151 151
 	 * @since 1.0.0
152
-     * @since 1.5.1 Declare function public.
152
+	 * @since 1.5.1 Declare function public.
153 153
 	 *
154 154
 	 * @param array $args     Widget arguments.
155 155
 	 * @param array $instance Saved values from database.
156 156
 	 */
157 157
 	public function widget($args, $instance)
158
-    {
159
-        geodir_popular_postview_output($args, $instance);
160
-    }
158
+	{
159
+		geodir_popular_postview_output($args, $instance);
160
+	}
161 161
 
162 162
 	/**
163 163
 	 * Sanitize popular posts widget form values as they are saved.
164 164
 	 *
165 165
 	 * @since 1.0.0
166
-     * @since 1.5.1 Declare function public.
166
+	 * @since 1.5.1 Declare function public.
167 167
 	 *
168 168
 	 * @param array $new_instance Values just sent to be saved.
169 169
 	 * @param array $old_instance Previously saved values from database.
@@ -171,99 +171,99 @@  discard block
 block discarded – undo
171 171
 	 * @return array Updated safe values to be saved.
172 172
 	 */
173 173
 	public function update($new_instance, $old_instance)
174
-    {
175
-        //save the widget
176
-        $instance = $old_instance;
177
-
178
-        if ($new_instance['title'] == '') {
179
-            $title = geodir_ucwords(strip_tags($new_instance['category_title']));
180
-            //$instance['title'] = $title;
181
-        }
182
-        $instance['title'] = strip_tags($new_instance['title']);
183
-
184
-        $instance['post_type'] = strip_tags($new_instance['post_type']);
185
-        //$instance['category'] = strip_tags($new_instance['category']);
186
-        $instance['category'] = isset($new_instance['category']) ? $new_instance['category'] : '';
187
-        $instance['category_title'] = strip_tags($new_instance['category_title']);
188
-        $instance['post_number'] = strip_tags($new_instance['post_number']);
189
-        $instance['layout'] = strip_tags($new_instance['layout']);
190
-        $instance['listing_width'] = strip_tags($new_instance['listing_width']);
191
-        $instance['list_sort'] = strip_tags($new_instance['list_sort']);
192
-        $instance['character_count'] = $new_instance['character_count'];
193
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
194
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
195
-        else
196
-            $instance['add_location_filter'] = '0';
197
-
198
-        $instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0;
199
-        $instance['show_special_only'] = isset($new_instance['show_special_only']) && $new_instance['show_special_only'] ? 1 : 0;
200
-        $instance['with_pics_only'] = isset($new_instance['with_pics_only']) && $new_instance['with_pics_only'] ? 1 : 0;
201
-        $instance['with_videos_only'] = isset($new_instance['with_videos_only']) && $new_instance['with_videos_only'] ? 1 : 0;
202
-        $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
203
-
204
-        return $instance;
205
-    }
174
+	{
175
+		//save the widget
176
+		$instance = $old_instance;
177
+
178
+		if ($new_instance['title'] == '') {
179
+			$title = geodir_ucwords(strip_tags($new_instance['category_title']));
180
+			//$instance['title'] = $title;
181
+		}
182
+		$instance['title'] = strip_tags($new_instance['title']);
183
+
184
+		$instance['post_type'] = strip_tags($new_instance['post_type']);
185
+		//$instance['category'] = strip_tags($new_instance['category']);
186
+		$instance['category'] = isset($new_instance['category']) ? $new_instance['category'] : '';
187
+		$instance['category_title'] = strip_tags($new_instance['category_title']);
188
+		$instance['post_number'] = strip_tags($new_instance['post_number']);
189
+		$instance['layout'] = strip_tags($new_instance['layout']);
190
+		$instance['listing_width'] = strip_tags($new_instance['listing_width']);
191
+		$instance['list_sort'] = strip_tags($new_instance['list_sort']);
192
+		$instance['character_count'] = $new_instance['character_count'];
193
+		if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
194
+			$instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
195
+		else
196
+			$instance['add_location_filter'] = '0';
197
+
198
+		$instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0;
199
+		$instance['show_special_only'] = isset($new_instance['show_special_only']) && $new_instance['show_special_only'] ? 1 : 0;
200
+		$instance['with_pics_only'] = isset($new_instance['with_pics_only']) && $new_instance['with_pics_only'] ? 1 : 0;
201
+		$instance['with_videos_only'] = isset($new_instance['with_videos_only']) && $new_instance['with_videos_only'] ? 1 : 0;
202
+		$instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
203
+
204
+		return $instance;
205
+	}
206 206
 
207 207
 	/**
208 208
 	 * Back-end popular posts widget settings form.
209 209
 	 *
210 210
 	 * @since 1.0.0
211
-     * @since 1.5.1 Declare function public.
211
+	 * @since 1.5.1 Declare function public.
212 212
 	 *
213 213
 	 * @param array $instance Previously saved values from database.
214 214
 	 */
215 215
 	public function form($instance)
216
-    {
217
-        //widgetform in backend
218
-        $instance = wp_parse_args((array)$instance,
219
-            array('title' => '',
220
-                'post_type' => '',
221
-                'category' => array(),
222
-                'category_title' => '',
223
-                'list_sort' => '',
224
-                'list_order' => '',
225
-                'post_number' => '5',
226
-                'layout' => 'gridview_onehalf',
227
-                'listing_width' => '',
228
-                'add_location_filter' => '1',
229
-                'character_count' => '20',
230
-                'show_featured_only' => '',
231
-                'show_special_only' => '',
232
-                'with_pics_only' => '',
233
-                'with_videos_only' => '',
234
-                'use_viewing_post_type' => ''
235
-            )
236
-        );
216
+	{
217
+		//widgetform in backend
218
+		$instance = wp_parse_args((array)$instance,
219
+			array('title' => '',
220
+				'post_type' => '',
221
+				'category' => array(),
222
+				'category_title' => '',
223
+				'list_sort' => '',
224
+				'list_order' => '',
225
+				'post_number' => '5',
226
+				'layout' => 'gridview_onehalf',
227
+				'listing_width' => '',
228
+				'add_location_filter' => '1',
229
+				'character_count' => '20',
230
+				'show_featured_only' => '',
231
+				'show_special_only' => '',
232
+				'with_pics_only' => '',
233
+				'with_videos_only' => '',
234
+				'use_viewing_post_type' => ''
235
+			)
236
+		);
237 237
 
238
-        $title = strip_tags($instance['title']);
238
+		$title = strip_tags($instance['title']);
239 239
 
240
-        $post_type = strip_tags($instance['post_type']);
240
+		$post_type = strip_tags($instance['post_type']);
241 241
 
242
-        $category = $instance['category'];
242
+		$category = $instance['category'];
243 243
 
244
-        $category_title = strip_tags($instance['category_title']);
244
+		$category_title = strip_tags($instance['category_title']);
245 245
 
246
-        $list_sort = strip_tags($instance['list_sort']);
246
+		$list_sort = strip_tags($instance['list_sort']);
247 247
 
248
-        $list_order = strip_tags($instance['list_order']);
248
+		$list_order = strip_tags($instance['list_order']);
249 249
 
250
-        $post_number = strip_tags($instance['post_number']);
250
+		$post_number = strip_tags($instance['post_number']);
251 251
 
252
-        $layout = strip_tags($instance['layout']);
252
+		$layout = strip_tags($instance['layout']);
253 253
 
254
-        $listing_width = strip_tags($instance['listing_width']);
254
+		$listing_width = strip_tags($instance['listing_width']);
255 255
 
256
-        $add_location_filter = strip_tags($instance['add_location_filter']);
256
+		$add_location_filter = strip_tags($instance['add_location_filter']);
257 257
 
258
-        $character_count = $instance['character_count'];
258
+		$character_count = $instance['character_count'];
259 259
 
260
-        $show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] ? true : false;
261
-        $show_special_only = isset($instance['show_special_only']) && $instance['show_special_only'] ? true : false;
262
-        $with_pics_only = isset($instance['with_pics_only']) && $instance['with_pics_only'] ? true : false;
263
-        $with_videos_only = isset($instance['with_videos_only']) && $instance['with_videos_only'] ? true : false;
264
-        $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
260
+		$show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] ? true : false;
261
+		$show_special_only = isset($instance['show_special_only']) && $instance['show_special_only'] ? true : false;
262
+		$with_pics_only = isset($instance['with_pics_only']) && $instance['with_pics_only'] ? true : false;
263
+		$with_videos_only = isset($instance['with_videos_only']) && $instance['with_videos_only'] ? true : false;
264
+		$use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
265 265
 
266
-        ?>
266
+		?>
267 267
 
268 268
         <p>
269 269
             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
                     <?php foreach ($postypes as $postypes_obj) { ?>
299 299
 
300 300
                         <option <?php if ($post_type == $postypes_obj) {
301
-                            echo 'selected="selected"';
302
-                        } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
303
-                            echo geodir_utf8_ucfirst($extvalue[1]); ?></option>
301
+							echo 'selected="selected"';
302
+						} ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
303
+							echo geodir_utf8_ucfirst($extvalue[1]); ?></option>
304 304
 
305 305
                     <?php } ?>
306 306
 
@@ -315,30 +315,30 @@  discard block
 block discarded – undo
315 315
 
316 316
                 <?php
317 317
 
318
-                $post_type = ($post_type != '') ? $post_type : 'gd_place';
318
+				$post_type = ($post_type != '') ? $post_type : 'gd_place';
319 319
 
320
-                $all_postypes = geodir_get_posttypes();
320
+				$all_postypes = geodir_get_posttypes();
321 321
 
322
-                if (!in_array($post_type, $all_postypes))
323
-                    $post_type = 'gd_place';
322
+				if (!in_array($post_type, $all_postypes))
323
+					$post_type = 'gd_place';
324 324
 
325
-                $category_taxonomy = geodir_get_taxonomies($post_type);
326
-                $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
325
+				$category_taxonomy = geodir_get_taxonomies($post_type);
326
+				$categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
327 327
 
328
-                ?>
328
+				?>
329 329
 
330 330
                 <select multiple="multiple" class="widefat" name="<?php echo $this->get_field_name('category'); ?>[]"
331 331
                         onchange="geodir_popular_widget_cat_title(this)">
332 332
 
333 333
                     <option <?php if (!is_array($category) || (is_array($category) && in_array('0', $category))) {
334
-                        echo 'selected="selected"';
335
-                    } ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
334
+						echo 'selected="selected"';
335
+					} ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
336 336
                     <?php foreach ($categories as $category_obj) {
337
-                        $selected = '';
338
-                        if (is_array($category) && in_array($category_obj->term_id, $category))
339
-                            echo $selected = 'selected="selected"';
337
+						$selected = '';
338
+						if (is_array($category) && in_array($category_obj->term_id, $category))
339
+							echo $selected = 'selected="selected"';
340 340
 
341
-                        ?>
341
+						?>
342 342
 
343 343
                         <option <?php echo $selected; ?>
344 344
                             value="<?php echo $category_obj->term_id; ?>"><?php echo geodir_utf8_ucfirst($category_obj->name); ?></option>
@@ -363,28 +363,28 @@  discard block
 block discarded – undo
363 363
                         name="<?php echo $this->get_field_name('list_sort'); ?>">
364 364
 
365 365
                     <option <?php if ($list_sort == 'az') {
366
-                        echo 'selected="selected"';
367
-                    } ?> value="az"><?php _e('A-Z', 'geodirectory'); ?></option>
366
+						echo 'selected="selected"';
367
+					} ?> value="az"><?php _e('A-Z', 'geodirectory'); ?></option>
368 368
 
369 369
                     <option <?php if ($list_sort == 'latest') {
370
-                        echo 'selected="selected"';
371
-                    } ?> value="latest"><?php _e('Latest', 'geodirectory'); ?></option>
370
+						echo 'selected="selected"';
371
+					} ?> value="latest"><?php _e('Latest', 'geodirectory'); ?></option>
372 372
 
373 373
                     <option <?php if ($list_sort == 'featured') {
374
-                        echo 'selected="selected"';
375
-                    } ?> value="featured"><?php _e('Featured', 'geodirectory'); ?></option>
374
+						echo 'selected="selected"';
375
+					} ?> value="featured"><?php _e('Featured', 'geodirectory'); ?></option>
376 376
 
377 377
                     <option <?php if ($list_sort == 'high_review') {
378
-                        echo 'selected="selected"';
379
-                    } ?> value="high_review"><?php _e('Review', 'geodirectory'); ?></option>
378
+						echo 'selected="selected"';
379
+					} ?> value="high_review"><?php _e('Review', 'geodirectory'); ?></option>
380 380
 
381 381
                     <option <?php if ($list_sort == 'high_rating') {
382
-                        echo 'selected="selected"';
383
-                    } ?> value="high_rating"><?php _e('Rating', 'geodirectory'); ?></option>
382
+						echo 'selected="selected"';
383
+					} ?> value="high_rating"><?php _e('Rating', 'geodirectory'); ?></option>
384 384
 
385 385
                     <option <?php if ($list_sort == 'random') {
386
-                        echo 'selected="selected"';
387
-                    } ?> value="random"><?php _e('Random', 'geodirectory'); ?></option>
386
+						echo 'selected="selected"';
387
+					} ?> value="random"><?php _e('Random', 'geodirectory'); ?></option>
388 388
 
389 389
                 </select>
390 390
             </label>
@@ -407,24 +407,24 @@  discard block
 block discarded – undo
407 407
                 <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>"
408 408
                         name="<?php echo $this->get_field_name('layout'); ?>">
409 409
                     <option <?php if ($layout == 'gridview_onehalf') {
410
-                        echo 'selected="selected"';
411
-                    } ?>
410
+						echo 'selected="selected"';
411
+					} ?>
412 412
                         value="gridview_onehalf"><?php _e('Grid View (Two Columns)', 'geodirectory'); ?></option>
413 413
                     <option <?php if ($layout == 'gridview_onethird') {
414
-                        echo 'selected="selected"';
415
-                    } ?>
414
+						echo 'selected="selected"';
415
+					} ?>
416 416
                         value="gridview_onethird"><?php _e('Grid View (Three Columns)', 'geodirectory'); ?></option>
417 417
                     <option <?php if ($layout == 'gridview_onefourth') {
418
-                        echo 'selected="selected"';
419
-                    } ?>
418
+						echo 'selected="selected"';
419
+					} ?>
420 420
                         value="gridview_onefourth"><?php _e('Grid View (Four Columns)', 'geodirectory'); ?></option>
421 421
                     <option <?php if ($layout == 'gridview_onefifth') {
422
-                        echo 'selected="selected"';
423
-                    } ?>
422
+						echo 'selected="selected"';
423
+					} ?>
424 424
                         value="gridview_onefifth"><?php _e('Grid View (Five Columns)', 'geodirectory'); ?></option>
425 425
                     <option <?php if ($layout == 'list') {
426
-                        echo 'selected="selected"';
427
-                    } ?> value="list"><?php _e('List view', 'geodirectory'); ?></option>
426
+						echo 'selected="selected"';
427
+					} ?> value="list"><?php _e('List view', 'geodirectory'); ?></option>
428 428
 
429 429
                 </select>
430 430
             </label>
@@ -494,8 +494,8 @@  discard block
 block discarded – undo
494 494
                 for="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"><?php _e('Use current viewing post type:', 'geodirectory'); ?>
495 495
                 <input type="checkbox" id="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"
496 496
                        name="<?php echo $this->get_field_name('use_viewing_post_type'); ?>" <?php if ($use_viewing_post_type) {
497
-                    echo 'checked="checked"';
498
-                } ?>  value="1"/>
497
+					echo 'checked="checked"';
498
+				} ?>  value="1"/>
499 499
             </label>
500 500
         </p>
501 501
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
         </script>
540 540
 
541 541
     <?php
542
-    }
542
+	}
543 543
 } // class geodir_popular_postview
544 544
 
545 545
 register_widget('geodir_popular_postview');
546 546
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-widgets/geodirectory_reviews_widget.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -14,37 +14,37 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class geodir_recent_reviews_widget extends WP_Widget
16 16
 {
17
-    /**
17
+	/**
18 18
 	 * Register the recent reviews widget.
19 19
 	 *
20 20
 	 * @since 1.0.0
21
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
21
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22 22
 	 */
23
-    public function __construct() {
24
-        $widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory'));
25
-        parent::__construct(
26
-            'geodir_recent_reviews', // Base ID
27
-            __('GD > Recent Reviews', 'geodirectory'), // Name
28
-            $widget_ops// Args
29
-        );
30
-    }
23
+	public function __construct() {
24
+		$widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory'));
25
+		parent::__construct(
26
+			'geodir_recent_reviews', // Base ID
27
+			__('GD > Recent Reviews', 'geodirectory'), // Name
28
+			$widget_ops// Args
29
+		);
30
+	}
31 31
 
32 32
 	/**
33 33
 	 * Front-end display content for recent reviews widget.
34 34
 	 *
35 35
 	 * @since 1.0.0
36
-     * @since 1.5.1 Declare function public.
36
+	 * @since 1.5.1 Declare function public.
37 37
 	 *
38 38
 	 * @param array $args     Widget arguments.
39 39
 	 * @param array $instance Saved values from database.
40 40
 	 */
41 41
 	public function widget($args, $instance)
42
-    {
43
-        // prints the widget
44
-        extract($args, EXTR_SKIP);
42
+	{
43
+		// prints the widget
44
+		extract($args, EXTR_SKIP);
45 45
 
46
-        /** This filter is documented in geodirectory_widgets.php */
47
-        $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
46
+		/** This filter is documented in geodirectory_widgets.php */
47
+		$title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
48 48
 		
49 49
 		/**
50 50
 		 * Filter the number of reviews to display.
@@ -63,35 +63,35 @@  discard block
 block discarded – undo
63 63
 		 * @param int $g_size Height and width of the avatar image in pixels. Default 30.
64 64
 		 */
65 65
 		$g_size = apply_filters('geodir_recent_reviews_g_size', 30);
66
-        /**
67
-         * Filter the excerpt length
68
-         *
69
-         * @since 1.0.0
70
-         *
71
-         * @param int $excerpt_length Excerpt length. Default 100.
72
-         */
73
-        $excerpt_length = apply_filters('geodir_recent_reviews_excerpt_length', 100);
74
-        $comments_li = geodir_get_recent_reviews($g_size, $count, $excerpt_length, false);
66
+		/**
67
+		 * Filter the excerpt length
68
+		 *
69
+		 * @since 1.0.0
70
+		 *
71
+		 * @param int $excerpt_length Excerpt length. Default 100.
72
+		 */
73
+		$excerpt_length = apply_filters('geodir_recent_reviews_excerpt_length', 100);
74
+		$comments_li = geodir_get_recent_reviews($g_size, $count, $excerpt_length, false);
75 75
 
76
-        if ($comments_li) {
77
-            echo $before_widget;
78
-            ?>
76
+		if ($comments_li) {
77
+			echo $before_widget;
78
+			?>
79 79
             <div class="widget geodir_recent_reviews_section">
80 80
                 <?php if ($title) {
81
-                    echo $before_title . $title . $after_title;
82
-                } ?>
81
+					echo $before_title . $title . $after_title;
82
+				} ?>
83 83
                 <ul class="geodir_recent_reviews"><?php echo $comments_li; ?></ul>
84 84
             </div>
85 85
             <?php
86
-            echo $after_widget;
87
-        }
88
-    }
86
+			echo $after_widget;
87
+		}
88
+	}
89 89
 
90 90
 	/**
91 91
 	 * Sanitize recent reviews widget form values as they are saved.
92 92
 	 *
93 93
 	 * @since 1.0.0
94
-     * @since 1.5.1 Declare function public.
94
+	 * @since 1.5.1 Declare function public.
95 95
 	 *
96 96
 	 * @param array $new_instance Values just sent to be saved.
97 97
 	 * @param array $old_instance Previously saved values from database.
@@ -99,29 +99,29 @@  discard block
 block discarded – undo
99 99
 	 * @return array Updated safe values to be saved.
100 100
 	 */
101 101
 	public function update($new_instance, $old_instance)
102
-    {
103
-        //save the widget
104
-        $instance = $old_instance;
105
-        $instance['title'] = strip_tags($new_instance['title']);
106
-        $instance['count'] = strip_tags($new_instance['count']);
107
-        return $instance;
108
-    }
102
+	{
103
+		//save the widget
104
+		$instance = $old_instance;
105
+		$instance['title'] = strip_tags($new_instance['title']);
106
+		$instance['count'] = strip_tags($new_instance['count']);
107
+		return $instance;
108
+	}
109 109
     
110 110
 	/**
111 111
 	 * Back-end recent reviews widget settings form.
112 112
 	 *
113 113
 	 * @since 1.0.0
114
-     * @since 1.5.1 Declare function public.
114
+	 * @since 1.5.1 Declare function public.
115 115
 	 *
116 116
 	 * @param array $instance Previously saved values from database.
117 117
 	 */
118 118
 	public function form($instance)
119
-    {
120
-        //widgetform in backend
121
-        $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
122
-        $title = strip_tags($instance['title']);
123
-        $count = strip_tags($instance['count']);
124
-        ?>
119
+	{
120
+		//widgetform in backend
121
+		$instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
122
+		$title = strip_tags($instance['title']);
123
+		$count = strip_tags($instance['count']);
124
+		?>
125 125
         <p><label for="<?php echo $this->get_field_id('title'); ?>">Widget Title: <input class="widefat"
126 126
                                                                                          id="<?php echo $this->get_field_id('title'); ?>"
127 127
                                                                                          name="<?php echo $this->get_field_name('title'); ?>"
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
                                                                                              value="<?php echo esc_attr($count); ?>"/></label>
136 136
         </p>
137 137
     <?php
138
-    }
138
+	}
139 139
 } // class geodir_recent_reviews_widget
140 140
 
141 141
 register_widget('geodir_recent_reviews_widget');
142 142
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             ?>
79 79
             <div class="widget geodir_recent_reviews_section">
80 80
                 <?php if ($title) {
81
-                    echo $before_title . $title . $after_title;
81
+                    echo $before_title.$title.$after_title;
82 82
                 } ?>
83 83
                 <ul class="geodir_recent_reviews"><?php echo $comments_li; ?></ul>
84 84
             </div>
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	public function form($instance)
119 119
     {
120 120
         //widgetform in backend
121
-        $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
121
+        $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
122 122
         $title = strip_tags($instance['title']);
123 123
         $count = strip_tags($instance['count']);
124 124
         ?>
Please login to merge, or discard this patch.
geodirectory-admin/admin_install.php 2 patches
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 function geodir_activation()
25 25
 {
26 26
 
27
-    geodir_install();
28
-    add_action('wp_loaded', 'geodir_flush_activation');
27
+	geodir_install();
28
+	add_action('wp_loaded', 'geodir_flush_activation');
29 29
 }
30 30
 
31 31
 /**
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function geodir_flush_activation()
38 38
 {
39
-    // Remove rewrite rules and then recreate rewrite rules.
40
-    // flush late so everything is loaded
41
-    flush_rewrite_rules();
39
+	// Remove rewrite rules and then recreate rewrite rules.
40
+	// flush late so everything is loaded
41
+	flush_rewrite_rules();
42 42
 }
43 43
 
44 44
 /**
@@ -50,44 +50,44 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function geodir_install()
52 52
 {
53
-    global $geodir_settings;
54
-
55
-    /**
56
-     * Called before the GD installation scripts have run.
57
-     *
58
-     * @since 1.0.0
59
-     * @see 'geodir_installation_end'
60
-     */
61
-    do_action('geodir_installation_start');
62
-
63
-    // Do install
64
-    if (!get_option('geodir_default_data_installed')) {
65
-        geodir_create_tables(); // in admin db install.php
66
-        geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
-        geodir_create_default_fields();
68
-        //geodir_default_taxonomies();
69
-        geodir_set_default_options();
70
-        geodir_create_pages();
71
-        geodir_set_default_widgets();
72
-        gd_install_theme_compat();
73
-
74
-        update_option('geodir_default_data_installed', 1);
75
-
76
-    }
77
-
78
-    if (!get_option('geodir_default_data_installed_1.2.8')) {
79
-        //geodir_create_tables(); // in admin db install.php
80
-        update_option('geodir_default_data_installed_1.2.8', 1);
81
-    }
82
-
83
-    geodir_installation_end();
84
-    /**
85
-     * Called after the GD installation scripts have run.
86
-     *
87
-     * @since 1.0.0
88
-     * @see 'geodir_installation_start'
89
-     */
90
-    do_action('geodir_installation_end');
53
+	global $geodir_settings;
54
+
55
+	/**
56
+	 * Called before the GD installation scripts have run.
57
+	 *
58
+	 * @since 1.0.0
59
+	 * @see 'geodir_installation_end'
60
+	 */
61
+	do_action('geodir_installation_start');
62
+
63
+	// Do install
64
+	if (!get_option('geodir_default_data_installed')) {
65
+		geodir_create_tables(); // in admin db install.php
66
+		geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
+		geodir_create_default_fields();
68
+		//geodir_default_taxonomies();
69
+		geodir_set_default_options();
70
+		geodir_create_pages();
71
+		geodir_set_default_widgets();
72
+		gd_install_theme_compat();
73
+
74
+		update_option('geodir_default_data_installed', 1);
75
+
76
+	}
77
+
78
+	if (!get_option('geodir_default_data_installed_1.2.8')) {
79
+		//geodir_create_tables(); // in admin db install.php
80
+		update_option('geodir_default_data_installed_1.2.8', 1);
81
+	}
82
+
83
+	geodir_installation_end();
84
+	/**
85
+	 * Called after the GD installation scripts have run.
86
+	 *
87
+	 * @since 1.0.0
88
+	 * @see 'geodir_installation_start'
89
+	 */
90
+	do_action('geodir_installation_end');
91 91
 
92 92
 
93 93
 }
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 function geodir_create_pages()
105 105
 {
106 106
 
107
-    //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
-    geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
-    geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
-    geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
-    geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
107
+	//geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
+	geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
+	geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
+	geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
+	geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
113 113
 
114
-    //New since 1.5.3
115
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
114
+	//New since 1.5.3
115
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
117 117
 
118 118
 
119 119
 }
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
  */
130 130
 function geodir_installation_end()
131 131
 {
132
-    //update_option( "geodir_db_version", GEODIRECTORY_VERSION );
132
+	//update_option( "geodir_db_version", GEODIRECTORY_VERSION );
133 133
 
134
-    update_option("geodir_installed", 1);
135
-    update_option("geodir_installation_redirect", 1);
136
-    update_option('skip_install_geodir_pages', 0);
134
+	update_option("geodir_installed", 1);
135
+	update_option("geodir_installation_redirect", 1);
136
+	update_option('skip_install_geodir_pages', 0);
137 137
 }
138 138
 
139 139
 /**
@@ -147,45 +147,45 @@  discard block
 block discarded – undo
147 147
  */
148 148
 function geodir_set_default_options()
149 149
 {
150
-    global $geodir_settings;
151
-    /**
152
-     * Contains settings array for general tab.
153
-     *
154
-     * @since 1.0.0
155
-     * @package GeoDirectory
156
-     */
157
-    include_once("option-pages/general_settings_array.php");
158
-    /**
159
-     * Contains settings array for design tab.
160
-     *
161
-     * @since 1.0.0
162
-     * @package GeoDirectory
163
-     */
164
-    include_once("option-pages/design_settings_array.php");
165
-    /**
166
-     * Contains settings array for notifications tab.
167
-     *
168
-     * @since 1.0.0
169
-     * @package GeoDirectory
170
-     */
171
-    include_once("option-pages/notifications_settings_array.php");
172
-    /**
173
-     * Contains settings array for permalink tab.
174
-     *
175
-     * @since 1.0.0
176
-     * @package GeoDirectory
177
-     */
178
-    include_once("option-pages/permalink_settings_array.php");
179
-    /**
180
-     * Contains settings array for title / meta tab.
181
-     *
182
-     * @since 1.5.4
183
-     * @package GeoDirectory
184
-     */
185
-    include_once("option-pages/title_meta_settings_array.php");
186
-    foreach ($geodir_settings as $value) {
187
-        geodir_update_options($value, true);
188
-    }
150
+	global $geodir_settings;
151
+	/**
152
+	 * Contains settings array for general tab.
153
+	 *
154
+	 * @since 1.0.0
155
+	 * @package GeoDirectory
156
+	 */
157
+	include_once("option-pages/general_settings_array.php");
158
+	/**
159
+	 * Contains settings array for design tab.
160
+	 *
161
+	 * @since 1.0.0
162
+	 * @package GeoDirectory
163
+	 */
164
+	include_once("option-pages/design_settings_array.php");
165
+	/**
166
+	 * Contains settings array for notifications tab.
167
+	 *
168
+	 * @since 1.0.0
169
+	 * @package GeoDirectory
170
+	 */
171
+	include_once("option-pages/notifications_settings_array.php");
172
+	/**
173
+	 * Contains settings array for permalink tab.
174
+	 *
175
+	 * @since 1.0.0
176
+	 * @package GeoDirectory
177
+	 */
178
+	include_once("option-pages/permalink_settings_array.php");
179
+	/**
180
+	 * Contains settings array for title / meta tab.
181
+	 *
182
+	 * @since 1.5.4
183
+	 * @package GeoDirectory
184
+	 */
185
+	include_once("option-pages/title_meta_settings_array.php");
186
+	foreach ($geodir_settings as $value) {
187
+		geodir_update_options($value, true);
188
+	}
189 189
 
190 190
 }
191 191
 
@@ -199,103 +199,103 @@  discard block
 block discarded – undo
199 199
 function geodir_set_default_widgets()
200 200
 {
201 201
 
202
-    $widget_option_list = array();
203
-    $widgetinfo = array();
204
-    $sidebarvalue_array = array();
205
-    $sidebars_widgets = array();
202
+	$widget_option_list = array();
203
+	$widgetinfo = array();
204
+	$sidebarvalue_array = array();
205
+	$sidebars_widgets = array();
206 206
 
207
-    /*===========================*/
208
-    /*  Widgets ON HOME PAGE     */
209
-    /*===========================*/
207
+	/*===========================*/
208
+	/*  Widgets ON HOME PAGE     */
209
+	/*===========================*/
210 210
 
211
-    $widget_option_list['geodir_home_top'] =
212
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
-            'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
-            'geodir_advance_search' => array());
211
+	$widget_option_list['geodir_home_top'] =
212
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
+			'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
+			'geodir_advance_search' => array());
215 215
 
216
-    $widget_option_list['geodir_home_content'] =
217
-        array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
216
+	$widget_option_list['geodir_home_content'] =
217
+		array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
218 218
 
219
-    $widget_option_list['geodir_home_right'] =
220
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
219
+	$widget_option_list['geodir_home_right'] =
220
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
222 222
 
223
-    /*===========================*/
224
-    /*  Widgets ON LISTING PAGE     */
225
-    /*===========================*/
223
+	/*===========================*/
224
+	/*  Widgets ON LISTING PAGE     */
225
+	/*===========================*/
226 226
 
227
-    $widget_option_list['geodir_listing_top'] =
228
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
-            'geodir_advance_search' => array());
227
+	$widget_option_list['geodir_listing_top'] =
228
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
+			'geodir_advance_search' => array());
230 230
 
231
-    $widget_option_list['geodir_listing_right_sidebar'] =
232
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
231
+	$widget_option_list['geodir_listing_right_sidebar'] =
232
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
235 235
 
236 236
 
237
-    /*===========================*/
238
-    /*  Widgets ON SEARCH PAGE     */
239
-    /*===========================*/
237
+	/*===========================*/
238
+	/*  Widgets ON SEARCH PAGE     */
239
+	/*===========================*/
240 240
 
241
-    $widget_option_list['geodir_search_top'] =
242
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
-            'geodir_advance_search' => array());
241
+	$widget_option_list['geodir_search_top'] =
242
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
+			'geodir_advance_search' => array());
244 244
 
245
-    $widget_option_list['geodir_search_right_sidebar'] =
246
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
245
+	$widget_option_list['geodir_search_right_sidebar'] =
246
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
249 249
 
250
-    /*===========================*/
251
-    /*  Widgets ON DETAIL/SINGLE PAGE     */
252
-    /*===========================*/
250
+	/*===========================*/
251
+	/*  Widgets ON DETAIL/SINGLE PAGE     */
252
+	/*===========================*/
253 253
 
254
-    $widget_option_list['geodir_detail_sidebar'] =
255
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
254
+	$widget_option_list['geodir_detail_sidebar'] =
255
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
258 258
 
259 259
 
260
-    /*===========================*/
261
-    /*  Widgets ON AUTHOR PAGE     */
262
-    /*===========================*/
260
+	/*===========================*/
261
+	/*  Widgets ON AUTHOR PAGE     */
262
+	/*===========================*/
263 263
 
264 264
 
265
-    $widget_option_list['geodir_author_right_sidebar'] =
266
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
265
+	$widget_option_list['geodir_author_right_sidebar'] =
266
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
267 267
 
268 268
 
269
-    $sidebars_widgets = get_option('sidebars_widgets');
269
+	$sidebars_widgets = get_option('sidebars_widgets');
270 270
 
271
-    foreach ($widget_option_list as $key => $widget_options) {
271
+	foreach ($widget_option_list as $key => $widget_options) {
272 272
 
273
-        foreach ($widget_options as $key2 => $widget_options_obj) {
274
-            $widgetid = 'widget_' . $key2;
273
+		foreach ($widget_options as $key2 => $widget_options_obj) {
274
+			$widgetid = 'widget_' . $key2;
275 275
 
276
-            $widgetinfo[$widgetid][] = $widget_options_obj;
276
+			$widgetinfo[$widgetid][] = $widget_options_obj;
277 277
 
278
-            $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
278
+			$sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
279 279
 
280
-            $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
280
+			$widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
281 281
 
282
-        }
282
+		}
283 283
 
284
-        if (!empty($sidebarvalue_array[$key])) {
284
+		if (!empty($sidebarvalue_array[$key])) {
285 285
 
286
-            $sidebars_widgets = get_option('sidebars_widgets');
287
-            $sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
-            update_option('sidebars_widgets', $sidebars_widgets);
286
+			$sidebars_widgets = get_option('sidebars_widgets');
287
+			$sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
+			update_option('sidebars_widgets', $sidebars_widgets);
289 289
 
290
-            foreach ($widget_update as $key => $value) {
290
+			foreach ($widget_update as $key => $value) {
291 291
 
292
-                update_option($key, $value);
292
+				update_option($key, $value);
293 293
 
294
-            }
294
+			}
295 295
 
296
-        }
296
+		}
297 297
 
298
-    }
298
+	}
299 299
 
300 300
 
301 301
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -271,11 +271,11 @@
 block discarded – undo
271 271
     foreach ($widget_option_list as $key => $widget_options) {
272 272
 
273 273
         foreach ($widget_options as $key2 => $widget_options_obj) {
274
-            $widgetid = 'widget_' . $key2;
274
+            $widgetid = 'widget_'.$key2;
275 275
 
276 276
             $widgetinfo[$widgetid][] = $widget_options_obj;
277 277
 
278
-            $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
278
+            $sidebarvalue_array[$key][] = $key2."-".(count($widgetinfo[$widgetid]));
279 279
 
280 280
             $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
281 281
 
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Jupiter.php 2 patches
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -16,28 +16,28 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function jupiter_action_calls()
18 18
 {
19
-    // REMOVE BREADCRUMB
20
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
-
27
-    // REMOVE PAGE TITLES
28
-    remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
29
-    remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
30
-    remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
31
-    remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
32
-    remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
33
-
34
-
35
-    // CAHNGE PAGE TITLES
36
-    remove_action('page_title', 'mk_page_title');
37
-    add_action('page_title', 'gd_mk_page_title');
38
-    // CHANGE BREADCRUMS FOR GD PAGES
39
-    remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs');
40
-    add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs');
19
+	// REMOVE BREADCRUMB
20
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
+
27
+	// REMOVE PAGE TITLES
28
+	remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
29
+	remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
30
+	remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
31
+	remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
32
+	remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
33
+
34
+
35
+	// CAHNGE PAGE TITLES
36
+	remove_action('page_title', 'mk_page_title');
37
+	add_action('page_title', 'gd_mk_page_title');
38
+	// CHANGE BREADCRUMS FOR GD PAGES
39
+	remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs');
40
+	add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs');
41 41
 
42 42
 
43 43
 }
@@ -52,19 +52,19 @@  discard block
 block discarded – undo
52 52
 function gd_mk_theme_breadcrumbs()
53 53
 {
54 54
 
55
-    if (is_page_geodir_home() || geodir_is_page('location')) {
56
-        jupiter_geodir_breadcrumb();
57
-    } elseif (geodir_is_page('listing')) {
58
-        jupiter_geodir_breadcrumb();
59
-    } elseif (geodir_is_page('detail')) {
60
-        jupiter_geodir_breadcrumb();
61
-    } elseif (geodir_is_page('search')) {
62
-        jupiter_geodir_breadcrumb();
63
-    } elseif (geodir_is_page('author')) {
64
-        jupiter_geodir_breadcrumb();
65
-    } else {
66
-        mk_theme_breadcrumbs();
67
-    }
55
+	if (is_page_geodir_home() || geodir_is_page('location')) {
56
+		jupiter_geodir_breadcrumb();
57
+	} elseif (geodir_is_page('listing')) {
58
+		jupiter_geodir_breadcrumb();
59
+	} elseif (geodir_is_page('detail')) {
60
+		jupiter_geodir_breadcrumb();
61
+	} elseif (geodir_is_page('search')) {
62
+		jupiter_geodir_breadcrumb();
63
+	} elseif (geodir_is_page('author')) {
64
+		jupiter_geodir_breadcrumb();
65
+	} else {
66
+		mk_theme_breadcrumbs();
67
+	}
68 68
 }
69 69
 
70 70
 /**
@@ -76,35 +76,35 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function gd_mk_page_title()
78 78
 {
79
-    global $wp;
80
-
81
-
82
-    if (is_page_geodir_home() || geodir_is_page('location')) {
83
-        jupiter_geodir_page_title();
84
-    } elseif (geodir_is_page('listing')) {
85
-        ob_start(); // Start buffering;
86
-        geodir_action_listings_title();
87
-        $gd_title = ob_get_clean();
88
-        $title_p = explode('">', $gd_title);
89
-        $title = str_replace('</h1></header>', "", $title_p[2]);
90
-        jupiter_geodir_page_title($title);
91
-    } elseif (geodir_is_page('search')) {
92
-        ob_start(); // Start buffering;
93
-        geodir_action_listings_title();
94
-        $gd_title = ob_get_clean();
95
-        $title_p = explode('">', $gd_title);
96
-        $title = str_replace('</h1></header>', "", $title_p[2]);
97
-        jupiter_geodir_page_title($title);
98
-    } elseif (geodir_is_page('author')) {
99
-        ob_start(); // Start buffering;
100
-        geodir_action_author_page_title();
101
-        $gd_title = ob_get_clean();
102
-        $gd_title = str_replace('<h1>', "", $gd_title);
103
-        $gd_title = str_replace('</h1>', "", $gd_title);
104
-        jupiter_geodir_page_title($gd_title);
105
-    } else {
106
-        mk_page_title();
107
-    }
79
+	global $wp;
80
+
81
+
82
+	if (is_page_geodir_home() || geodir_is_page('location')) {
83
+		jupiter_geodir_page_title();
84
+	} elseif (geodir_is_page('listing')) {
85
+		ob_start(); // Start buffering;
86
+		geodir_action_listings_title();
87
+		$gd_title = ob_get_clean();
88
+		$title_p = explode('">', $gd_title);
89
+		$title = str_replace('</h1></header>', "", $title_p[2]);
90
+		jupiter_geodir_page_title($title);
91
+	} elseif (geodir_is_page('search')) {
92
+		ob_start(); // Start buffering;
93
+		geodir_action_listings_title();
94
+		$gd_title = ob_get_clean();
95
+		$title_p = explode('">', $gd_title);
96
+		$title = str_replace('</h1></header>', "", $title_p[2]);
97
+		jupiter_geodir_page_title($title);
98
+	} elseif (geodir_is_page('author')) {
99
+		ob_start(); // Start buffering;
100
+		geodir_action_author_page_title();
101
+		$gd_title = ob_get_clean();
102
+		$gd_title = str_replace('<h1>', "", $gd_title);
103
+		$gd_title = str_replace('</h1>', "", $gd_title);
104
+		jupiter_geodir_page_title($gd_title);
105
+	} else {
106
+		mk_page_title();
107
+	}
108 108
 
109 109
 
110 110
 }
@@ -119,48 +119,48 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function jupiter_geodir_breadcrumb()
121 121
 {
122
-    $item = '';
123
-    ob_start(); // Start buffering;
124
-    geodir_breadcrumb();
125
-    $gd_crums = ob_get_clean();
126
-    if ($gd_crums) {
127
-        $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums);
128
-        $gd_crums = str_replace('</li></ul></div>', "", $gd_crums);
129
-        $gd_crums = str_replace('&nbsp;>&nbsp;', " > ", $gd_crums);
130
-        $gd_crums = str_replace('</li><li>', "", $gd_crums);
131
-        $gd_crums = explode(" > ", $gd_crums);
132
-        $trail_end = array_pop($gd_crums);
133
-        $gd_crums['trail_end'] = $trail_end;
134
-        //print_r($gd_crums);exit;
135
-        //print_r($trail);
136
-        $item = $gd_crums;
137
-
138
-    }
139
-    if (!$item) {
140
-        return;
141
-    }
142
-    global $mk_options, $post;
143
-    $post_id = global_get_post_id();
144
-
145
-    if ($post_id) {
146
-        $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true);
147
-        $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true);
148
-        if ($local_skining == 'true' && !empty($breadcrumb_skin)) {
149
-            $breadcrumb_skin_class = $breadcrumb_skin;
150
-        } else {
151
-            $breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
152
-        }
153
-    } else {
154
-        $breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
155
-    }
156
-
157
-
158
-    $delimiter = ' &#47; ';
159
-
160
-    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
161
-
162
-    echo implode($delimiter, $item);
163
-    echo "</div></div>";
122
+	$item = '';
123
+	ob_start(); // Start buffering;
124
+	geodir_breadcrumb();
125
+	$gd_crums = ob_get_clean();
126
+	if ($gd_crums) {
127
+		$gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums);
128
+		$gd_crums = str_replace('</li></ul></div>', "", $gd_crums);
129
+		$gd_crums = str_replace('&nbsp;>&nbsp;', " > ", $gd_crums);
130
+		$gd_crums = str_replace('</li><li>', "", $gd_crums);
131
+		$gd_crums = explode(" > ", $gd_crums);
132
+		$trail_end = array_pop($gd_crums);
133
+		$gd_crums['trail_end'] = $trail_end;
134
+		//print_r($gd_crums);exit;
135
+		//print_r($trail);
136
+		$item = $gd_crums;
137
+
138
+	}
139
+	if (!$item) {
140
+		return;
141
+	}
142
+	global $mk_options, $post;
143
+	$post_id = global_get_post_id();
144
+
145
+	if ($post_id) {
146
+		$local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true);
147
+		$breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true);
148
+		if ($local_skining == 'true' && !empty($breadcrumb_skin)) {
149
+			$breadcrumb_skin_class = $breadcrumb_skin;
150
+		} else {
151
+			$breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
152
+		}
153
+	} else {
154
+		$breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
155
+	}
156
+
157
+
158
+	$delimiter = ' &#47; ';
159
+
160
+	echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
161
+
162
+	echo implode($delimiter, $item);
163
+	echo "</div></div>";
164 164
 
165 165
 }
166 166
 
@@ -174,41 +174,41 @@  discard block
 block discarded – undo
174 174
  */
175 175
 function jupiter_geodir_page_title($title = '', $subtitle = '')
176 176
 {
177
-    global $mk_options;
178
-
179
-    $post_id = global_get_post_id();
180
-    $shadow_css = '';
181
-    if ($mk_options['page_title_shadow'] == 'true') {
182
-        $shadow_css = 'mk-drop-shadow';
183
-    }
184
-
185
-    $align = !empty($align) ? $align : 'left';
186
-
187
-    //$title = 'xxxx';
188
-    echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
189
-    echo '<div class="mk-grid">';
190
-    if (!empty($title)) {
191
-        echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
192
-
193
-    }
194
-
195
-    if (!empty($subtitle)) {
196
-        echo '<div class="page-introduce-subtitle">';
197
-        echo $subtitle;
198
-        echo '</div>';
199
-    }
200
-    if ($mk_options['disable_breadcrumb'] == 'true') {
201
-        if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') {
202
-            /**
203
-             * Calls the theme breadcrumbs for Jupiter theme.
204
-             *
205
-             * @since 1.4.0
206
-             */
207
-            do_action('theme_breadcrumbs', $post_id);
208
-        }
209
-    }
210
-
211
-    echo '<div class="clearboth"></div></div></section>';
177
+	global $mk_options;
178
+
179
+	$post_id = global_get_post_id();
180
+	$shadow_css = '';
181
+	if ($mk_options['page_title_shadow'] == 'true') {
182
+		$shadow_css = 'mk-drop-shadow';
183
+	}
184
+
185
+	$align = !empty($align) ? $align : 'left';
186
+
187
+	//$title = 'xxxx';
188
+	echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
189
+	echo '<div class="mk-grid">';
190
+	if (!empty($title)) {
191
+		echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
192
+
193
+	}
194
+
195
+	if (!empty($subtitle)) {
196
+		echo '<div class="page-introduce-subtitle">';
197
+		echo $subtitle;
198
+		echo '</div>';
199
+	}
200
+	if ($mk_options['disable_breadcrumb'] == 'true') {
201
+		if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') {
202
+			/**
203
+			 * Calls the theme breadcrumbs for Jupiter theme.
204
+			 *
205
+			 * @since 1.4.0
206
+			 */
207
+			do_action('theme_breadcrumbs', $post_id);
208
+		}
209
+	}
210
+
211
+	echo '<div class="clearboth"></div></div></section>';
212 212
 
213 213
 
214 214
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
     $delimiter = ' &#47; ';
159 159
 
160
-    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
160
+    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner '.$breadcrumb_skin_class.'-skin">';
161 161
 
162 162
     echo implode($delimiter, $item);
163 163
     echo "</div></div>";
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
     $align = !empty($align) ? $align : 'left';
186 186
 
187 187
     //$title = 'xxxx';
188
-    echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
188
+    echo '<section id="mk-page-introduce" class="intro-'.$align.'">';
189 189
     echo '<div class="mk-grid">';
190 190
     if (!empty($title)) {
191
-        echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
191
+        echo '<h1 class="page-introduce-title '.$shadow_css.'">'.$title.'</h1>';
192 192
 
193 193
     }
194 194
 
Please login to merge, or discard this patch.