Changeset 1252098
- Timestamp:
- 09/23/2015 03:07:45 PM (11 years ago)
- Location:
- expresscurate/trunk
- Files:
-
- 1 added
- 20 edited
-
ExpressCurate.php (modified) (1 diff)
-
ExpressCurate_Actions.php (modified) (16 diffs)
-
ExpressCurate_FeedManager.php (modified) (32 diffs)
-
ExpressCurate_HtmlParser.php (modified) (4 diffs)
-
ExpressCurate_Sitemap.php (modified) (11 diffs)
-
ExpressCurate_SocialManager.php (modified) (4 diffs)
-
css/expresscurate.css (modified) (13 diffs)
-
css/theme-styles.css (modified) (1 diff)
-
images/feed_icons.svg (modified) (1 diff)
-
js/Settings.js (modified) (1 diff)
-
js/bookmarks.js (modified) (2 diffs)
-
js/feed/contentFeed.js (modified) (7 diffs)
-
js/socialPostWidget.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
templates/bookmarks.php (modified) (2 diffs)
-
templates/content_feed_archive.php (added)
-
templates/dashboard/welcome_widget.php (modified) (1 diff)
-
templates/feed_dashboard.php (modified) (1 diff)
-
templates/feed_list.php (modified) (3 diffs)
-
templates/settings.php (modified) (1 diff)
-
templates/sitemap.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
expresscurate/trunk/ExpressCurate.php
r1191825 r1252098 5 5 Plugin URI: http://www.expresscurate.com/products 6 6 Description: ExpressCurate plugin is a content curation tool for WordPress. It enables you to create and publish high quality content within minutes. 7 Version: 2.1. 37 Version: 2.1.4 8 8 Author: ExpressCurate 9 9 Author URI: http://www.expresscurate.com -
expresscurate/trunk/ExpressCurate_Actions.php
r1191825 r1252098 99 99 add_action('wp_head', array(&$this, 'advanced_seo_update_canonical_url')); 100 100 add_filter('wp_title', array(&$this, 'advanced_seo_update_title')); 101 } 102 101 if($_GET['page'] == "expresscurate_feed_list"){ 102 update_option('unseen_feeds_count',0); 103 update_option('feedpage_last_time_opened',date('Y-m-d H:i:s',time())); 104 } 105 106 } 103 107 104 108 /** … … 130 134 131 135 add_action('admin_footer', array(&$this, 'add_inline_popup_content')); 136 if ($_GET['page'] == "expresscurate_bookmarks" || $_GET['page'] == "expresscurate_feed_list") { 137 add_action('admin_footer', array(&$this, 'add_confirm_dialogs')); 138 } 132 139 add_action('admin_footer', array(&$this, 'anonymous_tracking')); 133 140 … … 162 169 add_action('wp_ajax_expresscurate_bookmarks_delete', array($this->feedManager, 'delete_bookmarks')); 163 170 add_action('wp_ajax_expresscurate_delete_feed_content_items', array($this->feedManager, 'delete_feed_content_items')); 171 add_action('wp_ajax_expresscurate_remove_feed_archive_items', array($this->feedManager, 'remove_feed_archive_items')); 172 add_action('wp_ajax_expresscurate_restore_deleted_items', array($this->feedManager, 'restore_deleted_items')); 164 173 add_action('wp_ajax_expresscurate_add_post_source', array($this->feedManager, 'add_post_source')); 165 174 add_action('wp_ajax_expresscurate_delete_post_source', array($this->feedManager, 'delete_post_source')); … … 190 199 add_action('wp_dashboard_setup', array(&$this, 'add_dashboard_widgets')); 191 200 add_filter('user_contactmethods', array(&$this, 'add_user_profile_metas')); 201 192 202 if ($pagenow == 'post.php' || $pagenow == 'post-new.php') { 193 203 add_action('media_buttons_context', array(&$this, 'add_custom_button'), 11); … … 198 208 add_action('transition_post_status', array(&$this, 'status_changes'), 10, 3); 199 209 add_action('update_option_permalink_structure', array(&$this, 'permalink_changes'), 10, 2); 210 if ($pagenow == 'post.php') { 211 add_action('admin_head', array(&$this, 'edit_post_permalink')); 212 } 200 213 if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'expresscurate_settings') { 201 214 $this->cronManager->schedule_events(); … … 225 238 register_setting('expresscurate-group', 'expresscurate_publisher'); 226 239 register_setting('expresscurate-group', 'expresscurate_publisher_twitter'); 240 register_setting('expresscurate-group', 'expresscurate_publisher_facebook'); 227 241 register_setting('expresscurate-group', 'expresscurate_autosummary'); 228 242 register_setting('expresscurate-group', 'expresscurate_share'); … … 249 263 register_setting('expresscurate-sitemap-group', 'expresscurate_sitemap_priority_manual_value'); 250 264 register_setting('expresscurate-sitemap-group', 'expresscurate_sitemap_archiving'); 265 register_setting('expresscurate-sitemap-group', 'expresscurate_sitemap_domain'); 251 266 register_setting('expresscurate-changed-post-status', 'expresscurate_changed_post_status'); 252 267 register_setting('expresscurate-sitemap-generation-group', 'expresscurate_sitemap_generation_last_date'); … … 378 393 } 379 394 395 public function edit_post_permalink(){ 396 global $post; 397 ?> 398 <script> 399 jQuery(document).ready(function() { 400 jQuery('#titlediv').append('<input type="hidden" name="post_old_permalink" value="<?php echo (get_permalink($post->ID)?get_permalink($post->ID):''); ?>">'); 401 }); 402 </script> 403 <?php 404 } 405 406 380 407 public function add_custom_button($context) 381 408 { … … 431 458 <?php 432 459 } 460 } 461 462 public function add_confirm_dialogs(){ 463 ?> 464 <div id="expresscurate_delete_dialog" class="expresscurate_dialog" title="Confirm Delete"></div> 465 <!-- <div id="expresscurate_remove_dialog" class="expresscurate_dialog" title="Confirm Permanent Remove"></div>--> 466 <!--<div id="expresscurate_restore_dialog" class="expresscurate_dialog" title="Confirm Restore"></div>--> 467 <?php 433 468 } 434 469 … … 795 830 $post_content = $tags_obj->removeTagLinks($post_content); 796 831 } 832 $old_permalink = $_POST['post_old_permalink']; 833 $new_permalink = get_permalink($post->ID); 834 $this->permalink_changes($old_permalink, $new_permalink); 797 835 798 836 //Smart publishing … … 1127 1165 self::PLUGIN_NAME . ' Settings', self::PLUGIN_NAME, 'manage_options', 'expresscurate_settings', array(&$this, 'plugin_settings_page') 1128 1166 ); 1167 $unseen_feeds_count = get_option('unseen_feeds_count')?get_option('unseen_feeds_count'):0; 1168 $content_feed_label = sprintf( __( 'Content Feed %s' ),"<span class='awaiting-mod count-$unseen_feeds_count'><span class='$unseen_feeds_count'>$unseen_feeds_count </span></span>"); 1129 1169 add_menu_page(self::PLUGIN_NAME, self::PLUGIN_NAME, 'edit_posts', 'expresscurate', array(&$this, 'show_dashboard'), '', '9.95458'); 1130 add_submenu_page('expresscurate', 'Content Feed', 'Content Feed', 'edit_posts', 'expresscurate_feed_list', array(&$this, 'show_feed_list'), ''); 1170 add_submenu_page('expresscurate', 'Content Feed', $content_feed_label, 'edit_posts', 'expresscurate_feed_list', array(&$this, 'show_feed_list'), ''); 1171 add_submenu_page(null, 'Content Feed Archive', 'Content Feed Archive', 'edit_posts', 'expresscurate_content_feed_archive', array(&$this, 'show_deleted_feeds'), ''); 1131 1172 add_submenu_page('expresscurate', 'Bookmarks', 'Bookmarks', 'edit_posts', 'expresscurate_bookmarks', array(&$this, 'show_bookmarks'), ''); 1132 1173 add_submenu_page('expresscurate', 'Top Sources', 'Top Sources', 'edit_posts', 'expresscurate_websites', array(&$this, 'show_websites'), ''); … … 1355 1396 $featuredImageID = get_post_thumbnail_id($post_id); 1356 1397 if ($featuredImageID) { 1357 $featuredImage = wp_get_attachment_url( featuredImageID);1398 $featuredImage = wp_get_attachment_url($featuredImageID); 1358 1399 $featuredImage = $featuredImage ? esc_url($featuredImage) : null; 1359 1400 } … … 1509 1550 } 1510 1551 1552 public function show_deleted_feeds() 1553 { 1554 if (!current_user_can('edit_posts')) { 1555 wp_die(__('You do not have sufficient permissions to access this page.')); 1556 } 1557 include(sprintf("%s/templates/content_feed_archive.php", dirname(__FILE__))); 1558 1559 // init page tracking 1560 global $expresscurate_track_page; 1561 $expresscurate_track_page = 'rss-feeds'; 1562 } 1563 1511 1564 public function show_bookmarks() 1512 1565 { … … 1595 1648 1596 1649 wp_enqueue_script('expresscurate_keyword_utils', $pluginUrl . 'js/keywords/KeywordUtils.js', array('jquery')); 1597 wp_enqueue_script('expresscurate_keywords', $pluginUrl . 'js/keywords/Keywords.js', array('jquery', 'jquery-ui-core' , 'jquery-ui-datepicker'));1650 wp_enqueue_script('expresscurate_keywords', $pluginUrl . 'js/keywords/Keywords.js', array('jquery', 'jquery-ui-core')); 1598 1651 wp_enqueue_script('expresscurate_seo_control_center', $pluginUrl . 'js/keywords/SEOControlCenter.js', array('jquery', 'jquery-ui-draggable', 'jquery-ui-droppable')); 1599 1652 // … … 1640 1693 // Add new fields 1641 1694 $profile_fields['expresscurate_twitter'] = 'Twitter Username'; 1695 $profile_fields['expresscurate_twitter_url'] = 'Twitter URL'; 1642 1696 $profile_fields['expresscurate_facebook'] = 'Facebook URL'; 1643 1697 $profile_fields['expresscurate_gplus'] = 'Google+ URL'; 1644 1698 return $profile_fields; 1645 }1646 1647 private function get_match($regex, $content)1648 {1649 preg_match($regex, $content, $matches);1650 return $matches[1];1651 }1652 1653 private function pluginUrl()1654 {1655 return plugin_dir_url(__FILE__);1656 1699 } 1657 1700 … … 1803 1846 if (!ExpressCurate_HtmlParser::supportsDownload()) { 1804 1847 echo '<div class="update-nag">You should activate either curl extension or allow_url_fopen setting.</div>'; 1848 } 1849 1850 1851 1852 if (!ExpressCurate_HtmlParser::isNotSafeMode() || strlen(ini_get('open_basedir'))!=0) { 1853 echo '<div class="update-nag"> 1854 For the plugin to perform properly make sure those settings on your server in the following states.</br> 1855 <ol> 1856 <li> cUrl extension is enabled </li> 1857 <li> Safe mode is off(only for below php5.4)</li> 1858 <li>"Open_basedir" option is disabled </li> 1859 </ol> 1860 Otherwise enable "allow_url_fopen" setting 1861 </div>'; 1805 1862 } 1806 1863 -
expresscurate/trunk/ExpressCurate_FeedManager.php
r1179598 r1252098 32 32 { 33 33 global $wpdb; 34 if (!ExpressCurate_HtmlParser::supportsDownload()){35 $result = array("status" =>"You should activate either curl extension or allow_url_fopen setting.");34 if (!ExpressCurate_HtmlParser::supportsDownload()) { 35 $result = array("status" => "You should activate either curl extension or allow_url_fopen setting."); 36 36 } else { 37 37 $url = isset($url) ? $url : $_REQUEST['url']; … … 48 48 49 49 $rssUrl = $this->getRssUrl($url); 50 $existed_rss ="";50 $existed_rss = ""; 51 51 $rssLinks = array_values($curated_links_rss); 52 foreach($rssLinks as $link) { 53 if($link['feed_url']==$rssUrl) 54 { 52 foreach ($rssLinks as $link) { 53 if ($link['feed_url'] == $rssUrl) { 55 54 $existed_rss = $link['feed_url']; 56 55 break; 57 56 } 58 57 } 59 if ($rssUrl === null || $rssUrl =="") {58 if ($rssUrl === null || $rssUrl == "") { 60 59 $result['status'] = 'No RSS feed found at this URL.'; 61 60 } else if (!empty($existed_rss)) { … … 97 96 } 98 97 99 private function getFeedMeta($feedURL) { 100 $loadURL = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=" . urlencode($feedURL); 98 private function getFeedMeta($feedURL) 99 { 100 $loadURL = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=" . urlencode($feedURL) . "&num=-1"; 101 101 $htmlparser = new ExpressCurate_HtmlParser($loadURL); 102 102 $res = $htmlparser->download(); 103 103 $result = json_decode($res, true); 104 104 105 if (isset($result['responseData']) && isset($result['responseData']['feed'])) {105 if (isset($result['responseData']) && isset($result['responseData']['feed'])) { 106 106 $meta = array(); 107 107 $meta['title'] = $result['responseData']['feed']['title']; 108 $meta['feed'] = $result['responseData']['feed']['feedUrl'];109 $meta['link'] = $result['responseData']['feed']['link'];108 $meta['feed'] = $result['responseData']['feed']['feedUrl']; 109 $meta['link'] = $result['responseData']['feed']['link']; 110 110 return $meta; 111 111 } else { … … 119 119 $data = $_REQUEST; 120 120 if ($data['url']) { 121 $data['url'] = htmlentities($data['url'], ENT_COMPAT); 121 122 $curated_links_rss = get_option('expresscurate_links_rss', ''); 122 123 if ($curated_links_rss) { … … 161 162 162 163 $links = array(); 163 foreach ($curated_links_rss as $link => $data) {164 foreach ($curated_links_rss as $link => $data) { 164 165 $url = $data['feed_url']; 165 166 $links[$url] = 1; … … 173 174 if ($top_sources_rss) { 174 175 // check if migrated 175 $migrated1 = (isset($top_sources_rss['migrated']) && $top_sources_rss['migrated'] == 1);176 $migrated1 = (isset($top_sources_rss['migrated']) && $top_sources_rss['migrated'] == 1); 176 177 // if not migrated, clean the data up, calculate stats from scratch 177 178 $top_sources_rss = $migrated1 ? json_decode($top_sources_rss, true) : array(); … … 203 204 204 205 // filter 205 if (empty($link) || $link == '.') {206 if (empty($link) || $link == '.') { 206 207 continue; 207 208 } … … 221 222 $rssLinks = array(); 222 223 223 if (ExpressCurate_HtmlParser::supportsDownload()) {224 if (ExpressCurate_HtmlParser::supportsDownload()) { 224 225 foreach ($curated_links as $key => $top_link) { 225 226 $websiteHost = $top_link['host']; 226 227 $website = $top_link['link']; 227 228 228 if (isset($rssLinks[$websiteHost])) {229 if (isset($rssLinks[$websiteHost])) { 229 230 $rssUrl = $rssLinks[$websiteHost]; 230 231 } else { … … 273 274 } 274 275 276 public function get_deleted_feeds() 277 { 278 $deleted_feeds = get_option('expresscurate_feed_content_deleted', ''); 279 if ($deleted_feeds) { 280 $deleted_feeds = json_decode($deleted_feeds, true); 281 } else { 282 $deleted_feeds = array(); 283 } 284 return $deleted_feeds; 285 } 286 275 287 public function get_rss_list() 276 288 { … … 282 294 283 295 $save = false; 284 foreach ($curated_links_rss as $rss => $data) {285 if (isset($data['feed_title']) && strlen(trim($data['feed_title'])) > 0) {296 foreach ($curated_links_rss as $rss => $data) { 297 if (isset($data['feed_title']) && strlen(trim($data['feed_title'])) > 0) { 286 298 continue; 287 299 } … … 307 319 308 320 // update the post count 309 foreach ($curated_links_rss as $link => $data) {321 foreach ($curated_links_rss as $link => $data) { 310 322 // get the number of posts that are curated from this feed 311 323 $posts = $wpdb->get_results( 312 "SELECT post_id324 "SELECT post_id 313 325 FROM $wpdb->postmeta 314 WHERE meta_key LIKE '%_expresscurate_link_%' AND meta_value LIKE '%" . $ link. "%' GROUP BY post_id");326 WHERE meta_key LIKE '%_expresscurate_link_%' AND meta_value LIKE '%" . $data['link'] . "%' GROUP BY post_id"); 315 327 316 328 $curated_links_rss[$link]['post_count'] = count($posts); … … 334 346 * @return mixed|null JSON response or null if $url or $result is not set 335 347 * */ 336 public function doRssLookup($url) { 337 if(isset($url)) { 348 public function doRssLookup($url) 349 { 350 if (isset($url)) { 338 351 $lookup_url = "http://ajax.googleapis.com/ajax/services/feed/lookup?v=1.0&q=" . urlencode($url); 339 352 //$result = file_get_contents($lookup_url); … … 372 385 373 386 374 375 387 public function get_feed_content() 376 388 { … … 383 395 $feed_array = $feedContent['content']; 384 396 } 385 397 $unseen_feeds = get_option('unseen_feeds_count') ? intval(get_option('unseen_feeds_count')) : 0; 386 398 // blabla 387 399 $data = $_REQUEST; 388 400 $pull_feed_interval = (get_option('expresscurate_pull_hours_interval')) ? get_option('expresscurate_pull_hours_interval') : 1; 389 $date = ($data["date"]) ? urldecode($data["date"]) : date('Y-m-d H:i:s', strtotime("-" . $pull_feed_interval . " hour"));401 $date = ($data["date"]) ? urldecode($data["date"]) : date('Y-m-d H:i:s', strtotime("-" . $pull_feed_interval . " hour")); 390 402 $curated_links_rss = get_option('expresscurate_links_rss', ''); 391 403 if ($curated_links_rss) { … … 399 411 } 400 412 if (is_array($feed_content_deleted)) { 401 foreach ($feed_content_deleted as $delete t_item) {402 $deleted_urls[] = $delete t_item;413 foreach ($feed_content_deleted as $deleted_item) { 414 $deleted_urls[] = $deleted_item; 403 415 } 404 416 } … … 409 421 foreach ($curated_links_rss as $url => $feed_url) { 410 422 // pull content 411 $lookup_url = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=" . urlencode($feed_url['feed_url']) ;423 $lookup_url = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=" . urlencode($feed_url['feed_url']) . "&num=-1"; 412 424 $htmlparser = new ExpressCurate_HtmlParser($lookup_url); 413 425 $res = $htmlparser->download(); 414 426 // decode and collect 415 427 $result = json_decode($res, true); 416 417 $this->collect_feed($result, $deleted_urls, $feed_array, 'feed', $date);418 }428 $this->collect_feed($result, $deleted_urls, $feed_array, 'feed', $date, $unseen_feeds); 429 } 430 update_option('unseen_feeds_count', $unseen_feeds); 419 431 } 420 432 // check if the feed is empty and sort 421 if (!empty($feed_array)) {433 if (!empty($feed_array)) { 422 434 @uasort($feed_array, array($this, "feedSortByDate")); 423 435 424 436 // check if the feed is full or not 425 if (count($feed_array) > self::CONTENT_FEED_MAX_SIZE) {437 if (count($feed_array) > self::CONTENT_FEED_MAX_SIZE) { 426 438 // remove the last elements 427 $feed_array = array_slice($feed_array, 0,self::CONTENT_FEED_MAX_SIZE);439 $feed_array = array_slice($feed_array, 0, self::CONTENT_FEED_MAX_SIZE); 428 440 // TODO implement 429 441 … … 438 450 } 439 451 440 private function collect_feed($result, $deleted_urls, &$feed_array, $type = 'feed', $date = false )452 private function collect_feed($result, $deleted_urls, &$feed_array, $type = 'feed', $date = false, &$unseen_feeds) 441 453 { 442 454 $feeds = array(); … … 448 460 } 449 461 } 450 451 $blockWords = split(', ', trim(get_option('expresscurate_content_stop_keywords', ''))); 462 $blockWords = preg_split('/[,]+/iu', trim(get_option('expresscurate_content_stop_keywords', ''))); 452 463 $blockWords = empty($blockWords) ? false : $blockWords; 453 464 454 465 foreach ($feeds as $story) { 466 455 467 // get the post url 456 468 $link = isset($story['link']) ? $story['link'] : $story['address']; 457 if (empty($link) || isset($deleted_urls[$link])) {469 if (empty($link) || isset($deleted_urls[$link])) { 458 470 continue; 459 471 } … … 479 491 480 492 // check if this link is already in the feed 481 if (isset($feed_array[$link])) {493 if (isset($feed_array[$link])) { 482 494 continue; 483 495 } 484 496 485 $domain = parse_url($link); 486 if (preg_match('/(?P<subdomain>.<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $parsedLink['host'], $regs)) { 487 $domain = $regs['domain']; 497 $domain = parse_url($link); 498 if (preg_match('/(?P<subdomain>.<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $parsedLink['host'], $regs)) { 499 $domain = $regs['domain']; 500 } else { 501 $domain = $domain['host']; 502 } 503 504 // download and analyze 505 $html_parser = new ExpressCurate_HtmlParser($link); 506 $link = $html_parser->getRealURL(); 507 // check if the final page (initial or redirected address) is already in feed 508 if (isset($feed_array[$link])) { 509 continue; 510 } 511 512 if ($blockWords) { 513 $blocked = $html_parser->contains($blockWords); 514 if ($blocked) { 515 continue; 516 } 517 } 518 519 $keywords = $html_parser->analyzeKeywords(); 520 $media = $html_parser->containsMedia(); 521 522 $publishDate = isset($story['publishedDate']) ? $story['publishedDate'] : $story['date']; 523 $expressCurateDate = new ExpressCurate_Date(); 524 $publishDate = $expressCurateDate->dateWithTimeUtc(strtotime($publishDate)); 525 526 $story_array = array( 527 'title' => str_replace(""", "'", $story['title']), 528 'desc' => isset($story['contentSnippet']) ? str_replace(""", "'", $story['contentSnippet']) : '', 529 'link' => $link, 530 'date' => $publishDate, 531 'domain' => $domain, 532 'author' => $story['author'], 533 'curated' => 0, 534 'keywords' => $keywords, 535 'media' => $media 536 ); 537 538 if ($date) { 539 $starting_date = strtotime($date); 540 $story_date = strtotime($story_array['date']); 541 $diff = $story_date - $starting_date; 542 } 543 if (!$date || ($date && $diff >= 0)) { 544 if ($type = 'wall') { 545 $story_array['type'] = $story['channel']; 488 546 } else { 489 $domain = $domain['host']; 490 } 491 492 // download and analyze 493 $html_parser = new ExpressCurate_HtmlParser($link); 494 $link = $html_parser->getRealURL(); 495 // check if the final page (initial or redirected address) is already in feed 496 if(isset($feed_array[$link])) { 497 continue; 498 } 499 500 if($blockWords) { 501 $blocked = $html_parser->contains($blockWords); 502 if($blocked) { 503 continue; 504 } 505 } 506 507 $keywords = $html_parser->analyzeKeywords(); 508 $media = $html_parser->containsMedia(); 509 510 $publishDate = isset($story['publishedDate']) ? $story['publishedDate'] : $story['date']; 511 $expressCurateDate = new ExpressCurate_Date(); 512 $publishDate = $expressCurateDate->dateWithTimeUtc(strtotime($publishDate)); 513 514 $story_array = array( 515 'title' => str_replace(""","'",$story['title']), 516 'desc' => isset($story['contentSnippet']) ? str_replace(""","'",$story['contentSnippet']) : '', 517 'link' => $link, 518 'date' => $publishDate, 519 'domain' => $domain, 520 'author' => $story['author'], 521 'curated' => 0, 522 'keywords' => $keywords, 523 'media' => $media 524 ); 525 526 if ($date) { 527 $starting_date = strtotime($date); 528 $story_date = strtotime($story_array['date']); 529 $diff = $story_date - $starting_date; 530 } 531 if (!$date || ($date && $diff >= 0)) { 532 if ($type = 'wall') { 533 $story_array['type'] = $story['channel']; 534 } else { 535 $story_array['type'] = 'feed'; 536 } 537 $feed_array[$link] = $story_array; 538 } 539 } 540 } 541 542 public function manual_pull_feed() { 547 $story_array['type'] = 'feed'; 548 } 549 $feed_array[$link] = $story_array; 550 $unseen_feeds++; 551 } else { 552 break; 553 } 554 } 555 } 556 557 public function manual_pull_feed() 558 { 543 559 // get feed data 544 560 $feeds = json_decode($this->get_feed_content(), true); 545 561 546 562 // reschedule the cronjob 547 //if(!empty($feeds['content'])) {548 563 wp_clear_scheduled_hook('expresscurate_pull_feeds'); 549 564 $pull_feed_interval = (get_option('expresscurate_pull_hours_interval')) ? get_option('expresscurate_pull_hours_interval') : 1; 550 565 wp_schedule_event(strtotime("+" . $pull_feed_interval . " hour"), 'hourly', 'expresscurate_pull_feeds'); 551 566 $feeds["minutes_to_next_pull"] = human_time_diff(wp_next_scheduled('expresscurate_pull_feeds'), time()); 552 //}553 554 // return555 567 echo json_encode($feeds); 556 568 die; … … 563 575 } 564 576 565 public function filter_feeds_by_date() { 577 public function filter_feeds_by_date() 578 { 566 579 $data = $_REQUEST; 567 580 $feed_content = json_decode(get_option('expresscurate_feed_content', ''), true); 568 581 $filtered_feeds = array(); 569 if (isset($data['date']) && !empty($feed_content['content'])){570 foreach ($feed_content['content'] as $link => $feed){571 if ((strtotime($feed['date']) - $data['date']) >= 0){582 if (isset($data['date']) && !empty($feed_content['content'])) { 583 foreach ($feed_content['content'] as $link => $feed) { 584 if ((strtotime($feed['date']) - $data['date']) >= 0) { 572 585 $filtered_feeds[$link] = $feed; 573 586 } … … 582 595 if (get_option('expresscurate_enable_content_alert') == 'on') { 583 596 $expressCurateEmail = new ExpressCurate_Email(); 584 597 585 598 $alertAddresses = trim(get_option('expresscurate_content_alert_users', '')); 586 if (!$expressCurateEmail->hasContentAlertRecipients()) {599 if (!$expressCurateEmail->hasContentAlertRecipients()) { 587 600 return; 588 601 } 589 602 590 603 $feed_content = json_decode(get_option('expresscurate_feed_content', ''), true); 591 604 … … 622 635 if ($feed_contents) { 623 636 $feed_contents = json_decode($feed_contents, true); 624 $exists_url = array();625 foreach ($feed_contents['content'] as $content) {637 //$exists_url = array(); 638 /*foreach ($feed_contents['content'] as $content) { 626 639 $exists_url[] = $content['link']; 627 } 640 }*/ 628 641 foreach ($items as $item) { 629 if (in_array($item, $exists_url)) { 630 $feed_content_deleted[$item] = $item; 631 unset($feed_contents['content'][$item]); 642 $item = json_decode(stripslashes($item), true); 643 if (isset($feed_contents['content'][$item['link']])) { 644 $feed_content_deleted[$item['link']] = $item; 645 unset($feed_contents['content'][$item['link']]); 632 646 } 633 647 } … … 648 662 } 649 663 664 public function remove_feed_archive_items() 665 { 666 $data = $_REQUEST; 667 if (isset($data['items'])) { 668 $items = $data['items']; 669 $result = array(); 670 $feed_content_deleted = get_option('expresscurate_feed_content_deleted', ''); 671 if ($feed_content_deleted) { 672 $feed_content_deleted = json_decode($feed_content_deleted, true); 673 foreach ($items as $item) { 674 if (isset($feed_content_deleted[$item])) { 675 unset($feed_content_deleted[$item]); 676 } 677 } 678 $feed_content_deleted = json_encode($feed_content_deleted); 679 update_option('expresscurate_feed_content_deleted', $feed_content_deleted); 680 681 $result['status'] = 'success'; 682 } else { 683 $result['status'] = 'warning'; 684 } 685 } else { 686 $result['status'] = 'error'; 687 } 688 echo json_encode($result); 689 die; 690 } 691 692 public function restore_deleted_items() 693 { 694 $data = $_REQUEST; 695 if (isset($data['items'])) { 696 $items = $data['items']; 697 $result = array(); 698 $feed_contents = get_option('expresscurate_feed_content', ''); 699 $feed_content_deleted = get_option('expresscurate_feed_content_deleted', ''); 700 if ($feed_content_deleted) { 701 $feed_content_deleted = json_decode($feed_content_deleted, true); 702 } 703 if ($feed_contents) { 704 $feed_contents = json_decode($feed_contents, true); 705 706 foreach ($items as $item) { 707 $item = json_decode(stripslashes($item), true); 708 if (isset($feed_content_deleted[$item['link']])) { 709 $item['date'] = date("Y-m-d H:i:s", time()); 710 $feed_contents['content'][$item['link']] = $item; 711 unset($feed_content_deleted[$item['link']]); 712 } 713 } 714 $feed_contents = array_slice($feed_contents, 0, self::CONTENT_FEED_MAX_SIZE); 715 $feed_contents = json_encode($feed_contents); 716 $feed_content_deleted = json_encode($feed_content_deleted); 717 update_option('expresscurate_feed_content', $feed_contents); 718 update_option('expresscurate_feed_content_deleted', $feed_content_deleted); 719 720 $result['status'] = 'success'; 721 } else { 722 $result['status'] = 'warning'; 723 } 724 } else { 725 $result['status'] = 'error'; 726 } 727 echo json_encode($result); 728 die; 729 } 730 650 731 public function add_bookmarks() 651 732 { … … 653 734 $data = $_REQUEST; 654 735 if (isset($data['items'])) { 655 $items = json_decode(stripslashes($data['items']), true); 656 736 $items = $data['items']; 657 737 $bookmarks = get_option('expresscurate_bookmarks', ''); 658 738 if ($bookmarks) { … … 663 743 664 744 foreach ($items as $item) { 745 $item = json_decode(stripslashes($item), true); 665 746 $bookmarkURL = $item['link']; 666 747 if (isset($bookmarks[$bookmarkURL])) { 667 $result[$bookmarkURL]['status'] = 'warning';668 } else {748 $result[$bookmarkURL]['status'] = 'warning'; 749 } else { 669 750 $current_user = wp_get_current_user(); 670 751 $item['user'] = $current_user->display_name; … … 672 753 $this->collectBookmark($bookmarks, $item); 673 754 674 $result[$bookmarkURL]['status'] = 'success';755 // $result[$bookmarkURL]['status'] = 'success'; 675 756 } 676 757 } … … 689 770 $data = $_REQUEST; 690 771 $result = array(); 691 if (!ExpressCurate_HtmlParser::supportsDownload()) {772 if (!ExpressCurate_HtmlParser::supportsDownload()) { 692 773 $result['status'] = 'error'; 693 774 $result['msg'] = 'You should activate either curl extension or allow_url_fopen setting.'; … … 788 869 } 789 870 790 private function collectBookmark(&$bookmarks, $item, $url = null, $comment = '') { 871 private function collectBookmark(&$bookmarks, $item, $url = null, $comment = '') 872 { 791 873 if ($url) { 792 874 if (isset($item['result']) && isset($item['result']['title'])) { … … 849 931 $result['msg'] = 'Url is empty'; 850 932 } 851 echo json_encode($result, JSON_UNESCAPED_SLASHES);933 echo json_encode($result, JSON_UNESCAPED_SLASHES); 852 934 die; 853 935 } … … 862 944 if ($bookmarks) { 863 945 $bookmarks = json_decode($bookmarks, true); 864 $exists_url = array();865 foreach ($bookmarks as $bookmark) {866 $exists_url[] = $bookmark['link'];867 }946 /* $exists_url = array(); 947 foreach ($bookmarks as $bookmark) { 948 $exists_url[] = $bookmark['link']; 949 }*/ 868 950 foreach ($items as $item) { 869 if ( in_array($item['link'], $exists_url)) {951 if (array_key_exists($item['link'], $bookmarks)) { 870 952 unset($bookmarks[$item['link']]); 871 953 } … … 915 997 $feeds = array(); 916 998 } 917 if (!empty($bookmarks)){999 if (!empty($bookmarks)) { 918 1000 $hayStack = array_merge($bookmarks, $feeds); 919 1001 } 920 1002 } 921 1003 922 if (!empty($hayStack)){1004 if (!empty($hayStack)) { 923 1005 foreach ($hayStack as $content) { 924 1006 if (mb_stripos($content['title'], $needle) != false) { … … 940 1022 foreach ($bookmarks as $key => $bookmark) { 941 1023 $date_array = date_parse($bookmark['bookmark_date']); 942 $bookmark_date = strtotime(date('Y-m-d', mktime(0, 0,0,$date_array['month'], $date_array['day'], $date_array['year'])));1024 $bookmark_date = strtotime(date('Y-m-d', mktime(0, 0, 0, $date_array['month'], $date_array['day'], $date_array['year']))); 943 1025 if ($bookmark_date >= $start && $bookmark_date <= $end) { 944 1026 $count++; -
expresscurate/trunk/ExpressCurate_HtmlParser.php
r1191825 r1252098 50 50 { 51 51 $safeMode = ini_get('safe_mode'); 52 if( $safeMode&& version_compare(PHP_VERSION, '5.4.0') < 0) {52 if(!empty($safeMode) && version_compare(PHP_VERSION, '5.4.0') < 0) { 53 53 return false; 54 54 } else { … … 247 247 return; 248 248 } 249 set_time_limit(0); 250 if (self::supportsAsynch()&& self::isNotSafeMode() && strlen(ini_get('open_basedir'))==0) { 251 249 $curlDownload = true; 250 if(!self::isNotSafeMode()){ 251 $curlDownload = false; 252 } else if(strlen(ini_get('open_basedir'))!=0){ 253 $curlDownload = false; 254 } else if(self::supportsAsynch()) { 255 $curlDownload = true; 256 } else { 257 $curlDownload = false; 258 } 259 260 if ($curlDownload) { 261 ini_set('max_execution_time',0); 252 262 // setup the single curl 253 263 $ch = $this->createCURL($this->url); … … 258 268 curl_close($ch); 259 269 } else { 270 set_time_limit(0); 260 271 $header = ''; 261 272 if ($this->referer) { … … 352 363 } 353 364 } 354 355 365 // save and return 356 366 $this->data = $content; -
expresscurate/trunk/ExpressCurate_Sitemap.php
r1179063 r1252098 9 9 License URI: http://www.gnu.org/licenses/gpl.html 10 10 */ 11 11 12 12 class ExpressCurate_Sitemap 13 13 { … … 15 15 private static $instance; 16 16 17 function __construct() { 17 function __construct() 18 { 18 19 // action shall be added from actions controller 19 20 } 20 21 21 public static function getInstance() { 22 if ( ! ( self::$instance instanceof self ) ) { 22 public static function getInstance() 23 { 24 if (!(self::$instance instanceof self)) { 23 25 self::$instance = new self(); 24 26 } … … 27 29 } 28 30 29 public function generateSitemapScheduled(){ 31 public function generateSitemapScheduled() 32 { 30 33 $intervalInDays = null; 31 34 //$lastGenerationDate = 0; 32 switch(get_option('expresscurate_sitemap_generation_interval')) { 33 case 'daily': $intervalInDays = 1; 34 break; 35 case 'weekly': $intervalInDays = 7; 36 break; 37 case 'monthly': $intervalInDays = 30; 35 switch (get_option('expresscurate_sitemap_generation_interval')) { 36 case 'daily': 37 $intervalInDays = 1; 38 break; 39 case 'weekly': 40 $intervalInDays = 7; 41 break; 42 case 'monthly': 43 $intervalInDays = 30; 38 44 }; 39 45 … … 42 48 } 43 49 $lastGenerationDate = get_option('expresscurate_sitemap_generation_last_date'); 44 if (floor(date('Y-m-d H:i:s') - strtotime($lastGenerationDate) /(60*60*24)) >= $intervalInDays) {50 if (floor(date('Y-m-d H:i:s') - strtotime($lastGenerationDate) / (60 * 60 * 24)) >= $intervalInDays) { 45 51 $this->generateSitemap(); 46 52 } 47 53 } 48 54 49 public function pushSitemapScheduled(){ 55 public function pushSitemapScheduled() 56 { 50 57 $intervalInDays = null; 51 58 $lastGenerationDate = 0; 52 switch(get_option('expresscurate_sitemap_submit_frequency')) { 53 case 'daily': $intervalInDays = 1; 54 break; 55 case 'weekly': $intervalInDays = 7; 56 break; 57 case 'monthly': $intervalInDays = 30; 59 switch (get_option('expresscurate_sitemap_submit_frequency')) { 60 case 'daily': 61 $intervalInDays = 1; 62 break; 63 case 'weekly': 64 $intervalInDays = 7; 65 break; 66 case 'monthly': 67 $intervalInDays = 30; 58 68 }; 59 69 … … 62 72 } 63 73 $lastGenerationDate = get_option('expresscurate_sitemap_submit_lastDate'); 64 if (floor(date('Y-m-d H:i:s') - strtotime($lastGenerationDate) /(60*60*24)) >= $intervalInDays) {74 if (floor(date('Y-m-d H:i:s') - strtotime($lastGenerationDate) / (60 * 60 * 24)) >= $intervalInDays) { 65 75 $this->submitToGoogle(); 66 76 } … … 71 81 $homePath = get_home_path(); 72 82 $sitemmapPath = $homePath . 'sitemap.xml'; 73 $expresscurateSitemapUpdatePermission = get_option('expresscurate_sitemap_update_permission',false); 74 if($expresscurateSitemapUpdatePermission !='seen' && $expresscurateSitemapUpdatePermission != 'error') { 75 if (is_writable($sitemmapPath)) { 83 $expresscurateSitemapUpdatePermission = get_option('expresscurate_sitemap_update_permission', false); 84 if ($expresscurateSitemapUpdatePermission != 'seen' && $expresscurateSitemapUpdatePermission != 'error') { 85 $file = fopen($sitemmapPath, 'w'); 86 if ($file) { 76 87 $header = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; 77 88 $body = ''; 78 $footer = '</urlset>'; 89 $footer = ' 90 </urlset>'; 79 91 80 92 $posts_and_pages = array(); … … 101 113 } 102 114 $lastMod = gmdate('Y-m-d', strtotime($item['modified'])); 103 $body .= '<url> 104 <loc>' . get_permalink($item['ID']) . '</loc> 105 <lastmod>' . $lastMod . '</lastmod> 106 <changefreq>' . $changeFrequency . '</changefreq> 107 <priority>' . $priority . '</priority> 108 </url>'; 115 $body .= ' 116 <url> 117 <loc>' . get_permalink($item['ID']) . '</loc> 118 <lastmod>' . $lastMod . '</lastmod> 119 <changefreq>' . $changeFrequency . '</changefreq> 120 <priority>' . $priority . '</priority> 121 </url>'; 109 122 110 123 } 111 124 112 125 } 113 $path = get_home_path(); 114 115 $file = fopen($path . 'sitemap.xml', 'w'); 116 if ($file) { 117 fwrite($file, $header . $body . $footer); 118 fclose($file); 119 $this->addToRobots(); 120 update_option('expresscurate_sitemap_generation_last_date', date('Y-m-d H:i:s')); 121 return true; 122 } 126 fwrite($file, $header . $body . $footer); 127 fclose($file); 128 $this->addToRobots(); 129 update_option('expresscurate_sitemap_generation_last_date', date('Y-m-d H:i:s')); 130 return true; 123 131 } 124 132 } … … 127 135 } 128 136 129 public function isExists(){ 137 public function isExists() 138 { 130 139 $path = get_home_path(); 131 140 $file = file_exists($path . 'sitemap.xml'); 132 if ($file){141 if ($file) { 133 142 return true; 134 143 } … … 136 145 } 137 146 138 public function saveSitemapGoogleStatus() { 147 public function saveSitemapGoogleStatus() 148 { 139 149 $data = $_REQUEST; 140 150 $status = $data['status']; 141 if ($status == 'off'){151 if ($status == 'off') { 142 152 update_option('expresscurate_google_refresh_token', ''); 143 153 } … … 153 163 $response = $googleAuth->accessToken(); 154 164 if ($response) { 155 $response = $googleAuth->submitSitemap(get_site_url(), get_site_url() . '/sitemap.xml'); 156 echo json_encode($response); 157 die; 165 $sitemapDomain = get_option('expresscurate_sitemap_domain', ''); 166 $response = $googleAuth->submitSitemap(strlen($sitemapDomain) > 2 ? $sitemapDomain : get_site_url(), get_site_url() . '/sitemap.xml'); 158 167 } else { 159 $response = array('status' => 3,'message' => 'ExpressCurate shall be authorized to access to Google Search Console (aka Webmaster Tools).');168 $response = array('status' => 3, 'message' => 'ExpressCurate shall be authorized to access to Google Search Console (aka Webmaster Tools).'); 160 169 } 161 } 162 } 163 164 public function errorMessage(){ 170 echo json_encode($response); 171 die; 172 } 173 } 174 175 public function errorMessage() 176 { 165 177 $homeUrl = get_site_url(); 166 178 $sitemmapPath = $homeUrl . '/sitemap.xml'; 167 179 $message = '<div class="update-nag">'; 168 $message .= '180 $message .= ' 169 181 ExpressCurate tries to generate sitemap but it was not able to write sitemap. Please, grant write access to file 170 <p style="text-indent: 20px;font-weight: bolder">' .$sitemmapPath.'</p>171 <a class="expresscurateLink" href="' .$homeUrl.'/wp-admin/admin.php?page=expresscurate_settings" > Sitemap settings</a>182 <p style="text-indent: 20px;font-weight: bolder">' . $sitemmapPath . '</p> 183 <a class="expresscurateLink" href="' . $homeUrl . '/wp-admin/admin.php?page=expresscurate_settings" > Sitemap settings</a> 172 184 '; 173 185 $message .= '</div>'; … … 175 187 } 176 188 177 public function set_permission_status() { 189 public function set_permission_status() 190 { 178 191 $status = $_REQUEST['status']; 179 192 update_option('expresscurate_sitemap_update_permission', $status); 180 $result = array('status'=>'success'); 181 echo json_encode($result);die; 182 } 183 184 public function getSitemapFrequencyTagArray(){ 185 return array('always'=>'Always', 186 'hourly'=>'Hourly', 187 'daily'=>'Daily', 188 'weekly'=>'Weekly', 189 'monthly'=>'Monthly', 190 'yearly'=>'Yearly', 191 'never'=>'Never' 193 $result = array('status' => 'success'); 194 echo json_encode($result); 195 die; 196 } 197 198 public function getSitemapFrequencyTagArray() 199 { 200 return array('always' => 'Always', 201 'hourly' => 'Hourly', 202 'daily' => 'Daily', 203 'weekly' => 'Weekly', 204 'monthly' => 'Monthly', 205 'yearly' => 'Yearly', 206 'never' => 'Never' 192 207 ); 193 208 } 194 209 195 private function addToRobots(){ 210 private function addToRobots() 211 { 196 212 $path = get_home_path(); 197 $file = fopen($path .'robots.txt','w');198 fwrite($file, 'Sitemap: '.get_site_url().'/sitemap.xml');213 $file = fopen($path . 'robots.txt', 'w'); 214 fwrite($file, 'Sitemap: ' . get_site_url() . '/sitemap.xml'); 199 215 fclose($file); 200 216 } -
expresscurate/trunk/ExpressCurate_SocialManager.php
r1191825 r1252098 23 23 const PROFILE = 'profile_ids'; 24 24 const MESSAGE = 'message'; 25 const PERMALINK = 'permalink'; 25 26 26 27 private static $instance; … … 115 116 $allMessages = array(); 116 117 foreach ($messages as $messageId => $message) { 117 /*if (!isset($message[self::MESSAGE_ID])) { 118 $messageId = uniqid('', true); 119 $message[self::MESSAGE_ID] = $messageId; 120 }*/ 121 122 $messageId=$message[self::MESSAGE_ID]; 118 $messageId = $message[self::MESSAGE_ID]; 123 119 if (isset($message[self::APPROVED]) && $message[self::APPROVED] === true) { 124 120 $approved[$messageId] = $message; … … 133 129 update_post_meta($post_id, self::SOCIAL_APPROVED_POST_MESSAGES_META, $approved); 134 130 update_post_meta($post_id, self::SOCIAL_POST_MESSAGES_META, $allMessages); 135 update_post_meta($post_id, self::SOCIAL_POST_COUNTER, count($approved) +count($publishedPostMessages));131 update_post_meta($post_id, self::SOCIAL_POST_COUNTER, count($approved) + count($publishedPostMessages)); 136 132 } 137 133 … … 146 142 foreach ($approvedPostMessages as $messageId => $message) { 147 143 $data = array(); 144 if(isset($message[self::PERMALINK])) { 145 $permalink = $message[self::PERMALINK]; 146 } 148 147 $data[ExpressCurate_BufferClient::POST_FIELD_TEXT] = $message[self::MESSAGE] . $permalink; 149 148 $data[ExpressCurate_BufferClient::POST_FIELD_PROFILE] = $message[self::PROFILE]; -
expresscurate/trunk/css/expresscurate.css
r1191825 r1252098 3052 3052 .expresscurate_cat[type=radio]:checked + label:after, 3053 3053 .expresscurate_post_type[type=radio]:checked + label:after { 3054 background: url("../images/feed_icons.svg") no-repeat -7 9px -24px;3054 background: url("../images/feed_icons.svg") no-repeat -72px -24px; 3055 3055 background-size: auto 68px; 3056 3056 visibility: visible; … … 3830 3830 background-size: 13px auto; 3831 3831 background-position: 150px -17px; 3832 padding: 0 px20px 0 5px;3832 padding: 0 20px 0 5px; 3833 3833 } 3834 3834 .expresscurate_controls select option.expresscurate_filterOption{ … … 3850 3850 background-color: transparent; 3851 3851 background-size: 50px auto; 3852 margin: 0 10px 0 0;3852 margin: 0 5px 0 0; 3853 3853 cursor: pointer !important; 3854 3854 } … … 3866 3866 background-color: transparent; 3867 3867 background-size: auto 100px; 3868 background-position: -10 4px -35px;3868 background-position: -100px -35px; 3869 3869 cursor: pointer; 3870 3870 border: solid 1px #25bfa1; 3871 3871 } 3872 .confirm_post_title{ 3873 padding: 5px 0; 3874 color: #303030; 3875 font-size: 16px; 3876 display: inline-block; 3877 font-family: OpenSans-Regular, Verdana, Geneva, sans-serif; 3878 } 3879 3880 .expresscurate_controls li.restore { 3881 border-right: none; 3882 } 3883 .expresscurate_controls li.deletedFeedsPage{ 3884 display: inline-block; 3885 height: 30px; 3886 margin: 0; 3887 background: none; 3888 background-repeat: no-repeat; 3889 background-size: auto 82px; 3890 cursor: default; 3891 position: relative; 3892 border: solid 1px #dddddd; 3893 } 3894 .expresscurate_confirmbox .ui-dialog-buttonset button{ 3895 border-radius: 3px; 3896 font-size: 14px; 3897 text-align: center; 3898 height: 35px; 3899 margin-left: 10px; 3900 cursor: pointer; 3901 border: 1px solid #27cfae; 3902 -webkit-box-shadow: none; 3903 box-shadow: none; 3904 } 3905 .expresscurate_confirmbox .ui-dialog-buttonset button.expresscurate_confirm{ 3906 background: #27cfae; 3907 color: #ffffff; 3908 } 3909 .expresscurate_confirmbox .ui-dialog-buttonset button.expresscurate_cancel { 3910 background-color: #F7FFFD; 3911 color: #0A0A0A; 3912 } 3913 .expresscurate_confirmbox .expresscurate_dialog{ 3914 min-height: 55px !important; 3915 } 3916 .expresscurate_confirmbox .expresscurate_dialog p.dialog_text{ 3917 width: 93%; 3918 margin: 1.4em auto; 3919 3920 } 3921 .expresscurate_confirmbox .ui-dialog-buttonpane { 3922 padding: 10px 16px; 3923 } 3924 3872 3925 .expresscurate_controls .check.disabled{ 3873 3926 background-position: -104px 6px; … … 3876 3929 } 3877 3930 .expresscurate_controls .check.active{ 3878 background-position: -10 4px -75px;3931 background-position: -100px -75px; 3879 3932 background-color: #1cbb9f; 3880 3933 } … … 3891 3944 } 3892 3945 .expresscurate_controls .remove{ 3893 background-position: -52px 7px;3894 3946 border-left: none; 3895 3947 } 3948 .expresscurate_controls li.removePermanently{ 3949 background-position: -46px 7px; 3950 border-left: none; 3951 } 3952 .expresscurate_controls li.removePermanently.active{ 3953 background-position: -46px -26px; 3954 } 3955 .expresscurate_controls li.removePermanently.active:hover{ 3956 background-position: -46px -59px; 3957 background-color: #1cbb9f; 3958 border-color: #1cbb9f; 3959 } 3960 .expresscurate_controls li.restore{ 3961 background-size: auto 100px; 3962 background-position: -206px 4px; 3963 } 3964 .expresscurate_controls li.restore.active{ 3965 background-position: -206px -35px; 3966 } 3967 .expresscurate_controls li.restore.active:hover{ 3968 background-position: -206px -74px; 3969 background-color: #1cbb9f; 3970 border-color: #1cbb9f; 3971 } 3972 .expresscurate_controls li.linkToDeletedPosts{ 3973 background-position: -174px -35px; 3974 background-size: auto 100px; 3975 margin: 0 5px 0 0; 3976 border-color: #1cbb9f; 3977 cursor: pointer; 3978 } 3979 .expresscurate_controls li.linkToDeletedPosts:hover{ 3980 background-position: -172px -74px; 3981 background-color: #1cbb9f; 3982 } 3983 3896 3984 3897 3985 .expresscurate_controls .quotes{ … … 3899 3987 } 3900 3988 .expresscurate_controls .bookmark{ 3901 background-position: -1 5px 7px;3989 background-position: -14px 7px; 3902 3990 } 3903 3991 .expresscurate_controls .remove{ 3904 background-position: - 50px 8px;3992 background-position: -46px 8px; 3905 3993 } 3906 3994 .expresscurate_feed_list .feedListControls .pull.disabled:hover, … … 3910 3998 .expresscurate_feed_list .feedListControls .pull{ 3911 3999 /*background-position: -144px 6px;*/ 3912 background-size: auto 99px;4000 background-size: auto 101px; 3913 4001 margin-right: 10px; 3914 4002 } … … 3980 4068 } 3981 4069 .expresscurate_controls .quotes.active:hover{ 3982 background-position: 19px -5 9px;4070 background-position: 19px -57px; 3983 4071 background-color: #1cbb9f; 3984 4072 border-color: #1cbb9f; 3985 4073 } 3986 4074 .expresscurate_controls .bookmark.active:hover{ 3987 background-position: -1 5px -60px;4075 background-position: -14px -58px; 3988 4076 background-color: #1cbb9f; 3989 4077 border-color: #1cbb9f; 3990 4078 } 3991 4079 .expresscurate_controls .remove.active:hover{ 3992 background-position: - 50px -59px;4080 background-position: -46px -57px; 3993 4081 background-color: #1cbb9f; 3994 4082 border-color: #1cbb9f; 3995 4083 } 3996 4084 .expresscurate_feed_list .feedListControls .pull:hover{ 3997 background-position: -14 4px -74px;4085 background-position: -142px -74px; 3998 4086 background-color: #1cbb9f; 3999 4087 } … … 4003 4091 } 4004 4092 .expresscurate_controls .bookmark.active{ 4005 background-position: -1 5px -26px;4093 background-position: -14px -26px; 4006 4094 } 4007 4095 .expresscurate_controls .remove.active{ 4008 background-position: - 50px -25px;4096 background-position: -46px -25px; 4009 4097 } 4010 4098 .expresscurate_feed_list .feedListControls .pull{ 4011 background-position: -14 4px -33px;4099 background-position: -142px -33px; 4012 4100 border-color: #1cbb9f; 4013 4101 } … … 4146 4234 border-bottom-color: #000; 4147 4235 border-width: 5px; 4236 } 4237 4238 .expresscurate_controls li.linkToDeletedPosts .tooltip:before{ 4239 left: 70px 4240 } 4241 .expresscurate_controls li.linkToDeletedPosts .tooltip{ 4242 width: 130px; 4243 left: -55px; 4148 4244 } 4149 4245 … … 4220 4316 .expresscurate_bookmarkBoxes .checkInput[type=checkbox]:checked + label, 4221 4317 .expresscurate_feedBoxes .checkInput[type=checkbox]:checked + label{ 4222 background: url("../images/feed_icons.svg") no-repeat - 86px 1px;4223 background-size: auto 7 2px;4318 background: url("../images/feed_icons.svg") no-repeat -75px -3px; 4319 background-size: auto 73px; 4224 4320 } 4225 4321 .expresscurate_bookmarkBoxes li input[type=checkbox], … … 5465 5561 .expresscurate_SettingsError{ 5466 5562 font-size: 11px; 5563 line-height: 13px; 5467 5564 color: #e85e50; 5468 5565 margin: 0; -
expresscurate/trunk/css/theme-styles.css
r1179063 r1252098 74 74 overflow: hidden; 75 75 background-color:#F3F3F3; 76 word-break: break-all;77 76 text-align:justify; 78 77 color: #A39E9E; 78 word-break: break-word; 79 79 } 80 80 .expresscurate_fl_text_box , .expresscurate_fr_text_box{ -
expresscurate/trunk/images/feed_icons.svg
r1129694 r1252098 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> 3 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> 2 <!-- Generator: Adobe Illustrator 19.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> 4 3 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 5 width="782.447px" height="440.846px" viewBox="0 0 782.447 440.846" enable-background="new 0 0 782.447 440.846" 6 xml:space="preserve"> 4 viewBox="500 -175.8 1089.8 440.8" style="enable-background:new 500 -175.8 1089.8 440.8;" xml:space="preserve"> 5 <style type="text/css"> 6 .st0{fill:#23B99E;} 7 .st1{fill:#FFFFFF;} 8 .st2{fill:#B5B6B6;} 9 .st3{fill:#B4B4B5;} 10 .st4{fill:#20B89D;} 11 .st5{fill:#B3B3B4;} 12 </style> 7 13 <g> 8 <g> 9 <g> 10 <path fill="#B5B6B6" d="M42.204,5.059h32.79v31.68c0,0,1.258,30.607-32.54,39.045V62.112c0,0,16.9-4.048,19.321-24.364H42.204 11 V5.059z"/> 12 <path fill="#B5B6B6" d="M0,5.059h32.79v31.68c0,0,1.262,30.607-32.538,39.045V62.112c0,0,16.899-4.048,19.321-24.364H0V5.059z"/> 13 </g> 14 <polygon id="star-2-icon_5_" fill="#B5B6B6" points="217.502,0 230.496,26.804 260.002,30.879 238.527,51.518 243.768,80.841 15 217.502,66.793 191.235,80.841 196.479,51.518 175.002,30.879 204.508,26.804 "/> 16 <polygon id="plus-2-icon_5_" fill="#B5B6B6" points="435.001,64.118 411.307,40.422 435.001,16.724 421.197,2.921 397.502,26.618 17 373.805,2.921 360.004,16.724 383.698,40.422 360.004,64.118 373.805,77.921 397.502,54.225 421.197,77.921 "/> 18 <polygon id="check-mark-icon_2_" fill="#B5B6B6" points="604.207,9.81 566.936,47.083 550.79,30.935 538.817,42.91 19 566.936,71.035 616.188,21.78 "/> 20 <g> 21 <path fill="#23B99E" d="M42.205,185.062h32.79v31.68c0,0,1.258,30.606-32.54,39.045v-13.671c0,0,16.9-4.049,19.321-24.364H42.205 22 V185.062z"/> 23 <path fill="#23B99E" d="M0.001,185.062h32.79v31.68c0,0,1.262,30.606-32.538,39.045v-13.671c0,0,16.899-4.049,19.321-24.364 24 H0.001V185.062z"/> 25 </g> 26 <polygon id="star-2-icon_2_" fill="#23B99E" points="217.503,180.003 230.497,206.807 260.003,210.882 238.528,231.521 27 243.769,260.844 217.503,246.796 191.236,260.844 196.479,231.521 175.003,210.882 204.509,206.807 "/> 28 <polygon id="plus-2-icon_2_" fill="#23B99E" points="435.002,244.121 411.308,220.425 435.002,196.727 421.198,182.924 29 397.503,206.621 373.806,182.924 360.005,196.727 383.699,220.425 360.005,244.121 373.806,257.924 397.503,234.228 30 421.198,257.924 "/> 31 <polygon id="check-mark-icon_3_" fill="#23B99E" points="604.208,189.813 566.936,227.085 550.791,210.938 538.818,222.913 32 566.936,251.038 616.188,201.783 "/> 33 <g> 34 <path fill="#FFFFFF" d="M42.205,365.063h32.79v31.68c0,0,1.258,30.606-32.54,39.045v-13.671c0,0,16.9-4.049,19.321-24.364H42.205 35 V365.063z"/> 36 <path fill="#FFFFFF" d="M0.001,365.063h32.79v31.68c0,0,1.262,30.606-32.538,39.045v-13.671c0,0,16.899-4.049,19.321-24.364 37 H0.001V365.063z"/> 38 </g> 39 <polygon id="star-2-icon_7_" fill="#FFFFFF" points="217.503,360.004 230.497,386.81 260.003,390.883 238.528,411.521 40 243.769,440.846 217.503,426.797 191.236,440.846 196.479,411.521 175.003,390.883 204.509,386.81 "/> 41 <polygon id="plus-2-icon_7_" fill="#FFFFFF" points="435.002,424.124 411.308,400.426 435.002,376.729 421.198,362.926 42 397.503,386.623 373.806,362.926 360.005,376.729 383.699,400.426 360.005,424.124 373.806,437.926 397.503,414.23 43 421.198,437.926 "/> 44 <polygon id="check-mark-icon_5_" fill="#FFFFFF" points="604.208,369.815 566.936,407.087 550.791,390.94 538.818,402.915 45 566.936,431.04 616.188,381.785 "/> 46 </g> 47 <path fill="#B4B4B5" d="M771.418,27.365c0-9.069,1.785-14.295,9.413-16.757c-5.917-2.493-36.867-8.496-36.867,19.76 48 c0,9.49,0,17.368,0,17.368h-11.027l24.755,24.797l24.756-24.797h-11.029C771.418,47.736,771.418,35.292,771.418,27.365z"/> 49 <path fill="#20B89D" d="M771.418,207.368c0-9.069,1.785-14.295,9.413-16.757c-5.917-2.493-36.867-8.496-36.867,19.76 50 c0,9.49,0,17.368,0,17.368h-11.027l24.755,24.798l24.756-24.798h-11.029C771.418,227.739,771.418,215.295,771.418,207.368z"/> 51 <path fill="#FFFFFF" d="M771.418,387.37c0-9.069,1.785-14.295,9.413-16.757c-5.917-2.493-36.867-8.496-36.867,19.76 52 c0,9.49,0,17.368,0,17.368h-11.027l24.755,24.798l24.756-24.798h-11.029C771.418,407.741,771.418,395.297,771.418,387.37z"/> 14 <path class="st0" d="M542.1,9.2h32.8v31.7c0,0,1.3,30.6-32.5,39V66.3c0,0,16.9-4,19.3-24.4h-19.6V9.2L542.1,9.2z"/> 15 <path class="st0" d="M499.9,9.2h32.8v31.7c0,0,1.3,30.6-32.5,39V66.3c0,0,16.9-4,19.3-24.4h-19.6V9.2z"/> 16 </g> 17 <polygon id="star-2-icon_2_" class="st0" points="717.4,4.2 730.4,31 759.9,35 738.4,55.7 743.7,85 717.4,70.9 691.1,85 696.4,55.7 18 674.9,35 704.4,31 "/> 19 <polygon id="plus-2-icon_2_" class="st0" points="934.9,68.3 911.2,44.6 934.9,20.9 921.1,7.1 897.4,30.8 873.7,7.1 859.9,20.9 20 883.6,44.6 859.9,68.3 873.7,82.1 897.4,58.4 921.1,82.1 "/> 21 <polygon id="check-mark-icon_3_" class="st0" points="1104.1,14 1066.8,51.2 1050.7,35.1 1038.7,47.1 1066.8,75.2 1116.1,25.9 "/> 22 <g> 23 <path class="st1" d="M542.1,189.2h32.8v31.7c0,0,1.3,30.6-32.5,39v-13.7c0,0,16.9-4,19.3-24.4h-19.6V189.2L542.1,189.2z"/> 24 <path class="st1" d="M499.9,189.2h32.8v31.7c0,0,1.3,30.6-32.5,39v-13.7c0,0,16.9-4,19.3-24.4h-19.6V189.2z"/> 25 </g> 26 <polygon id="star-2-icon_7_" class="st1" points="717.4,184.2 730.4,211 759.9,215 738.4,235.7 743.7,265 717.4,251 691.1,265 27 696.4,235.7 674.9,215 704.4,211 "/> 28 <polygon id="plus-2-icon_7_" class="st1" points="934.9,248.3 911.2,224.6 934.9,200.9 921.1,187.1 897.4,210.8 873.7,187.1 29 859.9,200.9 883.6,224.6 859.9,248.3 873.7,262.1 897.4,238.4 921.1,262.1 "/> 30 <polygon id="check-mark-icon_5_" class="st1" points="1104.1,194 1066.8,231.2 1050.7,215.1 1038.7,227.1 1066.8,255.2 31 1116.1,205.9 "/> 32 <g> 33 <path class="st2" d="M542.1-170.8h32.8v31.7c0,0,1.3,30.6-32.5,39v-13.7c0,0,16.9-4,19.3-24.4h-19.6V-170.8L542.1-170.8z"/> 34 <path class="st2" d="M499.9-170.8h32.8v31.7c0,0,1.3,30.6-32.5,39v-13.7c0,0,16.9-4,19.3-24.4h-19.6V-170.8z"/> 35 </g> 36 <polygon id="star-2-icon_5_" class="st2" points="717.4,-175.8 730.4,-149 759.9,-145 738.4,-124.3 743.7,-95 717.4,-109.1 37 691.1,-95 696.4,-124.3 674.9,-145 704.4,-149 "/> 38 <polygon id="plus-2-icon_5_" class="st2" points="934.9,-111.7 911.2,-135.4 934.9,-159.1 921.1,-172.9 897.4,-149.2 873.7,-172.9 39 859.9,-159.1 883.6,-135.4 859.9,-111.7 873.7,-97.9 897.4,-121.6 921.1,-97.9 "/> 40 <polygon id="check-mark-icon_2_" class="st2" points="1104.1,-166 1066.8,-128.8 1050.7,-144.9 1038.7,-132.9 1066.8,-104.8 41 1116.1,-154.1 "/> 42 <path class="st3" d="M1271.3-148.5c0-9.1,1.8-14.3,9.4-16.8c-5.9-2.5-36.9-8.5-36.9,19.8c0,9.5,0,17.4,0,17.4h-11l24.8,24.8 43 l24.8-24.8h-11C1271.3-128.1,1271.3-140.6,1271.3-148.5z"/> 44 <path class="st4" d="M1271.3,31.5c0-9.1,1.8-14.3,9.4-16.8c-5.9-2.5-36.9-8.5-36.9,19.8c0,9.5,0,17.4,0,17.4h-11l24.8,24.8 45 l24.8-24.8h-11C1271.3,51.9,1271.3,39.4,1271.3,31.5z"/> 46 <path class="st1" d="M1271.3,211.5c0-9.1,1.8-14.3,9.4-16.8c-5.9-2.5-36.9-8.5-36.9,19.8c0,9.5,0,17.4,0,17.4h-11l24.8,24.8 47 l24.8-24.8h-11C1271.3,231.9,1271.3,219.5,1271.3,211.5z"/> 48 <g> 49 <path class="st5" d="M1569.1-113h-33.2v-33.2h19.4l9-9h-37.4v51.2h51.2v-37.4l-9,9V-113z"/> 50 <path class="st5" d="M1589.5-166.6c-0.2-0.2-0.5-0.3-0.8-0.3l-24.9,4.3c-0.3,0.1-0.6,0.3-0.7,0.6c-0.1,0.3,0,0.7,0.2,1l5.9,5.9 51 l-15.1,15.1c-0.4,0.4-0.4,1,0,1.3l7.5,7.5c0.2,0.2,0.4,0.3,0.7,0.3s0.5-0.1,0.7-0.3l15.1-15.1l5.9,5.9c0.3,0.3,0.6,0.3,1,0.2 52 c0.3-0.1,0.6-0.4,0.6-0.7l4.3-24.9C1589.8-166,1589.7-166.3,1589.5-166.6z"/> 53 </g> 54 <g> 55 <path class="st4" d="M1569.1,67h-33.2V33.8h19.4l9-9h-36.4c-0.5,0-0.9,0.4-0.9,0.9V75c0,0.5,0.4,0.9,0.9,0.9h49.3 56 c0.5,0,0.9-0.4,0.9-0.9V38.6l-9,9V67L1569.1,67z"/> 57 <path class="st4" d="M1589.5,13.4c-0.2-0.2-0.5-0.3-0.8-0.3l-24.9,4.3c-0.3,0.1-0.6,0.3-0.7,0.6c-0.1,0.3,0,0.7,0.2,1l5.9,5.9 58 L1554.1,40c-0.4,0.4-0.4,1,0,1.3l7.5,7.5c0.2,0.2,0.4,0.3,0.7,0.3s0.5-0.1,0.7-0.3l15.1-15.1l5.9,5.9c0.3,0.3,0.6,0.3,1,0.2 59 c0.3-0.1,0.6-0.4,0.6-0.7l4.3-24.9C1589.8,14,1589.7,13.7,1589.5,13.4z"/> 60 </g> 61 <g> 62 <path class="st1" d="M1569.1,247h-33.2v-33.2h19.4l9-9h-36.4c-0.5,0-0.9,0.4-0.9,0.9V255c0,0.5,0.4,0.9,0.9,0.9h49.3 63 c0.5,0,0.9-0.4,0.9-0.9v-36.4l-9,9V247L1569.1,247z"/> 64 <path class="st1" d="M1589.5,193.4c-0.2-0.2-0.5-0.3-0.8-0.3l-24.9,4.3c-0.3,0.1-0.6,0.3-0.7,0.6c-0.1,0.3,0,0.7,0.2,1l5.9,5.9 65 l-15.1,15.1c-0.4,0.4-0.4,1,0,1.3l7.5,7.5c0.2,0.2,0.4,0.3,0.7,0.3s0.5-0.1,0.7-0.3l15.1-15.1l5.9,5.9c0.3,0.3,0.6,0.3,1,0.2 66 c0.3-0.1,0.6-0.4,0.6-0.7l4.3-24.9C1589.8,194,1589.7,193.7,1589.5,193.4z"/> 67 </g> 68 <g> 69 <rect x="1380.9" y="-144.2" class="st5" width="51.1" height="40.5"/> 70 <rect x="1374.6" y="-167.2" class="st5" width="63.8" height="14.2"/> 71 </g> 72 <g> 73 <rect x="1380.9" y="35.8" class="st4" width="51.1" height="40.5"/> 74 <rect x="1374.6" y="12.8" class="st4" width="63.8" height="14.2"/> 75 </g> 76 <g> 77 <rect x="1380.9" y="215.8" class="st1" width="51.1" height="40.5"/> 78 <rect x="1374.6" y="192.8" class="st1" width="63.8" height="14.2"/> 53 79 </g> 54 80 </svg> -
expresscurate/trunk/js/Settings.js
r1179063 r1252098 217 217 } else { 218 218 className = 'expresscurate_SettingsError'; 219 var webmasterResponse = data.message.message; 220 message = webmasterResponse ? webmasterResponse : data.message; 219 221 if (data.status === 1) { 220 message = data.message;221 222 $autorize.removeClass('expresscurate_displayNone'); 222 } else if (data.status === 2 || data.status === 3) {223 message = data.message;224 223 } 225 224 } -
expresscurate/trunk/js/bookmarks.js
r1191825 r1252098 143 143 } 144 144 145 function openDeleteBookmark(items,itemChoose){ 146 var $deleteDialog = $("#expresscurate_delete_dialog"); 147 $deleteDialog.dialog({ 148 'dialogClass': 'wp-dialog expresscurate_confirmbox', 149 'modal': true, 150 'autoOpen': false, 151 'closeOnEscape': true, 152 'width': '500px', 153 'height': 'auto', 154 'resizable': false, 155 'buttons': { 156 'Confirm': function () { 157 bookmarkDelete(items); 158 $(this).dialog("close"); 159 }, 160 'Cancel': function () { 161 $(this).dialog("close"); 162 } 163 }, 164 'open' : function(){ 165 var text = ""; 166 if(itemChoose == "clicked"){ 167 var title = $(items).find('a.postTitle').text(); 168 text = "<p class='dialog_text'>" + 169 "This bookmark will be deleted: " + 170 "<span class='confirm_post_title'>"+title+"</span>" 171 "</p>"; 172 } 173 else if(items.length == 1 && itemChoose == "checked"){ 174 text = "<p class='dialog_text'>1 bookmark will be deleted</p>"; 175 }else if (items.length > 1) { 176 text = "<p class='dialog_text'>"+items.length+" bookmarks will be deleted</p>"; 177 } 178 $(this).html(text); 179 $('.ui-dialog-buttonpane').find('button:contains("Cancel")').addClass('expresscurate_cancel'); 180 $('.ui-dialog-buttonpane').find('button:contains("Confirm")').addClass('expresscurate_confirm'); 181 } 182 }); 183 $deleteDialog.dialog('open'); 184 } 185 145 186 function setupBookmarks() { 146 187 $input = $('.addBookmark input'); … … 252 293 }); 253 294 254 / *delete*/295 //delete bookmark 255 296 $('.expresscurate_bookmarks .remove').on('click', function () { 256 var $checked = $bookmarkBoxes.find('li input:checkbox:checked') ;257 bookmarkDelete($checked.parents('.expresscurate_bookmarkBoxes > li'));297 var $checked = $bookmarkBoxes.find('li input:checkbox:checked').parents('.expresscurate_bookmarkBoxes > li'); 298 openDeleteBookmark($checked,"checked"); 258 299 }); 259 300 $bookmarkBoxes.on('click', '.controls .hide', function () { 260 301 var $elem = $(this).parents('.expresscurate_bookmarkBoxes > li'); 261 bookmarkDelete($elem);262 });263 302 openDeleteBookmark($elem,"clicked"); 303 //bookmarkDelete($elem); 304 }); 264 305 /*add*/ 306 265 307 $input.on("keyup", function (e) { 266 308 if (e.keyCode === 13) { -
expresscurate/trunk/js/feed/contentFeed.js
r1191825 r1252098 1 1 var ExpressCurateFeedWall = (function ($) { 2 var $notDefFeed, $feedControls, $masonryWrap, $feedBoxes ;2 var $notDefFeed, $feedControls, $masonryWrap, $feedBoxes, $deleteDialog, $removeDialog, $restoreDialog; 3 3 4 4 function bookmarkAdd(els) { … … 8 8 9 9 $.each(els, function (index, el) { 10 items.push( JSON.parse($(el).find('.expresscurate_feedData').text()));10 items.push($(el).find('.expresscurate_feedData').text()); 11 11 }); 12 12 $.ajax({ 13 13 type: 'POST', 14 14 url: 'admin-ajax.php?action=expresscurate_bookmarks_add', 15 data: {items: JSON.stringify(items)}15 data: {items: items} 16 16 }); 17 17 } … … 45 45 ExpressCurateUtils.track('/content-feed/delete'); 46 46 47 var items = []; 48 47 var items = [], 48 page = location.search.replace('?page=',''), 49 url, 50 item; 51 if(page == "expresscurate_content_feed_archive"){ 52 url = 'admin-ajax.php?action=expresscurate_remove_feed_archive_items'; 53 } else if(page == "expresscurate_feed_list"){ 54 url = 'admin-ajax.php?action=expresscurate_delete_feed_content_items'; 55 } 49 56 $.each(els, function (index, el) { 50 var item = $(el).find('a.postTitle').data('link'); 57 if(page == "expresscurate_content_feed_archive"){ 58 item = $(el).find('a.postTitle').data('link'); 59 } else { item = $(el).find('textarea').val(); } 51 60 items.push(item); 52 61 }); 53 62 $.ajax({ 54 63 type: 'POST', 55 url: 'admin-ajax.php?action=expresscurate_delete_feed_content_items', 64 url: url, 65 data: {items: items} 66 }).done(function (res) { 67 var data = $.parseJSON(res); 68 69 if (data.status === 'success') { 70 $(els).addClass('expresscurate_transparent'); 71 setTimeout(function () { 72 $(els).remove(); 73 $masonryWrap.masonry(); 74 ExpressCurateUtils.checkControls($feedControls); 75 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 76 }, 700); 77 } 78 }); 79 } 80 81 function restoreFeedItems(els) { 82 ExpressCurateUtils.track('/content-feed/restore'); 83 84 var items = []; 85 86 $.each(els, function (index, el) { 87 var item = $(el).find('textarea').val(); 88 items.push(item); 89 }); 90 $.ajax({ 91 type: 'POST', 92 url: 'admin-ajax.php?action=expresscurate_restore_deleted_items', 56 93 data: {items: items} 57 94 }).done(function (res) { … … 145 182 } 146 183 184 // Confirm dialog for feeds' permanent remove 185 /*function openRemoveConfirm(items,itemChoose){ 186 var $removeDialog = $("#expresscurate_remove_dialog"); 187 $removeDialog.dialog({ 188 'dialogClass': 'wp-dialog expresscurate_confirmbox', 189 'modal': true, 190 'autoOpen': false, 191 'closeOnEscape': true, 192 'width': '500px', 193 'height': 'auto', 194 'resizable': false, 195 'buttons': { 196 'Confirm': function () { 197 deleteFeedItems(items, true); 198 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 199 $(this).dialog("close"); 200 }, 201 'Cancel': function () { 202 $(this).dialog("close"); 203 } 204 }, 205 'open' : function(){ 206 var text = ""; 207 if(itemChoose == "clicked"){ 208 var title = $(items).find('a.postTitle').text(); 209 text = "<p class='dialog_text'>" + 210 "This post will be deleted permanently: " + 211 "<span class='confirm_post_title'>"+title+"</span>" 212 "</p>"; 213 } 214 else if(items.length == 1 && itemChoose == "checked"){ 215 text = "<p class='dialog_text'>1 post will be deleted permanently?</p>"; 216 }else if (items.length > 1) { 217 text = " <p class='dialog_text'>"+items.length+" posts will be deleted permanently</p>"; 218 } 219 $(this).html(text); 220 $('.ui-dialog-buttonpane').find('button:contains("Cancel")').addClass('expresscurate_cancel'); 221 $('.ui-dialog-buttonpane').find('button:contains("Confirm")').addClass('expresscurate_confirm'); 222 } 223 }); 224 $removeDialog.dialog('open'); 225 } 226 // Restore feeds confirm dialog 227 function openRestoreConfirm(items,itemChoose){ 228 var $restoreDialog = $("#expresscurate_restore_dialog"); 229 $restoreDialog.dialog({ 230 'dialogClass': 'wp-dialog expresscurate_confirmbox', 231 'modal': true, 232 'autoOpen': false, 233 'closeOnEscape': true, 234 'width': '500px', 235 'height': 'auto', 236 'resizable': false, 237 'buttons': { 238 'Confirm': function () { 239 restoreFeedItems(items); 240 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 241 $(this).dialog("close"); 242 }, 243 'Cancel': function () { 244 $(this).dialog("close"); 245 } 246 }, 247 'open' : function(){ 248 var text = ""; 249 if(itemChoose == "clicked"){ 250 var title = $(items).find('a.postTitle').text(); 251 text = "<p class='dialog_text'>" + 252 "This post will be restored: " + 253 "<span class='confirm_post_title'>"+title+"</span>"+ 254 "</p>"; 255 } 256 else if(items.length == 1 && itemChoose == "checked"){ 257 text = "<p class='dialog_text'>1 post will be restored</p>"; 258 }else if (items.length > 1) { 259 text = "<p class='dialog_text'>"+items.length+" posts will be restored</p>"; 260 } 261 $(this).html(text); 262 $('.ui-dialog-buttonpane').find('button:contains("Cancel")').addClass('expresscurate_cancel'); 263 $('.ui-dialog-buttonpane').find('button:contains("Confirm")').addClass('expresscurate_confirm'); 264 } 265 }); 266 $restoreDialog.dialog('open'); 267 }*/ 268 // Delete feeds(from content feed) confirm dialog 269 function openDeleteConfirm(items,itemChoose){ 270 var $deleteDialog = $("#expresscurate_delete_dialog"); 271 $deleteDialog.dialog({ 272 'dialogClass': 'wp-dialog expresscurate_confirmbox', 273 'modal': true, 274 'autoOpen': false, 275 'closeOnEscape': true, 276 'width': '500px', 277 'height': 'auto', 278 'resizable': false, 279 'buttons': { 280 'Confirm': function () { 281 deleteFeedItems(items); 282 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 283 $(this).dialog("close"); 284 }, 285 'Cancel': function () { 286 $(this).dialog("close"); 287 } 288 }, 289 'open' : function(){ 290 var text = ""; 291 if(itemChoose == "clicked"){ 292 var title = $(items).find('a.postTitle').text(); 293 text = "<p class='dialog_text'>" + 294 "This post will be deleted: " + 295 "<span class='confirm_post_title'>"+title+"</span>" 296 "</p>"; 297 } 298 else if(items.length == 1 && itemChoose == "checked"){ 299 text = "<p class='dialog_text'>1 post will be deleted</p>"; 300 }else if (items.length > 1) { 301 text = "<p class='dialog_text'>"+items.length+" posts will be deleted</p>"; 302 } 303 $(this).html(text); 304 $('.ui-dialog-buttonpane').find('button:contains("Cancel")').addClass('expresscurate_cancel'); 305 $('.ui-dialog-buttonpane').find('button:contains("Confirm")').addClass('expresscurate_confirm'); 306 } 307 }); 308 $deleteDialog.dialog('open'); 309 } 310 147 311 function setupFeed() { 148 312 var $blogFilter = $('#expresscurate_blogFilter'), … … 151 315 $feedControls = $('.feedListControls li'); 152 316 $masonryWrap = $('.expresscurate_masonryWrap'); 153 $feedBoxes = $('.expresscurate_feedBoxes'); 317 $feedBoxes = $('.expresscurate_feedBoxes'), 318 $removeDialog = $("#expresscurate_remove_dialog"); 319 $restoreDialog = $("#expresscurate_restore_dialog"); 320 $deleteDialog = $("#expresscurate_delete_dialog"); 154 321 $masonryWrap.masonry({ 155 322 itemSelector: '.expresscurate_masonryItem', … … 187 354 /*delete*/ 188 355 $('.expresscurate_feed_list .remove').on('click', function () { 189 var $checked = $feedBoxes.find('li input:checkbox:checked'); 190 deleteFeedItems($checked.parents('.expresscurate_feedBoxes > li')); 191 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 192 356 var $checked = $feedBoxes.find('li input:checkbox:checked').parents('.expresscurate_feedBoxes > li'); 357 openDeleteConfirm($checked,"checked"); 193 358 }); 194 359 $feedBoxes.on('click', '.controls .hide', function () { 195 var $elem = $(this).parents('.expresscurate_feedBoxes > li'); 196 deleteFeedItems($elem); 197 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 360 var $checked = $(this).parents('.expresscurate_feedBoxes > li'); 361 openDeleteConfirm($checked,"clicked"); 198 362 }); 199 363 … … 214 378 bookmarkAdd($elems); 215 379 deleteFeedItems($elems); 380 }); 381 382 $feedBoxes.on('click', '.permanent_remove', function () { 383 var $elem = $(this).parents('.expresscurate_feedBoxes > li'); 384 //openRemoveConfirm($elem,"clicked"); 385 deleteFeedItems($elem); 386 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 387 }); 388 // confirm feeds' permanent delete 389 $('.expresscurate_feed_list').on('click','.controlsWrap .removePermanently.active', function () { 390 var elems = $feedBoxes.find('input:checkbox:checked').parent(); 391 //openRemoveConfirm(elems,"checked"); 392 deleteFeedItems(elems, true); 393 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 394 }); 395 // restore feeds 396 $('.expresscurate_feed_list').on('click','.controlsWrap .restore.active', function () { 397 var elems = $feedBoxes.find('input:checkbox:checked').parent(); 398 //openRestoreConfirm(items,"checked"); 399 restoreFeedItems(elems); 400 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 401 }); 402 403 $feedBoxes.on('click', '.controls .restore', function () { 404 var $elem = $(this).parents('.expresscurate_feedBoxes > li'); 405 //openRestoreConfirm($elem,"clicked"); 406 restoreFeedItems($elem); 407 ExpressCurateUtils.notDefinedMessage($notDefFeed, $feedBoxes.find(' > li')); 216 408 }); 217 409 -
expresscurate/trunk/js/socialPostWidget.js
r1191825 r1252098 151 151 152 152 if ($metaTag.length) { 153 var savedPosts = $ metaTag.val();154 var data = (savedPosts.length > 1) ? $.parseJSON(savedPosts): [];153 var savedPosts = $.parseJSON($metaTag.val()); 154 var data = (savedPosts.length > 1) ? savedPosts : []; 155 155 $.each(data, function (index, value) { 156 156 posts.push(value); -
expresscurate/trunk/readme.txt
r1191825 r1252098 4 4 Donate link: https://bit.ly/expresscuratedonate 5 5 Requires at least: 3.9 6 Tested up to: 4. 2.27 Stable tag: 2.1. 36 Tested up to: 4.3.1 7 Stable tag: 2.1.4 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl.html … … 132 132 == Changelog == 133 133 134 = 2.1.4 = 135 * Wordpress 4.3 supported now. 136 * Miscellaneous bug fixes and improvements. 137 134 138 = 2.1.3 = 135 139 * Welcome to ExpressCurate! widget with useful getting started links and resources. -
expresscurate/trunk/templates/bookmarks.php
r1191825 r1252098 119 119 </li> 120 120 <li class="separator">-</li> 121 <li class="share">Share </li> 122 <li class="separator">-</li> 121 <?php 122 if (get_option('expresscurate_social_publishing', '') == "on" && strlen(get_option('expresscurate_buffer_access_token')) > 2) { 123 ?> 124 <li class="share">Share </li> 125 <li class="separator">-</li> 126 <?php } ?> 123 127 <li class="copyURL">Copy URL</li> 124 128 <li class="separator">-</li> … … 168 172 <li><a class="curate" href="post-new.php?expresscurate_load_source={{data.curateLink}}">Curate</a></li> 169 173 <li class="separator">-</li> 170 <li class="share">Share</li> 171 <li class="separator">-</li> 174 <?php 175 if (get_option('expresscurate_social_publishing', '') == "on" && strlen(get_option('expresscurate_buffer_access_token')) > 2) { 176 ?> 177 <li class="share">Share </li> 178 <li class="separator">-</li> 179 <?php } ?> 172 180 <li class="copyURL">Copy URL</li> 173 181 <li class="separator">-</li> -
expresscurate/trunk/templates/dashboard/welcome_widget.php
r1191825 r1252098 3 3 <p>Here are a couple of useful links to help you get started:</p> 4 4 <ul> 5 <li><a href="http://www.expresscurate.com/p/guide/ configure-rss-feed" target="_blank">Bring in your RSS feeds</a> to get a content creation starting point</li>6 <li><a href="http://www.expresscurate.com/p/guide/ post-from-feed" target="_blank">Curate an article</a> using URLs</li>7 <li><a href="http://www.expresscurate.com/p/guide/ define-keyword" target="_blank">Add keywords</a> and see how they are optimized</li>8 <li><a href="http://www.expresscurate.com/p/guide/ post-enhancement" target="_blank">Enable SEO</a> to start using ExpressCurate SEO features</li>5 <li><a href="http://www.expresscurate.com/p/guide/getting-started/configure-rss-feed" target="_blank">Bring in your RSS feeds</a> to get a content creation starting point</li> 6 <li><a href="http://www.expresscurate.com/p/guide/getting-started/post-from-feed" target="_blank">Curate an article</a> using URLs</li> 7 <li><a href="http://www.expresscurate.com/p/guide/getting-started/define-keyword" target="_blank">Add keywords</a> and see how they are optimized</li> 8 <li><a href="http://www.expresscurate.com/p/guide/getting-started/post-enhancement" target="_blank">Enable SEO</a> to start using ExpressCurate SEO features</li> 9 9 </ul> 10 10 </div> -
expresscurate/trunk/templates/feed_dashboard.php
r1137344 r1252098 2 2 $feedManager = new ExpressCurate_FeedManager(); 3 3 $feed_list = $feedManager->get_rss_list(); 4 $nextPullTime = human_time_diff(time(),wp_next_scheduled('expresscurate_pull_feeds')); 4 5 ?> 5 6 -
expresscurate/trunk/templates/feed_list.php
r1191825 r1252098 39 39 } 40 40 41 $nextPullTime = human_time_diff( wp_next_scheduled('expresscurate_pull_feeds'), time());41 $nextPullTime = human_time_diff(time(),wp_next_scheduled('expresscurate_pull_feeds')); 42 42 ?> 43 43 <input id="adminUrl" type="hidden" value="<?php echo get_admin_url(); ?>"/> … … 96 96 </li> 97 97 <?php } ?> 98 <br class="second"/> 99 <a href="?page=expresscurate_content_feed_archive"> 100 <li class="linkToDeletedPosts expresscurate_floatRight"> 101 <span class="tooltip">Content Feed Archive</span> 102 </li> 103 </a> 104 <br class="second"/> 98 105 <li class="layout expresscurate_floatRight"> 99 106 <span class="tooltip"><?php if (get_option('expresscurate_bookmark_layout', '') == 'single') { … … 165 172 </li> 166 173 <li class="separator">-</li> 167 <li class="share">Share</li> 168 <li class="separator">-</li> 174 <?php 175 if (get_option('expresscurate_social_publishing', '') == "on" && strlen(get_option('expresscurate_buffer_access_token')) > 2) { 176 ?> 177 <li class="share">Share </li> 178 <li class="separator">-</li> 179 <?php } ?> 169 180 <li class="bookmark">Bookmark</li> 170 181 <li class="separator">-</li> -
expresscurate/trunk/templates/settings.php
r1191825 r1252098 180 180 echo ''; 181 181 } 182 ?>" name="expresscurate_publisher_twitter" placeholder="@publisher_handle"/> 182 ?>" name="expresscurate_publisher_twitter" /><!--placeholder="@publisher_handle"--> 183 184 <br/> 185 <label for="expresscurate_publisher_facebook" class="title">Publisher (Facebook)<span 186 class="description ">You can link content you publish on this blog to your company or personal Facebook profile. 187 <a href="https://plus.google.com/authorship" target="_blank">More Info</a>.</label></span> 188 189 <input class="controls" type="text" id="expresscurate_publisher_facebook" size="50" 190 value="<?php 191 if (get_option('expresscurate_publisher_facebook')) { 192 echo get_option('expresscurate_publisher_facebook'); 193 } else { 194 echo ''; 195 } 196 ?>" name="expresscurate_publisher_facebook" placeholder=""/> 183 197 </div> 184 198 </li> -
expresscurate/trunk/templates/sitemap.php
r1179063 r1252098 1 1 <h2 class="expresscurate_displayNone">Sitemap.xml</h2> 2 2 <form class="expresscurate_marginTop20" method="post" action="options.php"> 3 <?php @settings_fields('expresscurate-sitemap-group'); ?>4 <?php @do_settings_fields('expresscurate-sitemap-group'); ?>5 6 <?php //do_settings_sections('expresscurate');?>3 <?php @settings_fields('expresscurate-sitemap-group'); ?> 4 <?php @do_settings_fields('expresscurate-sitemap-group'); ?> 5 6 <?php //do_settings_sections('expresscurate');?> 7 7 8 8 <ul> 9 <li> 10 <div class="title submitSitemapWrap"> 11 <a class="generate <?php if (strlen(get_option('expresscurate_google_refresh_token')) < 3) {echo 'expresscurate_displayNone'; }else {echo 'generated';}?>" id="submitSiteMap" href="#">Submit Sitemap<span class="loading"></span></a> 9 <li> 10 <div class="title submitSitemapWrap"> 11 <a class="generate <?php if (strlen(get_option('expresscurate_google_refresh_token')) < 3) { 12 echo 'expresscurate_displayNone'; 13 } else { 14 echo 'generated'; 15 } ?>" id="submitSiteMap" href="#">Submit Sitemap<span class="loading"></span></a> 16 </div> 17 <a class="generate" id="generateSiteMap" href="#">Generate Sitemap</a> 18 </li> 19 <br/> 20 <li> 21 <p class="title">Sitemap update frequency<span 22 class="description ">How often should the sitemap be updated?</span></p> 23 <select class="controls" name="expresscurate_sitemap_generation_interval"> 24 <option value="always" <?php 25 if (get_option('expresscurate_sitemap_generation_interval') == 'always') { 26 echo 'selected="selected"'; 27 } 28 ?>>On every Post 29 </option> 30 <option value="daily" <?php 31 if (get_option('expresscurate_sitemap_generation_interval') == 'daily') { 32 echo 'selected="selected"'; 33 } 34 ?>>Daily 35 </option> 36 <option value="weekly" <?php 37 if (get_option('expresscurate_sitemap_generation_interval') == 'weekly') { 38 echo 'selected="selected"'; 39 } 40 ?>>Weekly 41 </option> 42 <option value="monthly" <?php 43 if (get_option('expresscurate_sitemap_generation_interval') == 'monthly') { 44 echo 'selected="selected"'; 45 } 46 ?>>Monthly 47 </option> 48 </select> 49 </li> 50 51 <li> 52 <p class="title">Include all new posts in sitemap?<span class="description ">All new posts will be included in your sitemap if this option is enabled</span> 53 </p> 54 <input class="expresscurate_displayNone" type="checkbox" id="expresscurate_sitemap_include_new_posts" 55 name="expresscurate_sitemap_include_new_posts" <?php if (get_option('expresscurate_sitemap_include_new_posts') == 'on') echo 'checked'; ?>> 56 <label class="controls checkboxLabel" for="expresscurate_sitemap_include_new_posts"></label> 57 </li> 58 <li> 59 <p class="title">Include all new pages in sitemap?<span class="description ">All new pages will be included in your sitemap if this option is enabled</span> 60 </p> 61 <input class="expresscurate_displayNone" type="checkbox" id="expresscurate_sitemap_include_new_pages" 62 name="expresscurate_sitemap_include_new_pages" <?php if (get_option('expresscurate_sitemap_include_new_pages') == 'on') echo 'checked'; ?>> 63 <label class="controls checkboxLabel" for="expresscurate_sitemap_include_new_pages"></label> 64 </li> 65 <!--<li>--> 66 <!-- <p class="title">New entry default priority<span class="description ">Please select the priority of new pages and posts in the sitemap</span></p>--> 67 <!-- <select class="controls" name="expresscurate_sitemap_default_priority">--> 68 <!-- <option value="manual" --><?php 69 // if (get_option('expresscurate_sitemap_default_priority') == 'manual') { 70 // echo 'selected="selected"'; 71 // } 72 // ?> 73 <!--manual--> 74 <!-- </option>--> 75 <!----> 76 <!-- <option value="automatic" --><?php 77 // if (get_option('expresscurate_sitemap_default_priority') == 'automatic') { 78 // echo 'selected="selected"'; 79 // } 80 // ?> 81 <!--automatic--> 82 <!-- </option>--> 83 <!-- </select>--> 84 <!--</li>--> 85 <?php 86 $sitemap = new ExpressCurate_Sitemap(); 87 $sitemapFrequencyArray = $sitemap->getSitemapFrequencyTagArray(); 88 $priority = (get_option('expresscurate_sitemap_priority_manual_value')) ? get_option('expresscurate_sitemap_priority_manual_value') : "0.8"; 89 $frequency = (get_option('expresscurate_sitemap_default_changefreq')) ? get_option('expresscurate_sitemap_default_changefreq') : "never"; 90 ?> 91 <li> 92 <p class="title">Sitemap manual priority value<span class="description ">Please select the priority for new posts in your sitemap</span> 93 </p> 94 <select class="controls" id="expresscurate_sitemap_priority_manual_value" 95 name="expresscurate_sitemap_priority_manual_value"> 96 <?php for ($i = 0.1; $i <= 1; $i = $i + 0.1) { 97 echo '<option value="' . $i . '" '; 98 if ((string)$i == $priority) { 99 echo ' selected="selected"'; 100 } 101 echo '>' . $i . '</option>'; 102 } ?> 103 </select> 104 </li> 105 <li> 106 <p class="title">Sitemap default changefreq<span class="description ">Please select the sitemap changefreq value for your new posts</span> 107 </p> 108 <select class="controls" name="expresscurate_sitemap_default_changefreq"> 109 <?php foreach ($sitemapFrequencyArray as $key => $val) { 110 echo '<option value="' . $key . '"'; 111 if ($key == $frequency) { 112 echo ' selected="selected"'; 113 } 114 echo '>' . $val . '</option>'; 115 } ?> 116 </select> 117 </li> 118 <li> 119 <p class="title">Sitemap archiving frequency<span class="description ">Please select the frequency of archiving old post definitions in the sitemap</span> 120 </p> 121 <select class="controls" name="expresscurate_sitemap_archiving"> 122 <option value="week" <?php 123 if (get_option('expresscurate_sitemap_archiving') == 'week') { 124 echo 'selected="selected"'; 125 } 126 ?>>1 week 127 </option> 128 129 <option value="month" <?php 130 if (get_option('expresscurate_sitemap_archiving') == 'month') { 131 echo 'selected="selected"'; 132 } 133 ?>>1 month 134 </option> 135 136 <option value="year" <?php 137 if (get_option('expresscurate_sitemap_archiving') == 'year') { 138 echo 'selected="selected"'; 139 } 140 ?>>1 year 141 </option> 142 </select> 143 </li> 144 <li class="expresscurate_sitemap_webmasters"> 145 <p class="title">Submit sitemap automatically?<span class="description ">If this option is enabled, sitemap will be submitted to webmaster tools of search engines automatically.</span> 146 </p> 147 <input class="expresscurate_displayNone" type="checkbox" id="expresscurate_sitemap_submit" 148 name="expresscurate_sitemap_submit" <?php if (get_option('expresscurate_sitemap_submit') == 'on') echo 'checked'; ?>/> 149 <label class="controls checkboxLabel" for="expresscurate_sitemap_submit"></label> 150 </li> 151 152 <li> 153 <div class="sitemapUpdateFrequency <?php if (get_option('expresscurate_sitemap_submit') != 'on') { 154 echo 'expresscurate_displayNone'; 155 } ?> />"> 156 <p class="title">Registered domain in Google Search Console (aka Webmaster Tools)<span 157 class="description">Specify if different from blog address</span></p> 158 <input class="controls" type="text" name="expresscurate_sitemap_domain" id="expresscurate_sitemap_domain" 159 value="<?php echo get_option('expresscurate_sitemap_domain',''); ?>" placeholder="<?php echo get_site_url(); ?>"> 160 <br> 161 <p class="title">Sitemap submission frequency<span class="description ">How often should sitemap be submitted to search engines?</span> 162 </p> 163 <select class="controls" name="expresscurate_sitemap_submit_frequency"> 164 <option value="always" <?php 165 if (get_option('expresscurate_sitemap_submit_frequency') == 'always') { 166 echo 'selected="selected"'; 167 } 168 ?>>On every Post 169 </option> 170 <option value="daily" <?php 171 if (get_option('expresscurate_sitemap_submit_frequency') == 'daily') { 172 echo 'selected="selected"'; 173 } 174 ?>>Daily 175 </option> 176 <option value="weekly" <?php 177 if (get_option('expresscurate_sitemap_submit_frequency') == 'weekly') { 178 echo 'selected="selected"'; 179 } 180 ?>>Weekly 181 </option> 182 <option value="monthly" <?php 183 if (get_option('expresscurate_sitemap_submit_frequency') == 'monthly') { 184 echo 'selected="selected"'; 185 } 186 ?>>Monthly 187 </option> 188 </select> 189 <?php 190 $blogName = urlencode(urlencode(get_bloginfo('url'))); 191 ?> 192 <a class="getApiKey <?php if (strlen(get_option('expresscurate_google_refresh_token')) > 2) { 193 echo 'expresscurate_displayNone'; 194 } ?>" 195 href="https://www.expresscurate.com/api/connector/google/webmasters/refreshtoken/<?= $blogName ?>">Authorize 196 access to Google Search Console (aka Webmaster Tools)</a> 197 </div> 198 </li> 199 </ul> 200 <div class="centerSave"> 201 <?php @submit_button(); ?> 12 202 </div> 13 <a class="generate" id="generateSiteMap" href="#">Generate Sitemap</a>14 </li>15 <br/>16 <li>17 <p class="title">Sitemap update frequency<span class="description ">How often should the sitemap be updated?</span></p>18 <select class="controls" name="expresscurate_sitemap_generation_interval">19 <option value="always" <?php20 if (get_option('expresscurate_sitemap_generation_interval') == 'always') {21 echo 'selected="selected"';22 }23 ?>>On every Post24 </option>25 <option value="daily" <?php26 if (get_option('expresscurate_sitemap_generation_interval') == 'daily') {27 echo 'selected="selected"';28 }29 ?>>Daily30 </option>31 <option value="weekly" <?php32 if (get_option('expresscurate_sitemap_generation_interval') == 'weekly') {33 echo 'selected="selected"';34 }35 ?>>Weekly36 </option>37 <option value="monthly" <?php38 if (get_option('expresscurate_sitemap_generation_interval') == 'monthly') {39 echo 'selected="selected"';40 }41 ?>>Monthly42 </option>43 </select>44 </li>45 46 <li>47 <p class="title">Include all new posts in sitemap?<span class="description ">All new posts will be included in your sitemap if this option is enabled</span></p>48 <input class="expresscurate_displayNone" type="checkbox" id="expresscurate_sitemap_include_new_posts"49 name="expresscurate_sitemap_include_new_posts" <?php if (get_option('expresscurate_sitemap_include_new_posts') == 'on') echo 'checked'; ?>>50 <label class="controls checkboxLabel" for="expresscurate_sitemap_include_new_posts"></label>51 </li>52 <li>53 <p class="title">Include all new pages in sitemap?<span class="description ">All new pages will be included in your sitemap if this option is enabled</span></p>54 <input class="expresscurate_displayNone" type="checkbox" id="expresscurate_sitemap_include_new_pages"55 name="expresscurate_sitemap_include_new_pages" <?php if (get_option('expresscurate_sitemap_include_new_pages') == 'on') echo 'checked'; ?>>56 <label class="controls checkboxLabel" for="expresscurate_sitemap_include_new_pages"></label>57 </li>58 <!--<li>-->59 <!-- <p class="title">New entry default priority<span class="description ">Please select the priority of new pages and posts in the sitemap</span></p>-->60 <!-- <select class="controls" name="expresscurate_sitemap_default_priority">-->61 <!-- <option value="manual" --><?php62 // if (get_option('expresscurate_sitemap_default_priority') == 'manual') {63 // echo 'selected="selected"';64 // }65 // ?>66 <!--manual-->67 <!-- </option>-->68 <!---->69 <!-- <option value="automatic" --><?php70 // if (get_option('expresscurate_sitemap_default_priority') == 'automatic') {71 // echo 'selected="selected"';72 // }73 // ?>74 <!--automatic-->75 <!-- </option>-->76 <!-- </select>-->77 <!--</li>-->78 <?php79 $sitemap = new ExpressCurate_Sitemap();80 $sitemapFrequencyArray =$sitemap->getSitemapFrequencyTagArray();81 $priority = (get_option('expresscurate_sitemap_priority_manual_value'))?get_option('expresscurate_sitemap_priority_manual_value'):"0.8";82 $frequency = (get_option('expresscurate_sitemap_default_changefreq'))?get_option('expresscurate_sitemap_default_changefreq'):"never";83 ?>84 <li>85 <p class="title">Sitemap manual priority value<span class="description ">Please select the priority for new posts in your sitemap</span></p>86 <select class="controls" id="expresscurate_sitemap_priority_manual_value" name="expresscurate_sitemap_priority_manual_value">87 <?php for($i=0.1; $i<=1; $i=$i+0.1) {88 echo '<option value="'.$i.'" ';89 if ((string)$i == $priority) {90 echo ' selected="selected"';91 }92 echo '>'.$i.'</option>';93 }?>94 </select>95 </li>96 <li>97 <p class="title">Sitemap default changefreq<span class="description ">Please select the sitemap changefreq value for your new posts</span></p>98 <select class="controls" name="expresscurate_sitemap_default_changefreq">99 <?php foreach($sitemapFrequencyArray as $key=>$val) {100 echo '<option value="' . $key . '"';101 if ($key == $frequency) {102 echo ' selected="selected"';103 }104 echo '>' . $val . '</option>';105 }?>106 </select>107 </li>108 <li>109 <p class="title">Sitemap archiving frequency<span class="description ">Please select the frequency of archiving old post definitions in the sitemap</span></p>110 <select class="controls" name="expresscurate_sitemap_archiving">111 <option value="week" <?php112 if (get_option('expresscurate_sitemap_archiving') == 'week') {113 echo 'selected="selected"';114 }115 ?>>1 week116 </option>117 118 <option value="month" <?php119 if (get_option('expresscurate_sitemap_archiving') == 'month') {120 echo 'selected="selected"';121 }122 ?>>1 month123 </option>124 125 <option value="year" <?php126 if (get_option('expresscurate_sitemap_archiving') == 'year') {127 echo 'selected="selected"';128 }129 ?>>1 year130 </option>131 </select>132 </li>133 <li class="expresscurate_sitemap_webmasters">134 <p class="title">Submit sitemap automatically?<span class="description ">If this option is enabled, sitemap will be submitted to webmaster tools of search engines automatically.</span></p>135 <input class="expresscurate_displayNone" type="checkbox" id="expresscurate_sitemap_submit"136 name="expresscurate_sitemap_submit" <?php if (get_option('expresscurate_sitemap_submit') == 'on') echo 'checked'; ?>/>137 <label class="controls checkboxLabel" for="expresscurate_sitemap_submit"></label>138 </li>139 <li>140 <div class="sitemapUpdateFrequency <?php if (get_option('expresscurate_sitemap_submit') != 'on') { echo 'expresscurate_displayNone';}?> />">141 <p class="title">Sitemap submission frequency<span class="description ">How often should sitemap be submitted to search engines?</span></p>142 <select class="controls" name="expresscurate_sitemap_submit_frequency">143 <option value="always" <?php144 if (get_option('expresscurate_sitemap_submit_frequency') == 'always') {145 echo 'selected="selected"';146 }147 ?>>On every Post148 </option>149 <option value="daily" <?php150 if (get_option('expresscurate_sitemap_submit_frequency') == 'daily') {151 echo 'selected="selected"';152 }153 ?>>Daily154 </option>155 <option value="weekly" <?php156 if (get_option('expresscurate_sitemap_submit_frequency') == 'weekly') {157 echo 'selected="selected"';158 }159 ?>>Weekly160 </option>161 <option value="monthly" <?php162 if (get_option('expresscurate_sitemap_submit_frequency') == 'monthly') {163 echo 'selected="selected"';164 }165 ?>>Monthly166 </option>167 </select>168 <?php169 $blogName = urlencode(urlencode(get_bloginfo('url')));170 ?>171 <a class="getApiKey <?php if (strlen(get_option('expresscurate_google_refresh_token')) > 2) {echo 'expresscurate_displayNone';}?>" href="https://www.expresscurate.com/api/connector/google/webmasters/refreshtoken/<?=$blogName?>">Authorize access to Google Search Console (aka Webmaster Tools)</a>172 </div>173 </li>174 </ul>175 <div class="centerSave">176 <?php @submit_button(); ?>177 </div>178 203 </form>
Note: See TracChangeset
for help on using the changeset viewer.