@@ -17,314 +17,314 @@ |
||
17 | 17 | $geodir_settings['notifications_settings'] = apply_filters('geodir_notifications_settings', array( |
18 | 18 | |
19 | 19 | |
20 | - array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'), |
|
21 | - |
|
22 | - |
|
23 | - array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'), |
|
24 | - |
|
25 | - array( |
|
26 | - 'name' => __('List of usable shortcodes', 'geodirectory'), |
|
27 | - 'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'), |
|
28 | - 'id' => 'geodir_list_of_usable_shordcodes', |
|
29 | - 'type' => 'html_content', |
|
30 | - 'css' => 'min-width:300px;', |
|
31 | - 'std' => 'All Places' // Default value for the page title - changed in settings |
|
32 | - ), |
|
33 | - |
|
34 | - array( |
|
35 | - 'name' => __('Use advanced editor? (slow loading)', 'geodirectory'), |
|
36 | - 'desc' => __('Yes', 'geodirectory'), |
|
37 | - 'id' => 'geodir_tiny_editor', |
|
38 | - 'std' => 'yes', |
|
39 | - 'type' => 'radio', |
|
40 | - 'value' => '1', |
|
41 | - 'radiogroup' => 'start' |
|
42 | - ), |
|
43 | - array( |
|
44 | - 'name' => __('Use advanced editor?(slow loading)', 'geodirectory'), |
|
45 | - 'desc' => __('No', 'geodirectory'), |
|
46 | - 'id' => 'geodir_tiny_editor', |
|
47 | - 'std' => 'yes', |
|
48 | - 'type' => 'radio', |
|
49 | - 'value' => '0', |
|
50 | - 'radiogroup' => 'end' |
|
51 | - ), |
|
52 | - |
|
53 | - |
|
54 | - array('type' => 'sectionend', 'id' => 'notification_options'), |
|
55 | - |
|
56 | - |
|
57 | - array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'), |
|
58 | - |
|
59 | - array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'), |
|
60 | - |
|
61 | - array( |
|
62 | - 'name' => __('New user registration', 'geodirectory'), |
|
63 | - 'desc' => __('Yes', 'geodirectory'), |
|
64 | - 'id' => 'geodir_bcc_new_user', |
|
65 | - 'std' => 'yes', |
|
66 | - 'type' => 'radio', |
|
67 | - 'value' => '1', |
|
68 | - 'radiogroup' => 'start' |
|
69 | - ), |
|
70 | - array( |
|
71 | - 'name' => __('New user registration', 'geodirectory'), |
|
72 | - 'desc' => __('No', 'geodirectory'), |
|
73 | - 'id' => 'geodir_bcc_new_user', |
|
74 | - 'std' => 'yes', |
|
75 | - 'type' => 'radio', |
|
76 | - 'value' => '0', |
|
77 | - 'radiogroup' => 'end' |
|
78 | - ), |
|
79 | - |
|
80 | - array( |
|
81 | - 'name' => __('Send to friend', 'geodirectory'), |
|
82 | - 'desc' => __('Yes', 'geodirectory'), |
|
83 | - 'id' => 'geodir_bcc_friend', |
|
84 | - 'std' => 'yes', |
|
85 | - 'type' => 'radio', |
|
86 | - 'value' => '1', |
|
87 | - 'radiogroup' => 'start' |
|
88 | - ), |
|
89 | - array( |
|
90 | - 'name' => __('Send to friend', 'geodirectory'), |
|
91 | - 'desc' => __('No', 'geodirectory'), |
|
92 | - 'id' => 'geodir_bcc_friend', |
|
93 | - 'std' => 'yes', |
|
94 | - 'type' => 'radio', |
|
95 | - 'value' => '0', |
|
96 | - 'radiogroup' => 'end' |
|
97 | - ), |
|
98 | - |
|
99 | - array( |
|
100 | - 'name' => __('Send enquiry', 'geodirectory'), |
|
101 | - 'desc' => __('Yes', 'geodirectory'), |
|
102 | - 'id' => 'geodir_bcc_enquiry', |
|
103 | - 'std' => 'yes', |
|
104 | - 'type' => 'radio', |
|
105 | - 'value' => '1', |
|
106 | - 'radiogroup' => 'start' |
|
107 | - ), |
|
108 | - array( |
|
109 | - 'name' => __('Send enquiry', 'geodirectory'), |
|
110 | - 'desc' => __('No', 'geodirectory'), |
|
111 | - 'id' => 'geodir_bcc_enquiry', |
|
112 | - 'std' => 'yes', |
|
113 | - 'type' => 'radio', |
|
114 | - 'value' => '0', |
|
115 | - 'radiogroup' => 'end' |
|
116 | - ), |
|
117 | - |
|
118 | - |
|
119 | - array('type' => 'sectionend', 'id' => 'site_bcc_options'), |
|
120 | - |
|
121 | - |
|
122 | - array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'), |
|
123 | - |
|
124 | - array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'), |
|
125 | - |
|
126 | - array( |
|
127 | - 'name' => __('Notify to admin on post submit', 'geodirectory'), |
|
128 | - 'desc' => __('Yes', 'geodirectory'), |
|
129 | - 'id' => 'geodir_notify_post_submit', |
|
130 | - 'std' => '1', |
|
131 | - 'type' => 'radio', |
|
132 | - 'value' => '1', |
|
133 | - 'radiogroup' => 'start' |
|
134 | - ), |
|
135 | - array( |
|
136 | - 'name' => __('Notify to admin on post submit', 'geodirectory'), |
|
137 | - 'desc' => __('No', 'geodirectory'), |
|
138 | - 'id' => 'geodir_notify_post_submit', |
|
139 | - 'std' => '1', |
|
140 | - 'type' => 'radio', |
|
141 | - 'value' => '0', |
|
142 | - 'radiogroup' => 'end' |
|
143 | - ), |
|
144 | - array( |
|
145 | - 'name' => __('Post submit success to admin email', 'geodirectory'), |
|
146 | - 'desc' => '', |
|
147 | - 'id' => 'geodir_post_submited_success_email_subject_admin', |
|
148 | - 'type' => 'text', |
|
149 | - 'css' => 'min-width:300px;', |
|
150 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
151 | - ), |
|
152 | - array( |
|
153 | - 'name' => '', |
|
154 | - 'desc' => '', |
|
155 | - 'id' => 'geodir_post_submited_success_email_content_admin', |
|
156 | - 'css' => 'width:500px; height: 150px;', |
|
157 | - 'type' => 'textarea', |
|
158 | - 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory') |
|
159 | - ), |
|
160 | - array( |
|
161 | - 'name' => __('Notify Admin when listing edited by Author', 'geodirectory'), |
|
162 | - 'desc' => __('Yes', 'geodirectory'), |
|
163 | - 'id' => 'geodir_notify_post_edited', |
|
164 | - 'std' => '0', |
|
165 | - 'type' => 'radio', |
|
166 | - 'value' => '1', |
|
167 | - 'radiogroup' => 'start' |
|
168 | - ), |
|
169 | - array( |
|
170 | - 'name' => __('Notify Admin when listing edited by Author', 'geodirectory'), |
|
171 | - 'desc' => __('No', 'geodirectory'), |
|
172 | - 'id' => 'geodir_notify_post_edited', |
|
173 | - 'std' => '0', |
|
174 | - 'type' => 'radio', |
|
175 | - 'value' => '0', |
|
176 | - 'radiogroup' => 'end' |
|
177 | - ), |
|
178 | - array( |
|
179 | - 'name' => __('Listing edited by Author', 'geodirectory'), |
|
180 | - 'desc' => '', |
|
181 | - 'id' => 'geodir_post_edited_email_subject_admin', |
|
182 | - 'type' => 'text', |
|
183 | - 'css' => 'min-width:300px;', |
|
184 | - 'std' => __('[[#site_name#]] Listing edited by Author', 'geodirectory') |
|
185 | - ), |
|
186 | - array( |
|
187 | - 'name' => '', |
|
188 | - 'desc' => '', |
|
189 | - 'id' => 'geodir_post_edited_email_content_admin', |
|
190 | - 'css' => 'width:500px; height: 150px;', |
|
191 | - 'type' => 'textarea', |
|
192 | - 'std' => __('<p>Dear Admin,</p><p>A listing [#listing_link#] has been edited by it\'s author [#post_author_name#].</p><br><p><b>Listing Details:</b></p><p>Listing ID: [#post_id#]</p><p>Listing URL: [#listing_link#]</p><p>Date: [#current_date#]</p><br><p>This email is just for your information.</p><p>[#site_name#]</p>', 'geodirectory') |
|
193 | - ), |
|
194 | - |
|
195 | - |
|
196 | - array('type' => 'sectionend', 'id' => 'admin_emails'), |
|
197 | - |
|
198 | - |
|
199 | - array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'), |
|
200 | - |
|
201 | - array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'), |
|
202 | - |
|
203 | - array( |
|
204 | - 'name' => __('Post submit success to client email', 'geodirectory'), |
|
205 | - 'desc' => '', |
|
206 | - 'id' => 'geodir_post_submited_success_email_subject', |
|
207 | - 'type' => 'text', |
|
208 | - 'css' => 'min-width:300px;', |
|
209 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
210 | - ), |
|
211 | - array( |
|
212 | - 'name' => '', |
|
213 | - 'desc' => '', |
|
214 | - 'id' => 'geodir_post_submited_success_email_content', |
|
215 | - 'css' => 'width:500px; height: 150px;', |
|
216 | - 'type' => 'textarea', |
|
217 | - 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory') |
|
218 | - ), |
|
219 | - |
|
220 | - |
|
221 | - array( |
|
222 | - 'name' => __('User forgot password email', 'geodirectory'), |
|
223 | - 'desc' => '', |
|
224 | - 'id' => 'geodir_forgot_password_subject', |
|
225 | - 'type' => 'text', |
|
226 | - 'css' => 'min-width:300px;', |
|
227 | - 'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings |
|
228 | - ), |
|
229 | - array( |
|
230 | - 'name' => '', |
|
231 | - 'desc' => '', |
|
232 | - 'id' => 'geodir_forgot_password_content', |
|
233 | - 'css' => 'width:500px; height: 150px;', |
|
234 | - 'type' => 'textarea', |
|
235 | - 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
236 | - ), |
|
237 | - |
|
238 | - array( |
|
239 | - 'name' => __('Registration success email', 'geodirectory'), |
|
240 | - 'desc' => '', |
|
241 | - 'id' => 'geodir_registration_success_email_subject', |
|
242 | - 'type' => 'text', |
|
243 | - 'css' => 'min-width:300px;', |
|
244 | - 'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings |
|
245 | - ), |
|
246 | - array( |
|
247 | - 'name' => '', |
|
248 | - 'desc' => '', |
|
249 | - 'id' => 'geodir_registration_success_email_content', |
|
250 | - 'css' => 'width:500px; height: 150px;', |
|
251 | - 'type' => 'textarea', |
|
252 | - 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
253 | - ), |
|
254 | - array( |
|
255 | - 'name' => __('Listing published email', 'geodirectory'), |
|
256 | - 'desc' => '', |
|
257 | - 'id' => 'geodir_post_published_email_subject', |
|
258 | - 'type' => 'text', |
|
259 | - 'css' => 'min-width:300px;', |
|
260 | - 'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
261 | - ), |
|
262 | - array( |
|
263 | - 'name' => '', |
|
264 | - 'desc' => '', |
|
265 | - 'id' => 'geodir_post_published_email_content', |
|
266 | - 'css' => 'width:500px; height: 150px;', |
|
267 | - 'type' => 'textarea', |
|
268 | - 'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory') |
|
269 | - ), |
|
270 | - |
|
271 | - array('type' => 'sectionend', 'id' => 'client_emails'), |
|
272 | - |
|
273 | - array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'), |
|
274 | - |
|
275 | - array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'), |
|
276 | - |
|
277 | - array( |
|
278 | - 'name' => __('Send to friend', 'geodirectory'), |
|
279 | - 'desc' => '', |
|
280 | - 'id' => 'geodir_email_friend_subject', |
|
281 | - 'type' => 'text', |
|
282 | - 'css' => 'min-width:300px;', |
|
283 | - 'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory') |
|
284 | - ), |
|
285 | - array( |
|
286 | - 'name' => '', |
|
287 | - 'desc' => '', |
|
288 | - 'id' => 'geodir_email_friend_content', |
|
289 | - 'css' => 'width:500px; height: 150px;', |
|
290 | - 'type' => 'textarea', |
|
291 | - 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory') |
|
292 | - ), |
|
293 | - |
|
294 | - array( |
|
295 | - 'name' => __('Email enquiry', 'geodirectory'), |
|
296 | - 'desc' => '', |
|
297 | - 'id' => 'geodir_email_enquiry_subject', |
|
298 | - 'type' => 'text', |
|
299 | - 'css' => 'min-width:300px;', |
|
300 | - 'std' => __('Website Enquiry', 'geodirectory') |
|
301 | - ), |
|
302 | - array( |
|
303 | - 'name' => '', |
|
304 | - 'desc' => '', |
|
305 | - 'id' => 'geodir_email_enquiry_content', |
|
306 | - 'css' => 'width:500px; height: 150px;', |
|
307 | - 'type' => 'textarea', |
|
308 | - 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
309 | - ), |
|
310 | - |
|
311 | - array('type' => 'sectionend', 'id' => 'other_emails'), |
|
312 | - |
|
313 | - |
|
314 | - array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'), |
|
315 | - |
|
316 | - array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'), |
|
317 | - |
|
318 | - array( |
|
319 | - 'name' => __('Post submitted success', 'geodirectory'), |
|
320 | - 'desc' => '', |
|
321 | - 'id' => 'geodir_post_added_success_msg_content', |
|
322 | - 'css' => 'width:500px; height: 150px;', |
|
323 | - 'type' => 'textarea', |
|
324 | - 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory') |
|
325 | - ), |
|
326 | - |
|
327 | - |
|
328 | - array('type' => 'sectionend', 'id' => 'messages'), |
|
20 | + array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'), |
|
21 | + |
|
22 | + |
|
23 | + array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'), |
|
24 | + |
|
25 | + array( |
|
26 | + 'name' => __('List of usable shortcodes', 'geodirectory'), |
|
27 | + 'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'), |
|
28 | + 'id' => 'geodir_list_of_usable_shordcodes', |
|
29 | + 'type' => 'html_content', |
|
30 | + 'css' => 'min-width:300px;', |
|
31 | + 'std' => 'All Places' // Default value for the page title - changed in settings |
|
32 | + ), |
|
33 | + |
|
34 | + array( |
|
35 | + 'name' => __('Use advanced editor? (slow loading)', 'geodirectory'), |
|
36 | + 'desc' => __('Yes', 'geodirectory'), |
|
37 | + 'id' => 'geodir_tiny_editor', |
|
38 | + 'std' => 'yes', |
|
39 | + 'type' => 'radio', |
|
40 | + 'value' => '1', |
|
41 | + 'radiogroup' => 'start' |
|
42 | + ), |
|
43 | + array( |
|
44 | + 'name' => __('Use advanced editor?(slow loading)', 'geodirectory'), |
|
45 | + 'desc' => __('No', 'geodirectory'), |
|
46 | + 'id' => 'geodir_tiny_editor', |
|
47 | + 'std' => 'yes', |
|
48 | + 'type' => 'radio', |
|
49 | + 'value' => '0', |
|
50 | + 'radiogroup' => 'end' |
|
51 | + ), |
|
52 | + |
|
53 | + |
|
54 | + array('type' => 'sectionend', 'id' => 'notification_options'), |
|
55 | + |
|
56 | + |
|
57 | + array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'), |
|
58 | + |
|
59 | + array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'), |
|
60 | + |
|
61 | + array( |
|
62 | + 'name' => __('New user registration', 'geodirectory'), |
|
63 | + 'desc' => __('Yes', 'geodirectory'), |
|
64 | + 'id' => 'geodir_bcc_new_user', |
|
65 | + 'std' => 'yes', |
|
66 | + 'type' => 'radio', |
|
67 | + 'value' => '1', |
|
68 | + 'radiogroup' => 'start' |
|
69 | + ), |
|
70 | + array( |
|
71 | + 'name' => __('New user registration', 'geodirectory'), |
|
72 | + 'desc' => __('No', 'geodirectory'), |
|
73 | + 'id' => 'geodir_bcc_new_user', |
|
74 | + 'std' => 'yes', |
|
75 | + 'type' => 'radio', |
|
76 | + 'value' => '0', |
|
77 | + 'radiogroup' => 'end' |
|
78 | + ), |
|
79 | + |
|
80 | + array( |
|
81 | + 'name' => __('Send to friend', 'geodirectory'), |
|
82 | + 'desc' => __('Yes', 'geodirectory'), |
|
83 | + 'id' => 'geodir_bcc_friend', |
|
84 | + 'std' => 'yes', |
|
85 | + 'type' => 'radio', |
|
86 | + 'value' => '1', |
|
87 | + 'radiogroup' => 'start' |
|
88 | + ), |
|
89 | + array( |
|
90 | + 'name' => __('Send to friend', 'geodirectory'), |
|
91 | + 'desc' => __('No', 'geodirectory'), |
|
92 | + 'id' => 'geodir_bcc_friend', |
|
93 | + 'std' => 'yes', |
|
94 | + 'type' => 'radio', |
|
95 | + 'value' => '0', |
|
96 | + 'radiogroup' => 'end' |
|
97 | + ), |
|
98 | + |
|
99 | + array( |
|
100 | + 'name' => __('Send enquiry', 'geodirectory'), |
|
101 | + 'desc' => __('Yes', 'geodirectory'), |
|
102 | + 'id' => 'geodir_bcc_enquiry', |
|
103 | + 'std' => 'yes', |
|
104 | + 'type' => 'radio', |
|
105 | + 'value' => '1', |
|
106 | + 'radiogroup' => 'start' |
|
107 | + ), |
|
108 | + array( |
|
109 | + 'name' => __('Send enquiry', 'geodirectory'), |
|
110 | + 'desc' => __('No', 'geodirectory'), |
|
111 | + 'id' => 'geodir_bcc_enquiry', |
|
112 | + 'std' => 'yes', |
|
113 | + 'type' => 'radio', |
|
114 | + 'value' => '0', |
|
115 | + 'radiogroup' => 'end' |
|
116 | + ), |
|
117 | + |
|
118 | + |
|
119 | + array('type' => 'sectionend', 'id' => 'site_bcc_options'), |
|
120 | + |
|
121 | + |
|
122 | + array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'), |
|
123 | + |
|
124 | + array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'), |
|
125 | + |
|
126 | + array( |
|
127 | + 'name' => __('Notify to admin on post submit', 'geodirectory'), |
|
128 | + 'desc' => __('Yes', 'geodirectory'), |
|
129 | + 'id' => 'geodir_notify_post_submit', |
|
130 | + 'std' => '1', |
|
131 | + 'type' => 'radio', |
|
132 | + 'value' => '1', |
|
133 | + 'radiogroup' => 'start' |
|
134 | + ), |
|
135 | + array( |
|
136 | + 'name' => __('Notify to admin on post submit', 'geodirectory'), |
|
137 | + 'desc' => __('No', 'geodirectory'), |
|
138 | + 'id' => 'geodir_notify_post_submit', |
|
139 | + 'std' => '1', |
|
140 | + 'type' => 'radio', |
|
141 | + 'value' => '0', |
|
142 | + 'radiogroup' => 'end' |
|
143 | + ), |
|
144 | + array( |
|
145 | + 'name' => __('Post submit success to admin email', 'geodirectory'), |
|
146 | + 'desc' => '', |
|
147 | + 'id' => 'geodir_post_submited_success_email_subject_admin', |
|
148 | + 'type' => 'text', |
|
149 | + 'css' => 'min-width:300px;', |
|
150 | + 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
151 | + ), |
|
152 | + array( |
|
153 | + 'name' => '', |
|
154 | + 'desc' => '', |
|
155 | + 'id' => 'geodir_post_submited_success_email_content_admin', |
|
156 | + 'css' => 'width:500px; height: 150px;', |
|
157 | + 'type' => 'textarea', |
|
158 | + 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory') |
|
159 | + ), |
|
160 | + array( |
|
161 | + 'name' => __('Notify Admin when listing edited by Author', 'geodirectory'), |
|
162 | + 'desc' => __('Yes', 'geodirectory'), |
|
163 | + 'id' => 'geodir_notify_post_edited', |
|
164 | + 'std' => '0', |
|
165 | + 'type' => 'radio', |
|
166 | + 'value' => '1', |
|
167 | + 'radiogroup' => 'start' |
|
168 | + ), |
|
169 | + array( |
|
170 | + 'name' => __('Notify Admin when listing edited by Author', 'geodirectory'), |
|
171 | + 'desc' => __('No', 'geodirectory'), |
|
172 | + 'id' => 'geodir_notify_post_edited', |
|
173 | + 'std' => '0', |
|
174 | + 'type' => 'radio', |
|
175 | + 'value' => '0', |
|
176 | + 'radiogroup' => 'end' |
|
177 | + ), |
|
178 | + array( |
|
179 | + 'name' => __('Listing edited by Author', 'geodirectory'), |
|
180 | + 'desc' => '', |
|
181 | + 'id' => 'geodir_post_edited_email_subject_admin', |
|
182 | + 'type' => 'text', |
|
183 | + 'css' => 'min-width:300px;', |
|
184 | + 'std' => __('[[#site_name#]] Listing edited by Author', 'geodirectory') |
|
185 | + ), |
|
186 | + array( |
|
187 | + 'name' => '', |
|
188 | + 'desc' => '', |
|
189 | + 'id' => 'geodir_post_edited_email_content_admin', |
|
190 | + 'css' => 'width:500px; height: 150px;', |
|
191 | + 'type' => 'textarea', |
|
192 | + 'std' => __('<p>Dear Admin,</p><p>A listing [#listing_link#] has been edited by it\'s author [#post_author_name#].</p><br><p><b>Listing Details:</b></p><p>Listing ID: [#post_id#]</p><p>Listing URL: [#listing_link#]</p><p>Date: [#current_date#]</p><br><p>This email is just for your information.</p><p>[#site_name#]</p>', 'geodirectory') |
|
193 | + ), |
|
194 | + |
|
195 | + |
|
196 | + array('type' => 'sectionend', 'id' => 'admin_emails'), |
|
197 | + |
|
198 | + |
|
199 | + array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'), |
|
200 | + |
|
201 | + array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'), |
|
202 | + |
|
203 | + array( |
|
204 | + 'name' => __('Post submit success to client email', 'geodirectory'), |
|
205 | + 'desc' => '', |
|
206 | + 'id' => 'geodir_post_submited_success_email_subject', |
|
207 | + 'type' => 'text', |
|
208 | + 'css' => 'min-width:300px;', |
|
209 | + 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
210 | + ), |
|
211 | + array( |
|
212 | + 'name' => '', |
|
213 | + 'desc' => '', |
|
214 | + 'id' => 'geodir_post_submited_success_email_content', |
|
215 | + 'css' => 'width:500px; height: 150px;', |
|
216 | + 'type' => 'textarea', |
|
217 | + 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory') |
|
218 | + ), |
|
219 | + |
|
220 | + |
|
221 | + array( |
|
222 | + 'name' => __('User forgot password email', 'geodirectory'), |
|
223 | + 'desc' => '', |
|
224 | + 'id' => 'geodir_forgot_password_subject', |
|
225 | + 'type' => 'text', |
|
226 | + 'css' => 'min-width:300px;', |
|
227 | + 'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings |
|
228 | + ), |
|
229 | + array( |
|
230 | + 'name' => '', |
|
231 | + 'desc' => '', |
|
232 | + 'id' => 'geodir_forgot_password_content', |
|
233 | + 'css' => 'width:500px; height: 150px;', |
|
234 | + 'type' => 'textarea', |
|
235 | + 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
236 | + ), |
|
237 | + |
|
238 | + array( |
|
239 | + 'name' => __('Registration success email', 'geodirectory'), |
|
240 | + 'desc' => '', |
|
241 | + 'id' => 'geodir_registration_success_email_subject', |
|
242 | + 'type' => 'text', |
|
243 | + 'css' => 'min-width:300px;', |
|
244 | + 'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings |
|
245 | + ), |
|
246 | + array( |
|
247 | + 'name' => '', |
|
248 | + 'desc' => '', |
|
249 | + 'id' => 'geodir_registration_success_email_content', |
|
250 | + 'css' => 'width:500px; height: 150px;', |
|
251 | + 'type' => 'textarea', |
|
252 | + 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
253 | + ), |
|
254 | + array( |
|
255 | + 'name' => __('Listing published email', 'geodirectory'), |
|
256 | + 'desc' => '', |
|
257 | + 'id' => 'geodir_post_published_email_subject', |
|
258 | + 'type' => 'text', |
|
259 | + 'css' => 'min-width:300px;', |
|
260 | + 'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
261 | + ), |
|
262 | + array( |
|
263 | + 'name' => '', |
|
264 | + 'desc' => '', |
|
265 | + 'id' => 'geodir_post_published_email_content', |
|
266 | + 'css' => 'width:500px; height: 150px;', |
|
267 | + 'type' => 'textarea', |
|
268 | + 'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory') |
|
269 | + ), |
|
270 | + |
|
271 | + array('type' => 'sectionend', 'id' => 'client_emails'), |
|
272 | + |
|
273 | + array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'), |
|
274 | + |
|
275 | + array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'), |
|
276 | + |
|
277 | + array( |
|
278 | + 'name' => __('Send to friend', 'geodirectory'), |
|
279 | + 'desc' => '', |
|
280 | + 'id' => 'geodir_email_friend_subject', |
|
281 | + 'type' => 'text', |
|
282 | + 'css' => 'min-width:300px;', |
|
283 | + 'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory') |
|
284 | + ), |
|
285 | + array( |
|
286 | + 'name' => '', |
|
287 | + 'desc' => '', |
|
288 | + 'id' => 'geodir_email_friend_content', |
|
289 | + 'css' => 'width:500px; height: 150px;', |
|
290 | + 'type' => 'textarea', |
|
291 | + 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory') |
|
292 | + ), |
|
293 | + |
|
294 | + array( |
|
295 | + 'name' => __('Email enquiry', 'geodirectory'), |
|
296 | + 'desc' => '', |
|
297 | + 'id' => 'geodir_email_enquiry_subject', |
|
298 | + 'type' => 'text', |
|
299 | + 'css' => 'min-width:300px;', |
|
300 | + 'std' => __('Website Enquiry', 'geodirectory') |
|
301 | + ), |
|
302 | + array( |
|
303 | + 'name' => '', |
|
304 | + 'desc' => '', |
|
305 | + 'id' => 'geodir_email_enquiry_content', |
|
306 | + 'css' => 'width:500px; height: 150px;', |
|
307 | + 'type' => 'textarea', |
|
308 | + 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
309 | + ), |
|
310 | + |
|
311 | + array('type' => 'sectionend', 'id' => 'other_emails'), |
|
312 | + |
|
313 | + |
|
314 | + array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'), |
|
315 | + |
|
316 | + array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'), |
|
317 | + |
|
318 | + array( |
|
319 | + 'name' => __('Post submitted success', 'geodirectory'), |
|
320 | + 'desc' => '', |
|
321 | + 'id' => 'geodir_post_added_success_msg_content', |
|
322 | + 'css' => 'width:500px; height: 150px;', |
|
323 | + 'type' => 'textarea', |
|
324 | + 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory') |
|
325 | + ), |
|
326 | + |
|
327 | + |
|
328 | + array('type' => 'sectionend', 'id' => 'messages'), |
|
329 | 329 | |
330 | 330 | )); // End Manage NOtifications settings |
@@ -10,53 +10,53 @@ discard block |
||
10 | 10 | global $wpdb; |
11 | 11 | |
12 | 12 | if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) { |
13 | - /** |
|
14 | - * Include custom database table related functions. |
|
15 | - * |
|
16 | - * @since 1.0.0 |
|
17 | - * @package GeoDirectory |
|
18 | - */ |
|
19 | - include_once('geodirectory-admin/admin_db_install.php'); |
|
20 | - add_action('plugins_loaded', 'geodirectory_upgrade_all', 10); |
|
21 | - if (GEODIRECTORY_VERSION <= '1.3.6') { |
|
22 | - add_action('plugins_loaded', 'geodir_upgrade_136', 11); |
|
23 | - } |
|
24 | - |
|
25 | - if (GEODIRECTORY_VERSION <= '1.4.6') { |
|
26 | - add_action('init', 'geodir_upgrade_146', 11); |
|
27 | - } |
|
28 | - |
|
29 | - if (GEODIRECTORY_VERSION <= '1.4.8') { |
|
30 | - add_action('init', 'geodir_upgrade_148', 11); |
|
31 | - } |
|
32 | - |
|
33 | - if (GEODIRECTORY_VERSION <= '1.5.0') { |
|
34 | - add_action('init', 'geodir_upgrade_150', 11); |
|
35 | - } |
|
36 | - |
|
37 | - if (GEODIRECTORY_VERSION <= '1.5.2') { |
|
38 | - add_action('init', 'geodir_upgrade_152', 11); |
|
39 | - } |
|
40 | - |
|
41 | - if (GEODIRECTORY_VERSION <= '1.5.3') { |
|
42 | - add_action('init', 'geodir_upgrade_153', 11); |
|
43 | - } |
|
44 | - |
|
45 | - if (GEODIRECTORY_VERSION <= '1.5.4') { |
|
46 | - add_action('init', 'geodir_upgrade_154', 11); |
|
47 | - } |
|
13 | + /** |
|
14 | + * Include custom database table related functions. |
|
15 | + * |
|
16 | + * @since 1.0.0 |
|
17 | + * @package GeoDirectory |
|
18 | + */ |
|
19 | + include_once('geodirectory-admin/admin_db_install.php'); |
|
20 | + add_action('plugins_loaded', 'geodirectory_upgrade_all', 10); |
|
21 | + if (GEODIRECTORY_VERSION <= '1.3.6') { |
|
22 | + add_action('plugins_loaded', 'geodir_upgrade_136', 11); |
|
23 | + } |
|
24 | + |
|
25 | + if (GEODIRECTORY_VERSION <= '1.4.6') { |
|
26 | + add_action('init', 'geodir_upgrade_146', 11); |
|
27 | + } |
|
28 | + |
|
29 | + if (GEODIRECTORY_VERSION <= '1.4.8') { |
|
30 | + add_action('init', 'geodir_upgrade_148', 11); |
|
31 | + } |
|
32 | + |
|
33 | + if (GEODIRECTORY_VERSION <= '1.5.0') { |
|
34 | + add_action('init', 'geodir_upgrade_150', 11); |
|
35 | + } |
|
36 | + |
|
37 | + if (GEODIRECTORY_VERSION <= '1.5.2') { |
|
38 | + add_action('init', 'geodir_upgrade_152', 11); |
|
39 | + } |
|
40 | + |
|
41 | + if (GEODIRECTORY_VERSION <= '1.5.3') { |
|
42 | + add_action('init', 'geodir_upgrade_153', 11); |
|
43 | + } |
|
44 | + |
|
45 | + if (GEODIRECTORY_VERSION <= '1.5.4') { |
|
46 | + add_action('init', 'geodir_upgrade_154', 11); |
|
47 | + } |
|
48 | 48 | |
49 | - if (GEODIRECTORY_VERSION <= '1.6.18') { |
|
50 | - add_action('init', 'geodir_upgrade_1618', 11); |
|
51 | - } |
|
49 | + if (GEODIRECTORY_VERSION <= '1.6.18') { |
|
50 | + add_action('init', 'geodir_upgrade_1618', 11); |
|
51 | + } |
|
52 | 52 | |
53 | - if (GEODIRECTORY_VERSION <= '1.6.22') { |
|
54 | - add_action('init', 'geodir_upgrade_1622', 11); |
|
55 | - } |
|
53 | + if (GEODIRECTORY_VERSION <= '1.6.22') { |
|
54 | + add_action('init', 'geodir_upgrade_1622', 11); |
|
55 | + } |
|
56 | 56 | |
57 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
57 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
58 | 58 | |
59 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
59 | + update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | */ |
70 | 70 | function geodirectory_upgrade_all() |
71 | 71 | { |
72 | - geodir_create_tables(); |
|
73 | - geodir_update_review_db(); |
|
74 | - gd_install_theme_compat(); |
|
75 | - gd_convert_custom_field_display(); |
|
72 | + geodir_create_tables(); |
|
73 | + geodir_update_review_db(); |
|
74 | + gd_install_theme_compat(); |
|
75 | + gd_convert_custom_field_display(); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | function geodir_upgrade_136() |
85 | 85 | { |
86 | - geodir_fix_review_overall_rating(); |
|
86 | + geodir_fix_review_overall_rating(); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @package GeoDirectory |
94 | 94 | */ |
95 | 95 | function geodir_upgrade_146(){ |
96 | - gd_convert_virtual_pages(); |
|
96 | + gd_convert_virtual_pages(); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @package GeoDirectory |
104 | 104 | */ |
105 | 105 | function geodir_upgrade_150(){ |
106 | - gd_fix_cpt_rewrite_slug(); |
|
106 | + gd_fix_cpt_rewrite_slug(); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | * @package GeoDirectory |
116 | 116 | */ |
117 | 117 | function geodir_upgrade_148(){ |
118 | - /* |
|
118 | + /* |
|
119 | 119 | * Blank the users google password if present as we now use oAuth 2.0 |
120 | 120 | */ |
121 | - update_option('geodir_ga_pass',''); |
|
122 | - update_option('geodir_ga_user',''); |
|
121 | + update_option('geodir_ga_pass',''); |
|
122 | + update_option('geodir_ga_user',''); |
|
123 | 123 | |
124 | 124 | } |
125 | 125 | |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @package GeoDirectory |
132 | 132 | */ |
133 | 133 | function geodir_upgrade_153(){ |
134 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
135 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
134 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
135 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @package GeoDirectory |
143 | 143 | */ |
144 | 144 | function geodir_upgrade_154(){ |
145 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
145 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * @package GeoDirectory |
153 | 153 | */ |
154 | 154 | function geodir_upgrade_152(){ |
155 | - gd_fix_address_detail_table_limit(); |
|
155 | + gd_fix_address_detail_table_limit(); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | */ |
169 | 169 | function geodir_update_review_db() |
170 | 170 | { |
171 | - global $wpdb, $plugin_prefix; |
|
171 | + global $wpdb, $plugin_prefix; |
|
172 | 172 | |
173 | - geodir_fix_review_date(); |
|
174 | - geodir_fix_review_post_status(); |
|
175 | - geodir_fix_review_content(); |
|
176 | - geodir_fix_review_location(); |
|
173 | + geodir_fix_review_date(); |
|
174 | + geodir_fix_review_post_status(); |
|
175 | + geodir_fix_review_content(); |
|
176 | + geodir_fix_review_location(); |
|
177 | 177 | |
178 | 178 | } |
179 | 179 | |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | */ |
187 | 187 | function geodir_fix_review_date() |
188 | 188 | { |
189 | - global $wpdb; |
|
190 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
189 | + global $wpdb; |
|
190 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | */ |
200 | 200 | function geodir_fix_review_post_status() |
201 | 201 | { |
202 | - global $wpdb; |
|
203 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
202 | + global $wpdb; |
|
203 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -213,12 +213,12 @@ discard block |
||
213 | 213 | */ |
214 | 214 | function geodir_fix_review_content() |
215 | 215 | { |
216 | - global $wpdb; |
|
217 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
218 | - return true; |
|
219 | - } else { |
|
220 | - return false; |
|
221 | - } |
|
216 | + global $wpdb; |
|
217 | + if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
218 | + return true; |
|
219 | + } else { |
|
220 | + return false; |
|
221 | + } |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
@@ -231,20 +231,20 @@ discard block |
||
231 | 231 | */ |
232 | 232 | function geodir_fix_review_location() |
233 | 233 | { |
234 | - global $wpdb; |
|
234 | + global $wpdb; |
|
235 | 235 | |
236 | - $all_postypes = geodir_get_posttypes(); |
|
236 | + $all_postypes = geodir_get_posttypes(); |
|
237 | 237 | |
238 | - if (!empty($all_postypes)) { |
|
239 | - foreach ($all_postypes as $key) { |
|
240 | - // update each GD CTP |
|
238 | + if (!empty($all_postypes)) { |
|
239 | + foreach ($all_postypes as $key) { |
|
240 | + // update each GD CTP |
|
241 | 241 | |
242 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
242 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
243 | 243 | |
244 | - } |
|
245 | - return true; |
|
246 | - } |
|
247 | - return false; |
|
244 | + } |
|
245 | + return true; |
|
246 | + } |
|
247 | + return false; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -256,82 +256,82 @@ discard block |
||
256 | 256 | */ |
257 | 257 | function geodir_fix_review_overall_rating() |
258 | 258 | { |
259 | - global $wpdb; |
|
259 | + global $wpdb; |
|
260 | 260 | |
261 | - $all_postypes = geodir_get_posttypes(); |
|
261 | + $all_postypes = geodir_get_posttypes(); |
|
262 | 262 | |
263 | - if (!empty($all_postypes)) { |
|
264 | - foreach ($all_postypes as $key) { |
|
265 | - // update each GD CTP |
|
266 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
263 | + if (!empty($all_postypes)) { |
|
264 | + foreach ($all_postypes as $key) { |
|
265 | + // update each GD CTP |
|
266 | + $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
267 | 267 | |
268 | - if (!empty($reviews)) { |
|
269 | - foreach ($reviews as $post_id) { |
|
270 | - geodir_update_postrating($post_id->post_id, $key); |
|
271 | - } |
|
268 | + if (!empty($reviews)) { |
|
269 | + foreach ($reviews as $post_id) { |
|
270 | + geodir_update_postrating($post_id->post_id, $key); |
|
271 | + } |
|
272 | 272 | |
273 | - } |
|
273 | + } |
|
274 | 274 | |
275 | - } |
|
275 | + } |
|
276 | 276 | |
277 | - } |
|
277 | + } |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | |
281 | 281 | function gd_convert_custom_field_display(){ |
282 | - global $wpdb; |
|
282 | + global $wpdb; |
|
283 | 283 | |
284 | - $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE); |
|
284 | + $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE); |
|
285 | 285 | |
286 | - $has_run = get_option('gd_convert_custom_field_display'); |
|
287 | - if($has_run){return;} |
|
286 | + $has_run = get_option('gd_convert_custom_field_display'); |
|
287 | + if($has_run){return;} |
|
288 | 288 | |
289 | - // set the field_type_key for standard fields |
|
290 | - $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type"); |
|
289 | + // set the field_type_key for standard fields |
|
290 | + $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type"); |
|
291 | 291 | |
292 | 292 | |
293 | - if(is_array( $field_info)){ |
|
293 | + if(is_array( $field_info)){ |
|
294 | 294 | |
295 | - foreach( $field_info as $cf){ |
|
295 | + foreach( $field_info as $cf){ |
|
296 | 296 | |
297 | - $id = $cf->id; |
|
297 | + $id = $cf->id; |
|
298 | 298 | |
299 | - if(!property_exists($cf,'show_in') || !$id){return;} |
|
299 | + if(!property_exists($cf,'show_in') || !$id){return;} |
|
300 | 300 | |
301 | - $show_in_arr = array(); |
|
301 | + $show_in_arr = array(); |
|
302 | 302 | |
303 | - if($cf->is_default){ |
|
304 | - $show_in_arr[] = "[detail]"; |
|
305 | - } |
|
303 | + if($cf->is_default){ |
|
304 | + $show_in_arr[] = "[detail]"; |
|
305 | + } |
|
306 | 306 | |
307 | - if($cf->show_on_detail){ |
|
308 | - $show_in_arr[] = "[moreinfo]"; |
|
309 | - } |
|
307 | + if($cf->show_on_detail){ |
|
308 | + $show_in_arr[] = "[moreinfo]"; |
|
309 | + } |
|
310 | 310 | |
311 | - if($cf->show_on_listing){ |
|
312 | - $show_in_arr[] = "[listing]"; |
|
313 | - } |
|
311 | + if($cf->show_on_listing){ |
|
312 | + $show_in_arr[] = "[listing]"; |
|
313 | + } |
|
314 | 314 | |
315 | - if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){ |
|
316 | - $show_in_arr[] = "[owntab]"; |
|
317 | - } |
|
315 | + if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){ |
|
316 | + $show_in_arr[] = "[owntab]"; |
|
317 | + } |
|
318 | 318 | |
319 | - if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){ |
|
320 | - $show_in_arr[] = "[mapbubble]"; |
|
321 | - } |
|
319 | + if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){ |
|
320 | + $show_in_arr[] = "[mapbubble]"; |
|
321 | + } |
|
322 | 322 | |
323 | - if(!empty($show_in_arr )){ |
|
324 | - $show_in_arr = implode(',',$show_in_arr); |
|
325 | - }else{ |
|
326 | - $show_in_arr = ''; |
|
327 | - } |
|
323 | + if(!empty($show_in_arr )){ |
|
324 | + $show_in_arr = implode(',',$show_in_arr); |
|
325 | + }else{ |
|
326 | + $show_in_arr = ''; |
|
327 | + } |
|
328 | 328 | |
329 | - $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id"); |
|
329 | + $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id"); |
|
330 | 330 | |
331 | - } |
|
331 | + } |
|
332 | 332 | |
333 | - update_option('gd_convert_custom_field_display',1); |
|
334 | - } |
|
333 | + update_option('gd_convert_custom_field_display',1); |
|
334 | + } |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | ############################################ |
@@ -347,422 +347,422 @@ discard block |
||
347 | 347 | */ |
348 | 348 | function gd_install_theme_compat() |
349 | 349 | { |
350 | - global $wpdb; |
|
350 | + global $wpdb; |
|
351 | 351 | |
352 | - $theme_compat = array(); |
|
353 | - $theme_compat = get_option('gd_theme_compats'); |
|
352 | + $theme_compat = array(); |
|
353 | + $theme_compat = get_option('gd_theme_compats'); |
|
354 | 354 | //GDF |
355 | - $theme_compat['GeoDirectory_Framework'] = array( |
|
356 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
357 | - 'geodir_wrapper_open_class' => '', |
|
358 | - 'geodir_wrapper_open_replace' => '', |
|
359 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
360 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
361 | - 'geodir_wrapper_content_open_class' => '', |
|
362 | - 'geodir_wrapper_content_open_replace' => '', |
|
363 | - 'geodir_wrapper_content_close_replace' => '', |
|
364 | - 'geodir_article_open_id' => '', |
|
365 | - 'geodir_article_open_class' => '', |
|
366 | - 'geodir_article_open_replace' => '', |
|
367 | - 'geodir_article_close_replace' => '', |
|
368 | - 'geodir_sidebar_right_open_id' => '', |
|
369 | - 'geodir_sidebar_right_open_class' => '', |
|
370 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
371 | - 'geodir_sidebar_right_close_replace' => '', |
|
372 | - 'geodir_sidebar_left_open_id' => '', |
|
373 | - 'geodir_sidebar_left_open_class' => '', |
|
374 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
375 | - 'geodir_sidebar_left_close_replace' => '', |
|
376 | - 'geodir_main_content_open_id' => '', |
|
377 | - 'geodir_main_content_open_class' => '', |
|
378 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
379 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
380 | - 'geodir_top_content_add' => '', |
|
381 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
382 | - 'geodir_before_widget_filter' => '', |
|
383 | - 'geodir_after_widget_filter' => '', |
|
384 | - 'geodir_theme_compat_css' => '', |
|
385 | - 'geodir_theme_compat_js' => '', |
|
386 | - 'geodir_theme_compat_default_options' => '', |
|
387 | - 'geodir_theme_compat_code' => '' |
|
388 | - ); |
|
355 | + $theme_compat['GeoDirectory_Framework'] = array( |
|
356 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
357 | + 'geodir_wrapper_open_class' => '', |
|
358 | + 'geodir_wrapper_open_replace' => '', |
|
359 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
360 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
361 | + 'geodir_wrapper_content_open_class' => '', |
|
362 | + 'geodir_wrapper_content_open_replace' => '', |
|
363 | + 'geodir_wrapper_content_close_replace' => '', |
|
364 | + 'geodir_article_open_id' => '', |
|
365 | + 'geodir_article_open_class' => '', |
|
366 | + 'geodir_article_open_replace' => '', |
|
367 | + 'geodir_article_close_replace' => '', |
|
368 | + 'geodir_sidebar_right_open_id' => '', |
|
369 | + 'geodir_sidebar_right_open_class' => '', |
|
370 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
371 | + 'geodir_sidebar_right_close_replace' => '', |
|
372 | + 'geodir_sidebar_left_open_id' => '', |
|
373 | + 'geodir_sidebar_left_open_class' => '', |
|
374 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
375 | + 'geodir_sidebar_left_close_replace' => '', |
|
376 | + 'geodir_main_content_open_id' => '', |
|
377 | + 'geodir_main_content_open_class' => '', |
|
378 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
379 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
380 | + 'geodir_top_content_add' => '', |
|
381 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
382 | + 'geodir_before_widget_filter' => '', |
|
383 | + 'geodir_after_widget_filter' => '', |
|
384 | + 'geodir_theme_compat_css' => '', |
|
385 | + 'geodir_theme_compat_js' => '', |
|
386 | + 'geodir_theme_compat_default_options' => '', |
|
387 | + 'geodir_theme_compat_code' => '' |
|
388 | + ); |
|
389 | 389 | |
390 | 390 | //Directory Theme |
391 | - $theme_compat['Directory_Starter'] = array( |
|
392 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
393 | - 'geodir_wrapper_open_class' => '', |
|
394 | - 'geodir_wrapper_open_replace' => '', |
|
395 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
396 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
397 | - 'geodir_wrapper_content_open_class' => '', |
|
398 | - 'geodir_wrapper_content_open_replace' => '', |
|
399 | - 'geodir_wrapper_content_close_replace' => '', |
|
400 | - 'geodir_article_open_id' => '', |
|
401 | - 'geodir_article_open_class' => '', |
|
402 | - 'geodir_article_open_replace' => '', |
|
403 | - 'geodir_article_close_replace' => '', |
|
404 | - 'geodir_sidebar_right_open_id' => '', |
|
405 | - 'geodir_sidebar_right_open_class' => '', |
|
406 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
407 | - 'geodir_sidebar_right_close_replace' => '', |
|
408 | - 'geodir_sidebar_left_open_id' => '', |
|
409 | - 'geodir_sidebar_left_open_class' => '', |
|
410 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
411 | - 'geodir_sidebar_left_close_replace' => '', |
|
412 | - 'geodir_main_content_open_id' => '', |
|
413 | - 'geodir_main_content_open_class' => '', |
|
414 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
415 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
416 | - 'geodir_top_content_add' => '', |
|
417 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
418 | - 'geodir_before_widget_filter' => '', |
|
419 | - 'geodir_after_widget_filter' => '', |
|
420 | - 'geodir_theme_compat_css' => '', |
|
421 | - 'geodir_theme_compat_js' => '', |
|
422 | - 'geodir_theme_compat_default_options' => '', |
|
423 | - 'geodir_theme_compat_code' => '' |
|
424 | - ); |
|
391 | + $theme_compat['Directory_Starter'] = array( |
|
392 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
393 | + 'geodir_wrapper_open_class' => '', |
|
394 | + 'geodir_wrapper_open_replace' => '', |
|
395 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
396 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
397 | + 'geodir_wrapper_content_open_class' => '', |
|
398 | + 'geodir_wrapper_content_open_replace' => '', |
|
399 | + 'geodir_wrapper_content_close_replace' => '', |
|
400 | + 'geodir_article_open_id' => '', |
|
401 | + 'geodir_article_open_class' => '', |
|
402 | + 'geodir_article_open_replace' => '', |
|
403 | + 'geodir_article_close_replace' => '', |
|
404 | + 'geodir_sidebar_right_open_id' => '', |
|
405 | + 'geodir_sidebar_right_open_class' => '', |
|
406 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
407 | + 'geodir_sidebar_right_close_replace' => '', |
|
408 | + 'geodir_sidebar_left_open_id' => '', |
|
409 | + 'geodir_sidebar_left_open_class' => '', |
|
410 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
411 | + 'geodir_sidebar_left_close_replace' => '', |
|
412 | + 'geodir_main_content_open_id' => '', |
|
413 | + 'geodir_main_content_open_class' => '', |
|
414 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
415 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
416 | + 'geodir_top_content_add' => '', |
|
417 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
418 | + 'geodir_before_widget_filter' => '', |
|
419 | + 'geodir_after_widget_filter' => '', |
|
420 | + 'geodir_theme_compat_css' => '', |
|
421 | + 'geodir_theme_compat_js' => '', |
|
422 | + 'geodir_theme_compat_default_options' => '', |
|
423 | + 'geodir_theme_compat_code' => '' |
|
424 | + ); |
|
425 | 425 | |
426 | 426 | //Jobby |
427 | - $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
427 | + $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
428 | 428 | |
429 | 429 | //GeoProperty |
430 | - $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
430 | + $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
431 | 431 | |
432 | 432 | //Avada |
433 | - $theme_compat['Avada'] = array( |
|
434 | - 'geodir_wrapper_open_id' => '', |
|
435 | - 'geodir_wrapper_open_class' => '', |
|
436 | - 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
437 | - 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
438 | - 'geodir_wrapper_content_open_id' => 'content', |
|
439 | - 'geodir_wrapper_content_open_class' => '', |
|
440 | - 'geodir_wrapper_content_open_replace' => '', |
|
441 | - 'geodir_wrapper_content_close_replace' => '', |
|
442 | - 'geodir_article_open_id' => '', |
|
443 | - 'geodir_article_open_class' => '', |
|
444 | - 'geodir_article_open_replace' => '', |
|
445 | - 'geodir_article_close_replace' => '', |
|
446 | - 'geodir_sidebar_right_open_id' => '', |
|
447 | - 'geodir_sidebar_right_open_class' => '', |
|
448 | - 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
449 | - 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
450 | - 'geodir_sidebar_left_open_id' => '', |
|
451 | - 'geodir_sidebar_left_open_class' => '', |
|
452 | - 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
453 | - 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
454 | - 'geodir_main_content_open_id' => '', |
|
455 | - 'geodir_main_content_open_class' => '', |
|
456 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
457 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
458 | - 'geodir_top_content_add' => '', |
|
459 | - 'geodir_before_main_content_add' => '', |
|
460 | - 'geodir_before_widget_filter' => '', |
|
461 | - 'geodir_after_widget_filter' => '', |
|
462 | - 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'), |
|
463 | - 'geodir_theme_compat_js' => '', |
|
464 | - 'geodir_theme_compat_default_options' => '', |
|
465 | - 'geodir_theme_compat_code' => 'Avada' |
|
466 | - ); |
|
433 | + $theme_compat['Avada'] = array( |
|
434 | + 'geodir_wrapper_open_id' => '', |
|
435 | + 'geodir_wrapper_open_class' => '', |
|
436 | + 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
437 | + 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
438 | + 'geodir_wrapper_content_open_id' => 'content', |
|
439 | + 'geodir_wrapper_content_open_class' => '', |
|
440 | + 'geodir_wrapper_content_open_replace' => '', |
|
441 | + 'geodir_wrapper_content_close_replace' => '', |
|
442 | + 'geodir_article_open_id' => '', |
|
443 | + 'geodir_article_open_class' => '', |
|
444 | + 'geodir_article_open_replace' => '', |
|
445 | + 'geodir_article_close_replace' => '', |
|
446 | + 'geodir_sidebar_right_open_id' => '', |
|
447 | + 'geodir_sidebar_right_open_class' => '', |
|
448 | + 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
449 | + 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
450 | + 'geodir_sidebar_left_open_id' => '', |
|
451 | + 'geodir_sidebar_left_open_class' => '', |
|
452 | + 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
453 | + 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
454 | + 'geodir_main_content_open_id' => '', |
|
455 | + 'geodir_main_content_open_class' => '', |
|
456 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
457 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
458 | + 'geodir_top_content_add' => '', |
|
459 | + 'geodir_before_main_content_add' => '', |
|
460 | + 'geodir_before_widget_filter' => '', |
|
461 | + 'geodir_after_widget_filter' => '', |
|
462 | + 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'), |
|
463 | + 'geodir_theme_compat_js' => '', |
|
464 | + 'geodir_theme_compat_default_options' => '', |
|
465 | + 'geodir_theme_compat_code' => 'Avada' |
|
466 | + ); |
|
467 | 467 | |
468 | 468 | //Enfold |
469 | - $theme_compat['Enfold'] = array( |
|
470 | - 'geodir_wrapper_open_id' => '', |
|
471 | - 'geodir_wrapper_open_class' => '', |
|
472 | - 'geodir_wrapper_open_replace' => '', |
|
473 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
474 | - 'geodir_wrapper_content_open_id' => '', |
|
475 | - 'geodir_wrapper_content_open_class' => '', |
|
476 | - 'geodir_wrapper_content_open_replace' => '', |
|
477 | - 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
478 | - 'geodir_article_open_id' => '', |
|
479 | - 'geodir_article_open_class' => '', |
|
480 | - 'geodir_article_open_replace' => '', |
|
481 | - 'geodir_article_close_replace' => '', |
|
482 | - 'geodir_sidebar_right_open_id' => '', |
|
483 | - 'geodir_sidebar_right_open_class' => '', |
|
484 | - 'geodir_sidebar_right_open_replace' => '', |
|
485 | - 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
486 | - 'geodir_sidebar_left_open_id' => '', |
|
487 | - 'geodir_sidebar_left_open_class' => '', |
|
488 | - 'geodir_sidebar_left_open_replace' => '', |
|
489 | - 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
490 | - 'geodir_main_content_open_id' => '', |
|
491 | - 'geodir_main_content_open_class' => '', |
|
492 | - 'geodir_main_content_open_replace' => '', |
|
493 | - 'geodir_main_content_close_replace' => '', |
|
494 | - 'geodir_top_content_add' => '', |
|
495 | - 'geodir_before_main_content_add' => '', |
|
496 | - 'geodir_before_widget_filter' => '', |
|
497 | - 'geodir_after_widget_filter' => '', |
|
498 | - 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'), |
|
499 | - 'geodir_theme_compat_js' => '', |
|
500 | - 'geodir_theme_compat_default_options' => '', |
|
501 | - 'geodir_theme_compat_code' => 'Enfold' |
|
502 | - ); |
|
469 | + $theme_compat['Enfold'] = array( |
|
470 | + 'geodir_wrapper_open_id' => '', |
|
471 | + 'geodir_wrapper_open_class' => '', |
|
472 | + 'geodir_wrapper_open_replace' => '', |
|
473 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
474 | + 'geodir_wrapper_content_open_id' => '', |
|
475 | + 'geodir_wrapper_content_open_class' => '', |
|
476 | + 'geodir_wrapper_content_open_replace' => '', |
|
477 | + 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
478 | + 'geodir_article_open_id' => '', |
|
479 | + 'geodir_article_open_class' => '', |
|
480 | + 'geodir_article_open_replace' => '', |
|
481 | + 'geodir_article_close_replace' => '', |
|
482 | + 'geodir_sidebar_right_open_id' => '', |
|
483 | + 'geodir_sidebar_right_open_class' => '', |
|
484 | + 'geodir_sidebar_right_open_replace' => '', |
|
485 | + 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
486 | + 'geodir_sidebar_left_open_id' => '', |
|
487 | + 'geodir_sidebar_left_open_class' => '', |
|
488 | + 'geodir_sidebar_left_open_replace' => '', |
|
489 | + 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
490 | + 'geodir_main_content_open_id' => '', |
|
491 | + 'geodir_main_content_open_class' => '', |
|
492 | + 'geodir_main_content_open_replace' => '', |
|
493 | + 'geodir_main_content_close_replace' => '', |
|
494 | + 'geodir_top_content_add' => '', |
|
495 | + 'geodir_before_main_content_add' => '', |
|
496 | + 'geodir_before_widget_filter' => '', |
|
497 | + 'geodir_after_widget_filter' => '', |
|
498 | + 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'), |
|
499 | + 'geodir_theme_compat_js' => '', |
|
500 | + 'geodir_theme_compat_default_options' => '', |
|
501 | + 'geodir_theme_compat_code' => 'Enfold' |
|
502 | + ); |
|
503 | 503 | |
504 | 504 | // X |
505 | - $theme_compat['X'] = array( |
|
506 | - 'geodir_wrapper_open_id' => '', |
|
507 | - 'geodir_wrapper_open_class' => '', |
|
508 | - 'geodir_wrapper_open_replace' => '', |
|
509 | - 'geodir_wrapper_close_replace' => '', |
|
510 | - 'geodir_wrapper_content_open_id' => '', |
|
511 | - 'geodir_wrapper_content_open_class' => '', |
|
512 | - 'geodir_wrapper_content_open_replace' => '', |
|
513 | - 'geodir_wrapper_content_close_replace' => '', |
|
514 | - 'geodir_article_open_id' => '', |
|
515 | - 'geodir_article_open_class' => '', |
|
516 | - 'geodir_article_open_replace' => '', |
|
517 | - 'geodir_article_close_replace' => '', |
|
518 | - 'geodir_sidebar_right_open_id' => '', |
|
519 | - 'geodir_sidebar_right_open_class' => '', |
|
520 | - 'geodir_sidebar_right_open_replace' => '', |
|
521 | - 'geodir_sidebar_right_close_replace' => '', |
|
522 | - 'geodir_sidebar_left_open_id' => '', |
|
523 | - 'geodir_sidebar_left_open_class' => '', |
|
524 | - 'geodir_sidebar_left_open_replace' => '', |
|
525 | - 'geodir_sidebar_left_close_replace' => '', |
|
526 | - 'geodir_main_content_open_id' => '', |
|
527 | - 'geodir_main_content_open_class' => '', |
|
528 | - 'geodir_main_content_open_replace' => '', |
|
529 | - 'geodir_main_content_close_replace' => '', |
|
530 | - 'geodir_top_content_add' => '', |
|
531 | - 'geodir_before_main_content_add' => '', |
|
532 | - 'geodir_before_widget_filter' => '', |
|
533 | - 'geodir_after_widget_filter' => '', |
|
534 | - 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
535 | - 'geodir_theme_compat_js' => '', |
|
536 | - 'geodir_theme_compat_default_options' => '', |
|
537 | - 'geodir_theme_compat_code' => 'X' |
|
538 | - ); |
|
505 | + $theme_compat['X'] = array( |
|
506 | + 'geodir_wrapper_open_id' => '', |
|
507 | + 'geodir_wrapper_open_class' => '', |
|
508 | + 'geodir_wrapper_open_replace' => '', |
|
509 | + 'geodir_wrapper_close_replace' => '', |
|
510 | + 'geodir_wrapper_content_open_id' => '', |
|
511 | + 'geodir_wrapper_content_open_class' => '', |
|
512 | + 'geodir_wrapper_content_open_replace' => '', |
|
513 | + 'geodir_wrapper_content_close_replace' => '', |
|
514 | + 'geodir_article_open_id' => '', |
|
515 | + 'geodir_article_open_class' => '', |
|
516 | + 'geodir_article_open_replace' => '', |
|
517 | + 'geodir_article_close_replace' => '', |
|
518 | + 'geodir_sidebar_right_open_id' => '', |
|
519 | + 'geodir_sidebar_right_open_class' => '', |
|
520 | + 'geodir_sidebar_right_open_replace' => '', |
|
521 | + 'geodir_sidebar_right_close_replace' => '', |
|
522 | + 'geodir_sidebar_left_open_id' => '', |
|
523 | + 'geodir_sidebar_left_open_class' => '', |
|
524 | + 'geodir_sidebar_left_open_replace' => '', |
|
525 | + 'geodir_sidebar_left_close_replace' => '', |
|
526 | + 'geodir_main_content_open_id' => '', |
|
527 | + 'geodir_main_content_open_class' => '', |
|
528 | + 'geodir_main_content_open_replace' => '', |
|
529 | + 'geodir_main_content_close_replace' => '', |
|
530 | + 'geodir_top_content_add' => '', |
|
531 | + 'geodir_before_main_content_add' => '', |
|
532 | + 'geodir_before_widget_filter' => '', |
|
533 | + 'geodir_after_widget_filter' => '', |
|
534 | + 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
535 | + 'geodir_theme_compat_js' => '', |
|
536 | + 'geodir_theme_compat_default_options' => '', |
|
537 | + 'geodir_theme_compat_code' => 'X' |
|
538 | + ); |
|
539 | 539 | |
540 | 540 | // Divi |
541 | - $theme_compat['Divi'] = array( |
|
542 | - 'geodir_wrapper_open_id' => 'main-content', |
|
543 | - 'geodir_wrapper_open_class' => '', |
|
544 | - 'geodir_wrapper_open_replace' => '', |
|
545 | - 'geodir_wrapper_close_replace' => '', |
|
546 | - 'geodir_wrapper_content_open_id' => 'left-area', |
|
547 | - 'geodir_wrapper_content_open_class' => '', |
|
548 | - 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
549 | - 'geodir_wrapper_content_close_replace' => '', |
|
550 | - 'geodir_article_open_id' => '', |
|
551 | - 'geodir_article_open_class' => '', |
|
552 | - 'geodir_article_open_replace' => '', |
|
553 | - 'geodir_article_close_replace' => '', |
|
554 | - 'geodir_sidebar_right_open_id' => 'sidebar', |
|
555 | - 'geodir_sidebar_right_open_class' => '', |
|
556 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
557 | - 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
558 | - 'geodir_sidebar_left_open_id' => 'sidebar', |
|
559 | - 'geodir_sidebar_left_open_class' => '', |
|
560 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
561 | - 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
562 | - 'geodir_main_content_open_id' => '', |
|
563 | - 'geodir_main_content_open_class' => '', |
|
564 | - 'geodir_main_content_open_replace' => '', |
|
565 | - 'geodir_main_content_close_replace' => '', |
|
566 | - 'geodir_top_content_add' => '', |
|
567 | - 'geodir_before_main_content_add' => '', |
|
568 | - 'geodir_before_widget_filter' => '', |
|
569 | - 'geodir_after_widget_filter' => '', |
|
570 | - 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{padding:0 15px;width:100%}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type=button],.geodir_full_page .geodir-search input[type=submit],.geodir_full_page .geodir-search input[type=text],.geodir_full_page .geodir-search select{display:inline-block;float:none}'), |
|
571 | - 'geodir_theme_compat_js' => '', |
|
572 | - 'geodir_theme_compat_default_options' => '', |
|
573 | - 'geodir_theme_compat_code' => 'Divi' |
|
574 | - ); |
|
541 | + $theme_compat['Divi'] = array( |
|
542 | + 'geodir_wrapper_open_id' => 'main-content', |
|
543 | + 'geodir_wrapper_open_class' => '', |
|
544 | + 'geodir_wrapper_open_replace' => '', |
|
545 | + 'geodir_wrapper_close_replace' => '', |
|
546 | + 'geodir_wrapper_content_open_id' => 'left-area', |
|
547 | + 'geodir_wrapper_content_open_class' => '', |
|
548 | + 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
549 | + 'geodir_wrapper_content_close_replace' => '', |
|
550 | + 'geodir_article_open_id' => '', |
|
551 | + 'geodir_article_open_class' => '', |
|
552 | + 'geodir_article_open_replace' => '', |
|
553 | + 'geodir_article_close_replace' => '', |
|
554 | + 'geodir_sidebar_right_open_id' => 'sidebar', |
|
555 | + 'geodir_sidebar_right_open_class' => '', |
|
556 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
557 | + 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
558 | + 'geodir_sidebar_left_open_id' => 'sidebar', |
|
559 | + 'geodir_sidebar_left_open_class' => '', |
|
560 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
561 | + 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
562 | + 'geodir_main_content_open_id' => '', |
|
563 | + 'geodir_main_content_open_class' => '', |
|
564 | + 'geodir_main_content_open_replace' => '', |
|
565 | + 'geodir_main_content_close_replace' => '', |
|
566 | + 'geodir_top_content_add' => '', |
|
567 | + 'geodir_before_main_content_add' => '', |
|
568 | + 'geodir_before_widget_filter' => '', |
|
569 | + 'geodir_after_widget_filter' => '', |
|
570 | + 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{padding:0 15px;width:100%}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type=button],.geodir_full_page .geodir-search input[type=submit],.geodir_full_page .geodir-search input[type=text],.geodir_full_page .geodir-search select{display:inline-block;float:none}'), |
|
571 | + 'geodir_theme_compat_js' => '', |
|
572 | + 'geodir_theme_compat_default_options' => '', |
|
573 | + 'geodir_theme_compat_code' => 'Divi' |
|
574 | + ); |
|
575 | 575 | |
576 | 576 | // Genesis |
577 | - $theme_compat['Genesis'] = array( |
|
578 | - 'geodir_wrapper_open_id' => '', |
|
579 | - 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
580 | - 'geodir_wrapper_open_replace' => '', |
|
581 | - 'geodir_wrapper_close_replace' => '', |
|
582 | - 'geodir_wrapper_content_open_id' => '', |
|
583 | - 'geodir_wrapper_content_open_class' => 'content', |
|
584 | - 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
585 | - 'geodir_wrapper_content_close_replace' => '', |
|
586 | - 'geodir_article_open_id' => '', |
|
587 | - 'geodir_article_open_class' => '', |
|
588 | - 'geodir_article_open_replace' => '', |
|
589 | - 'geodir_article_close_replace' => '', |
|
590 | - 'geodir_sidebar_right_open_id' => '', |
|
591 | - 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
592 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
593 | - 'geodir_sidebar_right_close_replace' => '', |
|
594 | - 'geodir_sidebar_left_open_id' => '', |
|
595 | - 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
596 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
597 | - 'geodir_sidebar_left_close_replace' => '', |
|
598 | - 'geodir_main_content_open_id' => '', |
|
599 | - 'geodir_main_content_open_class' => '', |
|
600 | - 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
601 | - 'geodir_main_content_close_replace' => '', |
|
602 | - 'geodir_top_content_add' => '', |
|
603 | - 'geodir_before_main_content_add' => '', |
|
604 | - 'geodir_before_widget_filter' => '', |
|
605 | - 'geodir_after_widget_filter' => '', |
|
606 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
607 | - 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'), |
|
608 | - 'geodir_theme_compat_js' => '', |
|
609 | - 'geodir_theme_compat_default_options' => '', |
|
610 | - 'geodir_theme_compat_code' => 'Genesis' |
|
611 | - ); |
|
577 | + $theme_compat['Genesis'] = array( |
|
578 | + 'geodir_wrapper_open_id' => '', |
|
579 | + 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
580 | + 'geodir_wrapper_open_replace' => '', |
|
581 | + 'geodir_wrapper_close_replace' => '', |
|
582 | + 'geodir_wrapper_content_open_id' => '', |
|
583 | + 'geodir_wrapper_content_open_class' => 'content', |
|
584 | + 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
585 | + 'geodir_wrapper_content_close_replace' => '', |
|
586 | + 'geodir_article_open_id' => '', |
|
587 | + 'geodir_article_open_class' => '', |
|
588 | + 'geodir_article_open_replace' => '', |
|
589 | + 'geodir_article_close_replace' => '', |
|
590 | + 'geodir_sidebar_right_open_id' => '', |
|
591 | + 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
592 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
593 | + 'geodir_sidebar_right_close_replace' => '', |
|
594 | + 'geodir_sidebar_left_open_id' => '', |
|
595 | + 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
596 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
597 | + 'geodir_sidebar_left_close_replace' => '', |
|
598 | + 'geodir_main_content_open_id' => '', |
|
599 | + 'geodir_main_content_open_class' => '', |
|
600 | + 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
601 | + 'geodir_main_content_close_replace' => '', |
|
602 | + 'geodir_top_content_add' => '', |
|
603 | + 'geodir_before_main_content_add' => '', |
|
604 | + 'geodir_before_widget_filter' => '', |
|
605 | + 'geodir_after_widget_filter' => '', |
|
606 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
607 | + 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'), |
|
608 | + 'geodir_theme_compat_js' => '', |
|
609 | + 'geodir_theme_compat_default_options' => '', |
|
610 | + 'geodir_theme_compat_code' => 'Genesis' |
|
611 | + ); |
|
612 | 612 | |
613 | 613 | // Jupiter |
614 | - $theme_compat['Jupiter'] = array( |
|
615 | - 'geodir_wrapper_open_id' => '', |
|
616 | - 'geodir_wrapper_open_class' => '', |
|
617 | - 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
618 | - 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
619 | - 'geodir_wrapper_content_open_id' => '', |
|
620 | - 'geodir_wrapper_content_open_class' => '', |
|
621 | - 'geodir_wrapper_content_open_replace' => '', |
|
622 | - 'geodir_wrapper_content_close_replace' => '', |
|
623 | - 'geodir_article_open_id' => '', |
|
624 | - 'geodir_article_open_class' => '', |
|
625 | - 'geodir_article_open_replace' => '', |
|
626 | - 'geodir_article_close_replace' => '', |
|
627 | - 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
628 | - 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
629 | - 'geodir_sidebar_right_open_replace' => '', |
|
630 | - 'geodir_sidebar_right_close_replace' => '', |
|
631 | - 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
632 | - 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
633 | - 'geodir_sidebar_left_open_replace' => '', |
|
634 | - 'geodir_sidebar_left_close_replace' => '', |
|
635 | - 'geodir_main_content_open_id' => '', |
|
636 | - 'geodir_main_content_open_class' => '', |
|
637 | - 'geodir_main_content_open_replace' => '', |
|
638 | - 'geodir_main_content_close_replace' => '', |
|
639 | - 'geodir_top_content_add' => '', |
|
640 | - 'geodir_before_main_content_add' => '', |
|
641 | - 'geodir_before_widget_filter' => '', |
|
642 | - 'geodir_after_widget_filter' => '', |
|
643 | - 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
644 | - 'geodir_after_title_filter' => '', |
|
645 | - 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
646 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
647 | - 'geodir_sub_menu_li_class_filter' => '', |
|
648 | - 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
649 | - 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
650 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
651 | - 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
652 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
653 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
654 | - 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
655 | - 'geodir_theme_compat_js' => '', |
|
656 | - 'geodir_theme_compat_default_options' => '', |
|
657 | - 'geodir_theme_compat_code' => 'Jupiter' |
|
658 | - ); |
|
614 | + $theme_compat['Jupiter'] = array( |
|
615 | + 'geodir_wrapper_open_id' => '', |
|
616 | + 'geodir_wrapper_open_class' => '', |
|
617 | + 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
618 | + 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
619 | + 'geodir_wrapper_content_open_id' => '', |
|
620 | + 'geodir_wrapper_content_open_class' => '', |
|
621 | + 'geodir_wrapper_content_open_replace' => '', |
|
622 | + 'geodir_wrapper_content_close_replace' => '', |
|
623 | + 'geodir_article_open_id' => '', |
|
624 | + 'geodir_article_open_class' => '', |
|
625 | + 'geodir_article_open_replace' => '', |
|
626 | + 'geodir_article_close_replace' => '', |
|
627 | + 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
628 | + 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
629 | + 'geodir_sidebar_right_open_replace' => '', |
|
630 | + 'geodir_sidebar_right_close_replace' => '', |
|
631 | + 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
632 | + 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
633 | + 'geodir_sidebar_left_open_replace' => '', |
|
634 | + 'geodir_sidebar_left_close_replace' => '', |
|
635 | + 'geodir_main_content_open_id' => '', |
|
636 | + 'geodir_main_content_open_class' => '', |
|
637 | + 'geodir_main_content_open_replace' => '', |
|
638 | + 'geodir_main_content_close_replace' => '', |
|
639 | + 'geodir_top_content_add' => '', |
|
640 | + 'geodir_before_main_content_add' => '', |
|
641 | + 'geodir_before_widget_filter' => '', |
|
642 | + 'geodir_after_widget_filter' => '', |
|
643 | + 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
644 | + 'geodir_after_title_filter' => '', |
|
645 | + 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
646 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
647 | + 'geodir_sub_menu_li_class_filter' => '', |
|
648 | + 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
649 | + 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
650 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
651 | + 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
652 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
653 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
654 | + 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
655 | + 'geodir_theme_compat_js' => '', |
|
656 | + 'geodir_theme_compat_default_options' => '', |
|
657 | + 'geodir_theme_compat_code' => 'Jupiter' |
|
658 | + ); |
|
659 | 659 | |
660 | 660 | // Multi News |
661 | - $theme_compat['Multi_News'] = array( |
|
662 | - 'geodir_wrapper_open_id' => '', |
|
663 | - 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
664 | - 'geodir_wrapper_open_replace' => '', |
|
665 | - 'geodir_wrapper_close_replace' => '', |
|
666 | - 'geodir_wrapper_content_open_id' => '', |
|
667 | - 'geodir_wrapper_content_open_class' => '', |
|
668 | - 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
669 | - 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
670 | - 'geodir_article_open_id' => '', |
|
671 | - 'geodir_article_open_class' => '', |
|
672 | - 'geodir_article_open_replace' => '', |
|
673 | - 'geodir_article_close_replace' => '', |
|
674 | - 'geodir_sidebar_right_open_id' => '', |
|
675 | - 'geodir_sidebar_right_open_class' => '', |
|
676 | - 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
677 | - 'geodir_sidebar_right_close_replace' => '', |
|
678 | - 'geodir_sidebar_left_open_id' => '', |
|
679 | - 'geodir_sidebar_left_open_class' => '', |
|
680 | - 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
681 | - 'geodir_sidebar_left_close_replace' => '', |
|
682 | - 'geodir_main_content_open_id' => '', |
|
683 | - 'geodir_main_content_open_class' => '', |
|
684 | - 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
685 | - 'geodir_main_content_close_replace' => '</div>', |
|
686 | - 'geodir_top_content_add' => '', |
|
687 | - 'geodir_before_main_content_add' => '', |
|
688 | - 'geodir_full_page_class_filter' => 'section full-width-section', |
|
689 | - 'geodir_before_widget_filter' => '', |
|
690 | - 'geodir_after_widget_filter' => '', |
|
691 | - 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
692 | - 'geodir_after_title_filter' => '</h2></div>', |
|
693 | - 'geodir_menu_li_class_filter' => '', |
|
694 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
695 | - 'geodir_sub_menu_li_class_filter' => '', |
|
696 | - 'geodir_menu_a_class_filter' => '', |
|
697 | - 'geodir_sub_menu_a_class_filter' => '', |
|
698 | - 'geodir_location_switcher_menu_li_class_filter' => '', |
|
699 | - 'geodir_location_switcher_menu_a_class_filter' => '', |
|
700 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
701 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
702 | - 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
703 | - 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
704 | - 'geodir_theme_compat_default_options' => '', |
|
705 | - 'geodir_theme_compat_code' => 'Multi_News' |
|
706 | - ); |
|
707 | - |
|
708 | - // Kelo |
|
709 | - $theme_compat['Kleo'] = array( |
|
710 | - 'geodir_theme_compat_code' => 'Kleo' |
|
711 | - ); |
|
712 | - |
|
713 | - |
|
714 | - // Twenty Seventeen |
|
715 | - $theme_compat['Twenty_Seventeen'] = array( |
|
716 | - 'geodir_wrapper_open_replace' => '<div class="wrap">', |
|
717 | - 'geodir_wrapper_content_open_replace' => '<div id="primary" class="content-area" >', |
|
718 | - 'geodir_sidebar_right_open_replace' => '<aside id="secondary" class="widget-area" itemscope itemtype="[itemtype]" >', |
|
719 | - 'geodir_sidebar_left_open_replace' => '<aside id="secondary" class="widget-area" itemscope itemtype="[itemtype]" >', |
|
720 | - 'geodir_theme_compat_css' => stripslashes('body.geodir-page #primary header.entry-header {margin-left:0;float:none !important;} .gxeodir_flex-container{float:left;} .geodir-tabs-content.entry-content{width:100% !important;} dl.geodir-tab-head, .geodir_map_container {z-index:2;} .geodir-cat-list ul.geodir-popular-cat-list li + li { margin-top: 0;} .geodir-cat-list .geodir-popular-cat-list a img, .entry-content .gm-style a img, .widget .gm-style a img { box-sizing: none; -webkit-box-shadow: none; -moz-box-shadow: none;}'), |
|
721 | - 'geodir_theme_compat_code' => 'Twenty_Seventeen' |
|
722 | - ); |
|
723 | - |
|
724 | - // buddyBoss |
|
725 | - $theme_compat['Boss.'] = array( |
|
726 | - 'geodir_wrapper_open_replace' => '<div class="page-right-sidebar">', |
|
727 | - 'geodir_wrapper_content_open_replace' => '<div id="primary" class="site-content">', |
|
728 | - 'geodir_article_open_replace' => '<div id="[id]" class="[class]" itemscope itemtype="[itemtype]">', |
|
729 | - 'geodir_article_close_replace' => '</div>', |
|
730 | - 'geodir_sidebar_right_open_replace' => '<div id="secondary" class="widget-area" >', |
|
731 | - 'geodir_sidebar_right_close_replace' => '</div>', |
|
732 | - 'geodir_sidebar_left_open_replace' => '<div id="secondary" class="widget-area" >', |
|
733 | - 'geodir_sidebar_left_close_replace' => '</div>', |
|
734 | - 'geodir_theme_compat_css' => stripslashes('.geodir-breadcrumb{padding-top:20px;border-bottom:1px solid #ddd;padding-bottom:0} article.geodir-category-listing{padding: 0 !important;}'), |
|
735 | - 'geodir_theme_compat_code' => 'BuddyBoss' |
|
736 | - |
|
737 | - |
|
738 | - ); |
|
739 | - |
|
740 | - // Flatsome |
|
741 | - $theme_compat['Flatsome'] = array( |
|
742 | - 'geodir_wrapper_open_replace' => '<div class="page-wrapper page-right-sidebar"><div class="row">', |
|
743 | - 'geodir_wrapper_close_replace' => '</div></div>', |
|
744 | - 'geodir_wrapper_content_open_replace' => '<div id="content" class="large-9 left col col-divided" role="main"><div class="page-inner">', |
|
745 | - 'geodir_wrapper_content_close_replace' => '</div></div>', |
|
746 | - 'geodir_sidebar_right_open_replace' => '<div class="large-3 col"><div id="secondary" class="widget-area " role="complementary">', |
|
747 | - 'geodir_sidebar_right_close_replace' => '</div></div>', |
|
748 | - 'geodir_sidebar_left_open_replace' => '<div class="large-3 col"><div id="secondary" class="widget-area " role="complementary">', |
|
749 | - 'geodir_sidebar_left_close_replace' => '</div></div>', |
|
750 | - 'geodir_menu_li_class_filter' => 'menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children has-dropdown', |
|
751 | - 'geodir_sub_menu_ul_class_filter' => 'nav-dropdown nav-dropdown-default gd-nav-dropdown', |
|
752 | - 'geodir_sub_menu_li_class_filter' => 'menu-item menu-item-type-custom menu-item-object-custom', |
|
753 | - 'geodir_menu_a_class_filter' => 'nav-top-link gd-nav-top-link', |
|
754 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher has-dropdown', |
|
755 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => 'nav-dropdown nav-dropdown-default', |
|
756 | - 'geodir_theme_compat_css' => stripslashes('dl.geodir_location_tabs_head dt{margin:0;}.header{z-index:90;}'), |
|
757 | - 'geodir_theme_compat_js' => stripslashes('jQuery(function(){jQuery("#masthead .gd-nav-top-link").append(\'<i class="icon-angle-down"></i>\'),jQuery("#menu-item-gd-location-switcher > a").append(\'<i class="icon-angle-down"></i>\'),jQuery(".mobile-sidebar .gd-nav-dropdown").addClass("children"),jQuery(".mobile-sidebar .gd-nav-dropdown").removeClass("nav-dropdown nav-dropdown-default"),jQuery(".mobile-sidebar #menu-item-gd-location-switcher ul").removeClass("nav-dropdown nav-dropdown-default"),setTimeout(function(){},5e3)});'), |
|
758 | - |
|
759 | - |
|
760 | - ); |
|
761 | - |
|
762 | - |
|
763 | - update_option('gd_theme_compats', $theme_compat); |
|
764 | - |
|
765 | - gd_set_theme_compat();// set the compat pack if avail |
|
661 | + $theme_compat['Multi_News'] = array( |
|
662 | + 'geodir_wrapper_open_id' => '', |
|
663 | + 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
664 | + 'geodir_wrapper_open_replace' => '', |
|
665 | + 'geodir_wrapper_close_replace' => '', |
|
666 | + 'geodir_wrapper_content_open_id' => '', |
|
667 | + 'geodir_wrapper_content_open_class' => '', |
|
668 | + 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
669 | + 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
670 | + 'geodir_article_open_id' => '', |
|
671 | + 'geodir_article_open_class' => '', |
|
672 | + 'geodir_article_open_replace' => '', |
|
673 | + 'geodir_article_close_replace' => '', |
|
674 | + 'geodir_sidebar_right_open_id' => '', |
|
675 | + 'geodir_sidebar_right_open_class' => '', |
|
676 | + 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
677 | + 'geodir_sidebar_right_close_replace' => '', |
|
678 | + 'geodir_sidebar_left_open_id' => '', |
|
679 | + 'geodir_sidebar_left_open_class' => '', |
|
680 | + 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
681 | + 'geodir_sidebar_left_close_replace' => '', |
|
682 | + 'geodir_main_content_open_id' => '', |
|
683 | + 'geodir_main_content_open_class' => '', |
|
684 | + 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
685 | + 'geodir_main_content_close_replace' => '</div>', |
|
686 | + 'geodir_top_content_add' => '', |
|
687 | + 'geodir_before_main_content_add' => '', |
|
688 | + 'geodir_full_page_class_filter' => 'section full-width-section', |
|
689 | + 'geodir_before_widget_filter' => '', |
|
690 | + 'geodir_after_widget_filter' => '', |
|
691 | + 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
692 | + 'geodir_after_title_filter' => '</h2></div>', |
|
693 | + 'geodir_menu_li_class_filter' => '', |
|
694 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
695 | + 'geodir_sub_menu_li_class_filter' => '', |
|
696 | + 'geodir_menu_a_class_filter' => '', |
|
697 | + 'geodir_sub_menu_a_class_filter' => '', |
|
698 | + 'geodir_location_switcher_menu_li_class_filter' => '', |
|
699 | + 'geodir_location_switcher_menu_a_class_filter' => '', |
|
700 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
701 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
702 | + 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
703 | + 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
704 | + 'geodir_theme_compat_default_options' => '', |
|
705 | + 'geodir_theme_compat_code' => 'Multi_News' |
|
706 | + ); |
|
707 | + |
|
708 | + // Kelo |
|
709 | + $theme_compat['Kleo'] = array( |
|
710 | + 'geodir_theme_compat_code' => 'Kleo' |
|
711 | + ); |
|
712 | + |
|
713 | + |
|
714 | + // Twenty Seventeen |
|
715 | + $theme_compat['Twenty_Seventeen'] = array( |
|
716 | + 'geodir_wrapper_open_replace' => '<div class="wrap">', |
|
717 | + 'geodir_wrapper_content_open_replace' => '<div id="primary" class="content-area" >', |
|
718 | + 'geodir_sidebar_right_open_replace' => '<aside id="secondary" class="widget-area" itemscope itemtype="[itemtype]" >', |
|
719 | + 'geodir_sidebar_left_open_replace' => '<aside id="secondary" class="widget-area" itemscope itemtype="[itemtype]" >', |
|
720 | + 'geodir_theme_compat_css' => stripslashes('body.geodir-page #primary header.entry-header {margin-left:0;float:none !important;} .gxeodir_flex-container{float:left;} .geodir-tabs-content.entry-content{width:100% !important;} dl.geodir-tab-head, .geodir_map_container {z-index:2;} .geodir-cat-list ul.geodir-popular-cat-list li + li { margin-top: 0;} .geodir-cat-list .geodir-popular-cat-list a img, .entry-content .gm-style a img, .widget .gm-style a img { box-sizing: none; -webkit-box-shadow: none; -moz-box-shadow: none;}'), |
|
721 | + 'geodir_theme_compat_code' => 'Twenty_Seventeen' |
|
722 | + ); |
|
723 | + |
|
724 | + // buddyBoss |
|
725 | + $theme_compat['Boss.'] = array( |
|
726 | + 'geodir_wrapper_open_replace' => '<div class="page-right-sidebar">', |
|
727 | + 'geodir_wrapper_content_open_replace' => '<div id="primary" class="site-content">', |
|
728 | + 'geodir_article_open_replace' => '<div id="[id]" class="[class]" itemscope itemtype="[itemtype]">', |
|
729 | + 'geodir_article_close_replace' => '</div>', |
|
730 | + 'geodir_sidebar_right_open_replace' => '<div id="secondary" class="widget-area" >', |
|
731 | + 'geodir_sidebar_right_close_replace' => '</div>', |
|
732 | + 'geodir_sidebar_left_open_replace' => '<div id="secondary" class="widget-area" >', |
|
733 | + 'geodir_sidebar_left_close_replace' => '</div>', |
|
734 | + 'geodir_theme_compat_css' => stripslashes('.geodir-breadcrumb{padding-top:20px;border-bottom:1px solid #ddd;padding-bottom:0} article.geodir-category-listing{padding: 0 !important;}'), |
|
735 | + 'geodir_theme_compat_code' => 'BuddyBoss' |
|
736 | + |
|
737 | + |
|
738 | + ); |
|
739 | + |
|
740 | + // Flatsome |
|
741 | + $theme_compat['Flatsome'] = array( |
|
742 | + 'geodir_wrapper_open_replace' => '<div class="page-wrapper page-right-sidebar"><div class="row">', |
|
743 | + 'geodir_wrapper_close_replace' => '</div></div>', |
|
744 | + 'geodir_wrapper_content_open_replace' => '<div id="content" class="large-9 left col col-divided" role="main"><div class="page-inner">', |
|
745 | + 'geodir_wrapper_content_close_replace' => '</div></div>', |
|
746 | + 'geodir_sidebar_right_open_replace' => '<div class="large-3 col"><div id="secondary" class="widget-area " role="complementary">', |
|
747 | + 'geodir_sidebar_right_close_replace' => '</div></div>', |
|
748 | + 'geodir_sidebar_left_open_replace' => '<div class="large-3 col"><div id="secondary" class="widget-area " role="complementary">', |
|
749 | + 'geodir_sidebar_left_close_replace' => '</div></div>', |
|
750 | + 'geodir_menu_li_class_filter' => 'menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children has-dropdown', |
|
751 | + 'geodir_sub_menu_ul_class_filter' => 'nav-dropdown nav-dropdown-default gd-nav-dropdown', |
|
752 | + 'geodir_sub_menu_li_class_filter' => 'menu-item menu-item-type-custom menu-item-object-custom', |
|
753 | + 'geodir_menu_a_class_filter' => 'nav-top-link gd-nav-top-link', |
|
754 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher has-dropdown', |
|
755 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => 'nav-dropdown nav-dropdown-default', |
|
756 | + 'geodir_theme_compat_css' => stripslashes('dl.geodir_location_tabs_head dt{margin:0;}.header{z-index:90;}'), |
|
757 | + 'geodir_theme_compat_js' => stripslashes('jQuery(function(){jQuery("#masthead .gd-nav-top-link").append(\'<i class="icon-angle-down"></i>\'),jQuery("#menu-item-gd-location-switcher > a").append(\'<i class="icon-angle-down"></i>\'),jQuery(".mobile-sidebar .gd-nav-dropdown").addClass("children"),jQuery(".mobile-sidebar .gd-nav-dropdown").removeClass("nav-dropdown nav-dropdown-default"),jQuery(".mobile-sidebar #menu-item-gd-location-switcher ul").removeClass("nav-dropdown nav-dropdown-default"),setTimeout(function(){},5e3)});'), |
|
758 | + |
|
759 | + |
|
760 | + ); |
|
761 | + |
|
762 | + |
|
763 | + update_option('gd_theme_compats', $theme_compat); |
|
764 | + |
|
765 | + gd_set_theme_compat();// set the compat pack if avail |
|
766 | 766 | } |
767 | 767 | |
768 | 768 | |
@@ -774,61 +774,61 @@ discard block |
||
774 | 774 | * @global object $wpdb WordPress Database object. |
775 | 775 | */ |
776 | 776 | function gd_convert_virtual_pages(){ |
777 | - global $wpdb; |
|
778 | - |
|
779 | - // Update the add listing page settings |
|
780 | - $add_listing_page = $wpdb->get_var( |
|
781 | - $wpdb->prepare( |
|
782 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
783 | - array('add-listing') |
|
784 | - ) |
|
785 | - ); |
|
786 | - |
|
787 | - if($add_listing_page){ |
|
788 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
789 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
790 | - } |
|
791 | - |
|
792 | - // Update the listing preview page settings |
|
793 | - $listing_preview_page = $wpdb->get_var( |
|
794 | - $wpdb->prepare( |
|
795 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
796 | - array('listing-preview') |
|
797 | - ) |
|
798 | - ); |
|
799 | - |
|
800 | - if($listing_preview_page){ |
|
801 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
802 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
803 | - } |
|
804 | - |
|
805 | - // Update the listing success page settings |
|
806 | - $listing_success_page = $wpdb->get_var( |
|
807 | - $wpdb->prepare( |
|
808 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
809 | - array('listing-success') |
|
810 | - ) |
|
811 | - ); |
|
812 | - |
|
813 | - if($listing_success_page){ |
|
814 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
815 | - update_option( 'geodir_success_page', $listing_success_page); |
|
816 | - } |
|
817 | - |
|
818 | - // Update the listing success page settings |
|
819 | - $location_page = $wpdb->get_var( |
|
820 | - $wpdb->prepare( |
|
821 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
822 | - array('location') |
|
823 | - ) |
|
824 | - ); |
|
825 | - |
|
826 | - if($location_page){ |
|
827 | - $location_slug = get_option('geodir_location_prefix'); |
|
828 | - if(!$location_slug ){$location_slug = 'location';} |
|
829 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
830 | - update_option( 'geodir_location_page', $location_page); |
|
831 | - } |
|
777 | + global $wpdb; |
|
778 | + |
|
779 | + // Update the add listing page settings |
|
780 | + $add_listing_page = $wpdb->get_var( |
|
781 | + $wpdb->prepare( |
|
782 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
783 | + array('add-listing') |
|
784 | + ) |
|
785 | + ); |
|
786 | + |
|
787 | + if($add_listing_page){ |
|
788 | + wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
789 | + update_option( 'geodir_add_listing_page', $add_listing_page); |
|
790 | + } |
|
791 | + |
|
792 | + // Update the listing preview page settings |
|
793 | + $listing_preview_page = $wpdb->get_var( |
|
794 | + $wpdb->prepare( |
|
795 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
796 | + array('listing-preview') |
|
797 | + ) |
|
798 | + ); |
|
799 | + |
|
800 | + if($listing_preview_page){ |
|
801 | + wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
802 | + update_option( 'geodir_preview_page', $listing_preview_page); |
|
803 | + } |
|
804 | + |
|
805 | + // Update the listing success page settings |
|
806 | + $listing_success_page = $wpdb->get_var( |
|
807 | + $wpdb->prepare( |
|
808 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
809 | + array('listing-success') |
|
810 | + ) |
|
811 | + ); |
|
812 | + |
|
813 | + if($listing_success_page){ |
|
814 | + wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
815 | + update_option( 'geodir_success_page', $listing_success_page); |
|
816 | + } |
|
817 | + |
|
818 | + // Update the listing success page settings |
|
819 | + $location_page = $wpdb->get_var( |
|
820 | + $wpdb->prepare( |
|
821 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
822 | + array('location') |
|
823 | + ) |
|
824 | + ); |
|
825 | + |
|
826 | + if($location_page){ |
|
827 | + $location_slug = get_option('geodir_location_prefix'); |
|
828 | + if(!$location_slug ){$location_slug = 'location';} |
|
829 | + wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
830 | + update_option( 'geodir_location_page', $location_page); |
|
831 | + } |
|
832 | 832 | |
833 | 833 | } |
834 | 834 | |
@@ -842,31 +842,31 @@ discard block |
||
842 | 842 | function gd_fix_cpt_rewrite_slug() |
843 | 843 | { |
844 | 844 | |
845 | - $alt_post_types = array(); |
|
846 | - $post_types = get_option('geodir_post_types'); |
|
845 | + $alt_post_types = array(); |
|
846 | + $post_types = get_option('geodir_post_types'); |
|
847 | 847 | |
848 | 848 | |
849 | - if (is_array($post_types)){ |
|
849 | + if (is_array($post_types)){ |
|
850 | 850 | |
851 | - foreach ($post_types as $post_type => $args) { |
|
851 | + foreach ($post_types as $post_type => $args) { |
|
852 | 852 | |
853 | 853 | |
854 | - if(isset($args['rewrite']['slug'])){ |
|
855 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
856 | - } |
|
854 | + if(isset($args['rewrite']['slug'])){ |
|
855 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
856 | + } |
|
857 | 857 | |
858 | - $alt_post_types[$post_type] = $args; |
|
858 | + $alt_post_types[$post_type] = $args; |
|
859 | 859 | |
860 | - } |
|
861 | - } |
|
860 | + } |
|
861 | + } |
|
862 | 862 | |
863 | - if(!empty($alt_post_types)) { |
|
864 | - update_option('geodir_post_types',$alt_post_types); |
|
865 | - } |
|
863 | + if(!empty($alt_post_types)) { |
|
864 | + update_option('geodir_post_types',$alt_post_types); |
|
865 | + } |
|
866 | 866 | |
867 | 867 | |
868 | - // flush the rewrite rules |
|
869 | - flush_rewrite_rules(); |
|
868 | + // flush the rewrite rules |
|
869 | + flush_rewrite_rules(); |
|
870 | 870 | } |
871 | 871 | |
872 | 872 | |
@@ -879,20 +879,20 @@ discard block |
||
879 | 879 | */ |
880 | 880 | function gd_fix_address_detail_table_limit() |
881 | 881 | { |
882 | - global $wpdb; |
|
883 | - |
|
884 | - $all_postypes = geodir_get_posttypes(); |
|
885 | - |
|
886 | - if (!empty($all_postypes)) { |
|
887 | - foreach ($all_postypes as $key) { |
|
888 | - // update each GD CTP |
|
889 | - try { |
|
890 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
891 | - } catch(Exception $e) { |
|
892 | - error_log( 'Error: ' . $e->getMessage() ); |
|
893 | - } |
|
894 | - } |
|
895 | - } |
|
882 | + global $wpdb; |
|
883 | + |
|
884 | + $all_postypes = geodir_get_posttypes(); |
|
885 | + |
|
886 | + if (!empty($all_postypes)) { |
|
887 | + foreach ($all_postypes as $key) { |
|
888 | + // update each GD CTP |
|
889 | + try { |
|
890 | + $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
891 | + } catch(Exception $e) { |
|
892 | + error_log( 'Error: ' . $e->getMessage() ); |
|
893 | + } |
|
894 | + } |
|
895 | + } |
|
896 | 896 | } |
897 | 897 | |
898 | 898 | /** |
@@ -904,63 +904,63 @@ discard block |
||
904 | 904 | * @return bool |
905 | 905 | */ |
906 | 906 | function geodir_upgrade_1618() { |
907 | - global $wpdb; |
|
907 | + global $wpdb; |
|
908 | 908 | |
909 | - $gd_posttypes = geodir_get_posttypes(); |
|
910 | - $default_location = geodir_get_default_location(); |
|
909 | + $gd_posttypes = geodir_get_posttypes(); |
|
910 | + $default_location = geodir_get_default_location(); |
|
911 | 911 | |
912 | - $old_country = 'Czech Republic'; |
|
913 | - $old_slug = 'czech-republic'; |
|
914 | - $new_country = 'Czechia'; |
|
915 | - $new_slug = 'czechia'; |
|
916 | - $flush_rewrite_rules = false; |
|
917 | - |
|
918 | - if (!empty($gd_posttypes) && defined('POST_LOCATION_TABLE')) { |
|
919 | - // Update locations |
|
920 | - if ($wpdb->query($wpdb->prepare("UPDATE `" . POST_LOCATION_TABLE . "` SET `country` = %s, country_slug = %s WHERE `country` LIKE %s OR country_slug LIKE %s", array($new_country, $new_slug, $old_country, $old_slug)))) { |
|
921 | - $flush_rewrite_rules = true; |
|
922 | - } |
|
912 | + $old_country = 'Czech Republic'; |
|
913 | + $old_slug = 'czech-republic'; |
|
914 | + $new_country = 'Czechia'; |
|
915 | + $new_slug = 'czechia'; |
|
916 | + $flush_rewrite_rules = false; |
|
917 | + |
|
918 | + if (!empty($gd_posttypes) && defined('POST_LOCATION_TABLE')) { |
|
919 | + // Update locations |
|
920 | + if ($wpdb->query($wpdb->prepare("UPDATE `" . POST_LOCATION_TABLE . "` SET `country` = %s, country_slug = %s WHERE `country` LIKE %s OR country_slug LIKE %s", array($new_country, $new_slug, $old_country, $old_slug)))) { |
|
921 | + $flush_rewrite_rules = true; |
|
922 | + } |
|
923 | 923 | |
924 | - // Update locations seo |
|
925 | - if ($wpdb->query($wpdb->prepare("UPDATE `" . LOCATION_SEO_TABLE . "` SET `country_slug` = %s WHERE country_slug LIKE %s", array($new_slug, $old_slug)))) { |
|
926 | - $flush_rewrite_rules = true; |
|
927 | - } |
|
928 | - |
|
929 | - // Update term meta |
|
930 | - if ($wpdb->query($wpdb->prepare("UPDATE `" . GEODIR_TERM_META . "` SET `country_slug` = %s WHERE country_slug LIKE %s", array($new_slug, $old_slug)))) { |
|
931 | - $flush_rewrite_rules = true; |
|
932 | - } |
|
933 | - |
|
934 | - if ($wpdb->query($wpdb->prepare("UPDATE `" . GEODIR_TERM_META . "` SET `location_name` = %s WHERE location_type LIKE 'gd_country' AND location_name LIKE %s", array($new_slug, $old_slug)))) { |
|
935 | - $flush_rewrite_rules = true; |
|
936 | - } |
|
937 | - |
|
938 | - // Update detail table |
|
939 | - foreach ($gd_posttypes as $pos_type) { |
|
940 | - try { |
|
941 | - if ($wpdb->query("UPDATE `" . $wpdb->prefix . "geodir_" . $pos_type . "_detail` SET post_country = '" . $new_country . "', post_locations = REPLACE ( post_locations, ',[" . $old_slug . "]', ',[" . $new_slug . "]' ) WHERE post_locations LIKE '%[" . $old_slug . "]' OR post_country LIKE '" . $old_country . "'")) { |
|
942 | - $flush_rewrite_rules = true; |
|
943 | - } |
|
944 | - } catch(Exception $e) { |
|
945 | - error_log( 'Error: ' . $e->getMessage() ); |
|
946 | - } |
|
947 | - } |
|
948 | - } |
|
924 | + // Update locations seo |
|
925 | + if ($wpdb->query($wpdb->prepare("UPDATE `" . LOCATION_SEO_TABLE . "` SET `country_slug` = %s WHERE country_slug LIKE %s", array($new_slug, $old_slug)))) { |
|
926 | + $flush_rewrite_rules = true; |
|
927 | + } |
|
928 | + |
|
929 | + // Update term meta |
|
930 | + if ($wpdb->query($wpdb->prepare("UPDATE `" . GEODIR_TERM_META . "` SET `country_slug` = %s WHERE country_slug LIKE %s", array($new_slug, $old_slug)))) { |
|
931 | + $flush_rewrite_rules = true; |
|
932 | + } |
|
933 | + |
|
934 | + if ($wpdb->query($wpdb->prepare("UPDATE `" . GEODIR_TERM_META . "` SET `location_name` = %s WHERE location_type LIKE 'gd_country' AND location_name LIKE %s", array($new_slug, $old_slug)))) { |
|
935 | + $flush_rewrite_rules = true; |
|
936 | + } |
|
937 | + |
|
938 | + // Update detail table |
|
939 | + foreach ($gd_posttypes as $pos_type) { |
|
940 | + try { |
|
941 | + if ($wpdb->query("UPDATE `" . $wpdb->prefix . "geodir_" . $pos_type . "_detail` SET post_country = '" . $new_country . "', post_locations = REPLACE ( post_locations, ',[" . $old_slug . "]', ',[" . $new_slug . "]' ) WHERE post_locations LIKE '%[" . $old_slug . "]' OR post_country LIKE '" . $old_country . "'")) { |
|
942 | + $flush_rewrite_rules = true; |
|
943 | + } |
|
944 | + } catch(Exception $e) { |
|
945 | + error_log( 'Error: ' . $e->getMessage() ); |
|
946 | + } |
|
947 | + } |
|
948 | + } |
|
949 | 949 | |
950 | - if (!empty($default_location) && ((isset($default_location->country) && $default_location->country == $old_country) || (isset($default_location->country_slug) && $default_location->country_slug == $old_slug))) { |
|
951 | - $default_location->country = $new_country; |
|
952 | - $default_location->country_slug = $new_slug; |
|
950 | + if (!empty($default_location) && ((isset($default_location->country) && $default_location->country == $old_country) || (isset($default_location->country_slug) && $default_location->country_slug == $old_slug))) { |
|
951 | + $default_location->country = $new_country; |
|
952 | + $default_location->country_slug = $new_slug; |
|
953 | 953 | |
954 | - update_option('geodir_default_location', $default_location); |
|
954 | + update_option('geodir_default_location', $default_location); |
|
955 | 955 | |
956 | - $flush_rewrite_rules = true; |
|
957 | - } |
|
956 | + $flush_rewrite_rules = true; |
|
957 | + } |
|
958 | 958 | |
959 | - if ($flush_rewrite_rules) { |
|
960 | - flush_rewrite_rules(); |
|
961 | - } |
|
959 | + if ($flush_rewrite_rules) { |
|
960 | + flush_rewrite_rules(); |
|
961 | + } |
|
962 | 962 | |
963 | - return true; |
|
963 | + return true; |
|
964 | 964 | } |
965 | 965 | |
966 | 966 | /** |
@@ -971,9 +971,9 @@ discard block |
||
971 | 971 | * @return bool |
972 | 972 | */ |
973 | 973 | function geodir_upgrade_1622() { |
974 | - if ( get_option( 'geodir_notify_post_submit', '-1' ) == '-1' ) { |
|
975 | - update_option( 'geodir_notify_post_submit', '1' ); |
|
976 | - } |
|
974 | + if ( get_option( 'geodir_notify_post_submit', '-1' ) == '-1' ) { |
|
975 | + update_option( 'geodir_notify_post_submit', '1' ); |
|
976 | + } |
|
977 | 977 | |
978 | - return true; |
|
978 | + return true; |
|
979 | 979 | } |
980 | 980 | \ No newline at end of file |
@@ -13,29 +13,29 @@ discard block |
||
13 | 13 | */ |
14 | 14 | function geodir_register_taxonomies() |
15 | 15 | { |
16 | - $taxonomies = array(); |
|
17 | - $taxonomies = get_option('geodir_taxonomies'); |
|
18 | - // If custom taxonomies are present, register them |
|
19 | - if (is_array($taxonomies)) { |
|
20 | - // Sort taxonomies |
|
21 | - ksort($taxonomies); |
|
22 | - |
|
23 | - // Register taxonomies |
|
24 | - foreach ($taxonomies as $taxonomy => $args) { |
|
25 | - // Allow taxonomy names to be translated |
|
26 | - if (!empty($args['args']['labels'])) { |
|
27 | - foreach ($args['args']['labels'] as $key => $tax_label) { |
|
28 | - $args['args']['labels'][$key] = __($tax_label, 'geodirectory'); |
|
29 | - } |
|
30 | - } |
|
31 | - |
|
32 | - $tax = register_taxonomy($taxonomy, $args['object_type'], $args['args']); |
|
33 | - |
|
34 | - if (taxonomy_exists($taxonomy)) { |
|
35 | - $tax = register_taxonomy_for_object_type($taxonomy, $args['object_type']); |
|
36 | - } |
|
37 | - } |
|
38 | - } |
|
16 | + $taxonomies = array(); |
|
17 | + $taxonomies = get_option('geodir_taxonomies'); |
|
18 | + // If custom taxonomies are present, register them |
|
19 | + if (is_array($taxonomies)) { |
|
20 | + // Sort taxonomies |
|
21 | + ksort($taxonomies); |
|
22 | + |
|
23 | + // Register taxonomies |
|
24 | + foreach ($taxonomies as $taxonomy => $args) { |
|
25 | + // Allow taxonomy names to be translated |
|
26 | + if (!empty($args['args']['labels'])) { |
|
27 | + foreach ($args['args']['labels'] as $key => $tax_label) { |
|
28 | + $args['args']['labels'][$key] = __($tax_label, 'geodirectory'); |
|
29 | + } |
|
30 | + } |
|
31 | + |
|
32 | + $tax = register_taxonomy($taxonomy, $args['object_type'], $args['args']); |
|
33 | + |
|
34 | + if (taxonomy_exists($taxonomy)) { |
|
35 | + $tax = register_taxonomy_for_object_type($taxonomy, $args['object_type']); |
|
36 | + } |
|
37 | + } |
|
38 | + } |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -46,45 +46,45 @@ discard block |
||
46 | 46 | * @global array $wp_post_types List of post types. |
47 | 47 | */ |
48 | 48 | function geodir_register_post_types() { |
49 | - global $wp_post_types; |
|
49 | + global $wp_post_types; |
|
50 | 50 | |
51 | - /** |
|
52 | - * Get available custom posttypes and taxonomies and register them. |
|
53 | - */ |
|
54 | - _x('places', 'URL slug', 'geodirectory'); |
|
55 | - |
|
56 | - $post_types = array(); |
|
57 | - $post_types = get_option('geodir_post_types'); |
|
58 | - |
|
59 | - // Register each post type if array of data is returned |
|
60 | - if (is_array($post_types)): |
|
61 | - |
|
62 | - foreach ($post_types as $post_type => $args): |
|
63 | - |
|
64 | - if (!empty($args['rewrite']['slug'])) { |
|
65 | - $args['rewrite']['slug'] = _x($args['rewrite']['slug'], 'URL slug', 'geodirectory'); |
|
66 | - } |
|
67 | - $args = stripslashes_deep($args); |
|
68 | - |
|
69 | - if (!empty($args['labels'])) { |
|
70 | - foreach ($args['labels'] as $key => $val) { |
|
71 | - $args['labels'][$key] = __($val, 'geodirectory');// allow translation |
|
72 | - } |
|
73 | - } |
|
74 | - |
|
75 | - /** |
|
76 | - * Filter post type args. |
|
77 | - * |
|
78 | - * @since 1.0.0 |
|
79 | - * @param string $args Post type args. |
|
80 | - * @param string $post_type The post type. |
|
81 | - */ |
|
82 | - $args = apply_filters('geodir_post_type_args', $args, $post_type); |
|
83 | - |
|
84 | - $post_type = register_post_type($post_type, $args); |
|
85 | - |
|
86 | - endforeach; |
|
87 | - endif; |
|
51 | + /** |
|
52 | + * Get available custom posttypes and taxonomies and register them. |
|
53 | + */ |
|
54 | + _x('places', 'URL slug', 'geodirectory'); |
|
55 | + |
|
56 | + $post_types = array(); |
|
57 | + $post_types = get_option('geodir_post_types'); |
|
58 | + |
|
59 | + // Register each post type if array of data is returned |
|
60 | + if (is_array($post_types)): |
|
61 | + |
|
62 | + foreach ($post_types as $post_type => $args): |
|
63 | + |
|
64 | + if (!empty($args['rewrite']['slug'])) { |
|
65 | + $args['rewrite']['slug'] = _x($args['rewrite']['slug'], 'URL slug', 'geodirectory'); |
|
66 | + } |
|
67 | + $args = stripslashes_deep($args); |
|
68 | + |
|
69 | + if (!empty($args['labels'])) { |
|
70 | + foreach ($args['labels'] as $key => $val) { |
|
71 | + $args['labels'][$key] = __($val, 'geodirectory');// allow translation |
|
72 | + } |
|
73 | + } |
|
74 | + |
|
75 | + /** |
|
76 | + * Filter post type args. |
|
77 | + * |
|
78 | + * @since 1.0.0 |
|
79 | + * @param string $args Post type args. |
|
80 | + * @param string $post_type The post type. |
|
81 | + */ |
|
82 | + $args = apply_filters('geodir_post_type_args', $args, $post_type); |
|
83 | + |
|
84 | + $post_type = register_post_type($post_type, $args); |
|
85 | + |
|
86 | + endforeach; |
|
87 | + endif; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -98,72 +98,72 @@ discard block |
||
98 | 98 | */ |
99 | 99 | function geodir_post_type_args_modify($args, $post_type) |
100 | 100 | { |
101 | - $geodir_location_prefix = isset($_REQUEST['geodir_location_prefix']) ? trim($_REQUEST['geodir_location_prefix']) : get_option('geodir_location_prefix'); |
|
101 | + $geodir_location_prefix = isset($_REQUEST['geodir_location_prefix']) ? trim($_REQUEST['geodir_location_prefix']) : get_option('geodir_location_prefix'); |
|
102 | 102 | if (isset($_REQUEST['geodir_listing_prefix']) && $_REQUEST['geodir_listing_prefix'] != '' && geodir_strtolower($_REQUEST['geodir_listing_prefix']) != geodir_strtolower($geodir_location_prefix)) { |
103 | 103 | |
104 | - $listing_slug = htmlentities(trim($_REQUEST['geodir_listing_prefix'])); |
|
104 | + $listing_slug = htmlentities(trim($_REQUEST['geodir_listing_prefix'])); |
|
105 | 105 | |
106 | - if ($post_type == 'gd_place') { |
|
107 | - if (array_key_exists('has_archive', $args)) |
|
108 | - $args['has_archive'] = $listing_slug; |
|
106 | + if ($post_type == 'gd_place') { |
|
107 | + if (array_key_exists('has_archive', $args)) |
|
108 | + $args['has_archive'] = $listing_slug; |
|
109 | 109 | |
110 | - if (array_key_exists('rewrite', $args)) { |
|
111 | - if (array_key_exists('slug', $args['rewrite'])) |
|
112 | - $args['rewrite']['slug'] = $listing_slug;// . '/%gd_taxonomy%'; |
|
113 | - } |
|
110 | + if (array_key_exists('rewrite', $args)) { |
|
111 | + if (array_key_exists('slug', $args['rewrite'])) |
|
112 | + $args['rewrite']['slug'] = $listing_slug;// . '/%gd_taxonomy%'; |
|
113 | + } |
|
114 | 114 | |
115 | - $geodir_post_types = get_option('geodir_post_types'); |
|
115 | + $geodir_post_types = get_option('geodir_post_types'); |
|
116 | 116 | |
117 | - if (array_key_exists($post_type, $geodir_post_types)) { |
|
117 | + if (array_key_exists($post_type, $geodir_post_types)) { |
|
118 | 118 | |
119 | - if (array_key_exists('has_archive', $geodir_post_types[$post_type])) |
|
120 | - $geodir_post_types[$post_type]['has_archive'] = $listing_slug; |
|
119 | + if (array_key_exists('has_archive', $geodir_post_types[$post_type])) |
|
120 | + $geodir_post_types[$post_type]['has_archive'] = $listing_slug; |
|
121 | 121 | |
122 | - if (array_key_exists('rewrite', $geodir_post_types[$post_type])) |
|
123 | - if (array_key_exists('slug', $geodir_post_types[$post_type]['rewrite'])) |
|
124 | - $geodir_post_types[$post_type]['rewrite']['slug'] = $listing_slug;// . '/%gd_taxonomy%'; |
|
122 | + if (array_key_exists('rewrite', $geodir_post_types[$post_type])) |
|
123 | + if (array_key_exists('slug', $geodir_post_types[$post_type]['rewrite'])) |
|
124 | + $geodir_post_types[$post_type]['rewrite']['slug'] = $listing_slug;// . '/%gd_taxonomy%'; |
|
125 | 125 | |
126 | - update_option('geodir_post_types', $geodir_post_types); |
|
126 | + update_option('geodir_post_types', $geodir_post_types); |
|
127 | 127 | |
128 | - } |
|
128 | + } |
|
129 | 129 | |
130 | - $geodir_post_types = get_option('geodir_post_types'); |
|
130 | + $geodir_post_types = get_option('geodir_post_types'); |
|
131 | 131 | |
132 | - /* --- update taxonomies (category) --- */ |
|
132 | + /* --- update taxonomies (category) --- */ |
|
133 | 133 | |
134 | - $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
134 | + $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
135 | 135 | |
136 | - if (array_key_exists('listing_slug', $geodir_taxonomies[$post_type . 'category'])) { |
|
137 | - $geodir_taxonomies[$post_type . 'category']['listing_slug'] = $listing_slug; |
|
136 | + if (array_key_exists('listing_slug', $geodir_taxonomies[$post_type . 'category'])) { |
|
137 | + $geodir_taxonomies[$post_type . 'category']['listing_slug'] = $listing_slug; |
|
138 | 138 | |
139 | - if (array_key_exists('args', $geodir_taxonomies[$post_type . 'category'])) |
|
140 | - if (array_key_exists('rewrite', $geodir_taxonomies[$post_type . 'category']['args'])) |
|
141 | - if (array_key_exists('slug', $geodir_taxonomies[$post_type . 'category']['args']['rewrite'])) |
|
142 | - $geodir_taxonomies[$post_type . 'category']['args']['rewrite']['slug'] = $listing_slug; |
|
139 | + if (array_key_exists('args', $geodir_taxonomies[$post_type . 'category'])) |
|
140 | + if (array_key_exists('rewrite', $geodir_taxonomies[$post_type . 'category']['args'])) |
|
141 | + if (array_key_exists('slug', $geodir_taxonomies[$post_type . 'category']['args']['rewrite'])) |
|
142 | + $geodir_taxonomies[$post_type . 'category']['args']['rewrite']['slug'] = $listing_slug; |
|
143 | 143 | |
144 | - update_option('geodir_taxonomies', $geodir_taxonomies); |
|
144 | + update_option('geodir_taxonomies', $geodir_taxonomies); |
|
145 | 145 | |
146 | - } |
|
146 | + } |
|
147 | 147 | |
148 | - /* --- update taxonomies (tags) --- */ |
|
149 | - $geodir_taxonomies_tag = get_option('geodir_taxonomies'); |
|
150 | - if (array_key_exists('listing_slug', $geodir_taxonomies_tag[$post_type . '_tags'])) { |
|
151 | - $geodir_taxonomies_tag[$post_type . '_tags']['listing_slug'] = $listing_slug . '/tags'; |
|
148 | + /* --- update taxonomies (tags) --- */ |
|
149 | + $geodir_taxonomies_tag = get_option('geodir_taxonomies'); |
|
150 | + if (array_key_exists('listing_slug', $geodir_taxonomies_tag[$post_type . '_tags'])) { |
|
151 | + $geodir_taxonomies_tag[$post_type . '_tags']['listing_slug'] = $listing_slug . '/tags'; |
|
152 | 152 | |
153 | - if (array_key_exists('args', $geodir_taxonomies_tag[$post_type . '_tags'])) |
|
154 | - if (array_key_exists('rewrite', $geodir_taxonomies_tag[$post_type . '_tags']['args'])) |
|
155 | - if (array_key_exists('slug', $geodir_taxonomies_tag[$post_type . '_tags']['args']['rewrite'])) |
|
156 | - $geodir_taxonomies_tag[$post_type . '_tags']['args']['rewrite']['slug'] = $listing_slug . '/tags'; |
|
153 | + if (array_key_exists('args', $geodir_taxonomies_tag[$post_type . '_tags'])) |
|
154 | + if (array_key_exists('rewrite', $geodir_taxonomies_tag[$post_type . '_tags']['args'])) |
|
155 | + if (array_key_exists('slug', $geodir_taxonomies_tag[$post_type . '_tags']['args']['rewrite'])) |
|
156 | + $geodir_taxonomies_tag[$post_type . '_tags']['args']['rewrite']['slug'] = $listing_slug . '/tags'; |
|
157 | 157 | |
158 | - update_option('geodir_taxonomies', $geodir_taxonomies_tag); |
|
158 | + update_option('geodir_taxonomies', $geodir_taxonomies_tag); |
|
159 | 159 | |
160 | - } |
|
160 | + } |
|
161 | 161 | |
162 | - } |
|
162 | + } |
|
163 | 163 | |
164 | - } |
|
164 | + } |
|
165 | 165 | |
166 | - return $args; |
|
166 | + return $args; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -176,8 +176,8 @@ discard block |
||
176 | 176 | */ |
177 | 177 | function geodir_flush_rewrite_rules() |
178 | 178 | { |
179 | - global $wp_rewrite; |
|
180 | - $wp_rewrite->flush_rules(false); |
|
179 | + global $wp_rewrite; |
|
180 | + $wp_rewrite->flush_rules(false); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -192,35 +192,35 @@ discard block |
||
192 | 192 | * @return array Rewrite rules. |
193 | 193 | */ |
194 | 194 | function geodir_listing_rewrite_rules($rules) { |
195 | - $newrules = array(); |
|
196 | - $taxonomies = get_option('geodir_taxonomies'); |
|
197 | - $detail_url_seprator = get_option('geodir_detailurl_separator'); |
|
195 | + $newrules = array(); |
|
196 | + $taxonomies = get_option('geodir_taxonomies'); |
|
197 | + $detail_url_seprator = get_option('geodir_detailurl_separator'); |
|
198 | 198 | |
199 | 199 | // create rules for post listing |
200 | - if (is_array($taxonomies)): |
|
201 | - foreach ($taxonomies as $taxonomy => $args): |
|
202 | - $post_type = $args['object_type']; |
|
203 | - $listing_slug = $args['listing_slug']; |
|
204 | - |
|
205 | - if (strpos($taxonomy, 'tags')) { |
|
206 | - $newrules[$listing_slug . '/(.+?)/page/?([0-9]{1,})/?$'] = 'index.php?' . $taxonomy . '=$matches[1]&paged=$matches[2]'; |
|
207 | - $newrules[$listing_slug . '/(.+?)/?$'] = 'index.php?' . $taxonomy . '=$matches[1]'; |
|
208 | - } else { |
|
209 | - // use this loop to add paging for details page comments paging |
|
210 | - $newrules[str_replace("/tags","",$listing_slug) . '/(.+?)/comment-page-([0-9]{1,})/?$'] = 'index.php?' . $taxonomy . '=$matches[1]&cpage=$matches[2]'; |
|
211 | - } |
|
212 | - endforeach; |
|
213 | - endif; |
|
214 | - |
|
215 | - // create rules for location listing |
|
216 | - $location_page = get_option('geodir_location_page'); |
|
200 | + if (is_array($taxonomies)): |
|
201 | + foreach ($taxonomies as $taxonomy => $args): |
|
202 | + $post_type = $args['object_type']; |
|
203 | + $listing_slug = $args['listing_slug']; |
|
204 | + |
|
205 | + if (strpos($taxonomy, 'tags')) { |
|
206 | + $newrules[$listing_slug . '/(.+?)/page/?([0-9]{1,})/?$'] = 'index.php?' . $taxonomy . '=$matches[1]&paged=$matches[2]'; |
|
207 | + $newrules[$listing_slug . '/(.+?)/?$'] = 'index.php?' . $taxonomy . '=$matches[1]'; |
|
208 | + } else { |
|
209 | + // use this loop to add paging for details page comments paging |
|
210 | + $newrules[str_replace("/tags","",$listing_slug) . '/(.+?)/comment-page-([0-9]{1,})/?$'] = 'index.php?' . $taxonomy . '=$matches[1]&cpage=$matches[2]'; |
|
211 | + } |
|
212 | + endforeach; |
|
213 | + endif; |
|
214 | + |
|
215 | + // create rules for location listing |
|
216 | + $location_page = get_option('geodir_location_page'); |
|
217 | 217 | |
218 | - if($location_page) { |
|
219 | - global $wpdb; |
|
220 | - $location_prefix = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_type='page' AND ID=%d", $location_page)); |
|
221 | - } |
|
222 | - if (!isset($location_prefix)) |
|
223 | - $location_prefix = 'location'; |
|
218 | + if($location_page) { |
|
219 | + global $wpdb; |
|
220 | + $location_prefix = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_type='page' AND ID=%d", $location_page)); |
|
221 | + } |
|
222 | + if (!isset($location_prefix)) |
|
223 | + $location_prefix = 'location'; |
|
224 | 224 | |
225 | 225 | $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active. |
226 | 226 | if ($location_manager) { |
@@ -264,12 +264,12 @@ discard block |
||
264 | 264 | $newrules[$location_prefix . '/([^/]+)/?$'] = 'index.php?page_id=' . $location_page . '&gd_country=$matches[1]'; |
265 | 265 | } |
266 | 266 | |
267 | - if ($location_page && geodir_is_wpml()) { |
|
268 | - foreach(icl_get_languages('skip_missing=N') as $lang){ |
|
269 | - $alt_page_id = ''; |
|
270 | - $alt_page_id = geodir_wpml_object_id($location_page, 'page', false,$lang['language_code']); |
|
271 | - if($alt_page_id){ |
|
272 | - $location_prefix = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_type='page' AND ID=%d", $alt_page_id)); |
|
267 | + if ($location_page && geodir_is_wpml()) { |
|
268 | + foreach(icl_get_languages('skip_missing=N') as $lang){ |
|
269 | + $alt_page_id = ''; |
|
270 | + $alt_page_id = geodir_wpml_object_id($location_page, 'page', false,$lang['language_code']); |
|
271 | + if($alt_page_id){ |
|
272 | + $location_prefix = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_type='page' AND ID=%d", $alt_page_id)); |
|
273 | 273 | |
274 | 274 | if ($location_manager && ($hide_country_part || $hide_region_part)) { |
275 | 275 | $matches2 = ''; |
@@ -305,14 +305,14 @@ discard block |
||
305 | 305 | $newrules[$location_prefix . '/([^/]+)/([^/]+)/?$'] = 'index.php?page_id=' . $alt_page_id . '&gd_country=$matches[1]&gd_region=$matches[2]'; |
306 | 306 | $newrules[$location_prefix . '/([^/]+)/?$'] = 'index.php?page_id=' . $alt_page_id . '&gd_country=$matches[1]'; |
307 | 307 | } |
308 | - } |
|
309 | - } |
|
310 | - } |
|
308 | + } |
|
309 | + } |
|
310 | + } |
|
311 | 311 | |
312 | - $newrules[$location_prefix . '/?$'] = 'index.php?page_id=' . $location_page; |
|
312 | + $newrules[$location_prefix . '/?$'] = 'index.php?page_id=' . $location_page; |
|
313 | 313 | |
314 | - $rules = array_merge($newrules, $rules); |
|
315 | - return $rules; |
|
314 | + $rules = array_merge($newrules, $rules); |
|
315 | + return $rules; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | /** |
@@ -327,18 +327,18 @@ discard block |
||
327 | 327 | */ |
328 | 328 | function geodir_htaccess_contents($rules) |
329 | 329 | { |
330 | - global $wpdb; |
|
331 | - $location_prefix = get_option('geodir_location_prefix'); |
|
332 | - // if location page slug changed then add redirect |
|
333 | - if ($location_prefix == 'location') { |
|
334 | - return $rules; |
|
335 | - } |
|
336 | - $my_content = <<<EOD |
|
330 | + global $wpdb; |
|
331 | + $location_prefix = get_option('geodir_location_prefix'); |
|
332 | + // if location page slug changed then add redirect |
|
333 | + if ($location_prefix == 'location') { |
|
334 | + return $rules; |
|
335 | + } |
|
336 | + $my_content = <<<EOD |
|
337 | 337 | \n# BEGIN GeoDirectory Rules |
338 | 338 | #Redirect 301 /location/ /$location_prefix/ |
339 | 339 | # END GeoDirectory Rules\n\n |
340 | 340 | EOD; |
341 | - return $my_content . $rules; |
|
341 | + return $my_content . $rules; |
|
342 | 342 | } |
343 | 343 | //add_filter('mod_rewrite_rules', 'geodir_htaccess_contents'); |
344 | 344 | |
@@ -352,10 +352,10 @@ discard block |
||
352 | 352 | */ |
353 | 353 | function geodir_add_location_var($public_query_vars) |
354 | 354 | { |
355 | - $public_query_vars[] = 'gd_country'; |
|
356 | - $public_query_vars[] = 'gd_region'; |
|
357 | - $public_query_vars[] = 'gd_city'; |
|
358 | - return $public_query_vars; |
|
355 | + $public_query_vars[] = 'gd_country'; |
|
356 | + $public_query_vars[] = 'gd_region'; |
|
357 | + $public_query_vars[] = 'gd_city'; |
|
358 | + return $public_query_vars; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | /** |
@@ -368,8 +368,8 @@ discard block |
||
368 | 368 | */ |
369 | 369 | function geodir_add_geodir_page_var($public_query_vars) |
370 | 370 | { |
371 | - $public_query_vars[] = 'gd_is_geodir_page'; |
|
372 | - return $public_query_vars; |
|
371 | + $public_query_vars[] = 'gd_is_geodir_page'; |
|
372 | + return $public_query_vars; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | /** |
@@ -381,20 +381,20 @@ discard block |
||
381 | 381 | */ |
382 | 382 | function geodir_add_page_id_in_query_var() |
383 | 383 | { |
384 | - global $wp_query; |
|
384 | + global $wp_query; |
|
385 | 385 | |
386 | - $page_id = $wp_query->get_queried_object_id(); |
|
386 | + $page_id = $wp_query->get_queried_object_id(); |
|
387 | 387 | |
388 | - if (!get_query_var('page_id') && !is_archive()) { |
|
389 | - // fix for WP tags conflict with enfold theme |
|
390 | - $theme_name = geodir_strtolower(wp_get_theme()); |
|
391 | - if (!geodir_is_geodir_page() && strpos($theme_name, 'enfold') !== false) { |
|
392 | - return $wp_query; |
|
393 | - } |
|
394 | - $wp_query->set('page_id', $page_id); |
|
395 | - } |
|
388 | + if (!get_query_var('page_id') && !is_archive()) { |
|
389 | + // fix for WP tags conflict with enfold theme |
|
390 | + $theme_name = geodir_strtolower(wp_get_theme()); |
|
391 | + if (!geodir_is_geodir_page() && strpos($theme_name, 'enfold') !== false) { |
|
392 | + return $wp_query; |
|
393 | + } |
|
394 | + $wp_query->set('page_id', $page_id); |
|
395 | + } |
|
396 | 396 | |
397 | - return $wp_query; |
|
397 | + return $wp_query; |
|
398 | 398 | } |
399 | 399 | |
400 | 400 | /** |
@@ -409,23 +409,23 @@ discard block |
||
409 | 409 | function geodir_set_location_var_in_session_in_core($wp) { |
410 | 410 | global $gd_session; |
411 | 411 | |
412 | - // Fix for WPML removing page_id query var: |
|
413 | - if (isset($wp->query_vars['page']) && !isset($wp->query_vars['page_id']) && isset($wp->query_vars['pagename']) && !is_home()) { |
|
414 | - global $wpdb; |
|
412 | + // Fix for WPML removing page_id query var: |
|
413 | + if (isset($wp->query_vars['page']) && !isset($wp->query_vars['page_id']) && isset($wp->query_vars['pagename']) && !is_home()) { |
|
414 | + global $wpdb; |
|
415 | 415 | |
416 | - $page_for_posts = get_option('page_for_posts'); |
|
417 | - $real_page_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name=%s",$wp->query_vars['pagename'])); |
|
416 | + $page_for_posts = get_option('page_for_posts'); |
|
417 | + $real_page_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name=%s",$wp->query_vars['pagename'])); |
|
418 | 418 | |
419 | - if (geodir_is_wpml()) { |
|
420 | - $real_page_id = geodir_wpml_object_id($real_page_id, 'page', true, ICL_LANGUAGE_CODE); |
|
421 | - } |
|
422 | - if ($real_page_id && $real_page_id!=$page_for_posts) { |
|
423 | - $wp->query_vars['page_id'] = $real_page_id; |
|
424 | - } |
|
425 | - } |
|
419 | + if (geodir_is_wpml()) { |
|
420 | + $real_page_id = geodir_wpml_object_id($real_page_id, 'page', true, ICL_LANGUAGE_CODE); |
|
421 | + } |
|
422 | + if ($real_page_id && $real_page_id!=$page_for_posts) { |
|
423 | + $wp->query_vars['page_id'] = $real_page_id; |
|
424 | + } |
|
425 | + } |
|
426 | 426 | // Query Vars will have page_id parameter |
427 | 427 | // check if query var has page_id and that page id is location page |
428 | - geodir_set_is_geodir_page($wp); |
|
428 | + geodir_set_is_geodir_page($wp); |
|
429 | 429 | // if is GD homepage set the page ID |
430 | 430 | if (geodir_is_page('home')) { |
431 | 431 | $wp->query_vars['page_id'] = get_option('page_on_front'); |
@@ -434,118 +434,118 @@ discard block |
||
434 | 434 | // The location url format (all or country_city or region_city or city). |
435 | 435 | $geodir_show_location_url = get_option('geodir_show_location_url'); |
436 | 436 | |
437 | - if (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id()) { |
|
438 | - $gd_country = ''; |
|
439 | - $gd_region = ''; |
|
440 | - $gd_city = ''; |
|
441 | - if (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') |
|
442 | - $gd_country = urldecode($wp->query_vars['gd_country']); |
|
443 | - |
|
444 | - if (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') |
|
445 | - $gd_region = urldecode($wp->query_vars['gd_region']); |
|
446 | - |
|
447 | - if (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') |
|
448 | - $gd_city = urldecode($wp->query_vars['gd_city']); |
|
449 | - |
|
450 | - if (!($gd_country == '' && $gd_region == '' && $gd_city == '')) { |
|
451 | - $default_location = geodir_get_default_location(); |
|
452 | - |
|
453 | - if (get_option('geodir_add_location_url')) { |
|
454 | - if ($geodir_show_location_url != 'all') { |
|
455 | - if ($gd_region == '') { |
|
456 | - if ($gd_ses_region = $gd_session->get('gd_region')) |
|
457 | - $gd_region = $gd_ses_region; |
|
458 | - else |
|
459 | - $gd_region = $default_location->region_slug; |
|
460 | - } |
|
461 | - |
|
462 | - if ($gd_city == '') { |
|
463 | - if ($gd_ses_city = $gd_session->get('gd_city')) |
|
464 | - $gd_city = $gd_ses_city; |
|
465 | - else |
|
466 | - $gd_city = $default_location->city_slug; |
|
467 | - |
|
468 | - $base_location_link = geodir_get_location_link('base'); |
|
469 | - wp_redirect($base_location_link . '/' . $gd_country . '/' . $gd_region . '/' . $gd_city); |
|
470 | - exit(); |
|
471 | - } |
|
472 | - } |
|
473 | - } |
|
474 | - |
|
475 | - $args = array( |
|
476 | - 'what' => 'city', |
|
477 | - 'city_val' => $gd_city, |
|
478 | - 'region_val' => $gd_region, |
|
479 | - 'country_val' => $gd_country, |
|
480 | - 'country_column_name' => 'country_slug', |
|
481 | - 'region_column_name' => 'region_slug', |
|
482 | - 'city_column_name' => 'city_slug', |
|
483 | - 'location_link_part' => false, |
|
484 | - 'compare_operator' => '' |
|
485 | - ); |
|
486 | - |
|
487 | - $location_array = function_exists('geodir_get_location_array') ? geodir_get_location_array($args) : array(); |
|
488 | - if (!empty($location_array)) { |
|
489 | - $gd_session->set('gd_multi_location', 1); |
|
490 | - $gd_session->set('gd_country', $gd_country); |
|
491 | - $gd_session->set('gd_region', $gd_region); |
|
492 | - $gd_session->set('gd_city', $gd_city); |
|
437 | + if (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id()) { |
|
438 | + $gd_country = ''; |
|
439 | + $gd_region = ''; |
|
440 | + $gd_city = ''; |
|
441 | + if (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') |
|
442 | + $gd_country = urldecode($wp->query_vars['gd_country']); |
|
443 | + |
|
444 | + if (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') |
|
445 | + $gd_region = urldecode($wp->query_vars['gd_region']); |
|
446 | + |
|
447 | + if (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') |
|
448 | + $gd_city = urldecode($wp->query_vars['gd_city']); |
|
449 | + |
|
450 | + if (!($gd_country == '' && $gd_region == '' && $gd_city == '')) { |
|
451 | + $default_location = geodir_get_default_location(); |
|
452 | + |
|
453 | + if (get_option('geodir_add_location_url')) { |
|
454 | + if ($geodir_show_location_url != 'all') { |
|
455 | + if ($gd_region == '') { |
|
456 | + if ($gd_ses_region = $gd_session->get('gd_region')) |
|
457 | + $gd_region = $gd_ses_region; |
|
458 | + else |
|
459 | + $gd_region = $default_location->region_slug; |
|
460 | + } |
|
461 | + |
|
462 | + if ($gd_city == '') { |
|
463 | + if ($gd_ses_city = $gd_session->get('gd_city')) |
|
464 | + $gd_city = $gd_ses_city; |
|
465 | + else |
|
466 | + $gd_city = $default_location->city_slug; |
|
467 | + |
|
468 | + $base_location_link = geodir_get_location_link('base'); |
|
469 | + wp_redirect($base_location_link . '/' . $gd_country . '/' . $gd_region . '/' . $gd_city); |
|
470 | + exit(); |
|
471 | + } |
|
472 | + } |
|
473 | + } |
|
474 | + |
|
475 | + $args = array( |
|
476 | + 'what' => 'city', |
|
477 | + 'city_val' => $gd_city, |
|
478 | + 'region_val' => $gd_region, |
|
479 | + 'country_val' => $gd_country, |
|
480 | + 'country_column_name' => 'country_slug', |
|
481 | + 'region_column_name' => 'region_slug', |
|
482 | + 'city_column_name' => 'city_slug', |
|
483 | + 'location_link_part' => false, |
|
484 | + 'compare_operator' => '' |
|
485 | + ); |
|
486 | + |
|
487 | + $location_array = function_exists('geodir_get_location_array') ? geodir_get_location_array($args) : array(); |
|
488 | + if (!empty($location_array)) { |
|
489 | + $gd_session->set('gd_multi_location', 1); |
|
490 | + $gd_session->set('gd_country', $gd_country); |
|
491 | + $gd_session->set('gd_region', $gd_region); |
|
492 | + $gd_session->set('gd_city', $gd_city); |
|
493 | 493 | |
494 | 494 | $wp->query_vars['gd_country'] = $gd_country; |
495 | - $wp->query_vars['gd_region'] = $gd_region; |
|
496 | - $wp->query_vars['gd_city'] = $gd_city; |
|
497 | - } else { |
|
498 | - $gd_session->un_set(array('gd_multi_location', 'gd_city', 'gd_region', 'gd_country')); |
|
499 | - } |
|
500 | - } else { |
|
501 | - $gd_session->un_set(array('gd_multi_location', 'gd_city', 'gd_region', 'gd_country')); |
|
502 | - } |
|
503 | - |
|
504 | - } else if (isset($wp->query_vars['post_type']) && $wp->query_vars['post_type'] != '') { |
|
505 | - if (!is_admin()) { |
|
506 | - $requested_post_type = $wp->query_vars['post_type']; |
|
507 | - // check if this post type is geodirectory post types |
|
508 | - $post_type_array = geodir_get_posttypes(); |
|
495 | + $wp->query_vars['gd_region'] = $gd_region; |
|
496 | + $wp->query_vars['gd_city'] = $gd_city; |
|
497 | + } else { |
|
498 | + $gd_session->un_set(array('gd_multi_location', 'gd_city', 'gd_region', 'gd_country')); |
|
499 | + } |
|
500 | + } else { |
|
501 | + $gd_session->un_set(array('gd_multi_location', 'gd_city', 'gd_region', 'gd_country')); |
|
502 | + } |
|
503 | + |
|
504 | + } else if (isset($wp->query_vars['post_type']) && $wp->query_vars['post_type'] != '') { |
|
505 | + if (!is_admin()) { |
|
506 | + $requested_post_type = $wp->query_vars['post_type']; |
|
507 | + // check if this post type is geodirectory post types |
|
508 | + $post_type_array = geodir_get_posttypes(); |
|
509 | 509 | |
510 | 510 | if (in_array($requested_post_type, $post_type_array)) { |
511 | - // now u can apply geodirectory related manipulation. |
|
512 | - } |
|
513 | - } |
|
514 | - } else { |
|
515 | - // check if a geodirectory taxonomy is set |
|
516 | - $gd_country = ''; |
|
517 | - $gd_region = ''; |
|
518 | - $gd_city = ''; |
|
511 | + // now u can apply geodirectory related manipulation. |
|
512 | + } |
|
513 | + } |
|
514 | + } else { |
|
515 | + // check if a geodirectory taxonomy is set |
|
516 | + $gd_country = ''; |
|
517 | + $gd_region = ''; |
|
518 | + $gd_city = ''; |
|
519 | 519 | |
520 | 520 | $is_geodir_taxonomy = false; |
521 | - $is_geodir_taxonomy_term = false; // the last term is real geodirectory taxonomy term or not |
|
522 | - $is_geodir_location_found = false; |
|
521 | + $is_geodir_taxonomy_term = false; // the last term is real geodirectory taxonomy term or not |
|
522 | + $is_geodir_location_found = false; |
|
523 | 523 | |
524 | 524 | $geodir_taxonomy = ''; |
525 | - $geodir_post_type = ''; |
|
526 | - $geodir_term = ''; |
|
527 | - $geodir_set_location_session = true; |
|
528 | - $geodir_taxonomis = geodir_get_taxonomies('', true); |
|
529 | - |
|
530 | - if(!empty($geodir_taxonomis)){ |
|
531 | - foreach ($geodir_taxonomis as $taxonomy) { |
|
532 | - if (array_key_exists($taxonomy, $wp->query_vars)) { |
|
533 | - $is_geodir_taxonomy = true; |
|
534 | - $geodir_taxonomy = $taxonomy; |
|
535 | - $geodir_post_type = str_replace('category', '', $taxonomy); |
|
536 | - $geodir_post_type = str_replace('_tags', '', $geodir_post_type); |
|
537 | - $geodir_term = $wp->query_vars[$geodir_taxonomy]; |
|
538 | - break; |
|
539 | - } |
|
540 | - } |
|
541 | - } |
|
542 | - |
|
543 | - // now get an array of all terms seperated by '/' |
|
544 | - $geodir_terms = explode('/', $geodir_term); |
|
545 | - $geodir_last_term = end($geodir_terms); |
|
546 | - |
|
547 | - if ($is_geodir_taxonomy) { // do all these only when it is a geodirectory taxonomy |
|
548 | - $wp->query_vars['post_type'] = $geodir_post_type; |
|
525 | + $geodir_post_type = ''; |
|
526 | + $geodir_term = ''; |
|
527 | + $geodir_set_location_session = true; |
|
528 | + $geodir_taxonomis = geodir_get_taxonomies('', true); |
|
529 | + |
|
530 | + if(!empty($geodir_taxonomis)){ |
|
531 | + foreach ($geodir_taxonomis as $taxonomy) { |
|
532 | + if (array_key_exists($taxonomy, $wp->query_vars)) { |
|
533 | + $is_geodir_taxonomy = true; |
|
534 | + $geodir_taxonomy = $taxonomy; |
|
535 | + $geodir_post_type = str_replace('category', '', $taxonomy); |
|
536 | + $geodir_post_type = str_replace('_tags', '', $geodir_post_type); |
|
537 | + $geodir_term = $wp->query_vars[$geodir_taxonomy]; |
|
538 | + break; |
|
539 | + } |
|
540 | + } |
|
541 | + } |
|
542 | + |
|
543 | + // now get an array of all terms seperated by '/' |
|
544 | + $geodir_terms = explode('/', $geodir_term); |
|
545 | + $geodir_last_term = end($geodir_terms); |
|
546 | + |
|
547 | + if ($is_geodir_taxonomy) { // do all these only when it is a geodirectory taxonomy |
|
548 | + $wp->query_vars['post_type'] = $geodir_post_type; |
|
549 | 549 | |
550 | 550 | // now check if last term is a post of geodirectory post types |
551 | 551 | $geodir_post = get_posts(array( |
@@ -594,196 +594,196 @@ discard block |
||
594 | 594 | //return ; |
595 | 595 | } |
596 | 596 | |
597 | - $geodir_location_terms = ''; |
|
598 | - // if last term is not a post then check if last term is a term of the specific texonomy or not |
|
599 | - if (geodir_term_exists($geodir_last_term, $geodir_taxonomy)) { |
|
600 | - $is_geodir_taxonomy_term = true; |
|
597 | + $geodir_location_terms = ''; |
|
598 | + // if last term is not a post then check if last term is a term of the specific texonomy or not |
|
599 | + if (geodir_term_exists($geodir_last_term, $geodir_taxonomy)) { |
|
600 | + $is_geodir_taxonomy_term = true; |
|
601 | 601 | |
602 | - $geodir_set_location_session = false; |
|
603 | - } |
|
602 | + $geodir_set_location_session = false; |
|
603 | + } |
|
604 | 604 | |
605 | 605 | |
606 | - // now check if there is location parts in the url or not |
|
607 | - if (get_option('geodir_add_location_url')) { |
|
606 | + // now check if there is location parts in the url or not |
|
607 | + if (get_option('geodir_add_location_url')) { |
|
608 | 608 | $default_location = geodir_get_default_location(); |
609 | 609 | |
610 | 610 | if ($geodir_show_location_url == 'all') { |
611 | - if (count($geodir_terms) >= 3) { |
|
612 | - $gd_country = urldecode($geodir_terms[0]); |
|
613 | - $gd_region = urldecode($geodir_terms[1]); |
|
614 | - $gd_city = urldecode($geodir_terms[2]); |
|
615 | - } else if (count($geodir_terms) >= 2) { |
|
616 | - $gd_country = urldecode($geodir_terms[0]); |
|
617 | - $gd_region = urldecode($geodir_terms[1]); |
|
618 | - } else if (count($geodir_terms) >= 1) { |
|
619 | - $gd_country = urldecode($geodir_terms[0]); |
|
620 | - } |
|
621 | - |
|
622 | - if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && |
|
623 | - geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) && |
|
624 | - geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city) |
|
625 | - ) |
|
626 | - $is_geodir_location_found = true; |
|
627 | - |
|
628 | - // if location has not been found for country , region and city then search for country and region only |
|
629 | - |
|
630 | - if (!$is_geodir_location_found) { |
|
631 | - $gd_city = ''; |
|
632 | - if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && |
|
633 | - geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) |
|
634 | - ) |
|
635 | - $is_geodir_location_found = true; |
|
636 | - |
|
637 | - } |
|
638 | - |
|
639 | - // if location has not been found for country , region then search for country only |
|
640 | - if (!$is_geodir_location_found) { |
|
641 | - $gd_city = ''; |
|
642 | - $gd_region = ''; |
|
643 | - if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country)) |
|
644 | - $is_geodir_location_found = true; |
|
645 | - } |
|
646 | - } else if ($geodir_show_location_url == 'country_city') { |
|
647 | - if (count($geodir_terms) >= 2) { |
|
648 | - $gd_country = urldecode($geodir_terms[0]); |
|
649 | - $gd_city = urldecode($geodir_terms[1]); |
|
650 | - } else if (count($geodir_terms) >= 1) { |
|
651 | - $gd_country = urldecode($geodir_terms[0]); |
|
652 | - } |
|
653 | - |
|
654 | - if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) |
|
655 | - $is_geodir_location_found = true; |
|
656 | - |
|
657 | - // if location has not been found for country and city then search for country only |
|
658 | - if (!$is_geodir_location_found) { |
|
659 | - $gd_city = ''; |
|
611 | + if (count($geodir_terms) >= 3) { |
|
612 | + $gd_country = urldecode($geodir_terms[0]); |
|
613 | + $gd_region = urldecode($geodir_terms[1]); |
|
614 | + $gd_city = urldecode($geodir_terms[2]); |
|
615 | + } else if (count($geodir_terms) >= 2) { |
|
616 | + $gd_country = urldecode($geodir_terms[0]); |
|
617 | + $gd_region = urldecode($geodir_terms[1]); |
|
618 | + } else if (count($geodir_terms) >= 1) { |
|
619 | + $gd_country = urldecode($geodir_terms[0]); |
|
620 | + } |
|
621 | + |
|
622 | + if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && |
|
623 | + geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) && |
|
624 | + geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city) |
|
625 | + ) |
|
626 | + $is_geodir_location_found = true; |
|
627 | + |
|
628 | + // if location has not been found for country , region and city then search for country and region only |
|
629 | + |
|
630 | + if (!$is_geodir_location_found) { |
|
631 | + $gd_city = ''; |
|
632 | + if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && |
|
633 | + geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) |
|
634 | + ) |
|
635 | + $is_geodir_location_found = true; |
|
636 | + |
|
637 | + } |
|
638 | + |
|
639 | + // if location has not been found for country , region then search for country only |
|
640 | + if (!$is_geodir_location_found) { |
|
641 | + $gd_city = ''; |
|
642 | + $gd_region = ''; |
|
643 | + if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country)) |
|
644 | + $is_geodir_location_found = true; |
|
645 | + } |
|
646 | + } else if ($geodir_show_location_url == 'country_city') { |
|
647 | + if (count($geodir_terms) >= 2) { |
|
648 | + $gd_country = urldecode($geodir_terms[0]); |
|
649 | + $gd_city = urldecode($geodir_terms[1]); |
|
650 | + } else if (count($geodir_terms) >= 1) { |
|
651 | + $gd_country = urldecode($geodir_terms[0]); |
|
652 | + } |
|
653 | + |
|
654 | + if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) |
|
655 | + $is_geodir_location_found = true; |
|
656 | + |
|
657 | + // if location has not been found for country and city then search for country only |
|
658 | + if (!$is_geodir_location_found) { |
|
659 | + $gd_city = ''; |
|
660 | 660 | |
661 | 661 | if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country)) |
662 | - $is_geodir_location_found = true; |
|
663 | - } |
|
664 | - } else if ($geodir_show_location_url == 'region_city') { |
|
665 | - if (count($geodir_terms) >= 2) { |
|
666 | - $gd_region = urldecode($geodir_terms[0]); |
|
667 | - $gd_city = urldecode($geodir_terms[1]); |
|
668 | - } else if (count($geodir_terms) >= 1) { |
|
669 | - $gd_region = urldecode($geodir_terms[0]); |
|
670 | - } |
|
671 | - |
|
672 | - if (geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) && geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) |
|
673 | - $is_geodir_location_found = true; |
|
674 | - |
|
675 | - // if location has not been found for region and city then search for region only |
|
676 | - if (!$is_geodir_location_found) { |
|
677 | - $gd_city = ''; |
|
662 | + $is_geodir_location_found = true; |
|
663 | + } |
|
664 | + } else if ($geodir_show_location_url == 'region_city') { |
|
665 | + if (count($geodir_terms) >= 2) { |
|
666 | + $gd_region = urldecode($geodir_terms[0]); |
|
667 | + $gd_city = urldecode($geodir_terms[1]); |
|
668 | + } else if (count($geodir_terms) >= 1) { |
|
669 | + $gd_region = urldecode($geodir_terms[0]); |
|
670 | + } |
|
671 | + |
|
672 | + if (geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) && geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) |
|
673 | + $is_geodir_location_found = true; |
|
674 | + |
|
675 | + // if location has not been found for region and city then search for region only |
|
676 | + if (!$is_geodir_location_found) { |
|
677 | + $gd_city = ''; |
|
678 | 678 | |
679 | 679 | if (geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region)) |
680 | - $is_geodir_location_found = true; |
|
681 | - } |
|
682 | - } else { |
|
683 | - $gd_city = $geodir_terms[0]; |
|
684 | - |
|
685 | - if (geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) { |
|
686 | - $is_geodir_location_found = true; |
|
687 | - $gd_region = $default_location->region_slug; |
|
688 | - $gd_country = $default_location->country_slug; |
|
689 | - } |
|
690 | - } |
|
691 | - // if location still not found then clear location related session variables |
|
692 | - if ($is_geodir_location_found && $geodir_set_location_session) { |
|
693 | - $gd_session->set('gd_multi_location', 1); |
|
694 | - $gd_session->set('gd_country', $gd_country); |
|
695 | - $gd_session->set('gd_region', $gd_region); |
|
696 | - $gd_session->set('gd_city', $gd_city); |
|
697 | - } |
|
698 | - |
|
699 | - if ($geodir_show_location_url == 'all') { |
|
680 | + $is_geodir_location_found = true; |
|
681 | + } |
|
682 | + } else { |
|
683 | + $gd_city = $geodir_terms[0]; |
|
684 | + |
|
685 | + if (geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) { |
|
686 | + $is_geodir_location_found = true; |
|
687 | + $gd_region = $default_location->region_slug; |
|
688 | + $gd_country = $default_location->country_slug; |
|
689 | + } |
|
690 | + } |
|
691 | + // if location still not found then clear location related session variables |
|
692 | + if ($is_geodir_location_found && $geodir_set_location_session) { |
|
693 | + $gd_session->set('gd_multi_location', 1); |
|
694 | + $gd_session->set('gd_country', $gd_country); |
|
695 | + $gd_session->set('gd_region', $gd_region); |
|
696 | + $gd_session->set('gd_city', $gd_city); |
|
697 | + } |
|
698 | + |
|
699 | + if ($geodir_show_location_url == 'all') { |
|
700 | 700 | } else if ($geodir_show_location_url == 'country_city') { |
701 | 701 | $gd_region = ''; |
702 | 702 | } else if ($geodir_show_location_url == 'region_city') { |
703 | 703 | $gd_country = ''; |
704 | 704 | } else { |
705 | 705 | $gd_country = ''; |
706 | - $gd_region = ''; |
|
706 | + $gd_region = ''; |
|
707 | 707 | } |
708 | 708 | |
709 | - if ($is_geodir_location_found) { |
|
710 | - $wp->query_vars['gd_country'] = $gd_country; |
|
711 | - $wp->query_vars['gd_region'] = $gd_region; |
|
712 | - $wp->query_vars['gd_city'] = $gd_city; |
|
713 | - } else { |
|
714 | - $gd_country = ''; |
|
715 | - $gd_region = ''; |
|
716 | - $gd_city = ''; |
|
717 | - } |
|
718 | - } |
|
719 | - |
|
720 | - $wp->query_vars[$geodir_taxonomy] = $geodir_term; |
|
721 | - // eliminate location related terms from taxonomy term |
|
722 | - if ($gd_country != '') |
|
723 | - $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_country) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
724 | - |
|
725 | - if ($gd_region != '') |
|
726 | - $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_region) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
727 | - |
|
728 | - if ($gd_city != '') |
|
729 | - $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_city) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
730 | - |
|
731 | - |
|
732 | - $wp->query_vars[$geodir_taxonomy] = str_replace('///', '', $wp->query_vars[$geodir_taxonomy]); |
|
733 | - $wp->query_vars[$geodir_taxonomy] = str_replace('//', '', $wp->query_vars[$geodir_taxonomy]); |
|
734 | - |
|
735 | - $wp->query_vars[$geodir_taxonomy] = trim($wp->query_vars[$geodir_taxonomy], '/'); |
|
736 | - |
|
737 | - if ($wp->query_vars[$geodir_taxonomy] == '') { |
|
738 | - unset($wp->query_vars[$geodir_taxonomy]); |
|
739 | - } else { |
|
740 | - if (!$is_geodir_taxonomy_term) { |
|
741 | - foreach ($wp->query_vars as $key => $vars) { |
|
742 | - unset($wp->query_vars[$key]); |
|
743 | - } |
|
744 | - $wp->query_vars['error'] = '404'; |
|
745 | - } |
|
746 | - } |
|
747 | - } |
|
748 | - } |
|
709 | + if ($is_geodir_location_found) { |
|
710 | + $wp->query_vars['gd_country'] = $gd_country; |
|
711 | + $wp->query_vars['gd_region'] = $gd_region; |
|
712 | + $wp->query_vars['gd_city'] = $gd_city; |
|
713 | + } else { |
|
714 | + $gd_country = ''; |
|
715 | + $gd_region = ''; |
|
716 | + $gd_city = ''; |
|
717 | + } |
|
718 | + } |
|
719 | + |
|
720 | + $wp->query_vars[$geodir_taxonomy] = $geodir_term; |
|
721 | + // eliminate location related terms from taxonomy term |
|
722 | + if ($gd_country != '') |
|
723 | + $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_country) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
724 | + |
|
725 | + if ($gd_region != '') |
|
726 | + $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_region) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
727 | + |
|
728 | + if ($gd_city != '') |
|
729 | + $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_city) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
730 | + |
|
731 | + |
|
732 | + $wp->query_vars[$geodir_taxonomy] = str_replace('///', '', $wp->query_vars[$geodir_taxonomy]); |
|
733 | + $wp->query_vars[$geodir_taxonomy] = str_replace('//', '', $wp->query_vars[$geodir_taxonomy]); |
|
734 | + |
|
735 | + $wp->query_vars[$geodir_taxonomy] = trim($wp->query_vars[$geodir_taxonomy], '/'); |
|
736 | + |
|
737 | + if ($wp->query_vars[$geodir_taxonomy] == '') { |
|
738 | + unset($wp->query_vars[$geodir_taxonomy]); |
|
739 | + } else { |
|
740 | + if (!$is_geodir_taxonomy_term) { |
|
741 | + foreach ($wp->query_vars as $key => $vars) { |
|
742 | + unset($wp->query_vars[$key]); |
|
743 | + } |
|
744 | + $wp->query_vars['error'] = '404'; |
|
745 | + } |
|
746 | + } |
|
747 | + } |
|
748 | + } |
|
749 | 749 | |
750 | 750 | // Unset location session if gd page and location not set. |
751 | 751 | if (isset($wp->query_vars['gd_is_geodir_page']) && !isset($wp->query_vars['gd_country'])) { |
752 | 752 | $gd_session->un_set(array('gd_multi_location', 'gd_city', 'gd_region', 'gd_country')); |
753 | 753 | } |
754 | 754 | |
755 | - if ($gd_session->get('gd_multi_location') == 1) { |
|
756 | - $wp->query_vars['gd_country'] = $gd_session->get('gd_country'); |
|
757 | - $wp->query_vars['gd_region'] = $gd_session->get('gd_region'); |
|
758 | - $wp->query_vars['gd_city'] = $gd_session->get('gd_city'); |
|
759 | - } |
|
755 | + if ($gd_session->get('gd_multi_location') == 1) { |
|
756 | + $wp->query_vars['gd_country'] = $gd_session->get('gd_country'); |
|
757 | + $wp->query_vars['gd_region'] = $gd_session->get('gd_region'); |
|
758 | + $wp->query_vars['gd_city'] = $gd_session->get('gd_city'); |
|
759 | + } |
|
760 | 760 | |
761 | - // now check if there is location parts in the url or not |
|
762 | - if (get_option('geodir_add_location_url')) { |
|
761 | + // now check if there is location parts in the url or not |
|
762 | + if (get_option('geodir_add_location_url')) { |
|
763 | 763 | if ($geodir_show_location_url == 'all') { |
764 | 764 | } else if ($geodir_show_location_url == 'country_city') { |
765 | 765 | if (isset($wp->query_vars['gd_region'])) |
766 | - $wp->query_vars['gd_region'] = ''; |
|
766 | + $wp->query_vars['gd_region'] = ''; |
|
767 | 767 | } else if ($geodir_show_location_url == 'region_city') { |
768 | 768 | if (isset($wp->query_vars['gd_country'])) |
769 | - $wp->query_vars['gd_country'] = ''; |
|
769 | + $wp->query_vars['gd_country'] = ''; |
|
770 | 770 | } else { |
771 | 771 | if (isset($wp->query_vars['gd_country'])) |
772 | - $wp->query_vars['gd_country'] = ''; |
|
772 | + $wp->query_vars['gd_country'] = ''; |
|
773 | 773 | |
774 | - if (isset($wp->query_vars['gd_region'])) |
|
775 | - $wp->query_vars['gd_region'] = ''; |
|
774 | + if (isset($wp->query_vars['gd_region'])) |
|
775 | + $wp->query_vars['gd_region'] = ''; |
|
776 | 776 | } |
777 | - } else { |
|
778 | - if (isset($wp->query_vars['gd_country'])) |
|
779 | - $wp->query_vars['gd_country'] = ''; |
|
777 | + } else { |
|
778 | + if (isset($wp->query_vars['gd_country'])) |
|
779 | + $wp->query_vars['gd_country'] = ''; |
|
780 | 780 | |
781 | - if (isset($wp->query_vars['gd_region'])) |
|
782 | - $wp->query_vars['gd_region'] = ''; |
|
781 | + if (isset($wp->query_vars['gd_region'])) |
|
782 | + $wp->query_vars['gd_region'] = ''; |
|
783 | 783 | |
784 | - if (isset($wp->query_vars['gd_city'])) |
|
785 | - $wp->query_vars['gd_city'] = ''; |
|
786 | - } |
|
784 | + if (isset($wp->query_vars['gd_city'])) |
|
785 | + $wp->query_vars['gd_city'] = ''; |
|
786 | + } |
|
787 | 787 | } |
788 | 788 | |
789 | 789 | /** |
@@ -797,24 +797,24 @@ discard block |
||
797 | 797 | */ |
798 | 798 | function geodir_custom_post_status() |
799 | 799 | { |
800 | - // Virtual Page Status |
|
801 | - register_post_status('virtual', array( |
|
802 | - 'label' => _x('Virtual', 'page', 'geodirectory'), |
|
803 | - 'public' => true, |
|
804 | - 'exclude_from_search' => true, |
|
805 | - 'show_in_admin_all_list' => true, |
|
806 | - 'show_in_admin_status_list' => true, |
|
807 | - 'label_count' => _n_noop('Virtual <span class="count">(%s)</span>', 'Virtual <span class="count">(%s)</span>', 'geodirectory'), |
|
808 | - )); |
|
809 | - |
|
810 | - /** |
|
811 | - * Called after we register the custom post status 'Virtual'. |
|
812 | - * |
|
813 | - * Can be use to add more post statuses. |
|
814 | - * |
|
815 | - * @since 1.0.0 |
|
816 | - */ |
|
817 | - do_action('geodir_custom_post_status'); |
|
800 | + // Virtual Page Status |
|
801 | + register_post_status('virtual', array( |
|
802 | + 'label' => _x('Virtual', 'page', 'geodirectory'), |
|
803 | + 'public' => true, |
|
804 | + 'exclude_from_search' => true, |
|
805 | + 'show_in_admin_all_list' => true, |
|
806 | + 'show_in_admin_status_list' => true, |
|
807 | + 'label_count' => _n_noop('Virtual <span class="count">(%s)</span>', 'Virtual <span class="count">(%s)</span>', 'geodirectory'), |
|
808 | + )); |
|
809 | + |
|
810 | + /** |
|
811 | + * Called after we register the custom post status 'Virtual'. |
|
812 | + * |
|
813 | + * Can be use to add more post statuses. |
|
814 | + * |
|
815 | + * @since 1.0.0 |
|
816 | + */ |
|
817 | + do_action('geodir_custom_post_status'); |
|
818 | 818 | } |
819 | 819 | |
820 | 820 | /** |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | */ |
830 | 830 | function geodir_get_term_link($termlink, $term, $taxonomy) |
831 | 831 | { |
832 | - return geodir_term_link($termlink, $term, $taxonomy); // taxonomy_functions.php |
|
832 | + return geodir_term_link($termlink, $term, $taxonomy); // taxonomy_functions.php |
|
833 | 833 | } |
834 | 834 | |
835 | 835 | /** |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | */ |
844 | 844 | function geodir_get_posttype_link($link, $post_type) |
845 | 845 | { |
846 | - return geodir_posttype_link($link, $post_type); // taxonomy_functions.php |
|
846 | + return geodir_posttype_link($link, $post_type); // taxonomy_functions.php |
|
847 | 847 | } |
848 | 848 | |
849 | 849 | /** |
@@ -858,13 +858,13 @@ discard block |
||
858 | 858 | */ |
859 | 859 | function exclude_from_wp_list_pages($exclude_array) |
860 | 860 | { |
861 | - $pages_ids = array(); |
|
862 | - $pages_array = get_posts(array('post_type' => 'page', 'post_status' => 'virtual')); |
|
863 | - foreach ($pages_array as $page) { |
|
864 | - $pages_ids[] = $page->ID; |
|
865 | - } |
|
866 | - $exclude_array = $exclude_array + $pages_ids; |
|
867 | - return $exclude_array; |
|
861 | + $pages_ids = array(); |
|
862 | + $pages_array = get_posts(array('post_type' => 'page', 'post_status' => 'virtual')); |
|
863 | + foreach ($pages_array as $page) { |
|
864 | + $pages_ids[] = $page->ID; |
|
865 | + } |
|
866 | + $exclude_array = $exclude_array + $pages_ids; |
|
867 | + return $exclude_array; |
|
868 | 868 | } |
869 | 869 | |
870 | 870 | /** |
@@ -877,8 +877,8 @@ discard block |
||
877 | 877 | */ |
878 | 878 | function geodir_exclude_page($query) |
879 | 879 | { |
880 | - add_filter('posts_where', 'geodir_exclude_page_where', 100); |
|
881 | - return $query; |
|
880 | + add_filter('posts_where', 'geodir_exclude_page_where', 100); |
|
881 | + return $query; |
|
882 | 882 | } |
883 | 883 | |
884 | 884 | /** |
@@ -893,11 +893,11 @@ discard block |
||
893 | 893 | */ |
894 | 894 | function geodir_exclude_page_where($where) |
895 | 895 | { |
896 | - global $wpdb; |
|
897 | - if (is_admin()) |
|
898 | - $where .= " AND $wpdb->posts.post_status != 'virtual'"; |
|
896 | + global $wpdb; |
|
897 | + if (is_admin()) |
|
898 | + $where .= " AND $wpdb->posts.post_status != 'virtual'"; |
|
899 | 899 | |
900 | - return $where; |
|
900 | + return $where; |
|
901 | 901 | } |
902 | 902 | |
903 | 903 | /** |
@@ -912,20 +912,20 @@ discard block |
||
912 | 912 | * @return mixed The taxonomy option value. |
913 | 913 | */ |
914 | 914 | function geodir_wpseo_taxonomy_meta( $value, $option = '' ) { |
915 | - global $wp_query; |
|
915 | + global $wp_query; |
|
916 | 916 | |
917 | - if ( !empty( $value ) && ( is_category() || is_tax() ) ) { |
|
918 | - $term = $wp_query->get_queried_object(); |
|
917 | + if ( !empty( $value ) && ( is_category() || is_tax() ) ) { |
|
918 | + $term = $wp_query->get_queried_object(); |
|
919 | 919 | |
920 | - if ( !empty( $term->term_id ) && !empty( $term->taxonomy ) && isset( $value[$term->taxonomy][$term->term_id] ) && in_array( str_replace( 'category', '', $term->taxonomy ), geodir_get_posttypes() ) ) { |
|
921 | - $image = geodir_get_default_catimage( $term->term_id, str_replace( 'category', '', $term->taxonomy ) ); |
|
920 | + if ( !empty( $term->term_id ) && !empty( $term->taxonomy ) && isset( $value[$term->taxonomy][$term->term_id] ) && in_array( str_replace( 'category', '', $term->taxonomy ), geodir_get_posttypes() ) ) { |
|
921 | + $image = geodir_get_default_catimage( $term->term_id, str_replace( 'category', '', $term->taxonomy ) ); |
|
922 | 922 | |
923 | - if ( !empty( $image['src'] ) ) { |
|
924 | - $value[$term->taxonomy][$term->term_id]['wpseo_twitter-image'] = $image['src']; |
|
925 | - $value[$term->taxonomy][$term->term_id]['wpseo_opengraph-image'] = $image['src']; |
|
926 | - } |
|
927 | - } |
|
928 | - } |
|
929 | - return $value; |
|
923 | + if ( !empty( $image['src'] ) ) { |
|
924 | + $value[$term->taxonomy][$term->term_id]['wpseo_twitter-image'] = $image['src']; |
|
925 | + $value[$term->taxonomy][$term->term_id]['wpseo_opengraph-image'] = $image['src']; |
|
926 | + } |
|
927 | + } |
|
928 | + } |
|
929 | + return $value; |
|
930 | 930 | } |
931 | 931 | add_filter( 'option_wpseo_taxonomy_meta', 'geodir_wpseo_taxonomy_meta', 10, 2 ); |
@@ -11,146 +11,146 @@ discard block |
||
11 | 11 | //include the main class file |
12 | 12 | require_once("Tax-meta-class.php"); |
13 | 13 | function geodir_set_tax_meta_fields() { |
14 | - /* |
|
14 | + /* |
|
15 | 15 | * prefix of meta keys, optional |
16 | 16 | * use underscore (_) at the beginning to make keys hidden, for example $prefix = '_ba_'; |
17 | 17 | * you also can make prefix empty to disable it |
18 | 18 | * |
19 | 19 | */ |
20 | 20 | |
21 | - $prefix = 'ct_'; |
|
22 | - /* |
|
21 | + $prefix = 'ct_'; |
|
22 | + /* |
|
23 | 23 | * configure your meta box |
24 | 24 | */ |
25 | 25 | |
26 | - $config = array( |
|
27 | - 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | - 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | - 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | - 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | - 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | - 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
33 | - 'use_with_theme' => true //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). |
|
34 | - ); |
|
26 | + $config = array( |
|
27 | + 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | + 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | + 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | + 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | + 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | + 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
33 | + 'use_with_theme' => true //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). |
|
34 | + ); |
|
35 | 35 | |
36 | 36 | |
37 | - /* |
|
37 | + /* |
|
38 | 38 | * Initiate your meta box |
39 | 39 | */ |
40 | - $my_meta = new Geodir_Tax_Meta_Class($config); |
|
41 | - $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | - $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | - $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
44 | - /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML |
|
40 | + $my_meta = new Geodir_Tax_Meta_Class($config); |
|
41 | + $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | + $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | + $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
44 | + /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML |
|
45 | 45 | |
46 | - $my_meta->addSelect($prefix . 'cat_schema', |
|
47 | - /* |
|
46 | + $my_meta->addSelect($prefix . 'cat_schema', |
|
47 | + /* |
|
48 | 48 | * Allows you to add/filter the cat schema types. |
49 | 49 | * |
50 | 50 | * @since 1.5.7 |
51 | 51 | */ |
52 | - apply_filters('geodir_cat_schemas',array( |
|
53 | - '' => __('Default (LocalBusiness)', 'geodirectory'), |
|
54 | - 'AccountingService' => 'AccountingService', |
|
55 | - 'Attorney' => 'Attorney', |
|
56 | - 'AutoBodyShop' => 'AutoBodyShop', |
|
57 | - 'AutoDealer' => 'AutoDealer', |
|
58 | - 'AutoPartsStore' => 'AutoPartsStore', |
|
59 | - 'AutoRental' => 'AutoRental', |
|
60 | - 'AutoRepair' => 'AutoRepair', |
|
61 | - 'AutoWash' => 'AutoWash', |
|
62 | - 'Bakery' => 'Bakery', |
|
63 | - 'BarOrPub' => 'BarOrPub', |
|
64 | - 'BeautySalon' => 'BeautySalon', |
|
65 | - 'BedAndBreakfast' => 'BedAndBreakfast', |
|
66 | - 'BikeStore' => 'BikeStore', |
|
67 | - 'BookStore' => 'BookStore', |
|
68 | - 'CafeOrCoffeeShop' => 'CafeOrCoffeeShop', |
|
69 | - 'Campground' => 'Campground', |
|
70 | - 'ChildCare' => 'ChildCare', |
|
71 | - 'ClothingStore' => 'ClothingStore', |
|
72 | - 'ComputerStore' => 'ComputerStore', |
|
73 | - 'DaySpa' => 'DaySpa', |
|
74 | - 'Dentist' => 'Dentist', |
|
75 | - 'DryCleaningOrLaundry' => 'DryCleaningOrLaundry', |
|
76 | - 'Electrician' => 'Electrician', |
|
77 | - 'ElectronicsStore' => 'ElectronicsStore', |
|
78 | - 'EmergencyService' => 'EmergencyService', |
|
79 | - 'EntertainmentBusiness' => 'EntertainmentBusiness', |
|
80 | - 'Event' => 'Event', |
|
81 | - 'EventVenue' => 'EventVenue', |
|
82 | - 'ExerciseGym' => 'ExerciseGym', |
|
83 | - 'FinancialService' => 'FinancialService', |
|
84 | - 'Florist' => 'Florist', |
|
85 | - 'FoodEstablishment' => 'FoodEstablishment', |
|
86 | - 'FurnitureStore' => 'FurnitureStore', |
|
87 | - 'GardenStore' => 'GardenStore', |
|
88 | - 'GeneralContractor' => 'GeneralContractor', |
|
89 | - 'GolfCourse' => 'GolfCourse', |
|
90 | - 'HairSalon' => 'HairSalon', |
|
91 | - 'HardwareStore' => 'HardwareStore', |
|
92 | - 'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness', |
|
93 | - 'HobbyShop' => 'HobbyShop', |
|
94 | - 'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness', |
|
95 | - 'HomeGoodsStore' => 'HomeGoodsStore', |
|
96 | - 'Hospital' => 'Hospital', |
|
97 | - 'Hostel' => 'Hostel', |
|
98 | - 'Hotel' => 'Hotel', |
|
99 | - 'HousePainter' => 'HousePainter', |
|
100 | - 'HVACBusiness' => 'HVACBusiness', |
|
101 | - 'InsuranceAgency' => 'InsuranceAgency', |
|
102 | - 'JewelryStore' => 'JewelryStore', |
|
103 | - 'LiquorStore' => 'LiquorStore', |
|
104 | - 'Locksmith' => 'Locksmith', |
|
105 | - 'LodgingBusiness' => 'LodgingBusiness', |
|
106 | - 'MedicalClinic' => 'MedicalClinic', |
|
107 | - 'MensClothingStore' => 'MensClothingStore', |
|
108 | - 'MobilePhoneStore' => 'MobilePhoneStore', |
|
109 | - 'Motel' => 'Motel', |
|
110 | - 'MotorcycleDealer' => 'MotorcycleDealer', |
|
111 | - 'MotorcycleRepair' => 'MotorcycleRepair', |
|
112 | - 'MovingCompany' => 'MovingCompany', |
|
113 | - 'MusicStore' => 'MusicStore', |
|
114 | - 'NailSalon' => 'NailSalon', |
|
115 | - 'NightClub' => 'NightClub', |
|
116 | - 'Notary' => 'Notary', |
|
117 | - 'OfficeEquipmentStore' => 'OfficeEquipmentStore', |
|
118 | - 'Optician' => 'Optician', |
|
119 | - 'PetStore' => 'PetStore', |
|
120 | - 'Physician' => 'Physician', |
|
121 | - 'Plumber' => 'Plumber', |
|
122 | - 'ProfessionalService' => 'ProfessionalService', |
|
123 | - 'RealEstateAgent' => 'RealEstateAgent', |
|
124 | - 'Residence' => 'Residence', |
|
125 | - 'Restaurant' => 'Restaurant', |
|
126 | - 'RoofingContractor' => 'RoofingContractor', |
|
127 | - 'RVPark' => 'RVPark', |
|
128 | - 'School' => 'School', |
|
129 | - 'SelfStorage' => 'SelfStorage', |
|
130 | - 'ShoeStore' => 'ShoeStore', |
|
131 | - 'SkiResort' => 'SkiResort', |
|
132 | - 'SportingGoodsStore' => 'SportingGoodsStore', |
|
133 | - 'SportsClub' => 'SportsClub', |
|
134 | - 'Store' => 'Store', |
|
135 | - 'TattooParlor' => 'TattooParlor', |
|
136 | - 'Taxi' => 'Taxi', |
|
137 | - 'TennisComplex' => 'TennisComplex', |
|
138 | - 'TireShop' => 'TireShop', |
|
139 | - 'TouristAttraction' => 'TouristAttraction', |
|
140 | - 'ToyStore' => 'ToyStore', |
|
141 | - 'TravelAgency' => 'TravelAgency', |
|
142 | - //'VacationRentals' => 'VacationRentals', // Not recognised by google yet |
|
143 | - 'VeterinaryCare' => 'VeterinaryCare', |
|
144 | - 'WholesaleStore' => 'WholesaleStore', |
|
145 | - 'Winery' => 'Winery' |
|
146 | - )), |
|
147 | - array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2'))); |
|
52 | + apply_filters('geodir_cat_schemas',array( |
|
53 | + '' => __('Default (LocalBusiness)', 'geodirectory'), |
|
54 | + 'AccountingService' => 'AccountingService', |
|
55 | + 'Attorney' => 'Attorney', |
|
56 | + 'AutoBodyShop' => 'AutoBodyShop', |
|
57 | + 'AutoDealer' => 'AutoDealer', |
|
58 | + 'AutoPartsStore' => 'AutoPartsStore', |
|
59 | + 'AutoRental' => 'AutoRental', |
|
60 | + 'AutoRepair' => 'AutoRepair', |
|
61 | + 'AutoWash' => 'AutoWash', |
|
62 | + 'Bakery' => 'Bakery', |
|
63 | + 'BarOrPub' => 'BarOrPub', |
|
64 | + 'BeautySalon' => 'BeautySalon', |
|
65 | + 'BedAndBreakfast' => 'BedAndBreakfast', |
|
66 | + 'BikeStore' => 'BikeStore', |
|
67 | + 'BookStore' => 'BookStore', |
|
68 | + 'CafeOrCoffeeShop' => 'CafeOrCoffeeShop', |
|
69 | + 'Campground' => 'Campground', |
|
70 | + 'ChildCare' => 'ChildCare', |
|
71 | + 'ClothingStore' => 'ClothingStore', |
|
72 | + 'ComputerStore' => 'ComputerStore', |
|
73 | + 'DaySpa' => 'DaySpa', |
|
74 | + 'Dentist' => 'Dentist', |
|
75 | + 'DryCleaningOrLaundry' => 'DryCleaningOrLaundry', |
|
76 | + 'Electrician' => 'Electrician', |
|
77 | + 'ElectronicsStore' => 'ElectronicsStore', |
|
78 | + 'EmergencyService' => 'EmergencyService', |
|
79 | + 'EntertainmentBusiness' => 'EntertainmentBusiness', |
|
80 | + 'Event' => 'Event', |
|
81 | + 'EventVenue' => 'EventVenue', |
|
82 | + 'ExerciseGym' => 'ExerciseGym', |
|
83 | + 'FinancialService' => 'FinancialService', |
|
84 | + 'Florist' => 'Florist', |
|
85 | + 'FoodEstablishment' => 'FoodEstablishment', |
|
86 | + 'FurnitureStore' => 'FurnitureStore', |
|
87 | + 'GardenStore' => 'GardenStore', |
|
88 | + 'GeneralContractor' => 'GeneralContractor', |
|
89 | + 'GolfCourse' => 'GolfCourse', |
|
90 | + 'HairSalon' => 'HairSalon', |
|
91 | + 'HardwareStore' => 'HardwareStore', |
|
92 | + 'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness', |
|
93 | + 'HobbyShop' => 'HobbyShop', |
|
94 | + 'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness', |
|
95 | + 'HomeGoodsStore' => 'HomeGoodsStore', |
|
96 | + 'Hospital' => 'Hospital', |
|
97 | + 'Hostel' => 'Hostel', |
|
98 | + 'Hotel' => 'Hotel', |
|
99 | + 'HousePainter' => 'HousePainter', |
|
100 | + 'HVACBusiness' => 'HVACBusiness', |
|
101 | + 'InsuranceAgency' => 'InsuranceAgency', |
|
102 | + 'JewelryStore' => 'JewelryStore', |
|
103 | + 'LiquorStore' => 'LiquorStore', |
|
104 | + 'Locksmith' => 'Locksmith', |
|
105 | + 'LodgingBusiness' => 'LodgingBusiness', |
|
106 | + 'MedicalClinic' => 'MedicalClinic', |
|
107 | + 'MensClothingStore' => 'MensClothingStore', |
|
108 | + 'MobilePhoneStore' => 'MobilePhoneStore', |
|
109 | + 'Motel' => 'Motel', |
|
110 | + 'MotorcycleDealer' => 'MotorcycleDealer', |
|
111 | + 'MotorcycleRepair' => 'MotorcycleRepair', |
|
112 | + 'MovingCompany' => 'MovingCompany', |
|
113 | + 'MusicStore' => 'MusicStore', |
|
114 | + 'NailSalon' => 'NailSalon', |
|
115 | + 'NightClub' => 'NightClub', |
|
116 | + 'Notary' => 'Notary', |
|
117 | + 'OfficeEquipmentStore' => 'OfficeEquipmentStore', |
|
118 | + 'Optician' => 'Optician', |
|
119 | + 'PetStore' => 'PetStore', |
|
120 | + 'Physician' => 'Physician', |
|
121 | + 'Plumber' => 'Plumber', |
|
122 | + 'ProfessionalService' => 'ProfessionalService', |
|
123 | + 'RealEstateAgent' => 'RealEstateAgent', |
|
124 | + 'Residence' => 'Residence', |
|
125 | + 'Restaurant' => 'Restaurant', |
|
126 | + 'RoofingContractor' => 'RoofingContractor', |
|
127 | + 'RVPark' => 'RVPark', |
|
128 | + 'School' => 'School', |
|
129 | + 'SelfStorage' => 'SelfStorage', |
|
130 | + 'ShoeStore' => 'ShoeStore', |
|
131 | + 'SkiResort' => 'SkiResort', |
|
132 | + 'SportingGoodsStore' => 'SportingGoodsStore', |
|
133 | + 'SportsClub' => 'SportsClub', |
|
134 | + 'Store' => 'Store', |
|
135 | + 'TattooParlor' => 'TattooParlor', |
|
136 | + 'Taxi' => 'Taxi', |
|
137 | + 'TennisComplex' => 'TennisComplex', |
|
138 | + 'TireShop' => 'TireShop', |
|
139 | + 'TouristAttraction' => 'TouristAttraction', |
|
140 | + 'ToyStore' => 'ToyStore', |
|
141 | + 'TravelAgency' => 'TravelAgency', |
|
142 | + //'VacationRentals' => 'VacationRentals', // Not recognised by google yet |
|
143 | + 'VeterinaryCare' => 'VeterinaryCare', |
|
144 | + 'WholesaleStore' => 'WholesaleStore', |
|
145 | + 'Winery' => 'Winery' |
|
146 | + )), |
|
147 | + array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2'))); |
|
148 | 148 | |
149 | - // Finish Meta Box Declaration |
|
150 | - $my_meta->Finish(); |
|
149 | + // Finish Meta Box Declaration |
|
150 | + $my_meta->Finish(); |
|
151 | 151 | } |
152 | 152 | if ( is_admin() ) { |
153 | - add_action( 'init', 'geodir_set_tax_meta_fields', 10 ); |
|
153 | + add_action( 'init', 'geodir_set_tax_meta_fields', 10 ); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -159,86 +159,86 @@ discard block |
||
159 | 159 | ############################################################## |
160 | 160 | $gd_taxonomies = geodir_get_taxonomies(); |
161 | 161 | if (!empty($gd_taxonomies)) { |
162 | - foreach ($gd_taxonomies as $gd_taxonomy) { |
|
162 | + foreach ($gd_taxonomies as $gd_taxonomy) { |
|
163 | 163 | |
164 | - add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2); |
|
165 | - add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3); |
|
164 | + add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2); |
|
165 | + add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3); |
|
166 | 166 | |
167 | - } |
|
167 | + } |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | function addCat_column($columns) |
171 | 171 | { |
172 | - if (isset($columns['description']) && $posts = $columns['description']) { |
|
173 | - unset($columns['description']); |
|
174 | - } |
|
172 | + if (isset($columns['description']) && $posts = $columns['description']) { |
|
173 | + unset($columns['description']); |
|
174 | + } |
|
175 | 175 | |
176 | - $columns['cat_icon'] = 'Icon'; |
|
177 | - $columns['cat_default_img'] = __('Default Image', 'geodirectory'); |
|
178 | - $columns['cat_ID_num'] = __('Cat ID', 'geodirectory'); |
|
179 | - return $columns; |
|
176 | + $columns['cat_icon'] = 'Icon'; |
|
177 | + $columns['cat_default_img'] = __('Default Image', 'geodirectory'); |
|
178 | + $columns['cat_ID_num'] = __('Cat ID', 'geodirectory'); |
|
179 | + return $columns; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | ############################################################# |
183 | 183 | function manage_category_custom_fields($deprecated, $column_name, $term_id) |
184 | 184 | { |
185 | - if ($column_name == 'cat_ID_num') |
|
186 | - echo $term_id; |
|
185 | + if ($column_name == 'cat_ID_num') |
|
186 | + echo $term_id; |
|
187 | 187 | |
188 | - if ($column_name == 'cat_icon') { |
|
189 | - $term_icon_url = geodir_get_tax_meta($term_id, 'ct_cat_icon'); |
|
188 | + if ($column_name == 'cat_icon') { |
|
189 | + $term_icon_url = geodir_get_tax_meta($term_id, 'ct_cat_icon'); |
|
190 | 190 | |
191 | - if ($term_icon_url != '') { |
|
192 | - $file_info = pathinfo($term_icon_url['src']); |
|
191 | + if ($term_icon_url != '') { |
|
192 | + $file_info = pathinfo($term_icon_url['src']); |
|
193 | 193 | |
194 | - if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') { |
|
195 | - $sub_dir = $file_info['dirname']; |
|
196 | - } else { |
|
197 | - $sub_dir = ''; |
|
198 | - } |
|
194 | + if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') { |
|
195 | + $sub_dir = $file_info['dirname']; |
|
196 | + } else { |
|
197 | + $sub_dir = ''; |
|
198 | + } |
|
199 | 199 | |
200 | - $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
201 | - $uploads_baseurl = $uploads['baseurl']; |
|
202 | - $uploads_path = $uploads['path']; |
|
200 | + $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
201 | + $uploads_baseurl = $uploads['baseurl']; |
|
202 | + $uploads_path = $uploads['path']; |
|
203 | 203 | |
204 | - $file_name = $file_info['basename']; |
|
204 | + $file_name = $file_info['basename']; |
|
205 | 205 | |
206 | - if (strpos($sub_dir, 'https://') !== false) { |
|
207 | - $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
208 | - } else { |
|
209 | - $uploads['baseurl'] = str_replace('https://', 'http://', $uploads['baseurl']); |
|
210 | - } |
|
211 | - $sub_dir = str_replace($uploads['baseurl'], '', $sub_dir); |
|
206 | + if (strpos($sub_dir, 'https://') !== false) { |
|
207 | + $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
208 | + } else { |
|
209 | + $uploads['baseurl'] = str_replace('https://', 'http://', $uploads['baseurl']); |
|
210 | + } |
|
211 | + $sub_dir = str_replace($uploads['baseurl'], '', $sub_dir); |
|
212 | 212 | |
213 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
213 | + $uploads_url = $uploads_baseurl . $sub_dir; |
|
214 | 214 | |
215 | - $term_icon_url['src'] = $uploads_url . '/' . $file_name; |
|
216 | - echo '<img src="' . $term_icon_url['src'] . '" />'; |
|
217 | - } |
|
218 | - } |
|
215 | + $term_icon_url['src'] = $uploads_url . '/' . $file_name; |
|
216 | + echo '<img src="' . $term_icon_url['src'] . '" />'; |
|
217 | + } |
|
218 | + } |
|
219 | 219 | |
220 | - if ($column_name == 'cat_default_img') { |
|
221 | - $cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img'); |
|
222 | - if ($cat_default_img != '') |
|
223 | - echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
220 | + if ($column_name == 'cat_default_img') { |
|
221 | + $cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img'); |
|
222 | + if ($cat_default_img != '') |
|
223 | + echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
224 | 224 | |
225 | - } |
|
225 | + } |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | function geodir_get_default_catimage($term_id, $post_type = 'gd_place') |
229 | 229 | { |
230 | 230 | |
231 | - if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) |
|
232 | - return $cat_default_img; |
|
233 | - else |
|
234 | - return false; |
|
231 | + if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) |
|
232 | + return $cat_default_img; |
|
233 | + else |
|
234 | + return false; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | //Clear custom fields |
238 | 238 | add_action('in_admin_footer', 'geodir_tax_meta_clear_custom_field'); |
239 | 239 | function geodir_tax_meta_clear_custom_field() { |
240 | - if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])): |
|
241 | - ?> |
|
240 | + if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])): |
|
241 | + ?> |
|
242 | 242 | <script type="text/javascript"> |
243 | 243 | jQuery(document).ready(function () { |
244 | 244 | jQuery('#addtag #submit').click(function () { |
@@ -267,5 +267,5 @@ discard block |
||
267 | 267 | }); |
268 | 268 | </script> |
269 | 269 | <?php |
270 | - endif; |
|
270 | + endif; |
|
271 | 271 | } |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | */ |
10 | 10 | function geodir_get_current_city_lat() |
11 | 11 | { |
12 | - $location = geodir_get_default_location(); |
|
13 | - $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : '39.952484'; |
|
12 | + $location = geodir_get_default_location(); |
|
13 | + $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : '39.952484'; |
|
14 | 14 | |
15 | - return $lat; |
|
15 | + return $lat; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function geodir_get_current_city_lng() |
27 | 27 | { |
28 | - $location = geodir_get_default_location(); |
|
29 | - $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : '-75.163786'; |
|
30 | - return $lng; |
|
28 | + $location = geodir_get_default_location(); |
|
29 | + $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : '-75.163786'; |
|
30 | + return $lng; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | */ |
41 | 41 | function geodir_get_default_location() |
42 | 42 | { |
43 | - /** |
|
44 | - * Filter the default location. |
|
45 | - * |
|
46 | - * @since 1.0.0 |
|
47 | - * @package GeoDirectory |
|
48 | - * |
|
49 | - * @param string $location_result The default location object. |
|
50 | - */ |
|
51 | - return $location_result = apply_filters('geodir_get_default_location', get_option('geodir_default_location')); |
|
43 | + /** |
|
44 | + * Filter the default location. |
|
45 | + * |
|
46 | + * @since 1.0.0 |
|
47 | + * @package GeoDirectory |
|
48 | + * |
|
49 | + * @param string $location_result The default location object. |
|
50 | + */ |
|
51 | + return $location_result = apply_filters('geodir_get_default_location', get_option('geodir_default_location')); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | */ |
61 | 61 | function geodir_is_default_location_set() |
62 | 62 | { |
63 | - $default_location = geodir_get_default_location(); |
|
64 | - if (!empty($default_location)) |
|
65 | - return true; |
|
66 | - else |
|
67 | - return false; |
|
63 | + $default_location = geodir_get_default_location(); |
|
64 | + if (!empty($default_location)) |
|
65 | + return true; |
|
66 | + else |
|
67 | + return false; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -78,15 +78,15 @@ discard block |
||
78 | 78 | function create_location_slug($location_string) |
79 | 79 | { |
80 | 80 | |
81 | - /** |
|
82 | - * Filter the location slug. |
|
83 | - * |
|
84 | - * @since 1.0.0 |
|
85 | - * @package GeoDirectory |
|
86 | - * |
|
87 | - * @param string $location_string Sanitized location string. |
|
88 | - */ |
|
89 | - return urldecode(apply_filters('geodir_location_slug_check', sanitize_title($location_string))); |
|
81 | + /** |
|
82 | + * Filter the location slug. |
|
83 | + * |
|
84 | + * @since 1.0.0 |
|
85 | + * @package GeoDirectory |
|
86 | + * |
|
87 | + * @param string $location_string Sanitized location string. |
|
88 | + */ |
|
89 | + return urldecode(apply_filters('geodir_location_slug_check', sanitize_title($location_string))); |
|
90 | 90 | |
91 | 91 | } |
92 | 92 | |
@@ -100,15 +100,15 @@ discard block |
||
100 | 100 | */ |
101 | 101 | function geodir_get_location($id = '') |
102 | 102 | { |
103 | - /** |
|
104 | - * Filter the location information. |
|
105 | - * |
|
106 | - * @since 1.0.0 |
|
107 | - * @package GeoDirectory |
|
108 | - * |
|
109 | - * @param string $id The location ID. |
|
110 | - */ |
|
111 | - return $location_result = apply_filters('geodir_get_location_by_id', get_option('geodir_default_location'), $id); |
|
103 | + /** |
|
104 | + * Filter the location information. |
|
105 | + * |
|
106 | + * @since 1.0.0 |
|
107 | + * @package GeoDirectory |
|
108 | + * |
|
109 | + * @param string $id The location ID. |
|
110 | + */ |
|
111 | + return $location_result = apply_filters('geodir_get_location_by_id', get_option('geodir_default_location'), $id); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -122,28 +122,28 @@ discard block |
||
122 | 122 | */ |
123 | 123 | function geodir_get_country_dl($post_country = '', $prefix = '') |
124 | 124 | { |
125 | - global $wpdb; |
|
125 | + global $wpdb; |
|
126 | 126 | |
127 | - $rows = $wpdb->get_results("SELECT Country,ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " ORDER BY Country ASC"); |
|
127 | + $rows = $wpdb->get_results("SELECT Country,ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " ORDER BY Country ASC"); |
|
128 | 128 | |
129 | - $ISO2 = array(); |
|
130 | - $countries = array(); |
|
129 | + $ISO2 = array(); |
|
130 | + $countries = array(); |
|
131 | 131 | |
132 | - foreach ($rows as $row) { |
|
133 | - $ISO2[$row->Country] = $row->ISO2; |
|
134 | - $countries[$row->Country] = __($row->Country, 'geodirectory'); |
|
135 | - } |
|
132 | + foreach ($rows as $row) { |
|
133 | + $ISO2[$row->Country] = $row->ISO2; |
|
134 | + $countries[$row->Country] = __($row->Country, 'geodirectory'); |
|
135 | + } |
|
136 | 136 | |
137 | - asort($countries); |
|
137 | + asort($countries); |
|
138 | 138 | |
139 | - $out_put = '<option ' . selected('', $post_country, false) . ' value="">' . __('Select Country', 'geodirectory') . '</option>'; |
|
140 | - foreach ($countries as $country => $name) { |
|
141 | - $ccode = $ISO2[$country]; |
|
139 | + $out_put = '<option ' . selected('', $post_country, false) . ' value="">' . __('Select Country', 'geodirectory') . '</option>'; |
|
140 | + foreach ($countries as $country => $name) { |
|
141 | + $ccode = $ISO2[$country]; |
|
142 | 142 | |
143 | - $out_put .= '<option ' . selected($post_country, $country, false) . ' value="' . esc_attr($country) . '" data-country_code="' . $ccode . '">' . $name . '</option>'; |
|
144 | - } |
|
143 | + $out_put .= '<option ' . selected($post_country, $country, false) . ' value="' . esc_attr($country) . '" data-country_code="' . $ccode . '">' . $name . '</option>'; |
|
144 | + } |
|
145 | 145 | |
146 | - echo $out_put; |
|
146 | + echo $out_put; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | |
@@ -158,40 +158,40 @@ discard block |
||
158 | 158 | function geodir_location_form_submit() |
159 | 159 | { |
160 | 160 | |
161 | - global $wpdb, $plugin_prefix; |
|
162 | - if (isset($_REQUEST['add_location'])) { |
|
161 | + global $wpdb, $plugin_prefix; |
|
162 | + if (isset($_REQUEST['add_location'])) { |
|
163 | 163 | |
164 | - $location_info = array( |
|
165 | - 'city' => $_REQUEST['city'], |
|
166 | - 'region' => $_REQUEST['region'], |
|
167 | - 'country' => $_REQUEST['country'], |
|
168 | - 'geo_lat' => $_REQUEST['latitude'], |
|
169 | - 'geo_lng' => $_REQUEST['longitude'], |
|
170 | - 'is_default' => $_REQUEST['is_default'], |
|
171 | - 'update_city' => $_REQUEST['update_city'] |
|
172 | - ); |
|
164 | + $location_info = array( |
|
165 | + 'city' => $_REQUEST['city'], |
|
166 | + 'region' => $_REQUEST['region'], |
|
167 | + 'country' => $_REQUEST['country'], |
|
168 | + 'geo_lat' => $_REQUEST['latitude'], |
|
169 | + 'geo_lng' => $_REQUEST['longitude'], |
|
170 | + 'is_default' => $_REQUEST['is_default'], |
|
171 | + 'update_city' => $_REQUEST['update_city'] |
|
172 | + ); |
|
173 | 173 | |
174 | - $old_location = geodir_get_default_location(); |
|
174 | + $old_location = geodir_get_default_location(); |
|
175 | 175 | |
176 | - $locationid = geodir_add_new_location($location_info); |
|
176 | + $locationid = geodir_add_new_location($location_info); |
|
177 | 177 | |
178 | - $default_location = geodir_get_location($locationid); |
|
178 | + $default_location = geodir_get_location($locationid); |
|
179 | 179 | |
180 | - //UPDATE AND DELETE LISTING |
|
181 | - $posttype = geodir_get_posttypes(); |
|
182 | - if (isset($_REQUEST['listing_action']) && $_REQUEST['listing_action'] == 'delete') { |
|
180 | + //UPDATE AND DELETE LISTING |
|
181 | + $posttype = geodir_get_posttypes(); |
|
182 | + if (isset($_REQUEST['listing_action']) && $_REQUEST['listing_action'] == 'delete') { |
|
183 | 183 | |
184 | - foreach ($posttype as $posttypeobj) { |
|
185 | - $post_locations = '[' . $default_location->city_slug . '],[' . $default_location->region_slug . '],[' . $default_location->country_slug . ']'; // set all overall post location |
|
184 | + foreach ($posttype as $posttypeobj) { |
|
185 | + $post_locations = '[' . $default_location->city_slug . '],[' . $default_location->region_slug . '],[' . $default_location->country_slug . ']'; // set all overall post location |
|
186 | 186 | |
187 | - $sql = $wpdb->prepare( |
|
188 | - "UPDATE " . $plugin_prefix . $posttypeobj . "_detail SET post_city=%s, post_region=%s, post_country=%s, post_locations=%s WHERE post_location_id=%d AND ( post_city!=%s OR post_region!=%s OR post_country!=%s OR post_locations!=%s OR post_locations IS NULL)", |
|
189 | - array($_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations, $locationid, $_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations) |
|
190 | - ); |
|
191 | - $wpdb->query($sql); |
|
192 | - } |
|
193 | - } |
|
194 | - } |
|
187 | + $sql = $wpdb->prepare( |
|
188 | + "UPDATE " . $plugin_prefix . $posttypeobj . "_detail SET post_city=%s, post_region=%s, post_country=%s, post_locations=%s WHERE post_location_id=%d AND ( post_city!=%s OR post_region!=%s OR post_country!=%s OR post_locations!=%s OR post_locations IS NULL)", |
|
189 | + array($_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations, $locationid, $_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations) |
|
190 | + ); |
|
191 | + $wpdb->query($sql); |
|
192 | + } |
|
193 | + } |
|
194 | + } |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -215,37 +215,37 @@ discard block |
||
215 | 215 | */ |
216 | 216 | function geodir_add_new_location($location_info = array()) |
217 | 217 | { |
218 | - global $wpdb; |
|
219 | - |
|
220 | - if (!empty($location_info)) { |
|
221 | - $location_city = ($location_info['city'] != '') ? $location_info['city'] : 'all'; |
|
222 | - $location_region = ($location_info['region'] != '') ? $location_info['region'] : 'all'; |
|
223 | - $location_country = ($location_info['country'] != '') ? geodir_get_normal_country($location_info['country']) : 'all'; |
|
224 | - $location_lat = ($location_info['geo_lat'] != '') ? $location_info['geo_lat'] : ''; |
|
225 | - $location_lng = ($location_info['geo_lng'] != '') ? $location_info['geo_lng'] : ''; |
|
226 | - $is_default = isset($location_info['is_default']) ? $location_info['is_default'] : ''; |
|
227 | - $country_slug = create_location_slug(__($location_country, 'geodirectory')); |
|
228 | - $region_slug = create_location_slug($location_region); |
|
229 | - $city_slug = create_location_slug($location_city); |
|
218 | + global $wpdb; |
|
219 | + |
|
220 | + if (!empty($location_info)) { |
|
221 | + $location_city = ($location_info['city'] != '') ? $location_info['city'] : 'all'; |
|
222 | + $location_region = ($location_info['region'] != '') ? $location_info['region'] : 'all'; |
|
223 | + $location_country = ($location_info['country'] != '') ? geodir_get_normal_country($location_info['country']) : 'all'; |
|
224 | + $location_lat = ($location_info['geo_lat'] != '') ? $location_info['geo_lat'] : ''; |
|
225 | + $location_lng = ($location_info['geo_lng'] != '') ? $location_info['geo_lng'] : ''; |
|
226 | + $is_default = isset($location_info['is_default']) ? $location_info['is_default'] : ''; |
|
227 | + $country_slug = create_location_slug(__($location_country, 'geodirectory')); |
|
228 | + $region_slug = create_location_slug($location_region); |
|
229 | + $city_slug = create_location_slug($location_city); |
|
230 | 230 | |
231 | - /** |
|
232 | - * Filter add new location data. |
|
233 | - * |
|
234 | - * @since 1.0.0 |
|
235 | - */ |
|
236 | - $geodir_location = (object)apply_filters('geodir_add_new_location', array('location_id' => 0, |
|
237 | - 'country' => $location_country, |
|
238 | - 'region' => $location_region, |
|
239 | - 'city' => $location_city, |
|
240 | - 'country_slug' => $country_slug, |
|
241 | - 'region_slug' => $region_slug, |
|
242 | - 'city_slug' => $city_slug, |
|
243 | - 'city_latitude' => $location_lat, |
|
244 | - 'city_longitude' => $location_lng, |
|
245 | - 'is_default' => $is_default |
|
246 | - )); |
|
247 | - |
|
248 | - /* // Not allowed to create country in DB : 2016-12-09 |
|
231 | + /** |
|
232 | + * Filter add new location data. |
|
233 | + * |
|
234 | + * @since 1.0.0 |
|
235 | + */ |
|
236 | + $geodir_location = (object)apply_filters('geodir_add_new_location', array('location_id' => 0, |
|
237 | + 'country' => $location_country, |
|
238 | + 'region' => $location_region, |
|
239 | + 'city' => $location_city, |
|
240 | + 'country_slug' => $country_slug, |
|
241 | + 'region_slug' => $region_slug, |
|
242 | + 'city_slug' => $city_slug, |
|
243 | + 'city_latitude' => $location_lat, |
|
244 | + 'city_longitude' => $location_lng, |
|
245 | + 'is_default' => $is_default |
|
246 | + )); |
|
247 | + |
|
248 | + /* // Not allowed to create country in DB : 2016-12-09 |
|
249 | 249 | if ($geodir_location->country) { |
250 | 250 | |
251 | 251 | $get_country = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country=%s", array($geodir_location->country))); |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | } |
260 | 260 | */ |
261 | 261 | |
262 | - if ($geodir_location->is_default) |
|
263 | - update_option('geodir_default_location', $geodir_location); |
|
262 | + if ($geodir_location->is_default) |
|
263 | + update_option('geodir_default_location', $geodir_location); |
|
264 | 264 | |
265 | - return $geodir_location->location_id; |
|
265 | + return $geodir_location->location_id; |
|
266 | 266 | |
267 | - } else { |
|
268 | - return false; |
|
269 | - } |
|
267 | + } else { |
|
268 | + return false; |
|
269 | + } |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | */ |
281 | 281 | function geodir_random_float($min = 0, $max = 1) |
282 | 282 | { |
283 | - return $min + mt_rand() / mt_getrandmax() * ($max - $min); |
|
283 | + return $min + mt_rand() / mt_getrandmax() * ($max - $min); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
@@ -294,22 +294,22 @@ discard block |
||
294 | 294 | */ |
295 | 295 | function geodir_get_address_by_lat_lan($lat, $lng) |
296 | 296 | { |
297 | - $url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' . trim($lat) . ',' . trim($lng) ; |
|
298 | - |
|
299 | - $ch = curl_init(); |
|
300 | - curl_setopt($ch, CURLOPT_URL, $url); |
|
301 | - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
302 | - curl_setopt($ch, CURLOPT_PROXYPORT, 3128); |
|
303 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
304 | - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
|
305 | - $response = curl_exec($ch); |
|
306 | - curl_close($ch); |
|
307 | - $data = json_decode($response); |
|
308 | - $status = $data->status; |
|
309 | - if ($status == "OK") { |
|
310 | - return $data->results[0]->address_components; |
|
311 | - } else |
|
312 | - return false; |
|
297 | + $url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' . trim($lat) . ',' . trim($lng) ; |
|
298 | + |
|
299 | + $ch = curl_init(); |
|
300 | + curl_setopt($ch, CURLOPT_URL, $url); |
|
301 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
302 | + curl_setopt($ch, CURLOPT_PROXYPORT, 3128); |
|
303 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
304 | + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
|
305 | + $response = curl_exec($ch); |
|
306 | + curl_close($ch); |
|
307 | + $data = json_decode($response); |
|
308 | + $status = $data->status; |
|
309 | + if ($status == "OK") { |
|
310 | + return $data->results[0]->address_components; |
|
311 | + } else |
|
312 | + return false; |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
@@ -326,71 +326,71 @@ discard block |
||
326 | 326 | */ |
327 | 327 | function geodir_get_current_location_terms($location_array_from = 'session', $gd_post_type = '') |
328 | 328 | { |
329 | - global $wp, $gd_session; |
|
330 | - $location_array = array(); |
|
331 | - if ($location_array_from == 'session') { |
|
332 | - if ($gd_session->get('gd_country') == 'me' || $gd_session->get('gd_region') == 'me' || $gd_session->get('gd_city') == 'me') { |
|
333 | - return $location_array; |
|
334 | - } |
|
329 | + global $wp, $gd_session; |
|
330 | + $location_array = array(); |
|
331 | + if ($location_array_from == 'session') { |
|
332 | + if ($gd_session->get('gd_country') == 'me' || $gd_session->get('gd_region') == 'me' || $gd_session->get('gd_city') == 'me') { |
|
333 | + return $location_array; |
|
334 | + } |
|
335 | 335 | |
336 | - $country = isset($_REQUEST['gd_country']) ? $_REQUEST['gd_country'] : $gd_session->get('gd_country'); |
|
337 | - if ($country != '' && $country) |
|
338 | - $location_array['gd_country'] = urldecode($country); |
|
336 | + $country = isset($_REQUEST['gd_country']) ? $_REQUEST['gd_country'] : $gd_session->get('gd_country'); |
|
337 | + if ($country != '' && $country) |
|
338 | + $location_array['gd_country'] = urldecode($country); |
|
339 | 339 | |
340 | - $region = isset($_REQUEST['gd_region']) ? $_REQUEST['gd_region'] : $gd_session->get('gd_region'); |
|
341 | - if ($region != '' && $region) |
|
342 | - $location_array['gd_region'] = urldecode($region); |
|
340 | + $region = isset($_REQUEST['gd_region']) ? $_REQUEST['gd_region'] : $gd_session->get('gd_region'); |
|
341 | + if ($region != '' && $region) |
|
342 | + $location_array['gd_region'] = urldecode($region); |
|
343 | 343 | |
344 | - $city = isset($_REQUEST['gd_city']) ? $_REQUEST['gd_city'] : $gd_session->get('gd_city'); |
|
345 | - if ($city != '' && $city) |
|
346 | - $location_array['gd_city'] = urldecode($city); |
|
347 | - } else { |
|
348 | - if ((isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] == 'me') || (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] == 'me') || (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] == 'me')) { |
|
349 | - return $location_array; |
|
350 | - } |
|
344 | + $city = isset($_REQUEST['gd_city']) ? $_REQUEST['gd_city'] : $gd_session->get('gd_city'); |
|
345 | + if ($city != '' && $city) |
|
346 | + $location_array['gd_city'] = urldecode($city); |
|
347 | + } else { |
|
348 | + if ((isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] == 'me') || (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] == 'me') || (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] == 'me')) { |
|
349 | + return $location_array; |
|
350 | + } |
|
351 | 351 | |
352 | - $country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
352 | + $country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
353 | 353 | |
354 | - $region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
354 | + $region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
355 | 355 | |
356 | - $city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
356 | + $city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
357 | 357 | |
358 | - if ($country != '') |
|
359 | - $location_array['gd_country'] = urldecode($country); |
|
358 | + if ($country != '') |
|
359 | + $location_array['gd_country'] = urldecode($country); |
|
360 | 360 | |
361 | - if ($region != '') |
|
362 | - $location_array['gd_region'] = urldecode($region); |
|
361 | + if ($region != '') |
|
362 | + $location_array['gd_region'] = urldecode($region); |
|
363 | 363 | |
364 | - if ($city != '') |
|
365 | - $location_array['gd_city'] = urldecode($city); |
|
364 | + if ($city != '') |
|
365 | + $location_array['gd_city'] = urldecode($city); |
|
366 | 366 | |
367 | 367 | // Fix category link in ajax popular category widget on change post type |
368 | 368 | if (empty($location_array) && defined('DOING_AJAX') && DOING_AJAX) { |
369 | 369 | $location_array = geodir_get_current_location_terms('session'); |
370 | 370 | } |
371 | - } |
|
371 | + } |
|
372 | 372 | |
373 | 373 | |
374 | 374 | /** |
375 | 375 | * Filter the location terms. |
376 | 376 | * |
377 | 377 | * @since 1.4.6 |
378 | - * @package GeoDirectory |
|
378 | + * @package GeoDirectory |
|
379 | + * |
|
380 | + * @param array $location_array { |
|
381 | + * Attributes of the location_array. |
|
382 | + * |
|
383 | + * @type string $gd_country The country slug. |
|
384 | + * @type string $gd_region The region slug. |
|
385 | + * @type string $gd_city The city slug. |
|
379 | 386 | * |
380 | - * @param array $location_array { |
|
381 | - * Attributes of the location_array. |
|
382 | - * |
|
383 | - * @type string $gd_country The country slug. |
|
384 | - * @type string $gd_region The region slug. |
|
385 | - * @type string $gd_city The city slug. |
|
386 | - * |
|
387 | - * } |
|
387 | + * } |
|
388 | 388 | * @param string $location_array_from Source type of location terms. Default session. |
389 | 389 | * @param string $gd_post_type WP post type. |
390 | 390 | */ |
391 | 391 | $location_array = apply_filters( 'geodir_current_location_terms', $location_array, $location_array_from, $gd_post_type ); |
392 | 392 | |
393 | - return $location_array; |
|
393 | + return $location_array; |
|
394 | 394 | |
395 | 395 | } |
396 | 396 | |
@@ -403,24 +403,24 @@ discard block |
||
403 | 403 | * @return bool|string |
404 | 404 | */ |
405 | 405 | function geodir_get_location_link($which_location = 'current') { |
406 | - $location_link = get_permalink(geodir_location_page_id()); |
|
407 | - |
|
408 | - if ($which_location == 'base') { |
|
409 | - return $location_link; |
|
410 | - } else { |
|
411 | - $location_terms = geodir_get_current_location_terms(); |
|
412 | - |
|
413 | - if (!empty($location_terms)) { |
|
414 | - if (get_option('permalink_structure') != '') { |
|
415 | - $location_terms = implode("/", $location_terms); |
|
416 | - $location_terms = rtrim($location_terms, '/'); |
|
417 | - $location_link .= $location_terms; |
|
418 | - } else { |
|
419 | - $location_link = geodir_getlink($location_link, $location_terms); |
|
420 | - } |
|
421 | - } |
|
422 | - } |
|
423 | - return $location_link; |
|
406 | + $location_link = get_permalink(geodir_location_page_id()); |
|
407 | + |
|
408 | + if ($which_location == 'base') { |
|
409 | + return $location_link; |
|
410 | + } else { |
|
411 | + $location_terms = geodir_get_current_location_terms(); |
|
412 | + |
|
413 | + if (!empty($location_terms)) { |
|
414 | + if (get_option('permalink_structure') != '') { |
|
415 | + $location_terms = implode("/", $location_terms); |
|
416 | + $location_terms = rtrim($location_terms, '/'); |
|
417 | + $location_link .= $location_terms; |
|
418 | + } else { |
|
419 | + $location_link = geodir_getlink($location_link, $location_terms); |
|
420 | + } |
|
421 | + } |
|
422 | + } |
|
423 | + return $location_link; |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | /** |
@@ -433,34 +433,34 @@ discard block |
||
433 | 433 | * @return array|bool Returns address on success. |
434 | 434 | */ |
435 | 435 | function geodir_get_osm_address_by_lat_lan($lat, $lng) { |
436 | - $url = is_ssl() ? 'https:' : 'http:'; |
|
437 | - $url .= '//nominatim.openstreetmap.org/reverse?format=json&lat=' . trim($lat) . '&lon=' . trim($lng) . '&zoom=16&addressdetails=1&email=' . get_option('admin_email'); |
|
438 | - |
|
439 | - $ch = curl_init(); |
|
440 | - curl_setopt($ch, CURLOPT_URL, $url); |
|
441 | - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
442 | - curl_setopt($ch, CURLOPT_PROXYPORT, 3128); |
|
443 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
444 | - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
|
445 | - $response = curl_exec($ch); |
|
446 | - curl_close($ch); |
|
447 | - $data = json_decode($response); |
|
436 | + $url = is_ssl() ? 'https:' : 'http:'; |
|
437 | + $url .= '//nominatim.openstreetmap.org/reverse?format=json&lat=' . trim($lat) . '&lon=' . trim($lng) . '&zoom=16&addressdetails=1&email=' . get_option('admin_email'); |
|
438 | + |
|
439 | + $ch = curl_init(); |
|
440 | + curl_setopt($ch, CURLOPT_URL, $url); |
|
441 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
442 | + curl_setopt($ch, CURLOPT_PROXYPORT, 3128); |
|
443 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
444 | + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
|
445 | + $response = curl_exec($ch); |
|
446 | + curl_close($ch); |
|
447 | + $data = json_decode($response); |
|
448 | 448 | |
449 | - if (!empty($data) && !empty($data->address)) { |
|
450 | - $address_fields = array('public_building', 'house', 'house_number', 'bakery', 'footway', 'street', 'road', 'village', 'attraction', 'pedestrian', 'neighbourhood', 'suburb'); |
|
451 | - $formatted_address = (array)$data->address; |
|
449 | + if (!empty($data) && !empty($data->address)) { |
|
450 | + $address_fields = array('public_building', 'house', 'house_number', 'bakery', 'footway', 'street', 'road', 'village', 'attraction', 'pedestrian', 'neighbourhood', 'suburb'); |
|
451 | + $formatted_address = (array)$data->address; |
|
452 | 452 | |
453 | - foreach ( $data->address as $key => $value ) { |
|
454 | - if (!in_array($key, $address_fields)) { |
|
455 | - unset($formatted_address[$key]); |
|
456 | - } |
|
457 | - } |
|
458 | - $data->formatted_address = !empty($formatted_address) ? implode(', ', $formatted_address) : ''; |
|
453 | + foreach ( $data->address as $key => $value ) { |
|
454 | + if (!in_array($key, $address_fields)) { |
|
455 | + unset($formatted_address[$key]); |
|
456 | + } |
|
457 | + } |
|
458 | + $data->formatted_address = !empty($formatted_address) ? implode(', ', $formatted_address) : ''; |
|
459 | 459 | |
460 | - return $data; |
|
461 | - } else { |
|
462 | - return false; |
|
463 | - } |
|
460 | + return $data; |
|
461 | + } else { |
|
462 | + return false; |
|
463 | + } |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | /** |
@@ -474,51 +474,51 @@ discard block |
||
474 | 474 | * @return string Returns the country. |
475 | 475 | */ |
476 | 476 | function geodir_get_normal_country($country, $default = '1') { |
477 | - global $wpdb; |
|
478 | - if ($result = geodir_get_country_by_name($country)) { |
|
479 | - return $result; |
|
480 | - } |
|
477 | + global $wpdb; |
|
478 | + if ($result = geodir_get_country_by_name($country)) { |
|
479 | + return $result; |
|
480 | + } |
|
481 | 481 | |
482 | - if (defined('POST_LOCATION_TABLE')) { |
|
483 | - $rows = $wpdb->get_results($wpdb->prepare("SELECT DISTINCT country FROM " . POST_LOCATION_TABLE . " WHERE country NOT LIKE %s ORDER BY location_id ASC", $country)); |
|
484 | - if (!empty($rows)) { |
|
485 | - foreach ($rows as $row) { |
|
486 | - $translated = __($row->country, 'geodirectory'); |
|
487 | - if (geodir_strtolower($translated) == geodir_strtolower($country) && $result = geodir_get_country_by_name($row->country)) { |
|
488 | - return $result; |
|
489 | - } |
|
490 | - } |
|
491 | - } |
|
482 | + if (defined('POST_LOCATION_TABLE')) { |
|
483 | + $rows = $wpdb->get_results($wpdb->prepare("SELECT DISTINCT country FROM " . POST_LOCATION_TABLE . " WHERE country NOT LIKE %s ORDER BY location_id ASC", $country)); |
|
484 | + if (!empty($rows)) { |
|
485 | + foreach ($rows as $row) { |
|
486 | + $translated = __($row->country, 'geodirectory'); |
|
487 | + if (geodir_strtolower($translated) == geodir_strtolower($country) && $result = geodir_get_country_by_name($row->country)) { |
|
488 | + return $result; |
|
489 | + } |
|
490 | + } |
|
491 | + } |
|
492 | 492 | |
493 | - $rows = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT country FROM " . POST_LOCATION_TABLE . " WHERE country_slug LIKE %s AND country NOT LIKE %s ORDER BY location_id", $country, $country ) ); |
|
494 | - if (!empty($rows)) { |
|
495 | - foreach ($rows as $row) { |
|
496 | - $translated = __($row->country, 'geodirectory'); |
|
497 | - if (geodir_strtolower($translated) == geodir_strtolower($country) && $result = geodir_get_country_by_name($row->country)) { |
|
498 | - return $result; |
|
499 | - } |
|
500 | - } |
|
501 | - } |
|
502 | - } |
|
493 | + $rows = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT country FROM " . POST_LOCATION_TABLE . " WHERE country_slug LIKE %s AND country NOT LIKE %s ORDER BY location_id", $country, $country ) ); |
|
494 | + if (!empty($rows)) { |
|
495 | + foreach ($rows as $row) { |
|
496 | + $translated = __($row->country, 'geodirectory'); |
|
497 | + if (geodir_strtolower($translated) == geodir_strtolower($country) && $result = geodir_get_country_by_name($row->country)) { |
|
498 | + return $result; |
|
499 | + } |
|
500 | + } |
|
501 | + } |
|
502 | + } |
|
503 | 503 | |
504 | - if ( $default === '0' ) { |
|
505 | - return NULL; |
|
506 | - } |
|
504 | + if ( $default === '0' ) { |
|
505 | + return NULL; |
|
506 | + } |
|
507 | 507 | |
508 | - $default_location = geodir_get_default_location(); |
|
509 | - if (!empty($default_location->country) && $result = geodir_get_country_by_name($default_location->country)) { |
|
510 | - return $result; |
|
511 | - } |
|
508 | + $default_location = geodir_get_default_location(); |
|
509 | + if (!empty($default_location->country) && $result = geodir_get_country_by_name($default_location->country)) { |
|
510 | + return $result; |
|
511 | + } |
|
512 | 512 | |
513 | - if (!empty($default_location->country_slug) && $result = geodir_get_country_by_name($default_location->country_slug)) { |
|
514 | - return $result; |
|
515 | - } |
|
513 | + if (!empty($default_location->country_slug) && $result = geodir_get_country_by_name($default_location->country_slug)) { |
|
514 | + return $result; |
|
515 | + } |
|
516 | 516 | |
517 | - if (!empty($default_location->country_ISO2) && $result = geodir_get_country_by_name($default_location->country_ISO2, true)) { |
|
518 | - return $result; |
|
519 | - } |
|
517 | + if (!empty($default_location->country_ISO2) && $result = geodir_get_country_by_name($default_location->country_ISO2, true)) { |
|
518 | + return $result; |
|
519 | + } |
|
520 | 520 | |
521 | - return $country; |
|
521 | + return $country; |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | /** |
@@ -530,16 +530,16 @@ discard block |
||
530 | 530 | * @return string Country ISO2 code. |
531 | 531 | */ |
532 | 532 | function geodir_get_country_iso2($country) { |
533 | - global $wpdb; |
|
533 | + global $wpdb; |
|
534 | 534 | |
535 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", $country))) { |
|
536 | - return $result; |
|
537 | - } |
|
538 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", geodir_get_normal_country($country)))) { |
|
539 | - return $result; |
|
540 | - } |
|
535 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", $country))) { |
|
536 | + return $result; |
|
537 | + } |
|
538 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", geodir_get_normal_country($country)))) { |
|
539 | + return $result; |
|
540 | + } |
|
541 | 541 | |
542 | - return $country; |
|
542 | + return $country; |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | /** |
@@ -552,16 +552,16 @@ discard block |
||
552 | 552 | * @return string|null Country ISO2 code. |
553 | 553 | */ |
554 | 554 | function geodir_get_country_by_name($country, $iso2 = false) { |
555 | - global $wpdb; |
|
555 | + global $wpdb; |
|
556 | 556 | |
557 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", $country))) { |
|
558 | - return $result; |
|
559 | - } |
|
560 | - if ($iso2 && $result = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE ISO2 LIKE %s", $country))) { |
|
561 | - return $result; |
|
562 | - } |
|
557 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", $country))) { |
|
558 | + return $result; |
|
559 | + } |
|
560 | + if ($iso2 && $result = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE ISO2 LIKE %s", $country))) { |
|
561 | + return $result; |
|
562 | + } |
|
563 | 563 | |
564 | - return NULL; |
|
564 | + return NULL; |
|
565 | 565 | } |
566 | 566 | |
567 | 567 | |
@@ -581,158 +581,158 @@ discard block |
||
581 | 581 | */ |
582 | 582 | function geodir_replace_location_variables($content, $location_array = array(), $sep = NULL, $gd_page = '') { |
583 | 583 | |
584 | - if (empty($content)) { |
|
585 | - return $content; |
|
586 | - } |
|
584 | + if (empty($content)) { |
|
585 | + return $content; |
|
586 | + } |
|
587 | 587 | |
588 | 588 | |
589 | - $location_replace_vars = geodir_location_replace_vars($location_array, $sep, $gd_page); |
|
589 | + $location_replace_vars = geodir_location_replace_vars($location_array, $sep, $gd_page); |
|
590 | 590 | |
591 | - if (!empty($location_replace_vars)) { |
|
592 | - foreach ($location_replace_vars as $search => $replace) { |
|
593 | - if (!empty($search) && strpos($content, $search) !== false) { |
|
594 | - $content = str_replace($search, $replace, $content); |
|
595 | - } |
|
596 | - } |
|
597 | - } |
|
591 | + if (!empty($location_replace_vars)) { |
|
592 | + foreach ($location_replace_vars as $search => $replace) { |
|
593 | + if (!empty($search) && strpos($content, $search) !== false) { |
|
594 | + $content = str_replace($search, $replace, $content); |
|
595 | + } |
|
596 | + } |
|
597 | + } |
|
598 | 598 | |
599 | - return $content; |
|
599 | + return $content; |
|
600 | 600 | } |
601 | 601 | add_filter('geodir_replace_location_variables', 'geodir_replace_location_variables'); |
602 | 602 | |
603 | 603 | |
604 | 604 | function geodir_location_replace_vars($location_array = array(), $sep = NULL, $gd_page = ''){ |
605 | 605 | |
606 | - global $wp; |
|
606 | + global $wp; |
|
607 | 607 | |
608 | - $location_manager = defined('GEODIRLOCATION_VERSION') ? true : false; |
|
609 | - |
|
610 | - if (empty($location_array)) { |
|
611 | - $location_array = geodir_get_current_location_terms('query_vars'); |
|
612 | - } |
|
613 | - |
|
614 | - $location_terms = array(); |
|
615 | - $location_terms['gd_neighbourhood'] = !empty($wp->query_vars['gd_neighbourhood']) ? $wp->query_vars['gd_neighbourhood'] : ''; |
|
616 | - $location_terms['gd_city'] = !empty($wp->query_vars['gd_city']) ? $wp->query_vars['gd_city'] : ''; |
|
617 | - $location_terms['gd_region'] = !empty($wp->query_vars['gd_region']) ? $wp->query_vars['gd_region'] : ''; |
|
618 | - $location_terms['gd_country'] = !empty($wp->query_vars['gd_country']) ? $wp->query_vars['gd_country'] : ''; |
|
619 | - |
|
620 | - $location_names = array(); |
|
621 | - foreach ($location_terms as $type => $location) { |
|
622 | - $location_name = $location; |
|
623 | - |
|
624 | - if (!empty($location_name)) { |
|
625 | - if ($location_manager) { |
|
626 | - $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
627 | - $location_name = get_actual_location_name($location_type, $location, true); |
|
628 | - } else { |
|
629 | - $location_name = preg_replace( '/-(\d+)$/', '', $location_name); |
|
630 | - $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
631 | - $location_name = __(geodir_ucwords($location_name), 'geodirectory'); |
|
632 | - } |
|
633 | - } |
|
634 | - |
|
635 | - $location_names[$type] = $location_name; |
|
636 | - } |
|
637 | - |
|
638 | - $location_single = ''; |
|
639 | - foreach ($location_terms as $type => $location) { |
|
640 | - if (!empty($location)) { |
|
641 | - if (!empty($location_names[$type])) { |
|
642 | - $location_single = $location_names[$type]; |
|
643 | - } else { |
|
644 | - if ($location_manager) { |
|
645 | - $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
646 | - $location_single = get_actual_location_name($location_type, $location, true); |
|
647 | - } else { |
|
648 | - $location_name = preg_replace( '/-(\d+)$/', '', $location); |
|
649 | - $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
650 | - $location_single = __(geodir_ucwords($location_name), 'geodirectory'); |
|
651 | - } |
|
652 | - } |
|
653 | - break; |
|
654 | - } |
|
655 | - } |
|
656 | - |
|
657 | - $full_location = array(); |
|
658 | - if (!empty($location_array)) { |
|
659 | - $location_array = array_reverse($location_array); |
|
660 | - |
|
661 | - foreach ($location_array as $type => $location) { |
|
662 | - if (!empty($location_names[$type])) { |
|
663 | - $location_name = $location_names[$type]; |
|
664 | - } else { |
|
665 | - if ($location_manager) { |
|
666 | - $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
667 | - $location_name = get_actual_location_name($location_type, $location, true); |
|
668 | - } else { |
|
669 | - $location_name = preg_replace( '/-(\d+)$/', '', $location); |
|
670 | - $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
671 | - $location_name = __(geodir_ucwords($location_name), 'geodirectory'); |
|
672 | - } |
|
673 | - } |
|
608 | + $location_manager = defined('GEODIRLOCATION_VERSION') ? true : false; |
|
609 | + |
|
610 | + if (empty($location_array)) { |
|
611 | + $location_array = geodir_get_current_location_terms('query_vars'); |
|
612 | + } |
|
613 | + |
|
614 | + $location_terms = array(); |
|
615 | + $location_terms['gd_neighbourhood'] = !empty($wp->query_vars['gd_neighbourhood']) ? $wp->query_vars['gd_neighbourhood'] : ''; |
|
616 | + $location_terms['gd_city'] = !empty($wp->query_vars['gd_city']) ? $wp->query_vars['gd_city'] : ''; |
|
617 | + $location_terms['gd_region'] = !empty($wp->query_vars['gd_region']) ? $wp->query_vars['gd_region'] : ''; |
|
618 | + $location_terms['gd_country'] = !empty($wp->query_vars['gd_country']) ? $wp->query_vars['gd_country'] : ''; |
|
619 | + |
|
620 | + $location_names = array(); |
|
621 | + foreach ($location_terms as $type => $location) { |
|
622 | + $location_name = $location; |
|
623 | + |
|
624 | + if (!empty($location_name)) { |
|
625 | + if ($location_manager) { |
|
626 | + $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
627 | + $location_name = get_actual_location_name($location_type, $location, true); |
|
628 | + } else { |
|
629 | + $location_name = preg_replace( '/-(\d+)$/', '', $location_name); |
|
630 | + $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
631 | + $location_name = __(geodir_ucwords($location_name), 'geodirectory'); |
|
632 | + } |
|
633 | + } |
|
674 | 634 | |
675 | - $full_location[] = $location_name; |
|
676 | - } |
|
635 | + $location_names[$type] = $location_name; |
|
636 | + } |
|
637 | + |
|
638 | + $location_single = ''; |
|
639 | + foreach ($location_terms as $type => $location) { |
|
640 | + if (!empty($location)) { |
|
641 | + if (!empty($location_names[$type])) { |
|
642 | + $location_single = $location_names[$type]; |
|
643 | + } else { |
|
644 | + if ($location_manager) { |
|
645 | + $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
646 | + $location_single = get_actual_location_name($location_type, $location, true); |
|
647 | + } else { |
|
648 | + $location_name = preg_replace( '/-(\d+)$/', '', $location); |
|
649 | + $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
650 | + $location_single = __(geodir_ucwords($location_name), 'geodirectory'); |
|
651 | + } |
|
652 | + } |
|
653 | + break; |
|
654 | + } |
|
655 | + } |
|
656 | + |
|
657 | + $full_location = array(); |
|
658 | + if (!empty($location_array)) { |
|
659 | + $location_array = array_reverse($location_array); |
|
660 | + |
|
661 | + foreach ($location_array as $type => $location) { |
|
662 | + if (!empty($location_names[$type])) { |
|
663 | + $location_name = $location_names[$type]; |
|
664 | + } else { |
|
665 | + if ($location_manager) { |
|
666 | + $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
667 | + $location_name = get_actual_location_name($location_type, $location, true); |
|
668 | + } else { |
|
669 | + $location_name = preg_replace( '/-(\d+)$/', '', $location); |
|
670 | + $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
671 | + $location_name = __(geodir_ucwords($location_name), 'geodirectory'); |
|
672 | + } |
|
673 | + } |
|
674 | + |
|
675 | + $full_location[] = $location_name; |
|
676 | + } |
|
677 | 677 | |
678 | - if (!empty($full_location)) { |
|
679 | - $full_location = array_unique($full_location); |
|
680 | - } |
|
681 | - } |
|
682 | - $full_location = !empty($full_location) ? implode(', ', $full_location): ''; |
|
678 | + if (!empty($full_location)) { |
|
679 | + $full_location = array_unique($full_location); |
|
680 | + } |
|
681 | + } |
|
682 | + $full_location = !empty($full_location) ? implode(', ', $full_location): ''; |
|
683 | 683 | |
684 | - if ( empty( $full_location ) ) { |
|
685 | - /** |
|
686 | - * Filter the text in meta description in full location is empty. |
|
687 | - * |
|
688 | - * @since 1.6.22 |
|
689 | - * |
|
690 | - * @param string $full_location Default: Empty. |
|
691 | - * @param array $location_array The array of location variables. |
|
692 | - * @param string $gd_page The page being filtered. |
|
693 | - * @param string $sep The separator. |
|
694 | - */ |
|
695 | - $full_location = apply_filters( 'geodir_meta_description_location_empty_text', '', $location_array, $gd_page, $sep ); |
|
696 | - } |
|
684 | + if ( empty( $full_location ) ) { |
|
685 | + /** |
|
686 | + * Filter the text in meta description in full location is empty. |
|
687 | + * |
|
688 | + * @since 1.6.22 |
|
689 | + * |
|
690 | + * @param string $full_location Default: Empty. |
|
691 | + * @param array $location_array The array of location variables. |
|
692 | + * @param string $gd_page The page being filtered. |
|
693 | + * @param string $sep The separator. |
|
694 | + */ |
|
695 | + $full_location = apply_filters( 'geodir_meta_description_location_empty_text', '', $location_array, $gd_page, $sep ); |
|
696 | + } |
|
697 | 697 | |
698 | - if ( empty( $location_single ) ) { |
|
699 | - /** |
|
700 | - * Filter the text in meta description in single location is empty. |
|
701 | - * |
|
702 | - * @since 1.6.22 |
|
703 | - * |
|
704 | - * @param string $location_single Default: Empty. |
|
705 | - * @param array $location_array The array of location variables. |
|
706 | - * @param string $gd_page The page being filtered. |
|
707 | - * @param string $sep The separator. |
|
708 | - */ |
|
709 | - $location_single = apply_filters( 'geodir_meta_description_single_location_empty_text', '', $location_array, $gd_page, $sep ); |
|
710 | - } |
|
711 | - |
|
712 | - $location_replace_vars = array(); |
|
713 | - $location_replace_vars['%%location_sep%%'] = $sep !== NULL ? $sep : '|'; |
|
714 | - $location_replace_vars['%%location%%'] = $full_location; |
|
715 | - $location_replace_vars['%%in_location%%'] = $full_location != '' ? sprintf( _x('in %s','in location', 'geodirectory'), $full_location ) : ''; |
|
716 | - $location_replace_vars['%%location_single%%'] = $location_single; |
|
717 | - $location_replace_vars['%%in_location_single%%'] = $location_single != '' ? sprintf( _x('in %s','in location', 'geodirectory'), $location_single ) : ''; |
|
718 | - |
|
719 | - foreach ($location_names as $type => $name) { |
|
720 | - $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
721 | - |
|
722 | - $location_replace_vars['%%location_' . $location_type . '%%'] = $name; |
|
723 | - $location_replace_vars['%%in_location_' . $location_type . '%%'] = !empty($name) ? sprintf( _x('in %s','in location', 'geodirectory'), $name ) : ''; |
|
724 | - } |
|
725 | - |
|
726 | - /** |
|
727 | - * Filter the location terms variables to search & replace. |
|
728 | - * |
|
729 | - * @since 1.6.16 |
|
730 | - * @package GeoDirectory |
|
731 | - * |
|
732 | - * @param array $location_replace_vars The array of search & replace variables. |
|
733 | - * @param array $location_array The array of location variables. |
|
734 | - * @param string $gd_page The page being filtered. |
|
735 | - * @param string $sep The separator. |
|
736 | - */ |
|
737 | - return apply_filters( 'geodir_filter_location_replace_variables', $location_replace_vars, $location_array, $gd_page, $sep ); |
|
698 | + if ( empty( $location_single ) ) { |
|
699 | + /** |
|
700 | + * Filter the text in meta description in single location is empty. |
|
701 | + * |
|
702 | + * @since 1.6.22 |
|
703 | + * |
|
704 | + * @param string $location_single Default: Empty. |
|
705 | + * @param array $location_array The array of location variables. |
|
706 | + * @param string $gd_page The page being filtered. |
|
707 | + * @param string $sep The separator. |
|
708 | + */ |
|
709 | + $location_single = apply_filters( 'geodir_meta_description_single_location_empty_text', '', $location_array, $gd_page, $sep ); |
|
710 | + } |
|
711 | + |
|
712 | + $location_replace_vars = array(); |
|
713 | + $location_replace_vars['%%location_sep%%'] = $sep !== NULL ? $sep : '|'; |
|
714 | + $location_replace_vars['%%location%%'] = $full_location; |
|
715 | + $location_replace_vars['%%in_location%%'] = $full_location != '' ? sprintf( _x('in %s','in location', 'geodirectory'), $full_location ) : ''; |
|
716 | + $location_replace_vars['%%location_single%%'] = $location_single; |
|
717 | + $location_replace_vars['%%in_location_single%%'] = $location_single != '' ? sprintf( _x('in %s','in location', 'geodirectory'), $location_single ) : ''; |
|
718 | + |
|
719 | + foreach ($location_names as $type => $name) { |
|
720 | + $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
721 | + |
|
722 | + $location_replace_vars['%%location_' . $location_type . '%%'] = $name; |
|
723 | + $location_replace_vars['%%in_location_' . $location_type . '%%'] = !empty($name) ? sprintf( _x('in %s','in location', 'geodirectory'), $name ) : ''; |
|
724 | + } |
|
725 | + |
|
726 | + /** |
|
727 | + * Filter the location terms variables to search & replace. |
|
728 | + * |
|
729 | + * @since 1.6.16 |
|
730 | + * @package GeoDirectory |
|
731 | + * |
|
732 | + * @param array $location_replace_vars The array of search & replace variables. |
|
733 | + * @param array $location_array The array of location variables. |
|
734 | + * @param string $gd_page The page being filtered. |
|
735 | + * @param string $sep The separator. |
|
736 | + */ |
|
737 | + return apply_filters( 'geodir_filter_location_replace_variables', $location_replace_vars, $location_array, $gd_page, $sep ); |
|
738 | 738 | } |
739 | 739 | \ No newline at end of file |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | * @return int|null Return the page ID if present or null if not. |
15 | 15 | */ |
16 | 16 | function geodir_add_listing_page_id(){ |
17 | - $gd_page_id = get_option('geodir_add_listing_page'); |
|
17 | + $gd_page_id = get_option('geodir_add_listing_page'); |
|
18 | 18 | |
19 | - if (geodir_is_wpml()) { |
|
20 | - $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
21 | - } |
|
19 | + if (geodir_is_wpml()) { |
|
20 | + $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
21 | + } |
|
22 | 22 | |
23 | - return $gd_page_id; |
|
23 | + return $gd_page_id; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | * @return int|null Return the page ID if present or null if not. |
32 | 32 | */ |
33 | 33 | function geodir_preview_page_id(){ |
34 | - $gd_page_id = get_option('geodir_preview_page'); |
|
34 | + $gd_page_id = get_option('geodir_preview_page'); |
|
35 | 35 | |
36 | - if (geodir_is_wpml()) { |
|
37 | - $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
38 | - } |
|
36 | + if (geodir_is_wpml()) { |
|
37 | + $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
38 | + } |
|
39 | 39 | |
40 | - return $gd_page_id; |
|
40 | + return $gd_page_id; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | * @return int|null Return the page ID if present or null if not. |
49 | 49 | */ |
50 | 50 | function geodir_success_page_id(){ |
51 | - $gd_page_id = get_option('geodir_success_page'); |
|
51 | + $gd_page_id = get_option('geodir_success_page'); |
|
52 | 52 | |
53 | - if (geodir_is_wpml()) { |
|
54 | - $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
55 | - } |
|
53 | + if (geodir_is_wpml()) { |
|
54 | + $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
55 | + } |
|
56 | 56 | |
57 | - return $gd_page_id; |
|
57 | + return $gd_page_id; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | * @return int|null Return the page ID if present or null if not. |
66 | 66 | */ |
67 | 67 | function geodir_location_page_id(){ |
68 | - $gd_page_id = get_option('geodir_location_page'); |
|
68 | + $gd_page_id = get_option('geodir_location_page'); |
|
69 | 69 | |
70 | - if (geodir_is_wpml()) { |
|
71 | - $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
72 | - } |
|
70 | + if (geodir_is_wpml()) { |
|
71 | + $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
72 | + } |
|
73 | 73 | |
74 | - return $gd_page_id; |
|
74 | + return $gd_page_id; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | * @return int|null Return the page ID if present or null if not. |
83 | 83 | */ |
84 | 84 | function geodir_home_page_id(){ |
85 | - $gd_page_id = get_option('geodir_home_page'); |
|
85 | + $gd_page_id = get_option('geodir_home_page'); |
|
86 | 86 | |
87 | - if (geodir_is_wpml()) { |
|
88 | - $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
89 | - } |
|
87 | + if (geodir_is_wpml()) { |
|
88 | + $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
89 | + } |
|
90 | 90 | |
91 | - return $gd_page_id; |
|
91 | + return $gd_page_id; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | * @return int|null Return the page ID if present or null if not. |
100 | 100 | */ |
101 | 101 | function geodir_info_page_id(){ |
102 | - $gd_page_id = get_option('geodir_info_page'); |
|
102 | + $gd_page_id = get_option('geodir_info_page'); |
|
103 | 103 | |
104 | - if (geodir_is_wpml()) { |
|
105 | - $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
106 | - } |
|
104 | + if (geodir_is_wpml()) { |
|
105 | + $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
106 | + } |
|
107 | 107 | |
108 | - return $gd_page_id; |
|
108 | + return $gd_page_id; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -116,13 +116,13 @@ discard block |
||
116 | 116 | * @return int|null Return the page ID if present or null if not. |
117 | 117 | */ |
118 | 118 | function geodir_login_page_id(){ |
119 | - $gd_page_id = get_option('geodir_login_page'); |
|
119 | + $gd_page_id = get_option('geodir_login_page'); |
|
120 | 120 | |
121 | - if (geodir_is_wpml()) { |
|
122 | - $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
123 | - } |
|
121 | + if (geodir_is_wpml()) { |
|
122 | + $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
123 | + } |
|
124 | 124 | |
125 | - return $gd_page_id; |
|
125 | + return $gd_page_id; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | |
@@ -134,51 +134,51 @@ discard block |
||
134 | 134 | * @return int|null Return the page ID if present or null if not. |
135 | 135 | */ |
136 | 136 | function geodir_login_url($args=array()){ |
137 | - $gd_page_id = get_option('geodir_login_page'); |
|
138 | - |
|
139 | - if (geodir_is_wpml()) { |
|
140 | - $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
141 | - } |
|
142 | - |
|
143 | - if (function_exists('geodir_location_geo_home_link')) { |
|
144 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
145 | - } |
|
146 | - |
|
147 | - if (geodir_is_wpml()){ |
|
148 | - $home_url = icl_get_home_url(); |
|
149 | - }else{ |
|
150 | - $home_url = home_url(); |
|
151 | - } |
|
152 | - |
|
153 | - if (function_exists('geodir_location_geo_home_link')) { |
|
154 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
155 | - } |
|
156 | - |
|
157 | - if($gd_page_id){ |
|
158 | - $post = get_post($gd_page_id); |
|
159 | - $slug = $post->post_name; |
|
160 | - //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
|
161 | - $login_url = trailingslashit($home_url)."$slug/"; |
|
162 | - }else{ |
|
163 | - $login_url = trailingslashit($home_url)."?geodir_signup=true"; |
|
164 | - } |
|
165 | - |
|
166 | - if($args){ |
|
167 | - $login_url = add_query_arg($args,$login_url ); |
|
168 | - } |
|
169 | - |
|
170 | - /** |
|
171 | - * Filter the GeoDirectory login page url. |
|
172 | - * |
|
173 | - * This filter can be used to change the GeoDirectory page url. |
|
174 | - * |
|
175 | - * @since 1.5.3 |
|
176 | - * @package GeoDirectory |
|
177 | - * @param string $login_url The url of the login page. |
|
178 | - * @param array $args The array of query args used. |
|
179 | - * @param int $gd_page_id The page id of the GD login page. |
|
180 | - */ |
|
181 | - return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id); |
|
137 | + $gd_page_id = get_option('geodir_login_page'); |
|
138 | + |
|
139 | + if (geodir_is_wpml()) { |
|
140 | + $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
141 | + } |
|
142 | + |
|
143 | + if (function_exists('geodir_location_geo_home_link')) { |
|
144 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
145 | + } |
|
146 | + |
|
147 | + if (geodir_is_wpml()){ |
|
148 | + $home_url = icl_get_home_url(); |
|
149 | + }else{ |
|
150 | + $home_url = home_url(); |
|
151 | + } |
|
152 | + |
|
153 | + if (function_exists('geodir_location_geo_home_link')) { |
|
154 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
155 | + } |
|
156 | + |
|
157 | + if($gd_page_id){ |
|
158 | + $post = get_post($gd_page_id); |
|
159 | + $slug = $post->post_name; |
|
160 | + //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
|
161 | + $login_url = trailingslashit($home_url)."$slug/"; |
|
162 | + }else{ |
|
163 | + $login_url = trailingslashit($home_url)."?geodir_signup=true"; |
|
164 | + } |
|
165 | + |
|
166 | + if($args){ |
|
167 | + $login_url = add_query_arg($args,$login_url ); |
|
168 | + } |
|
169 | + |
|
170 | + /** |
|
171 | + * Filter the GeoDirectory login page url. |
|
172 | + * |
|
173 | + * This filter can be used to change the GeoDirectory page url. |
|
174 | + * |
|
175 | + * @since 1.5.3 |
|
176 | + * @package GeoDirectory |
|
177 | + * @param string $login_url The url of the login page. |
|
178 | + * @param array $args The array of query args used. |
|
179 | + * @param int $gd_page_id The page id of the GD login page. |
|
180 | + */ |
|
181 | + return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -190,40 +190,40 @@ discard block |
||
190 | 190 | * @return string Info page url. |
191 | 191 | */ |
192 | 192 | function geodir_info_url($args=array()){ |
193 | - $gd_page_id = get_option('geodir_info_page'); |
|
194 | - |
|
195 | - if (geodir_is_wpml()) { |
|
196 | - $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
197 | - } |
|
198 | - |
|
199 | - if (function_exists('geodir_location_geo_home_link')) { |
|
200 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
201 | - } |
|
202 | - |
|
203 | - if (geodir_is_wpml()){ |
|
204 | - $home_url = icl_get_home_url(); |
|
205 | - }else{ |
|
206 | - $home_url = home_url(); |
|
207 | - } |
|
208 | - |
|
209 | - if (function_exists('geodir_location_geo_home_link')) { |
|
210 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
211 | - } |
|
212 | - |
|
213 | - if($gd_page_id){ |
|
214 | - $post = get_post($gd_page_id); |
|
215 | - $slug = $post->post_name; |
|
216 | - //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
|
217 | - $info_url = trailingslashit($home_url)."$slug/"; |
|
218 | - }else{ |
|
219 | - $info_url = trailingslashit($home_url); |
|
220 | - } |
|
221 | - |
|
222 | - if($args){ |
|
223 | - $info_url = add_query_arg($args,$info_url ); |
|
224 | - } |
|
225 | - |
|
226 | - return $info_url; |
|
193 | + $gd_page_id = get_option('geodir_info_page'); |
|
194 | + |
|
195 | + if (geodir_is_wpml()) { |
|
196 | + $gd_page_id = geodir_wpml_object_id($gd_page_id, 'page', true); |
|
197 | + } |
|
198 | + |
|
199 | + if (function_exists('geodir_location_geo_home_link')) { |
|
200 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
201 | + } |
|
202 | + |
|
203 | + if (geodir_is_wpml()){ |
|
204 | + $home_url = icl_get_home_url(); |
|
205 | + }else{ |
|
206 | + $home_url = home_url(); |
|
207 | + } |
|
208 | + |
|
209 | + if (function_exists('geodir_location_geo_home_link')) { |
|
210 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
211 | + } |
|
212 | + |
|
213 | + if($gd_page_id){ |
|
214 | + $post = get_post($gd_page_id); |
|
215 | + $slug = $post->post_name; |
|
216 | + //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
|
217 | + $info_url = trailingslashit($home_url)."$slug/"; |
|
218 | + }else{ |
|
219 | + $info_url = trailingslashit($home_url); |
|
220 | + } |
|
221 | + |
|
222 | + if($args){ |
|
223 | + $info_url = add_query_arg($args,$info_url ); |
|
224 | + } |
|
225 | + |
|
226 | + return $info_url; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | * @return string Returns converted string. |
240 | 240 | */ |
241 | 241 | function geodir_ucwords($string, $charset='UTF-8') { |
242 | - if (function_exists('mb_convert_case')) { |
|
243 | - return mb_convert_case($string, MB_CASE_TITLE, $charset); |
|
244 | - } else { |
|
245 | - return ucwords($string); |
|
246 | - } |
|
242 | + if (function_exists('mb_convert_case')) { |
|
243 | + return mb_convert_case($string, MB_CASE_TITLE, $charset); |
|
244 | + } else { |
|
245 | + return ucwords($string); |
|
246 | + } |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | /** |
@@ -259,11 +259,11 @@ discard block |
||
259 | 259 | * @return string Returns converted string. |
260 | 260 | */ |
261 | 261 | function geodir_strtolower($string, $charset='UTF-8') { |
262 | - if (function_exists('mb_convert_case')) { |
|
263 | - return mb_convert_case($string, MB_CASE_LOWER, $charset); |
|
264 | - } else { |
|
265 | - return strtolower($string); |
|
266 | - } |
|
262 | + if (function_exists('mb_convert_case')) { |
|
263 | + return mb_convert_case($string, MB_CASE_LOWER, $charset); |
|
264 | + } else { |
|
265 | + return strtolower($string); |
|
266 | + } |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
@@ -279,11 +279,11 @@ discard block |
||
279 | 279 | * @return string Returns converted string. |
280 | 280 | */ |
281 | 281 | function geodir_strtoupper($string, $charset='UTF-8') { |
282 | - if (function_exists('mb_convert_case')) { |
|
283 | - return mb_convert_case($string, MB_CASE_UPPER, $charset); |
|
284 | - } else { |
|
285 | - return strtoupper($string); |
|
286 | - } |
|
282 | + if (function_exists('mb_convert_case')) { |
|
283 | + return mb_convert_case($string, MB_CASE_UPPER, $charset); |
|
284 | + } else { |
|
285 | + return strtoupper($string); |
|
286 | + } |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | /** |
@@ -462,11 +462,11 @@ discard block |
||
462 | 462 | * @package GeoDirectory |
463 | 463 | */ |
464 | 464 | function _gd_die_handler() { |
465 | - if ( defined( 'GD_TESTING_MODE' ) ) { |
|
466 | - return '_gd_die_handler'; |
|
467 | - } else { |
|
468 | - die(); |
|
469 | - } |
|
465 | + if ( defined( 'GD_TESTING_MODE' ) ) { |
|
466 | + return '_gd_die_handler'; |
|
467 | + } else { |
|
468 | + die(); |
|
469 | + } |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
@@ -481,9 +481,9 @@ discard block |
||
481 | 481 | * @param int $status Optional. Status code. |
482 | 482 | */ |
483 | 483 | function gd_die( $message = '', $title = '', $status = 400 ) { |
484 | - add_filter( 'wp_die_ajax_handler', '_gd_die_handler', 10, 3 ); |
|
485 | - add_filter( 'wp_die_handler', '_gd_die_handler', 10, 3 ); |
|
486 | - wp_die( $message, $title, array( 'response' => $status )); |
|
484 | + add_filter( 'wp_die_ajax_handler', '_gd_die_handler', 10, 3 ); |
|
485 | + add_filter( 'wp_die_handler', '_gd_die_handler', 10, 3 ); |
|
486 | + wp_die( $message, $title, array( 'response' => $status )); |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | /* |
@@ -660,44 +660,44 @@ discard block |
||
660 | 660 | * @return string The formatted date. |
661 | 661 | */ |
662 | 662 | function geodir_date( $date_input, $date_to, $date_from = '', $locale = false ) { |
663 | - if ( empty( $date_input ) || empty( $date_to ) ) { |
|
664 | - return NULL; |
|
665 | - } |
|
663 | + if ( empty( $date_input ) || empty( $date_to ) ) { |
|
664 | + return NULL; |
|
665 | + } |
|
666 | 666 | |
667 | - $date_input = geodir_maybe_untranslate_date( $date_input ); |
|
667 | + $date_input = geodir_maybe_untranslate_date( $date_input ); |
|
668 | 668 | |
669 | - $timestamp = 0; |
|
670 | - if (!empty( $date_from ) && function_exists( 'date_create_from_format' ) ) { |
|
671 | - $datetime = date_create_from_format( $date_from, $date_input ); |
|
672 | - if ( !empty( $datetime ) ) { |
|
673 | - $timestamp = $datetime->getTimestamp(); |
|
674 | - } |
|
675 | - } |
|
669 | + $timestamp = 0; |
|
670 | + if (!empty( $date_from ) && function_exists( 'date_create_from_format' ) ) { |
|
671 | + $datetime = date_create_from_format( $date_from, $date_input ); |
|
672 | + if ( !empty( $datetime ) ) { |
|
673 | + $timestamp = $datetime->getTimestamp(); |
|
674 | + } |
|
675 | + } |
|
676 | 676 | |
677 | - if ( empty( $timestamp ) ) { |
|
678 | - $date = strpos( $date_input, '/' ) !== false ? str_replace( '/', '-', $date_input ) : $date_input; |
|
679 | - $timestamp = strtotime( $date ); |
|
680 | - } |
|
677 | + if ( empty( $timestamp ) ) { |
|
678 | + $date = strpos( $date_input, '/' ) !== false ? str_replace( '/', '-', $date_input ) : $date_input; |
|
679 | + $timestamp = strtotime( $date ); |
|
680 | + } |
|
681 | 681 | |
682 | - $date = date_i18n( $date_to, $timestamp ); |
|
682 | + $date = date_i18n( $date_to, $timestamp ); |
|
683 | 683 | |
684 | - if ( !$locale ) { |
|
685 | - $date = geodir_maybe_untranslate_date( $date ); |
|
686 | - } |
|
684 | + if ( !$locale ) { |
|
685 | + $date = geodir_maybe_untranslate_date( $date ); |
|
686 | + } |
|
687 | 687 | |
688 | - /** |
|
689 | - * Filter the the date format conversion. |
|
690 | - * |
|
691 | - * @since 1.6.7 |
|
692 | - * @package GeoDirectory |
|
693 | - * |
|
694 | - * @param string $date The date string. |
|
695 | - * @param string $date_input The date input. |
|
696 | - * @param string $date_to The destination date format. |
|
697 | - * @param string $date_from The source date format. |
|
698 | - * @param bool $locale True to retrieve the date in localized format. |
|
699 | - */ |
|
700 | - return apply_filters( 'geodir_date', $date, $date_input, $date_to, $date_from, $locale ); |
|
688 | + /** |
|
689 | + * Filter the the date format conversion. |
|
690 | + * |
|
691 | + * @since 1.6.7 |
|
692 | + * @package GeoDirectory |
|
693 | + * |
|
694 | + * @param string $date The date string. |
|
695 | + * @param string $date_input The date input. |
|
696 | + * @param string $date_to The destination date format. |
|
697 | + * @param string $date_from The source date format. |
|
698 | + * @param bool $locale True to retrieve the date in localized format. |
|
699 | + */ |
|
700 | + return apply_filters( 'geodir_date', $date, $date_input, $date_to, $date_from, $locale ); |
|
701 | 701 | } |
702 | 702 | |
703 | 703 | /** |
@@ -722,91 +722,91 @@ discard block |
||
722 | 722 | * @return string Trimmed string. |
723 | 723 | */ |
724 | 724 | function geodir_excerpt($text, $length = 100, $options = array()) { |
725 | - if (!(int)$length > 0) { |
|
726 | - return $text; |
|
727 | - } |
|
728 | - $default = array( |
|
729 | - 'ellipsis' => '', 'exact' => true, 'html' => true, 'trimWidth' => false, |
|
725 | + if (!(int)$length > 0) { |
|
726 | + return $text; |
|
727 | + } |
|
728 | + $default = array( |
|
729 | + 'ellipsis' => '', 'exact' => true, 'html' => true, 'trimWidth' => false, |
|
730 | 730 | ); |
731 | - if (!empty($options['html']) && function_exists('mb_internal_encoding') && strtolower(mb_internal_encoding()) === 'utf-8') { |
|
732 | - $default['ellipsis'] = ""; |
|
733 | - } |
|
734 | - $options += $default; |
|
735 | - |
|
736 | - $prefix = ''; |
|
737 | - $suffix = $options['ellipsis']; |
|
738 | - |
|
739 | - if ($options['html']) { |
|
740 | - $ellipsisLength = geodir_strlen(strip_tags($options['ellipsis']), $options); |
|
741 | - |
|
742 | - $truncateLength = 0; |
|
743 | - $totalLength = 0; |
|
744 | - $openTags = array(); |
|
745 | - $truncate = ''; |
|
746 | - |
|
747 | - preg_match_all('/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER); |
|
748 | - foreach ($tags as $tag) { |
|
749 | - $contentLength = geodir_strlen($tag[3], $options); |
|
750 | - |
|
751 | - if ($truncate === '') { |
|
752 | - if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/i', $tag[2])) { |
|
753 | - if (preg_match('/<[\w]+[^>]*>/', $tag[0])) { |
|
754 | - array_unshift($openTags, $tag[2]); |
|
755 | - } elseif (preg_match('/<\/([\w]+)[^>]*>/', $tag[0], $closeTag)) { |
|
756 | - $pos = array_search($closeTag[1], $openTags); |
|
757 | - if ($pos !== false) { |
|
758 | - array_splice($openTags, $pos, 1); |
|
759 | - } |
|
760 | - } |
|
761 | - } |
|
762 | - |
|
763 | - $prefix .= $tag[1]; |
|
764 | - |
|
765 | - if ($totalLength + $contentLength + $ellipsisLength > $length) { |
|
766 | - $truncate = $tag[3]; |
|
767 | - $truncateLength = $length - $totalLength; |
|
768 | - } else { |
|
769 | - $prefix .= $tag[3]; |
|
770 | - } |
|
771 | - } |
|
772 | - |
|
773 | - $totalLength += $contentLength; |
|
774 | - if ($totalLength > $length) { |
|
775 | - break; |
|
776 | - } |
|
777 | - } |
|
778 | - |
|
779 | - if ($totalLength <= $length) { |
|
780 | - return $text; |
|
781 | - } |
|
782 | - |
|
783 | - $text = $truncate; |
|
784 | - $length = $truncateLength; |
|
785 | - |
|
786 | - foreach ($openTags as $tag) { |
|
787 | - $suffix .= '</' . $tag . '>'; |
|
788 | - } |
|
789 | - } else { |
|
790 | - if (geodir_strlen($text, $options) <= $length) { |
|
791 | - return $text; |
|
792 | - } |
|
793 | - $ellipsisLength = geodir_strlen($options['ellipsis'], $options); |
|
794 | - } |
|
795 | - |
|
796 | - $result = geodir_substr($text, 0, $length - $ellipsisLength, $options); |
|
797 | - |
|
798 | - if (!$options['exact']) { |
|
799 | - if (geodir_substr($text, $length - $ellipsisLength, 1, $options) !== ' ') { |
|
800 | - $result = geodir_remove_last_word($result); |
|
801 | - } |
|
802 | - |
|
803 | - // Do not need to count ellipsis in the cut, if result is empty. |
|
804 | - if (!strlen($result)) { |
|
805 | - $result = geodir_substr($text, 0, $length, $options); |
|
806 | - } |
|
807 | - } |
|
808 | - |
|
809 | - return $prefix . $result . $suffix; |
|
731 | + if (!empty($options['html']) && function_exists('mb_internal_encoding') && strtolower(mb_internal_encoding()) === 'utf-8') { |
|
732 | + $default['ellipsis'] = ""; |
|
733 | + } |
|
734 | + $options += $default; |
|
735 | + |
|
736 | + $prefix = ''; |
|
737 | + $suffix = $options['ellipsis']; |
|
738 | + |
|
739 | + if ($options['html']) { |
|
740 | + $ellipsisLength = geodir_strlen(strip_tags($options['ellipsis']), $options); |
|
741 | + |
|
742 | + $truncateLength = 0; |
|
743 | + $totalLength = 0; |
|
744 | + $openTags = array(); |
|
745 | + $truncate = ''; |
|
746 | + |
|
747 | + preg_match_all('/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER); |
|
748 | + foreach ($tags as $tag) { |
|
749 | + $contentLength = geodir_strlen($tag[3], $options); |
|
750 | + |
|
751 | + if ($truncate === '') { |
|
752 | + if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/i', $tag[2])) { |
|
753 | + if (preg_match('/<[\w]+[^>]*>/', $tag[0])) { |
|
754 | + array_unshift($openTags, $tag[2]); |
|
755 | + } elseif (preg_match('/<\/([\w]+)[^>]*>/', $tag[0], $closeTag)) { |
|
756 | + $pos = array_search($closeTag[1], $openTags); |
|
757 | + if ($pos !== false) { |
|
758 | + array_splice($openTags, $pos, 1); |
|
759 | + } |
|
760 | + } |
|
761 | + } |
|
762 | + |
|
763 | + $prefix .= $tag[1]; |
|
764 | + |
|
765 | + if ($totalLength + $contentLength + $ellipsisLength > $length) { |
|
766 | + $truncate = $tag[3]; |
|
767 | + $truncateLength = $length - $totalLength; |
|
768 | + } else { |
|
769 | + $prefix .= $tag[3]; |
|
770 | + } |
|
771 | + } |
|
772 | + |
|
773 | + $totalLength += $contentLength; |
|
774 | + if ($totalLength > $length) { |
|
775 | + break; |
|
776 | + } |
|
777 | + } |
|
778 | + |
|
779 | + if ($totalLength <= $length) { |
|
780 | + return $text; |
|
781 | + } |
|
782 | + |
|
783 | + $text = $truncate; |
|
784 | + $length = $truncateLength; |
|
785 | + |
|
786 | + foreach ($openTags as $tag) { |
|
787 | + $suffix .= '</' . $tag . '>'; |
|
788 | + } |
|
789 | + } else { |
|
790 | + if (geodir_strlen($text, $options) <= $length) { |
|
791 | + return $text; |
|
792 | + } |
|
793 | + $ellipsisLength = geodir_strlen($options['ellipsis'], $options); |
|
794 | + } |
|
795 | + |
|
796 | + $result = geodir_substr($text, 0, $length - $ellipsisLength, $options); |
|
797 | + |
|
798 | + if (!$options['exact']) { |
|
799 | + if (geodir_substr($text, $length - $ellipsisLength, 1, $options) !== ' ') { |
|
800 | + $result = geodir_remove_last_word($result); |
|
801 | + } |
|
802 | + |
|
803 | + // Do not need to count ellipsis in the cut, if result is empty. |
|
804 | + if (!strlen($result)) { |
|
805 | + $result = geodir_substr($text, 0, $length, $options); |
|
806 | + } |
|
807 | + } |
|
808 | + |
|
809 | + return $prefix . $result . $suffix; |
|
810 | 810 | } |
811 | 811 | |
812 | 812 | /** |
@@ -830,28 +830,28 @@ discard block |
||
830 | 830 | * @return int |
831 | 831 | */ |
832 | 832 | function geodir_strlen($text, array $options) { |
833 | - if (empty($options['trimWidth'])) { |
|
834 | - $strlen = 'geodir_utf8_strlen'; |
|
835 | - } else { |
|
836 | - $strlen = 'geodir_utf8_strwidth'; |
|
837 | - } |
|
838 | - |
|
839 | - if (empty($options['html'])) { |
|
840 | - return $strlen($text); |
|
841 | - } |
|
842 | - |
|
843 | - $pattern = '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i'; |
|
844 | - $replace = preg_replace_callback( |
|
845 | - $pattern, |
|
846 | - function ($match) use ($strlen) { |
|
847 | - $utf8 = html_entity_decode($match[0], ENT_HTML5 | ENT_QUOTES, 'UTF-8'); |
|
848 | - |
|
849 | - return str_repeat(' ', $strlen($utf8, 'UTF-8')); |
|
850 | - }, |
|
851 | - $text |
|
852 | - ); |
|
853 | - |
|
854 | - return $strlen($replace); |
|
833 | + if (empty($options['trimWidth'])) { |
|
834 | + $strlen = 'geodir_utf8_strlen'; |
|
835 | + } else { |
|
836 | + $strlen = 'geodir_utf8_strwidth'; |
|
837 | + } |
|
838 | + |
|
839 | + if (empty($options['html'])) { |
|
840 | + return $strlen($text); |
|
841 | + } |
|
842 | + |
|
843 | + $pattern = '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i'; |
|
844 | + $replace = preg_replace_callback( |
|
845 | + $pattern, |
|
846 | + function ($match) use ($strlen) { |
|
847 | + $utf8 = html_entity_decode($match[0], ENT_HTML5 | ENT_QUOTES, 'UTF-8'); |
|
848 | + |
|
849 | + return str_repeat(' ', $strlen($utf8, 'UTF-8')); |
|
850 | + }, |
|
851 | + $text |
|
852 | + ); |
|
853 | + |
|
854 | + return $strlen($replace); |
|
855 | 855 | } |
856 | 856 | |
857 | 857 | /** |
@@ -872,80 +872,80 @@ discard block |
||
872 | 872 | * @return string |
873 | 873 | */ |
874 | 874 | function geodir_substr($text, $start, $length, array $options) { |
875 | - if (empty($options['trimWidth'])) { |
|
876 | - $substr = 'geodir_utf8_substr'; |
|
877 | - } else { |
|
878 | - $substr = 'geodir_utf8_strimwidth'; |
|
879 | - } |
|
880 | - |
|
881 | - $maxPosition = geodir_strlen($text, array('trimWidth' => false) + $options); |
|
882 | - if ($start < 0) { |
|
883 | - $start += $maxPosition; |
|
884 | - if ($start < 0) { |
|
885 | - $start = 0; |
|
886 | - } |
|
887 | - } |
|
888 | - if ($start >= $maxPosition) { |
|
889 | - return ''; |
|
890 | - } |
|
891 | - |
|
892 | - if ($length === null) { |
|
893 | - $length = geodir_strlen($text, $options); |
|
894 | - } |
|
895 | - |
|
896 | - if ($length < 0) { |
|
897 | - $text = geodir_substr($text, $start, null, $options); |
|
898 | - $start = 0; |
|
899 | - $length += geodir_strlen($text, $options); |
|
900 | - } |
|
901 | - |
|
902 | - if ($length <= 0) { |
|
903 | - return ''; |
|
904 | - } |
|
905 | - |
|
906 | - if (empty($options['html'])) { |
|
907 | - return (string)$substr($text, $start, $length); |
|
908 | - } |
|
909 | - |
|
910 | - $totalOffset = 0; |
|
911 | - $totalLength = 0; |
|
912 | - $result = ''; |
|
913 | - |
|
914 | - $pattern = '/(&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};)/i'; |
|
915 | - $parts = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
|
916 | - foreach ($parts as $part) { |
|
917 | - $offset = 0; |
|
918 | - |
|
919 | - if ($totalOffset < $start) { |
|
920 | - $len = geodir_strlen($part, array('trimWidth' => false) + $options); |
|
921 | - if ($totalOffset + $len <= $start) { |
|
922 | - $totalOffset += $len; |
|
923 | - continue; |
|
924 | - } |
|
925 | - |
|
926 | - $offset = $start - $totalOffset; |
|
927 | - $totalOffset = $start; |
|
928 | - } |
|
929 | - |
|
930 | - $len = geodir_strlen($part, $options); |
|
931 | - if ($offset !== 0 || $totalLength + $len > $length) { |
|
932 | - if (strpos($part, '&') === 0 && preg_match($pattern, $part) && $part !== html_entity_decode($part, ENT_HTML5 | ENT_QUOTES, 'UTF-8') ) { |
|
933 | - // Entities cannot be passed substr. |
|
934 | - continue; |
|
935 | - } |
|
936 | - |
|
937 | - $part = $substr($part, $offset, $length - $totalLength); |
|
938 | - $len = geodir_strlen($part, $options); |
|
939 | - } |
|
940 | - |
|
941 | - $result .= $part; |
|
942 | - $totalLength += $len; |
|
943 | - if ($totalLength >= $length) { |
|
944 | - break; |
|
945 | - } |
|
946 | - } |
|
947 | - |
|
948 | - return $result; |
|
875 | + if (empty($options['trimWidth'])) { |
|
876 | + $substr = 'geodir_utf8_substr'; |
|
877 | + } else { |
|
878 | + $substr = 'geodir_utf8_strimwidth'; |
|
879 | + } |
|
880 | + |
|
881 | + $maxPosition = geodir_strlen($text, array('trimWidth' => false) + $options); |
|
882 | + if ($start < 0) { |
|
883 | + $start += $maxPosition; |
|
884 | + if ($start < 0) { |
|
885 | + $start = 0; |
|
886 | + } |
|
887 | + } |
|
888 | + if ($start >= $maxPosition) { |
|
889 | + return ''; |
|
890 | + } |
|
891 | + |
|
892 | + if ($length === null) { |
|
893 | + $length = geodir_strlen($text, $options); |
|
894 | + } |
|
895 | + |
|
896 | + if ($length < 0) { |
|
897 | + $text = geodir_substr($text, $start, null, $options); |
|
898 | + $start = 0; |
|
899 | + $length += geodir_strlen($text, $options); |
|
900 | + } |
|
901 | + |
|
902 | + if ($length <= 0) { |
|
903 | + return ''; |
|
904 | + } |
|
905 | + |
|
906 | + if (empty($options['html'])) { |
|
907 | + return (string)$substr($text, $start, $length); |
|
908 | + } |
|
909 | + |
|
910 | + $totalOffset = 0; |
|
911 | + $totalLength = 0; |
|
912 | + $result = ''; |
|
913 | + |
|
914 | + $pattern = '/(&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};)/i'; |
|
915 | + $parts = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
|
916 | + foreach ($parts as $part) { |
|
917 | + $offset = 0; |
|
918 | + |
|
919 | + if ($totalOffset < $start) { |
|
920 | + $len = geodir_strlen($part, array('trimWidth' => false) + $options); |
|
921 | + if ($totalOffset + $len <= $start) { |
|
922 | + $totalOffset += $len; |
|
923 | + continue; |
|
924 | + } |
|
925 | + |
|
926 | + $offset = $start - $totalOffset; |
|
927 | + $totalOffset = $start; |
|
928 | + } |
|
929 | + |
|
930 | + $len = geodir_strlen($part, $options); |
|
931 | + if ($offset !== 0 || $totalLength + $len > $length) { |
|
932 | + if (strpos($part, '&') === 0 && preg_match($pattern, $part) && $part !== html_entity_decode($part, ENT_HTML5 | ENT_QUOTES, 'UTF-8') ) { |
|
933 | + // Entities cannot be passed substr. |
|
934 | + continue; |
|
935 | + } |
|
936 | + |
|
937 | + $part = $substr($part, $offset, $length - $totalLength); |
|
938 | + $len = geodir_strlen($part, $options); |
|
939 | + } |
|
940 | + |
|
941 | + $result .= $part; |
|
942 | + $totalLength += $len; |
|
943 | + if ($totalLength >= $length) { |
|
944 | + break; |
|
945 | + } |
|
946 | + } |
|
947 | + |
|
948 | + return $result; |
|
949 | 949 | } |
950 | 950 | |
951 | 951 | /** |
@@ -958,21 +958,21 @@ discard block |
||
958 | 958 | * @return string |
959 | 959 | */ |
960 | 960 | function geodir_remove_last_word($text) { |
961 | - $spacepos = geodir_utf8_strrpos($text, ' '); |
|
961 | + $spacepos = geodir_utf8_strrpos($text, ' '); |
|
962 | 962 | |
963 | - if ($spacepos !== false) { |
|
964 | - $lastWord = geodir_utf8_strrpos($text, $spacepos); |
|
963 | + if ($spacepos !== false) { |
|
964 | + $lastWord = geodir_utf8_strrpos($text, $spacepos); |
|
965 | 965 | |
966 | - // Some languages are written without word separation. |
|
967 | - // We recognize a string as a word if it does not contain any full-width characters. |
|
968 | - if (geodir_utf8_strwidth($lastWord) === geodir_utf8_strlen($lastWord)) { |
|
969 | - $text = geodir_utf8_substr($text, 0, $spacepos); |
|
970 | - } |
|
966 | + // Some languages are written without word separation. |
|
967 | + // We recognize a string as a word if it does not contain any full-width characters. |
|
968 | + if (geodir_utf8_strwidth($lastWord) === geodir_utf8_strlen($lastWord)) { |
|
969 | + $text = geodir_utf8_substr($text, 0, $spacepos); |
|
970 | + } |
|
971 | 971 | |
972 | - return $text; |
|
973 | - } |
|
972 | + return $text; |
|
973 | + } |
|
974 | 974 | |
975 | - return ''; |
|
975 | + return ''; |
|
976 | 976 | } |
977 | 977 | |
978 | 978 | function geodir_tool_restore_cpt_from_taxonomies(){ |
@@ -1090,11 +1090,11 @@ discard block |
||
1090 | 1090 | * @return string |
1091 | 1091 | */ |
1092 | 1092 | function geodir_utf8_strimwidth( $str, $start, $width, $trimmaker = '', $encoding = 'UTF-8' ) { |
1093 | - if ( function_exists( 'mb_strimwidth' ) ) { |
|
1094 | - return mb_strimwidth( $str, $start, $width, $trimmaker, $encoding ); |
|
1095 | - } |
|
1093 | + if ( function_exists( 'mb_strimwidth' ) ) { |
|
1094 | + return mb_strimwidth( $str, $start, $width, $trimmaker, $encoding ); |
|
1095 | + } |
|
1096 | 1096 | |
1097 | - return geodir_utf8_substr( $str, $start, $width, $encoding ) . $trimmaker; |
|
1097 | + return geodir_utf8_substr( $str, $start, $width, $encoding ) . $trimmaker; |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | /** |
@@ -1108,11 +1108,11 @@ discard block |
||
1108 | 1108 | * @return int Returns the number of characters in string. |
1109 | 1109 | */ |
1110 | 1110 | function geodir_utf8_strlen( $str, $encoding = 'UTF-8' ) { |
1111 | - if ( function_exists( 'mb_strlen' ) ) { |
|
1112 | - return mb_strlen( $str, $encoding ); |
|
1113 | - } |
|
1111 | + if ( function_exists( 'mb_strlen' ) ) { |
|
1112 | + return mb_strlen( $str, $encoding ); |
|
1113 | + } |
|
1114 | 1114 | |
1115 | - return strlen( $str ); |
|
1115 | + return strlen( $str ); |
|
1116 | 1116 | } |
1117 | 1117 | |
1118 | 1118 | /** |
@@ -1128,11 +1128,11 @@ discard block |
||
1128 | 1128 | * @return int Returns the position of the first occurrence of search in the string. |
1129 | 1129 | */ |
1130 | 1130 | function geodir_utf8_strpos( $str, $find, $offset = 0, $encoding = 'UTF-8' ) { |
1131 | - if ( function_exists( 'mb_strpos' ) ) { |
|
1132 | - return mb_strpos( $str, $find, $offset, $encoding ); |
|
1133 | - } |
|
1131 | + if ( function_exists( 'mb_strpos' ) ) { |
|
1132 | + return mb_strpos( $str, $find, $offset, $encoding ); |
|
1133 | + } |
|
1134 | 1134 | |
1135 | - return strpos( $str, $find, $offset ); |
|
1135 | + return strpos( $str, $find, $offset ); |
|
1136 | 1136 | } |
1137 | 1137 | |
1138 | 1138 | /** |
@@ -1148,11 +1148,11 @@ discard block |
||
1148 | 1148 | * @return int Returns the position of the last occurrence of search. |
1149 | 1149 | */ |
1150 | 1150 | function geodir_utf8_strrpos( $str, $find, $offset = 0, $encoding = 'UTF-8' ) { |
1151 | - if ( function_exists( 'mb_strrpos' ) ) { |
|
1152 | - return mb_strrpos( $str, $find, $offset, $encoding ); |
|
1153 | - } |
|
1151 | + if ( function_exists( 'mb_strrpos' ) ) { |
|
1152 | + return mb_strrpos( $str, $find, $offset, $encoding ); |
|
1153 | + } |
|
1154 | 1154 | |
1155 | - return strrpos( $str, $find, $offset ); |
|
1155 | + return strrpos( $str, $find, $offset ); |
|
1156 | 1156 | } |
1157 | 1157 | |
1158 | 1158 | /** |
@@ -1169,15 +1169,15 @@ discard block |
||
1169 | 1169 | * @return string |
1170 | 1170 | */ |
1171 | 1171 | function geodir_utf8_substr( $str, $start, $length = null, $encoding = 'UTF-8' ) { |
1172 | - if ( function_exists( 'mb_substr' ) ) { |
|
1173 | - if ( $length === null ) { |
|
1174 | - return mb_substr( $str, $start, geodir_utf8_strlen( $str, $encoding ), $encoding ); |
|
1175 | - } else { |
|
1176 | - return mb_substr( $str, $start, $length, $encoding ); |
|
1177 | - } |
|
1178 | - } |
|
1172 | + if ( function_exists( 'mb_substr' ) ) { |
|
1173 | + if ( $length === null ) { |
|
1174 | + return mb_substr( $str, $start, geodir_utf8_strlen( $str, $encoding ), $encoding ); |
|
1175 | + } else { |
|
1176 | + return mb_substr( $str, $start, $length, $encoding ); |
|
1177 | + } |
|
1178 | + } |
|
1179 | 1179 | |
1180 | - return substr( $str, $start, $length ); |
|
1180 | + return substr( $str, $start, $length ); |
|
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | /** |
@@ -1210,20 +1210,20 @@ discard block |
||
1210 | 1210 | * @return string The resulting string. |
1211 | 1211 | */ |
1212 | 1212 | function geodir_utf8_ucfirst( $str, $lower_str_end = false, $encoding = 'UTF-8' ) { |
1213 | - if ( function_exists( 'mb_strlen' ) ) { |
|
1214 | - $first_letter = geodir_strtoupper( geodir_utf8_substr( $str, 0, 1, $encoding ), $encoding ); |
|
1215 | - $str_end = ""; |
|
1213 | + if ( function_exists( 'mb_strlen' ) ) { |
|
1214 | + $first_letter = geodir_strtoupper( geodir_utf8_substr( $str, 0, 1, $encoding ), $encoding ); |
|
1215 | + $str_end = ""; |
|
1216 | 1216 | |
1217 | - if ( $lower_str_end ) { |
|
1218 | - $str_end = geodir_strtolower( geodir_utf8_substr( $str, 1, geodir_utf8_strlen( $str, $encoding ), $encoding ), $encoding ); |
|
1219 | - } else { |
|
1220 | - $str_end = geodir_utf8_substr( $str, 1, geodir_utf8_strlen( $str, $encoding ), $encoding ); |
|
1221 | - } |
|
1217 | + if ( $lower_str_end ) { |
|
1218 | + $str_end = geodir_strtolower( geodir_utf8_substr( $str, 1, geodir_utf8_strlen( $str, $encoding ), $encoding ), $encoding ); |
|
1219 | + } else { |
|
1220 | + $str_end = geodir_utf8_substr( $str, 1, geodir_utf8_strlen( $str, $encoding ), $encoding ); |
|
1221 | + } |
|
1222 | 1222 | |
1223 | - return $first_letter . $str_end; |
|
1224 | - } |
|
1223 | + return $first_letter . $str_end; |
|
1224 | + } |
|
1225 | 1225 | |
1226 | - return ucfirst( $str ); |
|
1226 | + return ucfirst( $str ); |
|
1227 | 1227 | } |
1228 | 1228 | |
1229 | 1229 | function geodir_total_listings_count($post_type = false) |