Advertisement
Guest User

Untitled

a guest
Apr 21st, 2016
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.89 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Easy Custom Auto Excerpt
  4. Plugin URI: https://www.tonjoostudio.com/addons/easy-custom-auto-excerpt/
  5. Description: Auto Excerpt for your post on home, front_page, search and archive.
  6. Version: 2.3.2
  7. Author: tonjoo
  8. Author URI: https://www.tonjoostudio.com/
  9. Contributor: Todi Adiyatmo Wijoyo, Haris Ainur Rozak
  10. */
  11.  
  12. define("TONJOO_ECAE", 'easy-custom-auto-excerpt');
  13. define("ECAE_VERSION", '2.3.2');
  14. define("ECAE_DIR_NAME", str_replace("/easy-custom-auto-excerpt.php", "", plugin_basename(__FILE__)));
  15. define("ECAE_HTTP_PROTO", is_ssl() ? "https://" : "http://");
  16.  
  17. require_once( plugin_dir_path( __FILE__ ) . 'ajax.php');
  18.  
  19. function tonjoo_ecae_plugin_init()
  20. {
  21. // modify post object here
  22. global $is_main_query_ecae;
  23.  
  24. $is_main_query_ecae=true;
  25.  
  26. // Localization
  27. load_plugin_textdomain(TONJOO_ECAE, false, dirname(plugin_basename(__FILE__)) . '/languages');
  28. }
  29.  
  30. add_action('plugins_loaded', 'tonjoo_ecae_plugin_init');
  31.  
  32. function tonjoo_ecae_remove_all_filters()
  33. {
  34. remove_all_filters('get_the_excerpt');
  35. remove_all_filters('the_excerpt');
  36.  
  37. /**
  38. * Filter get_the_excerpt to return the_content
  39. */
  40. add_filter('get_the_excerpt', 'tonjoo_ecae_get_the_excerpt',999);
  41. add_filter('the_excerpt', 'tonjoo_ecae_get_the_excerpt',999);
  42. }
  43.  
  44. add_action('wp_head', 'tonjoo_ecae_remove_all_filters');
  45.  
  46. function print_filters_for( $hook = '' ) {
  47. global $wp_filter;
  48. if( empty( $hook ) || !isset( $wp_filter[$hook] ) )
  49. return;
  50.  
  51. print '<pre>';
  52. print_r( $wp_filter[$hook] );
  53. print '</pre>';
  54. }
  55.  
  56. function tonjoo_ecae_get_the_excerpt($output) {
  57.  
  58. global $post;
  59.  
  60. return apply_filters( 'the_content', $post->post_content );
  61. }
  62.  
  63.  
  64.  
  65. $plugin = plugin_basename(__FILE__);
  66. add_filter("plugin_action_links_$plugin", 'tonjoo_ecae_donate');
  67.  
  68. function tonjoo_ecae_donate($links)
  69. {
  70. // $donate_link = '<a href="https://www.tonjoostudio.com/donate/" target="_blank" >Donate</a>';
  71. // array_push($links, $donate_link);
  72.  
  73. if(! function_exists('is_ecae_premium_exist'))
  74. {
  75. $premium_link = '<a href="http://wpexcerptplugin.com/" target="_blank" >Upgrade to premium</a>';
  76. array_push($links, $premium_link);
  77. }
  78.  
  79. return $links;
  80. }
  81.  
  82.  
  83. /**
  84. * ecae button shortcode
  85. */
  86. add_shortcode('ecae_button', 'ecae_button_shortcode');
  87. function ecae_button_shortcode()
  88. {
  89. $options = get_option('tonjoo_ecae_options');
  90. $options = tonjoo_ecae_load_default($options);
  91.  
  92. $button_skin = explode('-PREMIUM', $options['button_skin']);
  93. $trim_readmore_before = trim($options['read_more_text_before']);
  94.  
  95. $read_more_text_before = empty($trim_readmore_before) ? $options['read_more_text_before'] : $options['read_more_text_before']."&nbsp;&nbsp;";
  96.  
  97. $link = get_permalink();
  98. $readmore_link = " <a class='ecae-link' href='$link'><span>{$options['read_more']}</span></a>";
  99. $readmore = "<p class='ecae-button {$button_skin[0]}' style='text-align:{$options['read_more_align']};' >$read_more_text_before $readmore_link</p>";
  100.  
  101. if(is_single()) return "";
  102. else return $readmore;
  103. }
  104.  
  105.  
  106. /**
  107. * admin_enqueue_scripts - equeue on plugin page only
  108. */
  109. if (strpos($_SERVER['REQUEST_URI'], "tonjoo_excerpt") !== false)
  110. {
  111. add_action('admin_enqueue_scripts', 'ecae_admin_enqueue_scripts');
  112. }
  113.  
  114. function ecae_admin_enqueue_scripts()
  115. {
  116. if(isset($_GET['page']) && $_GET['page'] == "tonjoo_excerpt")
  117. {
  118. //print script
  119. echo "<script type='text/javascript'>";
  120. echo "var ecae_dir_name = '".plugins_url( ECAE_DIR_NAME , dirname(__FILE__) )."';";
  121. echo "var ecae_button_dir_name = '".plugins_url( ECAE_DIR_NAME.'/buttons/' , dirname(__FILE__) )."';";
  122.  
  123. if(function_exists('is_ecae_premium_exist')) {
  124. echo "var ecae_premium_dir_name = '".plugins_url( ECAE_PREMIUM_DIR_NAME , dirname(__FILE__) )."';";
  125. echo "var ecae_button_premium_dir_name = '".plugins_url( ECAE_PREMIUM_DIR_NAME.'/buttons/' , dirname(__FILE__) )."';";
  126. echo "var ecae_premium_enable = true;";
  127. }
  128. else
  129. {
  130. echo "var ecae_button_premium_dir_name = '".plugins_url( ECAE_DIR_NAME.'/assets/premium-promo/' , dirname(__FILE__) )."';";
  131. echo "var ecae_premium_enable = false;";
  132. }
  133.  
  134. echo "</script>";
  135.  
  136. // javascript
  137. wp_enqueue_script('ace-js',plugin_dir_url( __FILE__ )."assets/ace-min-noconflict-css-monokai/ace.js",array(),ECAE_VERSION);
  138. wp_enqueue_script('select2-js',plugin_dir_url( __FILE__ )."assets/select2/select2.js",array(),ECAE_VERSION);
  139. wp_enqueue_script('cloneya-js',plugin_dir_url( __FILE__ )."assets/jquery-cloneya.min.js",array(),ECAE_VERSION);
  140.  
  141. // css
  142. wp_enqueue_style('select2-css',plugin_dir_url( __FILE__ )."assets/select2/select2.css",array(),ECAE_VERSION);
  143.  
  144. // admin script and stylel
  145. wp_enqueue_script('ecae-admin-js',plugin_dir_url( __FILE__ )."assets/admin-script.js",array(),ECAE_VERSION);
  146. wp_enqueue_style('ecae-admin-css',plugin_dir_url( __FILE__ )."assets/admin-style.css",array(),ECAE_VERSION);
  147. }
  148. }
  149.  
  150.  
  151. /**
  152. * wp_enqueue_scripts
  153. */
  154. add_action('wp_enqueue_scripts', 'ecae_wp_enqueue_scripts', 100);
  155.  
  156. function ecae_wp_enqueue_scripts()
  157. {
  158. $options = get_option('tonjoo_ecae_options');
  159. $options = tonjoo_ecae_load_default($options);
  160.  
  161. /**
  162. * Font
  163. */
  164. if($options['button_font'] != ''):
  165. echo "<style type='text/css'>";
  166.  
  167. switch ($options['button_font'])
  168. {
  169. case "Open Sans":
  170. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,cyrillic-ext,latin-ext);"; //Open Sans
  171. break;
  172. case "Lobster":
  173. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Lobster);"; //Lobster
  174. break;
  175. case "Lobster Two":
  176. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Lobster+Two:400,400italic,700,700italic);"; //Lobster Two
  177. break;
  178. case "Ubuntu":
  179. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic);"; //Ubuntu
  180. break;
  181. case "Ubuntu Mono":
  182. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic,700italic);"; //Ubuntu Mono
  183. break;
  184. case "Titillium Web":
  185. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Titillium+Web:400,300,700,300italic,400italic,700italic);"; //Titillium Web
  186. break;
  187. case "Grand Hotel":
  188. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Grand+Hotel);"; //Grand Hotel
  189. break;
  190. case "Pacifico":
  191. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Pacifico);"; //Pacifico
  192. break;
  193. case "Crafty Girls":
  194. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Crafty+Girls);"; //Crafty Girls
  195. break;
  196. case "Bevan":
  197. echo "@import url(".ECAE_HTTP_PROTO."fonts.googleapis.com/css?family=Bevan);"; //Bevan
  198. break;
  199. default:
  200. echo ""; //Inherit fonts
  201. }
  202.  
  203. echo "p.ecae-button { font-family: '".$options['button_font']."', Helvetica, Arial, sans-serif; }";
  204. echo "</style>";
  205. endif;
  206.  
  207.  
  208. /**
  209. * Button skin
  210. */
  211. $array_buttonskins = ecae_get_array_buttonskins();
  212.  
  213. if(! isset($options['button_skin']) || ! in_array($options['button_skin'], $array_buttonskins))
  214. {
  215. $options['button_skin'] = 'ecae-buttonskin-none';
  216. }
  217.  
  218. /* filter if premium */
  219. $exp = explode('-PREMIUM', $options['button_skin']);
  220. if(count($exp) > 1 AND $exp[1] == 'true')
  221. {
  222. wp_enqueue_style($exp[0],plugins_url(ECAE_PREMIUM_DIR_NAME."/buttons/{$exp[0]}.css"),array(),ECAE_VERSION);
  223. }
  224. else
  225. {
  226. wp_enqueue_style($exp[0],plugins_url(ECAE_DIR_NAME."/buttons/{$exp[0]}.css"),array(),ECAE_VERSION);
  227. }
  228.  
  229. // frontend style
  230. wp_enqueue_style('ecae-frontend-css',plugin_dir_url( __FILE__ )."assets/style-frontend.css",array(),ECAE_VERSION);
  231. }
  232.  
  233. function ecae_get_array_buttonskins()
  234. {
  235. $skins = scandir(dirname(__FILE__)."/buttons");
  236.  
  237. $button_skin = array();
  238.  
  239. foreach ($skins as $key => $value) {
  240.  
  241. $extension = pathinfo($value, PATHINFO_EXTENSION);
  242. $filename = pathinfo($value, PATHINFO_FILENAME);
  243. $extension = strtolower($extension);
  244. $the_value = strtolower($filename);
  245.  
  246. if($extension=='css')
  247. {
  248. array_push($button_skin,$the_value);
  249. }
  250. }
  251.  
  252. if(function_exists('is_ecae_premium_exist'))
  253. {
  254. $skins = scandir(ABSPATH . 'wp-content/plugins/'.ECAE_PREMIUM_DIR_NAME.'/buttons');
  255.  
  256. foreach ($skins as $key => $value) {
  257.  
  258. $extension = pathinfo($value, PATHINFO_EXTENSION);
  259. $filename = pathinfo($value, PATHINFO_FILENAME);
  260. $extension = strtolower($extension);
  261. $the_value = strtolower($filename);
  262.  
  263. if($extension=='css')
  264. {
  265. array_push($button_skin,$the_value.'-PREMIUMtrue');
  266. }
  267. }
  268. }
  269.  
  270. return $button_skin;
  271. }
  272.  
  273. /**
  274. * Display a notice that can be dismissed
  275. */
  276. add_action('admin_notices', 'ecae_premium_notice');
  277. function ecae_premium_notice()
  278. {
  279. global $current_user ;
  280.  
  281. $user_id = $current_user->ID;
  282. $ignore_notice = get_user_meta($user_id, 'ecae_premium_ignore_notice', true);
  283. $ignore_count_notice = get_user_meta($user_id, 'ecae_premium_ignore_count_notice', true);
  284. $max_count_notice = 15;
  285.  
  286. // if usermeta(ignore_count_notice) is not exist
  287. if($ignore_count_notice == "")
  288. {
  289. add_user_meta($user_id, 'ecae_premium_ignore_count_notice', $max_count_notice, true);
  290.  
  291. $ignore_count_notice = 0;
  292. }
  293.  
  294. // display the notice or not
  295. if($ignore_notice == 'forever')
  296. {
  297. $is_ignore_notice = true;
  298. }
  299. else if($ignore_notice == 'later' && $ignore_count_notice < $max_count_notice)
  300. {
  301. $is_ignore_notice = true;
  302.  
  303. update_user_meta($user_id, 'ecae_premium_ignore_count_notice', intval($ignore_count_notice) + 1);
  304. }
  305. else
  306. {
  307. $is_ignore_notice = false;
  308. }
  309.  
  310. /* Check that the user hasn't already clicked to ignore the message & if premium not installed */
  311. if (! $is_ignore_notice && ! function_exists("is_ecae_premium_exist"))
  312. {
  313. echo '<div class="updated"><p>';
  314.  
  315. printf(__('Get 40+ read more button style, %1$s Get Easy Custom Auto Excerpt Premium ! %2$s Do not bug me again %3$s Not Now %4$s',TONJOO_ECAE),
  316. '<a href="http://wpexcerptplugin.com" target="_blank">',
  317. '</a><span style="float:right;"><a href="?ecae_premium_nag_ignore=forever" style="color:#a00;">',
  318. '</a> <a href="?ecae_premium_nag_ignore=later" class="button button-primary" style="margin:-5px -5px 0 5px;vertical-align:baseline;">',
  319. '</a></span>');
  320.  
  321. echo "</p></div>";
  322. }
  323. }
  324.  
  325. add_action('admin_init', 'ecae_premium_nag_ignore');
  326. function ecae_premium_nag_ignore()
  327. {
  328. global $current_user;
  329. $user_id = $current_user->ID;
  330.  
  331. // If user clicks to ignore the notice, add that to their user meta
  332. if (isset($_GET['ecae_premium_nag_ignore']) && $_GET['ecae_premium_nag_ignore'] == 'forever')
  333. {
  334. update_user_meta($user_id, 'ecae_premium_ignore_notice', 'forever');
  335.  
  336. /**
  337. * Redirect
  338. */
  339. $location = admin_url("options-general.php?page=tonjoo_excerpt") . '&settings-updated=true';
  340. echo "<meta http-equiv='refresh' content='0;url=$location' />";
  341. echo "<h2>Loading...</h2>";
  342. exit();
  343. }
  344. else if (isset($_GET['ecae_premium_nag_ignore']) && $_GET['ecae_premium_nag_ignore'] == 'later')
  345. {
  346. update_user_meta($user_id, 'ecae_premium_ignore_notice', 'later');
  347. update_user_meta($user_id, 'ecae_premium_ignore_count_notice', 0);
  348.  
  349. $total_ignore_notice = get_user_meta($user_id, 'ecae_premium_ignore_count_notice_total', true);
  350.  
  351. if($total_ignore_notice == '') $total_ignore_notice = 0;
  352.  
  353. update_user_meta($user_id, 'ecae_premium_ignore_count_notice_total', intval($total_ignore_notice) + 1);
  354.  
  355. if(intval($total_ignore_notice) >= 5)
  356. {
  357. update_user_meta($user_id, 'ecae_premium_ignore_notice', 'forever');
  358. }
  359.  
  360. /**
  361. * Redirect
  362. */
  363. $location = admin_url("options-general.php?page=tonjoo_excerpt") . '&settings-updated=true';
  364. echo "<meta http-equiv='refresh' content='0;url=$location' />";
  365. echo "<h2>Loading...</h2>";
  366. exit();
  367. }
  368. }
  369.  
  370. /**
  371. * Main Query Check
  372. */
  373. add_action( 'loop_end', 'tonjoo_ecae_loop_end' );
  374. function tonjoo_ecae_loop_end( $query )
  375. {
  376. // modify post object here
  377. global $is_main_query_ecae;
  378.  
  379. $is_main_query_ecae=false;
  380.  
  381. if($query->is_main_query()){
  382. $is_main_query_ecae=true;
  383. }
  384. }
  385.  
  386.  
  387.  
  388.  
  389.  
  390. /**
  391. * Do Filter after this
  392. * add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop()
  393. * So we can preserve shortcode
  394. */
  395. add_filter('the_content', 'tonjoo_ecae_execute', 10);
  396.  
  397. function tonjoo_ecae_execute($content, $width = 400)
  398. {
  399. global $content_pure;
  400.  
  401. $options = get_option('tonjoo_ecae_options');
  402. $options = tonjoo_ecae_load_default($options);
  403.  
  404. // if post type is FRS
  405. if('pjc_slideshow' == get_post_type())
  406. {
  407. return $content;
  408.  
  409. exit;
  410. }
  411.  
  412. // if RSS FEED
  413. if(is_feed() && $options['disable_on_feed'] == 'yes')
  414. {
  415. return $content;
  416.  
  417. exit;
  418. }
  419.  
  420. if(isset($options['special_method']) && $options['special_method'] == 'yes')
  421. {
  422. global $is_main_query_ecae;
  423.  
  424. if(!$is_main_query_ecae)
  425. return $content;
  426. }
  427.  
  428. $content_pure = $content;
  429.  
  430. $width = $options['width'];
  431. $justify = $options['justify'];
  432.  
  433. /**
  434. * no limit number if 1st-paragraph mode
  435. */
  436. if(strpos($options['excerpt_method'],'-paragraph'))
  437. {
  438. if(function_exists("is_ecae_premium_exist"))
  439. {
  440. $width = strlen(wp_kses($content,array())); //max integer in 32-bit system
  441. }
  442. else
  443. {
  444. $options['excerpt_method'] = 'paragraph';
  445. }
  446. }
  447.  
  448. if($options['location_settings_type'] == 'basic')
  449. {
  450. if ($options['home'] == "yes" && is_home()) {
  451. return tonjoo_ecae_excerpt($content, $width, $justify);
  452. }
  453.  
  454. if ($options['front_page'] == "yes" && is_front_page()) {
  455. return tonjoo_ecae_excerpt($content, $width, $justify);
  456. }
  457.  
  458. if ($options['search'] == "yes" && is_search()) {
  459. return tonjoo_ecae_excerpt($content, $width, $justify);
  460. }
  461.  
  462. if ($options['archive'] == "yes" && is_archive()) {
  463. return tonjoo_ecae_excerpt($content, $width, $justify);
  464. }
  465.  
  466. /**
  467. * excerpt in pages
  468. */
  469. $excerpt_in_page = $options['excerpt_in_page'];
  470. $excerpt_in_page = trim($excerpt_in_page);
  471.  
  472. if($excerpt_in_page!='')
  473. {
  474. $excerpt_in_page = explode('|',$excerpt_in_page);
  475. }
  476. else
  477. {
  478. $excerpt_in_page = array();
  479. }
  480.  
  481. foreach ($excerpt_in_page as $key => $value) {
  482. if($value != '' && is_page($value)) {
  483. return tonjoo_ecae_excerpt($content, $width, $justify);
  484. break;
  485. }
  486. }
  487. }
  488. else
  489. {
  490. $advExcLoc = new advExcLoc($options,$content,$width,$justify);
  491.  
  492. if(is_home()){
  493. $options['excerpt_method'] = $advExcLoc->get_excerpt_method('advanced_home');
  494. return $advExcLoc->do_excerpt('advanced_home','home_post_type','home_category');
  495. }
  496.  
  497. if(is_front_page()){
  498. $options['excerpt_method'] = $advExcLoc->get_excerpt_method('advanced_frontpage');
  499. return $advExcLoc->do_excerpt('advanced_frontpage','frontpage_post_type','frontpage_category');
  500. }
  501.  
  502. if(is_archive()){
  503. $options['excerpt_method'] = $advExcLoc->get_excerpt_method('advanced_archive');
  504. return $advExcLoc->do_excerpt('advanced_archive','archive_post_type','archive_category');
  505. }
  506.  
  507. if(is_search()){
  508. $options['excerpt_method'] = $advExcLoc->get_excerpt_method('advanced_search');
  509. return $advExcLoc->do_excerpt('advanced_search','search_post_type','search_category');
  510. }
  511.  
  512. // Page Excerpt
  513. if($options['advanced_page_main'] != 'disable')
  514. {
  515. $type = 'advanced_page_main';
  516. $excerpt_in_page = $options['excerpt_in_page_advanced'];
  517. $options['excerpt_method'] = $advExcLoc->get_excerpt_method($type);
  518.  
  519. // excerpt size
  520. if(isset($options[$type . '_width']) && $options[$type . '_width'] > 0)
  521. {
  522. $width = $options[$type . '_width'];
  523. }
  524.  
  525. if(is_array($excerpt_in_page))
  526. {
  527. foreach ($excerpt_in_page as $key => $value) {
  528. if($value != '' && is_page($value)) {
  529. return tonjoo_ecae_excerpt($content, $width, $justify);
  530. break;
  531. }
  532. }
  533. }
  534.  
  535. if($options['advanced_page_main'] == 'selection')
  536. {
  537. $advanced_page = $options['advanced_page'];
  538. $page_post_type = $options['page_post_type'];
  539. $page_category = $options['page_category'];
  540.  
  541. if(count($advanced_page) > 0)
  542. {
  543. foreach ($advanced_page as $key => $value)
  544. {
  545. if($value != '' && is_page($value))
  546. {
  547. $return['data'] = $content;
  548. $return['excerpt'] = false;
  549.  
  550. if(isset($page_post_type[$key]))
  551. $return = $advExcLoc->excerpt_in_post_type($page_post_type[$key],$width);
  552.  
  553. if($return['excerpt'] == false)
  554. {
  555. if(isset($page_category[$key]))
  556. $return = $advExcLoc->excerpt_in_category($page_category[$key],$width);
  557.  
  558. return $return['data'];
  559. }
  560. else return $return['data'];
  561. }
  562. }
  563. }
  564. }
  565. // end advanced_page_main
  566. }
  567. // end location_settings_type
  568. }
  569.  
  570. /**
  571. * else
  572. */
  573. return $content;
  574. }
  575.  
  576.  
  577. /**
  578. * Class advanced excerpt location
  579. */
  580. class advExcLoc
  581. {
  582. function __construct($options,$content,$width,$justify)
  583. {
  584. $this->options = $options;
  585. $this->content = $content;
  586. $this->width = $width;
  587. $this->justify = $justify;
  588. }
  589.  
  590. function do_excerpt($type,$post_type,$category)
  591. {
  592. // excerpt size
  593. $width = $this->width;
  594.  
  595. if(isset($this->options[$type . '_width']) && $this->options[$type . '_width'] > 0)
  596. {
  597. $width = $this->options[$type . '_width'];
  598. }
  599.  
  600. // excerpt
  601. switch ($this->options[$type]) {
  602. case 'all':
  603. return tonjoo_ecae_excerpt($this->content,$width,$this->justify);
  604. break;
  605.  
  606. case 'selection':
  607. $return = $this->excerpt_in_post_type($this->options[$post_type],$width);
  608.  
  609. if($return['excerpt'] == false)
  610. {
  611. $return = $this->excerpt_in_category($this->options[$category],$width);
  612. return $return['data'];
  613. }
  614. else return $return['data'];
  615.  
  616. default:
  617. return $this->content;
  618. break;
  619. }
  620. }
  621.  
  622. function get_excerpt_method($type)
  623. {
  624. if(isset($this->options[$type . '_width']) && $this->options[$type . '_width'] > 0)
  625. {
  626. return 'word';
  627. }
  628. else return $this->options['excerpt_method'];
  629. }
  630.  
  631. function excerpt_in_post_type($opt_post_type,$width)
  632. {
  633. /**
  634. * excerpt in post type
  635. */
  636. $return['data'] = $this->content;
  637. $return['excerpt'] = false;
  638.  
  639. $current_post_type = get_post_type(get_the_ID());
  640.  
  641. $excerpt_in_post_type = $opt_post_type;
  642.  
  643. if(is_array($excerpt_in_post_type) && in_array($current_post_type, $excerpt_in_post_type))
  644. {
  645. $return['data'] = tonjoo_ecae_excerpt($this->content, $width, $this->justify);
  646. $return['excerpt'] = true;
  647. }
  648.  
  649. return $return;
  650. }
  651.  
  652. function excerpt_in_category($opt_category,$width)
  653. {
  654. /**
  655. * excerpt in category
  656. */
  657. $return['data'] = $this->content;
  658. $return['excerpt'] = false;
  659.  
  660. $taxonomies = get_the_taxonomies(get_the_ID());
  661.  
  662. foreach ($taxonomies as $key => $value)
  663. {
  664. $taxonomy = $key;
  665. $category = wp_get_post_terms(get_the_ID(),$taxonomy);
  666.  
  667. foreach ($category as $n) {
  668. $current_category = $n->term_id;
  669. $excerpt_in_category = $opt_category;
  670.  
  671. if(is_array($excerpt_in_category) && in_array($current_category, $excerpt_in_category))
  672. {
  673. $return['data'] = tonjoo_ecae_excerpt($this->content, $width, $this->justify);
  674. $return['excerpt'] = true;
  675.  
  676. break 2;
  677. }
  678. }
  679. }
  680.  
  681. return $return;
  682. }
  683. }
  684.  
  685. function tonjoo_ecae_excerpt($content, $width, $justify)
  686. {
  687. global $post;
  688.  
  689. $options = get_option('tonjoo_ecae_options');
  690. $options = tonjoo_ecae_load_default($options);
  691.  
  692. $postmeta = get_post_meta($post->ID, 'ecae_meta', true);
  693.  
  694. if(function_exists('is_ecae_premium_exist') && isset($postmeta['disable_excerpt']) && $postmeta['disable_excerpt'] == 'yes')
  695. {
  696. return $content;
  697.  
  698. exit;
  699. }
  700.  
  701. $total_width = 0;
  702. $pos = strpos($content, '<!--more-->');
  703. $array_replace_list = array();
  704.  
  705. // if read more
  706. if ($pos)
  707. {
  708. // check shortcode optons
  709. if ($options['strip_shortcode'] == 'yes') {
  710. $content = strip_shortcodes($content);
  711. }
  712.  
  713. $content = substr($content, 0, $pos);
  714. }
  715. elseif ($post->post_excerpt != '')
  716. {
  717. // check shortcode optons
  718. if ($options['strip_shortcode'] == 'yes') {
  719. $content = strip_shortcodes($content);
  720. }
  721.  
  722. $content = $post->post_excerpt;
  723. }
  724. elseif ($width == 0)
  725. {
  726. $content = '';
  727. }
  728. // elseif (!(strlen($content) <= (int) $width))
  729. else
  730. {
  731. // Do caption shortcode
  732. $content = ecae_convert_caption($content,$options);
  733.  
  734. $caption_image_replace = new eace_content_regex("|$", "/<div[^>]*class=\"[^\"]*wp-caption[^\"]*\".*>(.*)<img[^>]+\>(.*)<\/div>/",$options,true);
  735. $figure_replace = new eace_content_regex("|:", "/<figure.*?\>([^`]*?)<\/figure>/",$options,true);
  736. $hyperlink_image_replace = new eace_content_regex("|#", "/<a[^>]*>(\n|\s)*(<img[^>]+>)(\n|\s)*<\/a>/",$options,true);
  737. $image_replace = new eace_content_regex("|(", "/<img[^>]+\>/",$options,true );
  738.  
  739. //biggest -> lowest the change code
  740.  
  741. $html_replace = array();
  742.  
  743. $extra_markup = $options['extra_html_markup'];
  744.  
  745. $extra_markup = trim($extra_markup);
  746.  
  747. //prevent white space explode
  748. if($extra_markup!='')
  749. $extra_markup = explode('|',$extra_markup);
  750. else
  751. $extra_markup = array();
  752.  
  753. $extra_markup_tag=array('*=','(=',')=','_=','<=','>=','/=','\=',']=','[=','{=','}=','|=');
  754.  
  755. //default order
  756. $array_replace_list['pre']='=@'; // syntax highlighter like crayon
  757. $array_replace_list['video']='=}';
  758. $array_replace_list['table']='={';
  759. $array_replace_list['p']='=!';
  760. $array_replace_list['b']='=&';
  761. $array_replace_list['a']='=*';
  762. $array_replace_list['i']='=)';
  763. $array_replace_list['h1']='=-';
  764. $array_replace_list['h2']='`=';
  765. $array_replace_list['h3']='!=';
  766. $array_replace_list['h4']='#=';
  767. $array_replace_list['h5']='$=';
  768. $array_replace_list['h6']='%=';
  769. $array_replace_list['ul']='=#';
  770. $array_replace_list['ol']='=$';
  771. $array_replace_list['strong']='=(';
  772. $array_replace_list['blockquote']='=^';
  773.  
  774. foreach ($extra_markup as $markup)
  775. {
  776. $counter = 0;
  777.  
  778. if(!isset($array_replace_list[$markup]))
  779. $array_replace_list[$markup]=$extra_markup_tag[$counter];
  780.  
  781. $counter++;
  782. }
  783.  
  784. //push every markup into processor
  785. foreach ($array_replace_list as $key=>$value)
  786. {
  787. //use image processing algorithm for table and video
  788. if($key=='video'||$key=='table')
  789. $push = new eace_content_regex("{$value}", "/<{$key}.*?\>([^`]*?)<\/{$key}>/",$options,true);
  790. else
  791. $push = new eace_content_regex("{$value}", "/<{$key}.*?\>([^`]*?)<\/{$key}>/",$options);
  792.  
  793. array_push($html_replace, $push);
  794. }
  795.  
  796. $pattern = get_shortcode_regex();
  797.  
  798. if(!strpos('hana-flv-player', $pattern))
  799. $pattern = str_replace('embed','caption|hana-flv-player',$pattern);
  800.  
  801. $shortcode_replace = new eace_content_regex("+*", '/'.$pattern.'/s',$options);
  802.  
  803. //trim image
  804. $option_image = $options['show_image'];
  805.  
  806. if ($option_image == 'yes' || $option_image == 'first-image')
  807. {
  808. $number = false;
  809. //limit the image excerpt
  810. if ($option_image == 'first-image')
  811. $number = 1;
  812.  
  813. $caption_image_replace->replace($content, $width, $number);
  814. $figure_replace->replace($content, $width, $number);
  815. $hyperlink_image_replace->replace($content, $width, $number);
  816. $image_replace->replace($content, $width, $number);
  817. }
  818. else
  819. {
  820. //remove image , this is also done for featured-image option
  821. $caption_image_replace->remove($content);
  822. $figure_replace->remove($content);
  823. $hyperlink_image_replace->remove($content);
  824. $image_replace->remove($content);
  825. }
  826.  
  827. // check shortcode optons
  828. if ($options['strip_shortcode'] == 'yes') {
  829. $content = strip_shortcodes($content);
  830. }
  831.  
  832. // Replace remaining tag
  833. foreach ($html_replace as $replace) {
  834. $replace->replace($content, $width,false,$total_width);
  835. }
  836.  
  837. $shortcode_replace->replace($content, $width,false,$total_width);
  838.  
  839. //use wp kses to fix broken element problem
  840. $content = wp_kses($content, array());
  841.  
  842. if(strpos($content,'<!--STOP THE EXCERPT HERE-->')===false)
  843. {
  844. //give the stop mark so the plugin can stop
  845. $content=$content.'<!--STOP THE EXCERPT HERE-->';
  846. }
  847.  
  848. //strip the text
  849. $content = substr($content, 0, strpos($content,'<!--STOP THE EXCERPT HERE-->'));
  850.  
  851. //do the restore 3 times, avoid nesting
  852. $shortcode_replace->restore($content);
  853.  
  854. foreach ($html_replace as $restore) $restore->restore($content, $width);
  855. foreach ($html_replace as $restore) $restore->restore($content, $width);
  856. foreach ($html_replace as $restore) $restore->restore($content, $width);
  857.  
  858. $shortcode_replace->restore($content);
  859.  
  860. /**
  861. * image position
  862. */
  863. switch ($options['image_position']) {
  864. case 'right':
  865. $img_position = "";
  866. break;
  867.  
  868. case 'left':
  869. $img_position = "";
  870. break;
  871.  
  872. case 'center':
  873. $img_position = "margin-left:auto !important; margin-right:auto !important;";
  874. break;
  875.  
  876. case 'float-left':
  877. $img_position = "float:left;";
  878. break;
  879.  
  880. case 'float-right':
  881. $img_position = "float:right;";
  882. break;
  883.  
  884. default:
  885. $img_position = "text-align:left;";
  886. break;
  887. }
  888.  
  889. $img_added_css = $img_position;
  890.  
  891. if($options['image_width_type'] == 'manual')
  892. {
  893. $img_added_css.= "width:{$options['image_width']}px;";
  894. }
  895.  
  896. $img_added_css.= "padding:{$options['image_padding_top']}px {$options['image_padding_right']}px {$options['image_padding_bottom']}px {$options['image_padding_left']}px;";
  897.  
  898. if ($option_image == 'yes')
  899. {
  900. $caption_image_replace->restore($content,false,true);
  901. $figure_replace->restore($content,false,true);
  902. $hyperlink_image_replace->restore($content,false,true);
  903. $image_replace->restore($content,false,true);
  904. }
  905. elseif ($option_image == 'first-image')
  906. {
  907. //catch all of hyperlink and image on the content => '|#' and '|(' and '|$'
  908. preg_match_all('/\|\([0-9]*\|\(|\|\#[0-9]*\|\#|\|\$[0-9]*\|\$|\|\:[0-9]*\|\:/', $content, $result, PREG_PATTERN_ORDER);
  909.  
  910. if (isset($result[0]))
  911. {
  912. $remaining = array_slice($result[0], 0, 1);
  913.  
  914. if(isset($remaining[0]))
  915. {
  916. //delete remaining image
  917. $content = preg_replace('/\|\:[0-9]*\|\:/', '', $content);
  918. $content = preg_replace('/\|\([0-9]*\|\C/', '', $content);
  919. $content = preg_replace('/\|\#[0-9]*\|\#/', '', $content);
  920. $content = preg_replace('/\|\$[0-9]*\|\$/', '', $content);
  921.  
  922.  
  923. if($options['image_position'] == 'left')
  924. {
  925. $content = "<div class='ecae-image ecae-table-left'><div class='ecae-table-cell' style='$img_added_css'>" . $remaining[0] . "</div>" . "<div class='ecae-table-cell'>" . $content . '</div>' ;
  926. }
  927. else if($options['image_position'] == 'right')
  928. {
  929. $content = "<div class='ecae-image ecae-table-right'><div class='ecae-table-cell' style='$img_added_css'>" . $remaining[0] . "</div>" . "<div class='ecae-table-cell'>" . $content . '</div>' ;
  930. }
  931. else
  932. {
  933. $content = "<div class='ecae-image' style='$img_added_css'>" . $remaining[0] . "</div>" . $content;
  934. }
  935.  
  936. $caption_image_replace->restore($content,1,true);
  937. $figure_replace->restore($content, 1,true);
  938. $hyperlink_image_replace->restore($content, 1,true);
  939. $image_replace->restore($content, 1,true);
  940. }
  941. }
  942. }
  943. elseif ($option_image == 'featured-image')
  944. {
  945. //check featured image;
  946. $featured_image = has_post_thumbnail(get_the_ID());
  947. $image = false;
  948.  
  949. if($featured_image) $image = get_the_post_thumbnail(get_the_ID());
  950.  
  951. // only put image if there is image :p
  952. if($image)
  953. {
  954. if($options['image_position'] == 'left')
  955. {
  956. $content = "<div class='ecae-image ecae-table-left'><div class='ecae-table-cell' style='$img_added_css'>" . $image . "</div>" . "<div class='ecae-table-cell'>" . $content . '</div>' ;
  957. }
  958. else if($options['image_position'] == 'right')
  959. {
  960. $content = "<div class='ecae-image ecae-table-right'><div class='ecae-table-cell' style='$img_added_css'>" . $image . "</div>" . "<div class='ecae-table-cell'>" . $content . '</div>' ;
  961. }
  962. else
  963. {
  964. $content = "<div class='ecae-image' style='$img_added_css'>" . $image . "</div>" . $content;
  965. }
  966. }
  967. }
  968.  
  969. // remove empty html tags
  970. if($options["strip_empty_tags"] == 'yes') {
  971. $content = strip_empty_tags($content);
  972. }
  973.  
  974. //delete remaining image
  975. $content = preg_replace('/\|\([0-9]*\|\C/', '', $content);
  976. $content = preg_replace('/\|\#[0-9]*\|\#/', '', $content);
  977.  
  978. //delete remaining
  979. $extra_markup_tag=array('*='.'(=',')=','_=','<=','>=','/=','\=',']=','[=','{=','}=','|=');
  980.  
  981. foreach ($extra_markup_tag as $value)
  982. {
  983. $char = str_split($value);
  984.  
  985. $content = preg_replace("/"."\\"."{$char[0]}"."\\"."{$char[1]}"."[0-9]*"."\\"."{$char[0]}"."\\"."{$char[1]}"."/", '', $content);
  986. }
  987.  
  988. foreach($array_replace_list as $key=>$value)
  989. {
  990. $char = str_split($value);
  991.  
  992. $content = preg_replace("/"."\\"."{$char[0]}"."\\"."{$char[1]}"."[0-9]*"."\\"."{$char[0]}"."\\"."{$char[1]}"."/", '', $content);
  993. }
  994. }
  995.  
  996.  
  997. /**
  998. * readmore text
  999. */
  1000. $link = get_permalink();
  1001. $readmore = "";
  1002. $is_readmore = false;
  1003.  
  1004. //remove last div is image position left / right
  1005. if($options['image_position'] == 'left' || $options['image_position'] == 'right' && strpos($content, 'ecae-table-cell'))
  1006. {
  1007. if(strpos($content, 'ecae-table-cell')) $content = substr($content, 0, -6);
  1008. }
  1009.  
  1010. if (trim($options['read_more']) != '-')
  1011. {
  1012. //failsafe
  1013. $options['read_more_text_before'] = isset($options['read_more_text_before'] )? $options['read_more_text_before'] : '...';
  1014.  
  1015. $button_skin = explode('-PREMIUM', $options['button_skin']);
  1016. $trim_readmore_before = trim($options['read_more_text_before']);
  1017.  
  1018. $read_more_text_before = empty($trim_readmore_before) ? $options['read_more_text_before'] : $options['read_more_text_before']."&nbsp;&nbsp;";
  1019.  
  1020. $readmore_link = " <a class='ecae-link' href='$link'><span>{$options['read_more']}</span></a>";
  1021. $readmore = "<p class='ecae-button {$button_skin[0]}' style='text-align:{$options['read_more_align']};' >$read_more_text_before $readmore_link</p>";
  1022.  
  1023. // button_display_option
  1024. if(! strpos($options['excerpt_method'],'-paragraph'))
  1025. {
  1026. if(strpos($content, '<!-- READ MORE TEXT -->')) $is_readmore = true;
  1027.  
  1028. if($options['button_display_option'] == 'always_show')
  1029. {
  1030. $content = str_replace('<!-- READ MORE TEXT -->', '', $content);
  1031. $content = $content . $readmore;
  1032. }
  1033. else if($options['button_display_option'] == 'always_hide')
  1034. {
  1035. $content = str_replace('<!-- READ MORE TEXT -->', '', $content);
  1036.  
  1037. $is_readmore = false;
  1038. }
  1039. else
  1040. {
  1041. $content = str_replace('<!-- READ MORE TEXT -->', $readmore, $content);
  1042. }
  1043. }
  1044. }
  1045.  
  1046. /**
  1047. * filter if 1st-paragraph mode
  1048. */
  1049. if(strpos($options['excerpt_method'],'-paragraph'))
  1050. {
  1051. $num_paragraph = substr($options['excerpt_method'], 0, 1);
  1052. $content = get_per_paragraph(intval($num_paragraph), $content);
  1053.  
  1054. global $content_pure;
  1055.  
  1056. $len_content = strlen(wp_kses($content,array())) + 1; // 1 is a difference between them
  1057. $len_content_pure = strlen(wp_kses($content_pure,array()));
  1058.  
  1059. // button_display_option
  1060. if($options['button_display_option'] == 'always_show')
  1061. {
  1062. $content = $content . $readmore;
  1063. $is_readmore = true;
  1064. }
  1065. else if($options['button_display_option'] == 'always_hide')
  1066. {
  1067. $content = $content;
  1068. }
  1069. else
  1070. {
  1071. if($len_content < $len_content_pure)
  1072. {
  1073. $content = $content . $readmore;
  1074. $is_readmore = true;
  1075. }
  1076. }
  1077. }
  1078.  
  1079. // wrap with a container
  1080. $justify = $justify != 'no' ? $justify : 'inherit';
  1081. $content = "<div class='ecae' style='text-align:$justify'>" . $content . "</div>";
  1082.  
  1083. //add last div is image position left / right
  1084. if($options['image_position'] == 'left' || $options['image_position'] == 'right')
  1085. {
  1086. if(strpos($content, 'ecae-table-cell')) $content .= '</div>';
  1087. }
  1088.  
  1089. /**
  1090. * custom css
  1091. */
  1092. $style = "<style type='text/css'>";
  1093. $trimmed_custom_css = str_replace(' ', '', $options["custom_css"]);
  1094.  
  1095. if($trimmed_custom_css != '')
  1096. {
  1097. $style.= $options["custom_css"];
  1098. }
  1099.  
  1100. if(function_exists('is_ecae_premium_exist') && isset($options["button_font_size"]))
  1101. {
  1102. $style.= '.ecae-button { font-size: '.$options["button_font_size"].'px !important; }';
  1103. }
  1104.  
  1105. if($is_readmore && $options['readmore_inline'] == 'yes')
  1106. {
  1107. $style.= ".ecae p:nth-last-of-type(2) {
  1108. display: inline !important;
  1109. padding-right: 10px;
  1110. }
  1111.  
  1112. .ecae-button {
  1113. display: inline-block !important;
  1114. }";
  1115. }
  1116.  
  1117. $style.= "</style>";
  1118.  
  1119. // remove empty html tags
  1120. if($options["strip_empty_tags"] == 'yes') {
  1121. $content = strip_empty_tags($content);
  1122. }
  1123.  
  1124. return "<!-- Generated by Easy Custom Auto Excerpt -->$style $content<!-- Generated by Easy Custom Auto Excerpt -->";
  1125. }
  1126.  
  1127. class eace_content_regex
  1128. {
  1129. var $key;
  1130. var $holder;
  1131. var $regex;
  1132. var $unique_char;
  1133. var $image;
  1134. var $options;
  1135.  
  1136. public function __construct($unique_char, $regex,$options,$image=false)
  1137. {
  1138. $this->regex = $regex;
  1139. $this->unique_char = $unique_char;
  1140.  
  1141. $this->image = $image;
  1142. $this->options = $options;
  1143. }
  1144.  
  1145. public function replace(&$content, &$width, $number = false, &$total_width=0)
  1146. {
  1147. //get all image in the content
  1148. preg_match_all($this->regex, $content, $this->holder, PREG_PATTERN_ORDER);
  1149.  
  1150. $this->key = 0;
  1151.  
  1152. //only cut bellow the $number variabel treshold ( to limit the number of replacing)
  1153. if($number) array_slice($this->holder[0], 0, $number);
  1154.  
  1155. foreach ($this->holder[0] as $text)
  1156. {
  1157. $unique_key = "{$this->unique_char}{$this->key}{$this->unique_char}";
  1158.  
  1159. $content = str_replace($text, $unique_key, $content);
  1160.  
  1161. if(!$this->image&&strpos($content,'<!--STOP THE EXCERPT HERE-->')===false)
  1162. {
  1163. $total_width = $total_width + strlen(wp_kses($text,array()));
  1164.  
  1165. if($total_width > $width && !strpos($this->options['excerpt_method'],'-paragraph'))
  1166. {
  1167. //tell plugin to stop at this point
  1168. $content = str_replace($unique_key, "{$unique_key}<!--STOP THE EXCERPT HERE--><!--- SECRET END TOKEN ECAE --->",$content);
  1169. //exit loop
  1170.  
  1171. if($this->options['excerpt_method'] == 'word')
  1172. {
  1173. //if use word cut technique
  1174. $overflow = $total_width - $width;
  1175.  
  1176. $current_lenght = strlen(wp_kses($text,array()));
  1177.  
  1178. $overflow = $current_lenght-$overflow;
  1179.  
  1180. // $pos = get cut position based on fixed position ($overflow), but without break last word
  1181. $pos = strpos($text, ' ', $overflow);
  1182. $holder_str = substr($text,0,$pos);
  1183.  
  1184. // delete last non alphanumeric character (save the ">", because it's html end markup)
  1185. $holder_str = preg_replace('/[`!@#$%^&*()_+=\-\[\]\';,.\/{}|":<?~\\\\]$/', '', $holder_str);
  1186.  
  1187. $holder_str = wp_kses($holder_str,array());
  1188.  
  1189. $holder_str = "<p>{$holder_str}<!-- READ MORE TEXT --></p>";
  1190.  
  1191. $this->holder[0][$this->key] = $holder_str;
  1192. }
  1193. else
  1194. {
  1195. //if use preserve paragraph technique
  1196. $this->holder[0][$this->key] = "{$this->holder[0][$this->key]}<!-- READ MORE TEXT -->";
  1197. }
  1198.  
  1199. //strip the text
  1200. $content = substr($content, 0, strpos($content,'<!--- SECRET END TOKEN ECAE --->'));
  1201.  
  1202. break;
  1203. }
  1204. }
  1205.  
  1206. $this->key = $this->key + 1;
  1207. }
  1208. }
  1209.  
  1210. function restore(&$content, $maximal = false)
  1211. {
  1212. //maximal number to restore
  1213. if (!$maximal) $maximal = $this->key;
  1214.  
  1215. //serves as counter, how many replace are made
  1216. $i = 0;
  1217.  
  1218. for ($i; $i < $maximal; $i++) {
  1219. if (isset($this->holder[0][$i]))
  1220. {
  1221. $content = str_replace("{$this->unique_char}{$i}{$this->unique_char}", $this->holder[0][$i], $content);
  1222. }
  1223. }
  1224. }
  1225.  
  1226. function remove(&$content)
  1227. {
  1228. $content = preg_replace($this->regex, "", $content);
  1229. }
  1230. }
  1231.  
  1232. function ecae_convert_caption($content,$options)
  1233. {
  1234. $results[0] = array();
  1235.  
  1236. $pattern = '/\[(\[?)(caption)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)/s';
  1237.  
  1238. preg_match_all($pattern, $content, $results);
  1239.  
  1240. $img_num = 0;
  1241.  
  1242. foreach ($results[0] as $result)
  1243. {
  1244. $img_num++;
  1245.  
  1246. $caption = do_shortcode($result);
  1247.  
  1248. if($options['show_image'] == 'first-image' && $img_num == 1)
  1249. {
  1250. $content = str_replace($result,$caption,$content);
  1251. }
  1252. else if($options['show_image'] == 'yes')
  1253. {
  1254. $content = str_replace($result,$caption,$content);
  1255. }
  1256. else
  1257. {
  1258. $content = str_replace($result,'',$content);
  1259. }
  1260. }
  1261.  
  1262. return $content;
  1263. }
  1264.  
  1265. function strip_empty_tags($str, $repto = NULL)
  1266. {
  1267. //** Return if string not given or empty.
  1268. if (!is_string ($str) || trim ($str) == '')
  1269. return $str;
  1270.  
  1271. //** Recursive empty HTML tags.
  1272. return preg_replace (
  1273.  
  1274. //** Pattern written by Junaid Atari.
  1275. '/<([^<\/>]*)>([\s|&nbsp;]*?|(?R))<\/\1>/imsU',
  1276.  
  1277. //** Replace with nothing if string empty.
  1278. !is_string ($repto) ? '' : $repto,
  1279.  
  1280. //** Source string
  1281. $str
  1282. );
  1283. }
  1284.  
  1285. require_once(plugin_dir_path(__FILE__) . 'tonjoo-library.php');
  1286. require_once(plugin_dir_path(__FILE__) . 'default.php');
  1287. require_once(plugin_dir_path(__FILE__) . 'options-page.php');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement