|
1 <?php |
|
2 |
|
3 /** inove options */ |
|
4 class iNoveOptions { |
|
5 |
|
6 function getOptions() { |
|
7 $options = get_option('inove_options'); |
|
8 if (!is_array($options)) { |
|
9 $options['google_cse'] = false; |
|
10 $options['google_cse_cx'] = ''; |
|
11 $options['menu_type'] = 'pages'; |
|
12 $options['nosidebar'] = false; |
|
13 $options['notice'] = false; |
|
14 $options['notice_content'] = ''; |
|
15 $options['banner_registered'] = false; |
|
16 $options['banner_commentator'] = false; |
|
17 $options['banner_visitor'] = false; |
|
18 $options['banner_content'] = ''; |
|
19 $options['showcase_registered'] = false; |
|
20 $options['showcase_commentator'] = false; |
|
21 $options['showcase_visitor'] = false; |
|
22 $options['showcase_caption'] = false; |
|
23 $options['showcase_title'] = ''; |
|
24 $options['showcase_content'] = ''; |
|
25 $options['author'] = true; |
|
26 $options['categories'] = true; |
|
27 $options['tags'] = true; |
|
28 $options['ctrlentry'] = false; |
|
29 $options['feed_readers'] = true; |
|
30 $options['feed'] = false; |
|
31 $options['feed_url'] = ''; |
|
32 $options['feed_email'] = false; |
|
33 $options['feed_url_email'] = ''; |
|
34 $options['twitter'] = false; |
|
35 $options['twitter_username'] = ''; |
|
36 $options['analytics'] = false; |
|
37 $options['analytics_content'] = ''; |
|
38 update_option('inove_options', $options); |
|
39 } |
|
40 return $options; |
|
41 } |
|
42 |
|
43 function add() { |
|
44 if(isset($_POST['inove_save'])) { |
|
45 $options = iNoveOptions::getOptions(); |
|
46 |
|
47 // google custom search engine |
|
48 if ($_POST['google_cse']) { |
|
49 $options['google_cse'] = (bool)true; |
|
50 } else { |
|
51 $options['google_cse'] = (bool)false; |
|
52 } |
|
53 $options['google_cse_cx'] = stripslashes($_POST['google_cse_cx']); |
|
54 |
|
55 // menu |
|
56 $options['menu_type'] = stripslashes($_POST['menu_type']); |
|
57 |
|
58 // sidebar |
|
59 if ($_POST['nosidebar']) { |
|
60 $options['nosidebar'] = (bool)true; |
|
61 } else { |
|
62 $options['nosidebar'] = (bool)false; |
|
63 } |
|
64 |
|
65 // notice |
|
66 if ($_POST['notice']) { |
|
67 $options['notice'] = (bool)true; |
|
68 } else { |
|
69 $options['notice'] = (bool)false; |
|
70 } |
|
71 $options['notice_content'] = stripslashes($_POST['notice_content']); |
|
72 |
|
73 // banner |
|
74 if (!$_POST['banner_registered']) { |
|
75 $options['banner_registered'] = (bool)false; |
|
76 } else { |
|
77 $options['banner_registered'] = (bool)true; |
|
78 } |
|
79 if (!$_POST['banner_commentator']) { |
|
80 $options['banner_commentator'] = (bool)false; |
|
81 } else { |
|
82 $options['banner_commentator'] = (bool)true; |
|
83 } |
|
84 if (!$_POST['banner_visitor']) { |
|
85 $options['banner_visitor'] = (bool)false; |
|
86 } else { |
|
87 $options['banner_visitor'] = (bool)true; |
|
88 } |
|
89 $options['banner_content'] = stripslashes($_POST['banner_content']); |
|
90 |
|
91 // showcase |
|
92 if (!$_POST['showcase_registered']) { |
|
93 $options['showcase_registered'] = (bool)false; |
|
94 } else { |
|
95 $options['showcase_registered'] = (bool)true; |
|
96 } |
|
97 if (!$_POST['showcase_commentator']) { |
|
98 $options['showcase_commentator'] = (bool)false; |
|
99 } else { |
|
100 $options['showcase_commentator'] = (bool)true; |
|
101 } |
|
102 if (!$_POST['showcase_visitor']) { |
|
103 $options['showcase_visitor'] = (bool)false; |
|
104 } else { |
|
105 $options['showcase_visitor'] = (bool)true; |
|
106 } |
|
107 if ($_POST['showcase_caption']) { |
|
108 $options['showcase_caption'] = (bool)true; |
|
109 } else { |
|
110 $options['showcase_caption'] = (bool)false; |
|
111 } |
|
112 $options['showcase_title'] = stripslashes($_POST['showcase_title']); |
|
113 $options['showcase_content'] = stripslashes($_POST['showcase_content']); |
|
114 |
|
115 // posts |
|
116 if ($_POST['author']) { |
|
117 $options['author'] = (bool)true; |
|
118 } else { |
|
119 $options['author'] = (bool)false; |
|
120 } |
|
121 if ($_POST['categories']) { |
|
122 $options['categories'] = (bool)true; |
|
123 } else { |
|
124 $options['categories'] = (bool)false; |
|
125 } |
|
126 if (!$_POST['tags']) { |
|
127 $options['tags'] = (bool)false; |
|
128 } else { |
|
129 $options['tags'] = (bool)true; |
|
130 } |
|
131 |
|
132 // ctrl + entry |
|
133 if ($_POST['ctrlentry']) { |
|
134 $options['ctrlentry'] = (bool)true; |
|
135 } else { |
|
136 $options['ctrlentry'] = (bool)false; |
|
137 } |
|
138 |
|
139 // feed |
|
140 if (!$_POST['feed_readers']) { |
|
141 $options['feed_readers'] = (bool)false; |
|
142 } else { |
|
143 $options['feed_readers'] = (bool)true; |
|
144 } |
|
145 if ($_POST['feed']) { |
|
146 $options['feed'] = (bool)true; |
|
147 } else { |
|
148 $options['feed'] = (bool)false; |
|
149 } |
|
150 $options['feed_url'] = stripslashes($_POST['feed_url']); |
|
151 if ($_POST['feed_email']) { |
|
152 $options['feed_email'] = (bool)true; |
|
153 } else { |
|
154 $options['feed_email'] = (bool)false; |
|
155 } |
|
156 $options['feed_url_email'] = stripslashes($_POST['feed_url_email']); |
|
157 |
|
158 // twitter |
|
159 if ($_POST['twitter']) { |
|
160 $options['twitter'] = (bool)true; |
|
161 } else { |
|
162 $options['twitter'] = (bool)false; |
|
163 } |
|
164 $options['twitter_username'] = stripslashes($_POST['twitter_username']); |
|
165 |
|
166 // analytics |
|
167 if ($_POST['analytics']) { |
|
168 $options['analytics'] = (bool)true; |
|
169 } else { |
|
170 $options['analytics'] = (bool)false; |
|
171 } |
|
172 $options['analytics_content'] = stripslashes($_POST['analytics_content']); |
|
173 |
|
174 update_option('inove_options', $options); |
|
175 |
|
176 } else { |
|
177 iNoveOptions::getOptions(); |
|
178 } |
|
179 |
|
180 add_theme_page(__('Current Theme Options', 'inove'), __('Current Theme Options', 'inove'), 'edit_themes', basename(__FILE__), array('iNoveOptions', 'display')); |
|
181 } |
|
182 |
|
183 function display() { |
|
184 $options = iNoveOptions::getOptions(); |
|
185 ?> |
|
186 |
|
187 <form action="#" method="post" enctype="multipart/form-data" name="inove_form" id="inove_form"> |
|
188 <div class="wrap"> |
|
189 <h2><?php _e('Current Theme Options', 'inove'); ?></h2> |
|
190 |
|
191 <table class="form-table"> |
|
192 <tbody> |
|
193 <tr valign="top"> |
|
194 <th scope="row"><?php _e('Search', 'inove'); ?></th> |
|
195 <td> |
|
196 <label> |
|
197 <input name="google_cse" type="checkbox" value="checkbox" <?php if($options['google_cse']) echo "checked='checked'"; ?> /> |
|
198 <?php _e('Using google custom search engine.', 'inove'); ?> |
|
199 </label> |
|
200 <br/> |
|
201 <?php _e('CX:', 'inove'); ?> |
|
202 <input type="text" name="google_cse_cx" id="google_cse_cx" class="code" size="40" value="<?php echo($options['google_cse_cx']); ?>"> |
|
203 <br/> |
|
204 <?php printf(__('Find <code>name="cx"</code> in the <strong>Search box code</strong> of <a href="%1$s">Google Custom Search Engine</a>, and type the <code>value</code> here.<br/>For example: <code>014782006753236413342:1ltfrybsbz4</code>', 'inove'), 'http://www.google.com/coop/cse/'); ?> |
|
205 </td> |
|
206 </tr> |
|
207 </tbody> |
|
208 </table> |
|
209 |
|
210 <table class="form-table"> |
|
211 <tbody> |
|
212 <tr valign="top"> |
|
213 <th scope="row"><?php _e('Menubar', 'inove'); ?></th> |
|
214 <td> |
|
215 <label style="margin-right:20px;"> |
|
216 <input name="menu_type" type="radio" value="pages" <?php if($options['menu_type'] != 'categories') echo "checked='checked'"; ?> /> |
|
217 <?php _e('Show pages as menu.', 'inove'); ?> |
|
218 </label> |
|
219 <label> |
|
220 <input name="menu_type" type="radio" value="categories" <?php if($options['menu_type'] == 'categories') echo "checked='checked'"; ?> /> |
|
221 <?php _e('Show categories as menu.', 'inove'); ?> |
|
222 </label> |
|
223 </td> |
|
224 </tr> |
|
225 </tbody> |
|
226 </table> |
|
227 |
|
228 <table class="form-table"> |
|
229 <tbody> |
|
230 <tr valign="top"> |
|
231 <th scope="row"><?php _e('Sidebar', 'inove'); ?></th> |
|
232 <td> |
|
233 <label> |
|
234 <input name="nosidebar" type="checkbox" value="checkbox" <?php if($options['nosidebar']) echo "checked='checked'"; ?> /> |
|
235 <?php _e('Hide sidebar from all pages.', 'inove'); ?> |
|
236 </label> |
|
237 </td> |
|
238 </tr> |
|
239 </tbody> |
|
240 </table> |
|
241 |
|
242 <table class="form-table"> |
|
243 <tbody> |
|
244 <tr valign="top"> |
|
245 <th scope="row"> |
|
246 <?php _e('Notice', 'inove'); ?> |
|
247 <br/> |
|
248 <small style="font-weight:normal;"><?php _e('HTML enabled', 'inove'); ?></small> |
|
249 </th> |
|
250 <td> |
|
251 <!-- notice START --> |
|
252 <label> |
|
253 <input name="notice" type="checkbox" value="checkbox" <?php if($options['notice']) echo "checked='checked'"; ?> /> |
|
254 <?php _e('This notice bar will display at the top of posts on homepage.', 'inove'); ?> |
|
255 </label> |
|
256 <br /> |
|
257 <label> |
|
258 <textarea name="notice_content" id="notice_content" cols="50" rows="10" style="width:98%;font-size:12px;" class="code"><?php echo($options['notice_content']); ?></textarea> |
|
259 </label> |
|
260 <!-- notice END --> |
|
261 </td> |
|
262 </tr> |
|
263 </tbody> |
|
264 </table> |
|
265 |
|
266 <table class="form-table"> |
|
267 <tbody> |
|
268 <tr valign="top"> |
|
269 <th scope="row"> |
|
270 <?php _e('Banner', 'inove'); ?> |
|
271 <br/> |
|
272 <small style="font-weight:normal;"><?php _e('HTML enabled', 'inove'); ?></small> |
|
273 </th> |
|
274 <td> |
|
275 <!-- banner START --> |
|
276 <?php _e('This banner will display at the right of header. (height: 60 pixels)', 'inove'); ?> |
|
277 <br/> |
|
278 <?php _e('Who can see?', 'inove'); ?> |
|
279 <label style="margin-left:10px;"> |
|
280 <input name="banner_registered" type="checkbox" value="checkbox" <?php if($options['banner_registered']) echo "checked='checked'"; ?> /> |
|
281 <?php _e('Registered Users', 'inove'); ?> |
|
282 </label> |
|
283 <label style="margin-left:10px;"> |
|
284 <input name="banner_commentator" type="checkbox" value="checkbox" <?php if($options['banner_commentator']) echo "checked='checked'"; ?> /> |
|
285 <?php _e('Commentator', 'inove'); ?> |
|
286 </label> |
|
287 <label style="margin-left:10px;"> |
|
288 <input name="banner_visitor" type="checkbox" value="checkbox" <?php if($options['banner_visitor']) echo "checked='checked'"; ?> /> |
|
289 <?php _e('Visitors', 'inove'); ?> |
|
290 </label> |
|
291 <br/> |
|
292 <label> |
|
293 <textarea name="banner_content" id="banner_content" cols="50" rows="10" style="width:98%;font-size:12px;" class="code"><?php echo($options['banner_content']); ?></textarea> |
|
294 </label> |
|
295 <!-- banner END --> |
|
296 </td> |
|
297 </tr> |
|
298 </tbody> |
|
299 </table> |
|
300 |
|
301 <table class="form-table"> |
|
302 <tbody> |
|
303 <tr valign="top"> |
|
304 <th scope="row"> |
|
305 <?php _e('Showcase', 'inove'); ?> |
|
306 <br/> |
|
307 <small style="font-weight:normal;"><?php _e('HTML enabled', 'inove'); ?></small> |
|
308 </th> |
|
309 <td> |
|
310 <!-- showcase START --> |
|
311 <?php _e('This showcase will display at the top of sidebar.', 'inove'); ?> |
|
312 <br/> |
|
313 <?php _e('Who can see?', 'inove'); ?> |
|
314 <label style="margin-left:10px;"> |
|
315 <input name="showcase_registered" type="checkbox" value="checkbox" <?php if($options['showcase_registered']) echo "checked='checked'"; ?> /> |
|
316 <?php _e('Registered Users', 'inove'); ?> |
|
317 </label> |
|
318 <label style="margin-left:10px;"> |
|
319 <input name="showcase_commentator" type="checkbox" value="checkbox" <?php if($options['showcase_commentator']) echo "checked='checked'"; ?> /> |
|
320 <?php _e('Commentator', 'inove'); ?> |
|
321 </label> |
|
322 <label style="margin-left:10px;"> |
|
323 <input name="showcase_visitor" type="checkbox" value="checkbox" <?php if($options['showcase_visitor']) echo "checked='checked'"; ?> /> |
|
324 <?php _e('Visitors', 'inove'); ?> |
|
325 </label> |
|
326 <br/> |
|
327 <label> |
|
328 <input name="showcase_caption" type="checkbox" value="checkbox" <?php if($options['showcase_caption']) echo "checked='checked'"; ?> /> |
|
329 <?php _e('Title:', 'inove'); ?> |
|
330 </label> |
|
331 <input type="text" name="showcase_title" id="showcase_title" class="code" size="40" value="<?php echo($options['showcase_title']); ?>" /> |
|
332 <br/> |
|
333 <label> |
|
334 <textarea name="showcase_content" id="showcase_content" cols="50" rows="10" style="width:98%;font-size:12px;" class="code"><?php echo($options['showcase_content']); ?></textarea> |
|
335 </label> |
|
336 <!-- showcase END --> |
|
337 </td> |
|
338 </tr> |
|
339 </tbody> |
|
340 </table> |
|
341 |
|
342 <table class="form-table"> |
|
343 <tbody> |
|
344 <tr valign="top"> |
|
345 <th scope="row"><?php _e('Posts', 'inove'); ?></th> |
|
346 <td> |
|
347 <label style="margin-right:20px;"> |
|
348 <input name="author" type="checkbox" value="checkbox" <?php if($options['author']) echo "checked='checked'"; ?> /> |
|
349 <?php _e('Show author on posts.', 'inove'); ?> |
|
350 </label> |
|
351 <label style="margin-right:20px;"> |
|
352 <input name="categories" type="checkbox" value="checkbox" <?php if($options['categories']) echo "checked='checked'"; ?> /> |
|
353 <?php _e('Show categories on posts.', 'inove'); ?> |
|
354 </label> |
|
355 <label> |
|
356 <input name="tags" type="checkbox" value="checkbox" <?php if($options['tags']) echo "checked='checked'"; ?> /> |
|
357 <?php _e('Show tags on posts.', 'inove'); ?> |
|
358 </label> |
|
359 </td> |
|
360 </tr> |
|
361 </tbody> |
|
362 </table> |
|
363 |
|
364 <table class="form-table"> |
|
365 <tbody> |
|
366 <tr valign="top"> |
|
367 <th scope="row"><?php _e('Comments', 'inove'); ?></th> |
|
368 <td> |
|
369 <label> |
|
370 <input name="ctrlentry" type="checkbox" value="checkbox" <?php if($options['ctrlentry']) echo "checked='checked'"; ?> /> |
|
371 <?php _e('Submit comments with Ctrl+Enter.', 'inove'); ?> |
|
372 </label> |
|
373 </td> |
|
374 </tr> |
|
375 </tbody> |
|
376 </table> |
|
377 |
|
378 <table class="form-table"> |
|
379 <tbody> |
|
380 <tr valign="top"> |
|
381 <th scope="row"><?php _e('Feed', 'inove'); ?></th> |
|
382 <td> |
|
383 <label> |
|
384 <input name="feed_readers" type="checkbox" value="checkbox" <?php if($options['feed_readers']) echo "checked='checked'"; ?> /> |
|
385 <?php _e('Show the feed reader list when mouse over on feed button.', 'inove'); ?> |
|
386 </label> |
|
387 <br /> |
|
388 <label> |
|
389 <input name="feed" type="checkbox" value="checkbox" <?php if($options['feed']) echo "checked='checked'"; ?> /> |
|
390 <?php _e('Custom feed.', 'inove'); ?> |
|
391 </label> |
|
392 <?php _e('URL:', 'inove'); ?> <input type="text" name="feed_url" id="feed_url" class="code" size="60" value="<?php echo($options['feed_url']); ?>"> |
|
393 <br/> |
|
394 <label> |
|
395 <input name="feed_email" type="checkbox" value="checkbox" <?php if($options['feed_email']) echo "checked='checked'"; ?> /> |
|
396 <?php _e('Email feed.', 'inove'); ?> |
|
397 </label> |
|
398 <?php _e('URL:', 'inove'); ?> <input type="text" name="feed_url_email" id="feed_url_email" class="code" size="60" value="<?php echo($options['feed_url_email']); ?>"> |
|
399 </td> |
|
400 </tr> |
|
401 </tbody> |
|
402 </table> |
|
403 |
|
404 <table class="form-table"> |
|
405 <tbody> |
|
406 <tr valign="top"> |
|
407 <th scope="row"><?php _e('Twitter', 'inove'); ?></th> |
|
408 <td> |
|
409 <label> |
|
410 <input name="twitter" type="checkbox" value="checkbox" <?php if($options['twitter']) echo "checked='checked'"; ?> /> |
|
411 <?php _e('Add Twitter button.', 'inove'); ?> |
|
412 </label> |
|
413 <br /> |
|
414 <?php _e('Twitter username:', 'inove'); ?> |
|
415 <input type="text" name="twitter_username" id="twitter_username" class="code" size="40" value="<?php echo($options['twitter_username']); ?>"> |
|
416 <br /> |
|
417 <a href="http://twitter.com/neoease/" onclick="window.open(this.href);return false;">Follow NeoEase</a> |
|
418 | <a href="http://twitter.com/mg12/" onclick="window.open(this.href);return false;">Follow MG12</a> |
|
419 </td> |
|
420 </tr> |
|
421 </tbody> |
|
422 </table> |
|
423 |
|
424 <table class="form-table"> |
|
425 <tbody> |
|
426 <tr valign="top"> |
|
427 <th scope="row"> |
|
428 <?php _e('Web Analytics', 'inove'); ?> |
|
429 <br/> |
|
430 <small style="font-weight:normal;"><?php _e('HTML enabled', 'inove'); ?></small> |
|
431 </th> |
|
432 <td> |
|
433 <label> |
|
434 <input name="analytics" type="checkbox" value="checkbox" <?php if($options['analytics']) echo "checked='checked'"; ?> /> |
|
435 <?php _e('Add web analytics code to your site. (e.g. Google Analytics, Yahoo! Web Analytics, ...)', 'inove'); ?> |
|
436 </label> |
|
437 <label> |
|
438 <textarea name="analytics_content" cols="50" rows="10" id="analytics_content" class="code" style="width:98%;font-size:12px;"><?php echo($options['analytics_content']); ?></textarea> |
|
439 </label> |
|
440 </td> |
|
441 </tr> |
|
442 </tbody> |
|
443 </table> |
|
444 |
|
445 <p class="submit"> |
|
446 <input class="button-primary" type="submit" name="inove_save" value="<?php _e('Save Changes', 'inove'); ?>" /> |
|
447 </p> |
|
448 </div> |
|
449 </form> |
|
450 |
|
451 <!-- donation --> |
|
452 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> |
|
453 <div class="wrap" style="background:#E3E3E3; margin-bottom:1em;"> |
|
454 |
|
455 <table class="form-table"> |
|
456 <tbody> |
|
457 <tr valign="top"> |
|
458 <th scope="row">Donation</th> |
|
459 <td> |
|
460 If you find my work useful and you want to encourage the development of more free resources, you can do it by donating... |
|
461 <br /> |
|
462 <input type="hidden" name="cmd" value="_s-xclick" /> |
|
463 <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHLwYJKoZIhvcNAQcEoIIHIDCCBxwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCwFHlz2W/LEg0L98DkEuGVuws4IZhsYsjipEowCK0b/2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CS7-----" /> |
|
464 <input style="border:none;" type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donate_LG.gif" name="submit" alt="" /> |
|
465 <img alt="" src="https://www.paypal.com/zh_XC/i/scr/pixel.gif" /> |
|
466 </td> |
|
467 </tr> |
|
468 </tbody> |
|
469 </table> |
|
470 |
|
471 </div> |
|
472 </form> |
|
473 |
|
474 <?php |
|
475 } |
|
476 } |
|
477 |
|
478 // register functions |
|
479 add_action('admin_menu', array('iNoveOptions', 'add')); |
|
480 |
|
481 |
|
482 /** l10n */ |
|
483 function theme_init(){ |
|
484 load_theme_textdomain('inove', get_template_directory() . '/languages'); |
|
485 } |
|
486 add_action ('init', 'theme_init'); |
|
487 |
|
488 /** widgets */ |
|
489 if( function_exists('register_sidebar') ) { |
|
490 register_sidebar(array( |
|
491 'name' => 'north_sidebar', |
|
492 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
|
493 'after_widget' => '</div>', |
|
494 'before_title' => '<h3>', |
|
495 'after_title' => '</h3>' |
|
496 )); |
|
497 register_sidebar(array( |
|
498 'name' => 'south_sidebar', |
|
499 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
|
500 'after_widget' => '</div>', |
|
501 'before_title' => '<h3>', |
|
502 'after_title' => '</h3>' |
|
503 )); |
|
504 register_sidebar(array( |
|
505 'name' => 'west_sidebar', |
|
506 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
|
507 'after_widget' => '</div>', |
|
508 'before_title' => '<h3>', |
|
509 'after_title' => '</h3>' |
|
510 )); |
|
511 register_sidebar(array( |
|
512 'name' => 'east_sidebar', |
|
513 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
|
514 'after_widget' => '</div>', |
|
515 'before_title' => '<h3>', |
|
516 'after_title' => '</h3>' |
|
517 )); |
|
518 } |
|
519 |
|
520 /** Comments */ |
|
521 if (function_exists('wp_list_comments')) { |
|
522 // comment count |
|
523 function comment_count( $commentcount ) { |
|
524 global $id; |
|
525 $_comments = get_comments('status=approve&post_id=' . $id); |
|
526 $comments_by_type = &separate_comments($_comments); |
|
527 return count($comments_by_type['comment']); |
|
528 } |
|
529 } |
|
530 |
|
531 // custom comments |
|
532 function custom_comments($comment, $args, $depth) { |
|
533 $GLOBALS['comment'] = $comment; |
|
534 global $commentcount; |
|
535 if(!$commentcount) { |
|
536 $commentcount = 0; |
|
537 } |
|
538 ?> |
|
539 <li class="comment <?php if($comment->comment_author_email == get_the_author_email()) {echo 'admincomment';} else {echo 'regularcomment';} ?>" id="comment-<?php comment_ID() ?>"> |
|
540 <div class="author"> |
|
541 <div class="pic"> |
|
542 <?php if (function_exists('get_avatar') && get_option('show_avatars')) { echo get_avatar($comment, 32); } ?> |
|
543 </div> |
|
544 <div class="name"> |
|
545 <?php if (get_comment_author_url()) : ?> |
|
546 <a id="commentauthor-<?php comment_ID() ?>" class="url" href="<?php comment_author_url() ?>" rel="external nofollow"> |
|
547 <?php else : ?> |
|
548 <span id="commentauthor-<?php comment_ID() ?>"> |
|
549 <?php endif; ?> |
|
550 |
|
551 <?php comment_author(); ?> |
|
552 |
|
553 <?php if(get_comment_author_url()) : ?> |
|
554 </a> |
|
555 <?php else : ?> |
|
556 </span> |
|
557 <?php endif; ?> |
|
558 </div> |
|
559 </div> |
|
560 |
|
561 <div class="info"> |
|
562 <div class="date"> |
|
563 <?php printf( __('%1$s at %2$s', 'inove'), get_comment_time(__('F jS, Y', 'inove')), get_comment_time(__('H:i', 'inove')) ); ?> |
|
564 | <a href="#comment-<?php comment_ID() ?>"><?php printf('#%1$s', ++$commentcount); ?></a> |
|
565 </div> |
|
566 <div class="act"> |
|
567 <a href="javascript:void(0);" onclick="MGJS_CMT.reply('commentauthor-<?php comment_ID() ?>', 'comment-<?php comment_ID() ?>', 'comment');"><?php _e('Reply', 'inove'); ?></a> | |
|
568 <a href="javascript:void(0);" onclick="MGJS_CMT.quote('commentauthor-<?php comment_ID() ?>', 'comment-<?php comment_ID() ?>', 'commentbody-<?php comment_ID() ?>', 'comment');"><?php _e('Quote', 'inove'); ?></a> |
|
569 <?php |
|
570 if (function_exists("qc_comment_edit_link")) { |
|
571 qc_comment_edit_link('', ' | ', '', __('Edit', 'inove')); |
|
572 } |
|
573 edit_comment_link(__('Advanced edit', 'inove'), ' | ', ''); |
|
574 ?> |
|
575 </div> |
|
576 <div class="fixed"></div> |
|
577 <div class="content"> |
|
578 <?php if ($comment->comment_approved == '0') : ?> |
|
579 <p><small><?php _e('Your comment is awaiting moderation.', 'inove'); ?></small></p> |
|
580 <?php endif; ?> |
|
581 |
|
582 <div id="commentbody-<?php comment_ID() ?>"> |
|
583 <?php comment_text(); ?> |
|
584 </div> |
|
585 </div> |
|
586 </div> |
|
587 <div class="fixed"></div> |
|
588 |
|
589 <?php |
|
590 } |
|
591 ?> |