Plugin Directory

Changeset 1252098


Ignore:
Timestamp:
09/23/2015 03:07:45 PM (11 years ago)
Author:
expresscurate
Message:

new version v2.1.4 with changes:

  • Wordpress 4.3 supported now.
  • Miscellaneous bug fixes and improvements.
Location:
expresscurate/trunk
Files:
1 added
20 edited

Legend:

Unmodified
Added
Removed
  • expresscurate/trunk/ExpressCurate.php

    r1191825 r1252098  
    55  Plugin URI: http://www.expresscurate.com/products
    66  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.3
     7  Version: 2.1.4
    88  Author: ExpressCurate
    99  Author URI: http://www.expresscurate.com
  • expresscurate/trunk/ExpressCurate_Actions.php

    r1191825 r1252098  
    9999        add_action('wp_head', array(&$this, 'advanced_seo_update_canonical_url'));
    100100        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    }
    103107
    104108    /**
     
    130134
    131135        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        }
    132139        add_action('admin_footer', array(&$this, 'anonymous_tracking'));
    133140
     
    162169        add_action('wp_ajax_expresscurate_bookmarks_delete', array($this->feedManager, 'delete_bookmarks'));
    163170        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'));
    164173        add_action('wp_ajax_expresscurate_add_post_source', array($this->feedManager, 'add_post_source'));
    165174        add_action('wp_ajax_expresscurate_delete_post_source', array($this->feedManager, 'delete_post_source'));
     
    190199        add_action('wp_dashboard_setup', array(&$this, 'add_dashboard_widgets'));
    191200        add_filter('user_contactmethods', array(&$this, 'add_user_profile_metas'));
     201
    192202        if ($pagenow == 'post.php' || $pagenow == 'post-new.php') {
    193203            add_action('media_buttons_context', array(&$this, 'add_custom_button'), 11);
     
    198208        add_action('transition_post_status', array(&$this, 'status_changes'), 10, 3);
    199209        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        }
    200213        if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'expresscurate_settings') {
    201214            $this->cronManager->schedule_events();
     
    225238        register_setting('expresscurate-group', 'expresscurate_publisher');
    226239        register_setting('expresscurate-group', 'expresscurate_publisher_twitter');
     240        register_setting('expresscurate-group', 'expresscurate_publisher_facebook');
    227241        register_setting('expresscurate-group', 'expresscurate_autosummary');
    228242        register_setting('expresscurate-group', 'expresscurate_share');
     
    249263        register_setting('expresscurate-sitemap-group', 'expresscurate_sitemap_priority_manual_value');
    250264        register_setting('expresscurate-sitemap-group', 'expresscurate_sitemap_archiving');
     265        register_setting('expresscurate-sitemap-group', 'expresscurate_sitemap_domain');
    251266        register_setting('expresscurate-changed-post-status', 'expresscurate_changed_post_status');
    252267        register_setting('expresscurate-sitemap-generation-group', 'expresscurate_sitemap_generation_last_date');
     
    378393    }
    379394
     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
    380407    public function add_custom_button($context)
    381408    {
     
    431458        <?php
    432459        }
     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
    433468    }
    434469
     
    795830            $post_content = $tags_obj->removeTagLinks($post_content);
    796831        }
     832        $old_permalink = $_POST['post_old_permalink'];
     833        $new_permalink = get_permalink($post->ID);
     834        $this->permalink_changes($old_permalink, $new_permalink);
    797835
    798836        //Smart publishing
     
    11271165            self::PLUGIN_NAME . ' Settings', self::PLUGIN_NAME, 'manage_options', 'expresscurate_settings', array(&$this, 'plugin_settings_page')
    11281166        );
     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>");
    11291169        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'), '');
    11311172        add_submenu_page('expresscurate', 'Bookmarks', 'Bookmarks', 'edit_posts', 'expresscurate_bookmarks', array(&$this, 'show_bookmarks'), '');
    11321173        add_submenu_page('expresscurate', 'Top Sources', 'Top Sources', 'edit_posts', 'expresscurate_websites', array(&$this, 'show_websites'), '');
     
    13551396        $featuredImageID = get_post_thumbnail_id($post_id);
    13561397        if ($featuredImageID) {
    1357             $featuredImage = wp_get_attachment_url(featuredImageID);
     1398            $featuredImage = wp_get_attachment_url($featuredImageID);
    13581399            $featuredImage = $featuredImage ? esc_url($featuredImage) : null;
    13591400        }
     
    15091550    }
    15101551
     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
    15111564    public function show_bookmarks()
    15121565    {
     
    15951648
    15961649        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'));
    15981651        wp_enqueue_script('expresscurate_seo_control_center', $pluginUrl . 'js/keywords/SEOControlCenter.js', array('jquery', 'jquery-ui-draggable', 'jquery-ui-droppable'));
    15991652        //
     
    16401693        // Add new fields
    16411694        $profile_fields['expresscurate_twitter'] = 'Twitter Username';
     1695        $profile_fields['expresscurate_twitter_url'] = 'Twitter  URL';
    16421696        $profile_fields['expresscurate_facebook'] = 'Facebook URL';
    16431697        $profile_fields['expresscurate_gplus'] = 'Google+ URL';
    16441698        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__);
    16561699    }
    16571700
     
    18031846        if (!ExpressCurate_HtmlParser::supportsDownload()) {
    18041847            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>';
    18051862        }
    18061863
  • expresscurate/trunk/ExpressCurate_FeedManager.php

    r1179598 r1252098  
    3232    {
    3333        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.");
    3636        } else {
    3737            $url = isset($url) ? $url : $_REQUEST['url'];
     
    4848
    4949                $rssUrl = $this->getRssUrl($url);
    50                 $existed_rss="";
     50                $existed_rss = "";
    5151                $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) {
    5554                        $existed_rss = $link['feed_url'];
    5655                        break;
    5756                    }
    5857                }
    59                 if ($rssUrl === null || $rssUrl=="") {
     58                if ($rssUrl === null || $rssUrl == "") {
    6059                    $result['status'] = 'No RSS feed found at this URL.';
    6160                } else if (!empty($existed_rss)) {
     
    9796    }
    9897
    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";
    101101        $htmlparser = new ExpressCurate_HtmlParser($loadURL);
    102102        $res = $htmlparser->download();
    103103        $result = json_decode($res, true);
    104104
    105         if(isset($result['responseData']) && isset($result['responseData']['feed'])) {
     105        if (isset($result['responseData']) && isset($result['responseData']['feed'])) {
    106106            $meta = array();
    107107            $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'];
    110110            return $meta;
    111111        } else {
     
    119119        $data = $_REQUEST;
    120120        if ($data['url']) {
     121            $data['url'] = htmlentities($data['url'], ENT_COMPAT);
    121122            $curated_links_rss = get_option('expresscurate_links_rss', '');
    122123            if ($curated_links_rss) {
     
    161162
    162163            $links = array();
    163             foreach($curated_links_rss as $link => $data) {
     164            foreach ($curated_links_rss as $link => $data) {
    164165                $url = $data['feed_url'];
    165166                $links[$url] = 1;
     
    173174        if ($top_sources_rss) {
    174175            // 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);
    176177            // if not migrated, clean the data up, calculate stats from scratch
    177178            $top_sources_rss = $migrated1 ? json_decode($top_sources_rss, true) : array();
     
    203204
    204205                            // filter
    205                             if(empty($link) || $link == '.') {
     206                            if (empty($link) || $link == '.') {
    206207                                continue;
    207208                            }
     
    221222        $rssLinks = array();
    222223
    223         if(ExpressCurate_HtmlParser::supportsDownload()) {
     224        if (ExpressCurate_HtmlParser::supportsDownload()) {
    224225            foreach ($curated_links as $key => $top_link) {
    225226                $websiteHost = $top_link['host'];
    226227                $website = $top_link['link'];
    227228
    228                 if(isset($rssLinks[$websiteHost])) {
     229                if (isset($rssLinks[$websiteHost])) {
    229230                    $rssUrl = $rssLinks[$websiteHost];
    230231                } else {
     
    273274    }
    274275
     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
    275287    public function get_rss_list()
    276288    {
     
    282294
    283295            $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) {
    286298                    continue;
    287299                }
     
    307319
    308320            // update the post count
    309             foreach($curated_links_rss as $link => $data) {
     321            foreach ($curated_links_rss as $link => $data) {
    310322                // get the number of posts that are curated from this feed
    311323                $posts = $wpdb->get_results(
    312                             "SELECT post_id
     324                    "SELECT post_id
    313325                             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");
    315327
    316328                $curated_links_rss[$link]['post_count'] = count($posts);
     
    334346     * @return mixed|null JSON response or null if $url or $result is not set
    335347     * */
    336     public function doRssLookup($url) {
    337         if(isset($url)) {
     348    public function doRssLookup($url)
     349    {
     350        if (isset($url)) {
    338351            $lookup_url = "http://ajax.googleapis.com/ajax/services/feed/lookup?v=1.0&q=" . urlencode($url);
    339352            //$result = file_get_contents($lookup_url);
     
    372385
    373386
    374 
    375387    public function get_feed_content()
    376388    {
     
    383395            $feed_array = $feedContent['content'];
    384396        }
    385 
     397        $unseen_feeds = get_option('unseen_feeds_count') ? intval(get_option('unseen_feeds_count')) : 0;
    386398        // blabla
    387399        $data = $_REQUEST;
    388400        $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"));
    390402        $curated_links_rss = get_option('expresscurate_links_rss', '');
    391403        if ($curated_links_rss) {
     
    399411            }
    400412            if (is_array($feed_content_deleted)) {
    401                 foreach ($feed_content_deleted as $deletet_item) {
    402                     $deleted_urls[] = $deletet_item;
     413                foreach ($feed_content_deleted as $deleted_item) {
     414                    $deleted_urls[] = $deleted_item;
    403415                }
    404416            }
     
    409421                foreach ($curated_links_rss as $url => $feed_url) {
    410422                    // 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";
    412424                    $htmlparser = new ExpressCurate_HtmlParser($lookup_url);
    413425                    $res = $htmlparser->download();
    414426                    // decode and collect
    415427                    $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);
    419431            }
    420432            // check if the feed is empty and sort
    421             if(!empty($feed_array)) {
     433            if (!empty($feed_array)) {
    422434                @uasort($feed_array, array($this, "feedSortByDate"));
    423435
    424436                // 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) {
    426438                    // 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);
    428440                    // TODO implement
    429441
     
    438450    }
    439451
    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)
    441453    {
    442454        $feeds = array();
     
    448460            }
    449461        }
    450        
    451         $blockWords = split(', ', trim(get_option('expresscurate_content_stop_keywords', '')));
     462        $blockWords = preg_split('/[,]+/iu', trim(get_option('expresscurate_content_stop_keywords', '')));
    452463        $blockWords = empty($blockWords) ? false : $blockWords;
    453        
     464
    454465        foreach ($feeds as $story) {
     466
    455467            // get the post url
    456468            $link = isset($story['link']) ? $story['link'] : $story['address'];
    457             if(empty($link) || isset($deleted_urls[$link])) {
     469            if (empty($link) || isset($deleted_urls[$link])) {
    458470                continue;
    459471            }
     
    479491
    480492            // check if this link is already in the feed
    481             if(isset($feed_array[$link])) {
     493            if (isset($feed_array[$link])) {
    482494                continue;
    483495            }
    484496
    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("&quot;", "'", $story['title']),
     528                'desc' => isset($story['contentSnippet']) ? str_replace("&quot;", "'", $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'];
    488546                } 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("&quot;","'",$story['title']),
    516                     'desc' => isset($story['contentSnippet']) ? str_replace("&quot;","'",$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    {
    543559        // get feed data
    544560        $feeds = json_decode($this->get_feed_content(), true);
    545561
    546562        // reschedule the cronjob
    547         //if(!empty($feeds['content'])) {
    548563        wp_clear_scheduled_hook('expresscurate_pull_feeds');
    549564        $pull_feed_interval = (get_option('expresscurate_pull_hours_interval')) ? get_option('expresscurate_pull_hours_interval') : 1;
    550565        wp_schedule_event(strtotime("+" . $pull_feed_interval . " hour"), 'hourly', 'expresscurate_pull_feeds');
    551566        $feeds["minutes_to_next_pull"] = human_time_diff(wp_next_scheduled('expresscurate_pull_feeds'), time());
    552         //}
    553 
    554         // return
    555567        echo json_encode($feeds);
    556568        die;
     
    563575    }
    564576
    565     public function filter_feeds_by_date() {
     577    public function filter_feeds_by_date()
     578    {
    566579        $data = $_REQUEST;
    567580        $feed_content = json_decode(get_option('expresscurate_feed_content', ''), true);
    568581        $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) {
    572585                    $filtered_feeds[$link] = $feed;
    573586                }
     
    582595        if (get_option('expresscurate_enable_content_alert') == 'on') {
    583596            $expressCurateEmail = new ExpressCurate_Email();
    584            
     597
    585598            $alertAddresses = trim(get_option('expresscurate_content_alert_users', ''));
    586             if(!$expressCurateEmail->hasContentAlertRecipients()) {
     599            if (!$expressCurateEmail->hasContentAlertRecipients()) {
    587600                return;
    588601            }
    589        
     602
    590603            $feed_content = json_decode(get_option('expresscurate_feed_content', ''), true);
    591604
     
    622635            if ($feed_contents) {
    623636                $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) {
    626639                    $exists_url[] = $content['link'];
    627                 }
     640                }*/
    628641                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']]);
    632646                    }
    633647                }
     
    648662    }
    649663
     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
    650731    public function add_bookmarks()
    651732    {
     
    653734        $data = $_REQUEST;
    654735        if (isset($data['items'])) {
    655             $items = json_decode(stripslashes($data['items']), true);
    656 
     736            $items = $data['items'];
    657737            $bookmarks = get_option('expresscurate_bookmarks', '');
    658738            if ($bookmarks) {
     
    663743
    664744            foreach ($items as $item) {
     745                $item = json_decode(stripslashes($item), true);
    665746                $bookmarkURL = $item['link'];
    666747                if (isset($bookmarks[$bookmarkURL])) {
    667                         $result[$bookmarkURL]['status'] = 'warning';
    668                 }else {
     748                    $result[$bookmarkURL]['status'] = 'warning';
     749                } else {
    669750                    $current_user = wp_get_current_user();
    670751                    $item['user'] = $current_user->display_name;
     
    672753                    $this->collectBookmark($bookmarks, $item);
    673754
    674                     $result[$bookmarkURL]['status'] = 'success';
     755                    // $result[$bookmarkURL]['status'] = 'success';
    675756                }
    676757            }
     
    689770        $data = $_REQUEST;
    690771        $result = array();
    691         if(!ExpressCurate_HtmlParser::supportsDownload()) {
     772        if (!ExpressCurate_HtmlParser::supportsDownload()) {
    692773            $result['status'] = 'error';
    693774            $result['msg'] = 'You should activate either curl extension or allow_url_fopen setting.';
     
    788869    }
    789870
    790     private function collectBookmark(&$bookmarks, $item, $url = null, $comment = '') {
     871    private function collectBookmark(&$bookmarks, $item, $url = null, $comment = '')
     872    {
    791873        if ($url) {
    792874            if (isset($item['result']) && isset($item['result']['title'])) {
     
    849931            $result['msg'] = 'Url is empty';
    850932        }
    851         echo json_encode($result,JSON_UNESCAPED_SLASHES);
     933        echo json_encode($result, JSON_UNESCAPED_SLASHES);
    852934        die;
    853935    }
     
    862944            if ($bookmarks) {
    863945                $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                                }*/
    868950                foreach ($items as $item) {
    869                     if (in_array($item['link'], $exists_url)) {
     951                    if (array_key_exists($item['link'], $bookmarks)) {
    870952                        unset($bookmarks[$item['link']]);
    871953                    }
     
    915997                $feeds = array();
    916998            }
    917             if(!empty($bookmarks)){
     999            if (!empty($bookmarks)) {
    9181000                $hayStack = array_merge($bookmarks, $feeds);
    9191001            }
    9201002        }
    9211003
    922         if(!empty($hayStack)){
     1004        if (!empty($hayStack)) {
    9231005            foreach ($hayStack as $content) {
    9241006                if (mb_stripos($content['title'], $needle) != false) {
     
    9401022            foreach ($bookmarks as $key => $bookmark) {
    9411023                $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'])));
    9431025                if ($bookmark_date >= $start && $bookmark_date <= $end) {
    9441026                    $count++;
  • expresscurate/trunk/ExpressCurate_HtmlParser.php

    r1191825 r1252098  
    5050    {
    5151        $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) {
    5353            return false;
    5454        } else {
     
    247247            return;
    248248        }
    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);
    252262            // setup the single curl
    253263            $ch = $this->createCURL($this->url);
     
    258268            curl_close($ch);
    259269        } else {
     270            set_time_limit(0);
    260271            $header = '';
    261272            if ($this->referer) {
     
    352363            }
    353364        }
    354 
    355365        // save and return
    356366        $this->data = $content;
  • expresscurate/trunk/ExpressCurate_Sitemap.php

    r1179063 r1252098  
    99  License URI: http://www.gnu.org/licenses/gpl.html
    1010 */
    11  
     11
    1212class ExpressCurate_Sitemap
    1313{
     
    1515    private static $instance;
    1616
    17     function __construct() {
     17    function __construct()
     18    {
    1819        // action shall be added from actions controller
    1920    }
    2021
    21     public static function getInstance() {
    22         if ( ! ( self::$instance instanceof self ) ) {
     22    public static function getInstance()
     23    {
     24        if (!(self::$instance instanceof self)) {
    2325            self::$instance = new self();
    2426        }
     
    2729    }
    2830
    29     public function generateSitemapScheduled(){
     31    public function generateSitemapScheduled()
     32    {
    3033        $intervalInDays = null;
    3134        //$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;
    3844        };
    3945
     
    4248        }
    4349        $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) {
    4551            $this->generateSitemap();
    4652        }
    4753    }
    4854
    49     public function pushSitemapScheduled(){
     55    public function pushSitemapScheduled()
     56    {
    5057        $intervalInDays = null;
    5158        $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;
    5868        };
    5969
     
    6272        }
    6373        $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) {
    6575            $this->submitToGoogle();
    6676        }
     
    7181        $homePath = get_home_path();
    7282        $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) {
    7687                $header = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
    7788                $body = '';
    78                 $footer = '</urlset>';
     89                $footer = '
     90                            </urlset>';
    7991
    8092                $posts_and_pages = array();
     
    101113                        }
    102114                        $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>';
    109122
    110123                    }
    111124
    112125                }
    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;
    123131            }
    124132        }
     
    127135    }
    128136
    129     public function isExists(){
     137    public function isExists()
     138    {
    130139        $path = get_home_path();
    131140        $file = file_exists($path . 'sitemap.xml');
    132         if($file){
     141        if ($file) {
    133142            return true;
    134143        }
     
    136145    }
    137146
    138     public function saveSitemapGoogleStatus() {
     147    public function saveSitemapGoogleStatus()
     148    {
    139149        $data = $_REQUEST;
    140150        $status = $data['status'];
    141         if($status == 'off'){
     151        if ($status == 'off') {
    142152            update_option('expresscurate_google_refresh_token', '');
    143153        }
     
    153163            $response = $googleAuth->accessToken();
    154164            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');
    158167            } 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).');
    160169            }
    161        }
    162     }
    163 
    164     public function errorMessage(){
     170            echo json_encode($response);
     171            die;
     172        }
     173    }
     174
     175    public function errorMessage()
     176    {
    165177        $homeUrl = get_site_url();
    166178        $sitemmapPath = $homeUrl . '/sitemap.xml';
    167179        $message = '<div class="update-nag">';
    168         $message .=  '
     180        $message .= '
    169181                          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>
    172184                    ';
    173185        $message .= '</div>';
     
    175187    }
    176188
    177     public function set_permission_status() {
     189    public function set_permission_status()
     190    {
    178191        $status = $_REQUEST['status'];
    179192        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'
    192207        );
    193208    }
    194209
    195     private function addToRobots(){
     210    private function addToRobots()
     211    {
    196212        $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');
    199215        fclose($file);
    200216    }
  • expresscurate/trunk/ExpressCurate_SocialManager.php

    r1191825 r1252098  
    2323    const PROFILE = 'profile_ids';
    2424    const MESSAGE = 'message';
     25    const PERMALINK = 'permalink';
    2526
    2627    private static $instance;
     
    115116        $allMessages = array();
    116117        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];
    123119            if (isset($message[self::APPROVED]) && $message[self::APPROVED] === true) {
    124120                $approved[$messageId] = $message;
     
    133129        update_post_meta($post_id, self::SOCIAL_APPROVED_POST_MESSAGES_META, $approved);
    134130        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));
    136132    }
    137133
     
    146142        foreach ($approvedPostMessages as $messageId => $message) {
    147143            $data = array();
     144            if(isset($message[self::PERMALINK])) {
     145                $permalink = $message[self::PERMALINK];
     146            }
    148147            $data[ExpressCurate_BufferClient::POST_FIELD_TEXT] = $message[self::MESSAGE] . $permalink;
    149148            $data[ExpressCurate_BufferClient::POST_FIELD_PROFILE] = $message[self::PROFILE];
  • expresscurate/trunk/css/expresscurate.css

    r1191825 r1252098  
    30523052.expresscurate_cat[type=radio]:checked + label:after,
    30533053.expresscurate_post_type[type=radio]:checked + label:after {
    3054     background: url("../images/feed_icons.svg") no-repeat -79px -24px;
     3054    background: url("../images/feed_icons.svg") no-repeat -72px -24px;
    30553055    background-size: auto 68px;
    30563056    visibility: visible;
     
    38303830            background-size: 13px auto;
    38313831            background-position: 150px -17px;
    3832             padding: 0px 20px 0 5px;
     3832            padding: 0 20px 0 5px;
    38333833        }
    38343834            .expresscurate_controls select option.expresscurate_filterOption{
     
    38503850            background-color: transparent;
    38513851            background-size: 50px auto;
    3852             margin: 0 10px 0 0;
     3852            margin: 0 5px 0 0;
    38533853            cursor: pointer !important;
    38543854        }
     
    38663866                background-color: transparent;
    38673867                background-size: auto 100px;
    3868                 background-position: -104px -35px;
     3868                background-position: -100px -35px;
    38693869                cursor: pointer;
    38703870                border: solid 1px #25bfa1;
    38713871            }
     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
    38723925.expresscurate_controls .check.disabled{
    38733926    background-position: -104px 6px;
     
    38763929}
    38773930.expresscurate_controls .check.active{
    3878     background-position: -104px -75px;
     3931    background-position: -100px -75px;
    38793932    background-color: #1cbb9f;
    38803933}
     
    38913944}
    38923945.expresscurate_controls .remove{
    3893     background-position: -52px 7px;
    38943946    border-left: none;
    38953947}
     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
    38963984
    38973985            .expresscurate_controls .quotes{
     
    38993987            }
    39003988            .expresscurate_controls .bookmark{
    3901                 background-position: -15px 7px;
     3989                background-position: -14px 7px;
    39023990            }
    39033991            .expresscurate_controls .remove{
    3904                 background-position: -50px 8px;
     3992                background-position: -46px 8px;
    39053993            }
    39063994            .expresscurate_feed_list .feedListControls .pull.disabled:hover,
     
    39103998            .expresscurate_feed_list .feedListControls .pull{
    39113999                /*background-position: -144px 6px;*/
    3912                 background-size: auto 99px;
     4000                background-size: auto 101px;
    39134001                margin-right: 10px;
    39144002            }
     
    39804068            }
    39814069            .expresscurate_controls .quotes.active:hover{
    3982                 background-position: 19px -59px;
     4070                background-position: 19px -57px;
    39834071                background-color: #1cbb9f;
    39844072                border-color: #1cbb9f;
    39854073            }
    39864074            .expresscurate_controls .bookmark.active:hover{
    3987                 background-position: -15px -60px;
     4075                background-position: -14px -58px;
    39884076                background-color: #1cbb9f;
    39894077                border-color: #1cbb9f;
    39904078            }
    39914079            .expresscurate_controls .remove.active:hover{
    3992                 background-position: -50px -59px;
     4080                background-position: -46px -57px;
    39934081                background-color: #1cbb9f;
    39944082                border-color: #1cbb9f;
    39954083            }
    39964084            .expresscurate_feed_list .feedListControls .pull:hover{
    3997                 background-position: -144px -74px;
     4085                background-position: -142px -74px;
    39984086                background-color: #1cbb9f;
    39994087            }
     
    40034091            }
    40044092            .expresscurate_controls .bookmark.active{
    4005                 background-position: -15px -26px;
     4093                background-position: -14px -26px;
    40064094            }
    40074095            .expresscurate_controls .remove.active{
    4008                 background-position: -50px -25px;
     4096                background-position: -46px -25px;
    40094097            }
    40104098            .expresscurate_feed_list .feedListControls .pull{
    4011                 background-position: -144px -33px;
     4099                background-position: -142px -33px;
    40124100                border-color: #1cbb9f;
    40134101            }
     
    41464234    border-bottom-color: #000;
    41474235    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;
    41484244}
    41494245
     
    42204316        .expresscurate_bookmarkBoxes .checkInput[type=checkbox]:checked + label,
    42214317        .expresscurate_feedBoxes .checkInput[type=checkbox]:checked + label{
    4222             background: url("../images/feed_icons.svg") no-repeat -86px 1px;
    4223             background-size: auto 72px;
     4318            background: url("../images/feed_icons.svg") no-repeat -75px -3px;
     4319            background-size: auto 73px;
    42244320        }
    42254321        .expresscurate_bookmarkBoxes li input[type=checkbox],
     
    54655561.expresscurate_SettingsError{
    54665562    font-size: 11px;
     5563    line-height: 13px;
    54675564    color: #e85e50;
    54685565    margin: 0;
  • expresscurate/trunk/css/theme-styles.css

    r1179063 r1252098  
    7474    overflow: hidden;
    7575    background-color:#F3F3F3;
    76     word-break: break-all;
    7776    text-align:justify;
    7877    color: #A39E9E;
     78    word-break: break-word;
    7979}
    8080.expresscurate_fl_text_box , .expresscurate_fr_text_box{
  • expresscurate/trunk/images/feed_icons.svg

    r1129694 r1252098  
    11<?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)  -->
    43<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>
    713<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"/>
    5379</g>
    5480</svg>
  • expresscurate/trunk/js/Settings.js

    r1179063 r1252098  
    217217                } else {
    218218                    className = 'expresscurate_SettingsError';
     219                    var webmasterResponse = data.message.message;
     220                    message = webmasterResponse ? webmasterResponse : data.message;
    219221                    if (data.status === 1) {
    220                         message = data.message;
    221222                        $autorize.removeClass('expresscurate_displayNone');
    222                     } else if (data.status === 2 || data.status === 3) {
    223                         message = data.message;
    224223                    }
    225224                }
  • expresscurate/trunk/js/bookmarks.js

    r1191825 r1252098  
    143143    }
    144144
     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
    145186    function setupBookmarks() {
    146187        $input = $('.addBookmark input');
     
    252293        });
    253294
    254         /*delete*/
     295        //delete bookmark
    255296        $('.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");
    258299        });
    259300        $bookmarkBoxes.on('click', '.controls .hide', function () {
    260301            var $elem = $(this).parents('.expresscurate_bookmarkBoxes > li');
    261             bookmarkDelete($elem);
    262         });
    263 
     302            openDeleteBookmark($elem,"clicked");
     303            //bookmarkDelete($elem);
     304        });
    264305        /*add*/
     306
    265307        $input.on("keyup", function (e) {
    266308            if (e.keyCode === 13) {
  • expresscurate/trunk/js/feed/contentFeed.js

    r1191825 r1252098  
    11var ExpressCurateFeedWall = (function ($) {
    2     var $notDefFeed, $feedControls, $masonryWrap, $feedBoxes;
     2    var $notDefFeed, $feedControls, $masonryWrap, $feedBoxes, $deleteDialog, $removeDialog, $restoreDialog;
    33
    44    function bookmarkAdd(els) {
     
    88
    99        $.each(els, function (index, el) {
    10             items.push(JSON.parse($(el).find('.expresscurate_feedData').text()));
     10            items.push($(el).find('.expresscurate_feedData').text());
    1111        });
    1212        $.ajax({
    1313            type: 'POST',
    1414            url: 'admin-ajax.php?action=expresscurate_bookmarks_add',
    15             data: {items: JSON.stringify(items)}
     15            data: {items: items}
    1616        });
    1717    }
     
    4545        ExpressCurateUtils.track('/content-feed/delete');
    4646
    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        }
    4956        $.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(); }
    5160            items.push(item);
    5261        });
    5362        $.ajax({
    5463            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',
    5693            data: {items: items}
    5794        }).done(function (res) {
     
    145182    }
    146183
     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
    147311    function setupFeed() {
    148312        var $blogFilter = $('#expresscurate_blogFilter'),
     
    151315        $feedControls = $('.feedListControls li');
    152316        $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");
    154321        $masonryWrap.masonry({
    155322            itemSelector: '.expresscurate_masonryItem',
     
    187354        /*delete*/
    188355        $('.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");
    193358        });
    194359        $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");
    198362        });
    199363
     
    214378            bookmarkAdd($elems);
    215379            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'));
    216408        });
    217409
  • expresscurate/trunk/js/socialPostWidget.js

    r1191825 r1252098  
    151151
    152152        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 : [];
    155155            $.each(data, function (index, value) {
    156156                posts.push(value);
  • expresscurate/trunk/readme.txt

    r1191825 r1252098  
    44Donate link: https://bit.ly/expresscuratedonate
    55Requires at least: 3.9
    6 Tested up to: 4.2.2
    7 Stable tag: 2.1.3
     6Tested up to: 4.3.1
     7Stable tag: 2.1.4
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl.html
     
    132132== Changelog ==
    133133
     134= 2.1.4 =
     135* Wordpress 4.3 supported now.
     136* Miscellaneous bug fixes and improvements.
     137
    134138= 2.1.3 =
    135139* Welcome to ExpressCurate! widget with useful getting started links and resources.
  • expresscurate/trunk/templates/bookmarks.php

    r1191825 r1252098  
    119119                        </li>
    120120                        <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 } ?>
    123127                        <li class="copyURL">Copy URL</li>
    124128                        <li class="separator">-</li>
     
    168172                <li><a class="curate" href="post-new.php?expresscurate_load_source={{data.curateLink}}">Curate</a></li>
    169173                <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 } ?>
    172180                <li class="copyURL">Copy URL</li>
    173181                <li class="separator">-</li>
  • expresscurate/trunk/templates/dashboard/welcome_widget.php

    r1191825 r1252098  
    33        <p>Here are a couple of useful links to help you get started:</p>
    44        <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>
    99        </ul>
    1010    </div>
  • expresscurate/trunk/templates/feed_dashboard.php

    r1137344 r1252098  
    22$feedManager = new ExpressCurate_FeedManager();
    33$feed_list = $feedManager->get_rss_list();
     4$nextPullTime = human_time_diff(time(),wp_next_scheduled('expresscurate_pull_feeds'));
    45?>
    56
  • expresscurate/trunk/templates/feed_list.php

    r1191825 r1252098  
    3939}
    4040
    41 $nextPullTime = human_time_diff(wp_next_scheduled('expresscurate_pull_feeds'), time());
     41$nextPullTime = human_time_diff(time(),wp_next_scheduled('expresscurate_pull_feeds'));
    4242?>
    4343<input id="adminUrl" type="hidden" value="<?php echo get_admin_url(); ?>"/>
     
    9696                    </li>
    9797                <?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"/>
    98105                <li class="layout expresscurate_floatRight">
    99106                    <span class="tooltip"><?php if (get_option('expresscurate_bookmark_layout', '') == 'single') {
     
    165172                    </li>
    166173                    <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 } ?>
    169180                    <li class="bookmark">Bookmark</li>
    170181                    <li class="separator">-</li>
  • expresscurate/trunk/templates/settings.php

    r1191825 r1252098  
    180180                                       echo '';
    181181                                   }
    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=""/>
    183197                        </div>
    184198                    </li>
  • expresscurate/trunk/templates/sitemap.php

    r1179063 r1252098  
    11<h2 class="expresscurate_displayNone">Sitemap.xml</h2>
    22<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');?>
    77
    88    <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(); ?>
    12202    </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" <?php
    20         if (get_option('expresscurate_sitemap_generation_interval') == 'always') {
    21             echo 'selected="selected"';
    22         }
    23         ?>>On every Post
    24         </option>
    25         <option value="daily" <?php
    26         if (get_option('expresscurate_sitemap_generation_interval') == 'daily') {
    27             echo 'selected="selected"';
    28         }
    29         ?>>Daily
    30         </option>
    31         <option value="weekly" <?php
    32         if (get_option('expresscurate_sitemap_generation_interval') == 'weekly') {
    33             echo 'selected="selected"';
    34         }
    35         ?>>Weekly
    36         </option>
    37         <option value="monthly" <?php
    38         if (get_option('expresscurate_sitemap_generation_interval') == 'monthly') {
    39             echo 'selected="selected"';
    40         }
    41         ?>>Monthly
    42         </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" --><?php
    62 //        if (get_option('expresscurate_sitemap_default_priority') == 'manual') {
    63 //            echo 'selected="selected"';
    64 //        }
    65 //        ?>
    66 <!--manual-->
    67 <!--        </option>-->
    68 <!---->
    69 <!--        <option value="automatic" --><?php
    70 //        if (get_option('expresscurate_sitemap_default_priority') == 'automatic') {
    71 //            echo 'selected="selected"';
    72 //        }
    73 //        ?>
    74 <!--automatic-->
    75 <!--        </option>-->
    76 <!--    </select>-->
    77 <!--</li>-->
    78 <?php
    79     $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" <?php
    112         if (get_option('expresscurate_sitemap_archiving') == 'week') {
    113             echo 'selected="selected"';
    114         }
    115         ?>>1 week
    116         </option>
    117 
    118         <option value="month" <?php
    119         if (get_option('expresscurate_sitemap_archiving') == 'month') {
    120             echo 'selected="selected"';
    121         }
    122         ?>>1 month
    123         </option>
    124 
    125         <option value="year" <?php
    126         if (get_option('expresscurate_sitemap_archiving') == 'year') {
    127             echo 'selected="selected"';
    128         }
    129         ?>>1 year
    130         </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" <?php
    144             if (get_option('expresscurate_sitemap_submit_frequency') == 'always') {
    145                 echo 'selected="selected"';
    146             }
    147             ?>>On every Post
    148             </option>
    149             <option value="daily" <?php
    150             if (get_option('expresscurate_sitemap_submit_frequency') == 'daily') {
    151                 echo 'selected="selected"';
    152             }
    153             ?>>Daily
    154             </option>
    155             <option value="weekly" <?php
    156             if (get_option('expresscurate_sitemap_submit_frequency') == 'weekly') {
    157                 echo 'selected="selected"';
    158             }
    159             ?>>Weekly
    160             </option>
    161             <option value="monthly" <?php
    162             if (get_option('expresscurate_sitemap_submit_frequency') == 'monthly') {
    163                 echo 'selected="selected"';
    164             }
    165             ?>>Monthly
    166             </option>
    167         </select>
    168         <?php
    169         $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>
    178203</form>
Note: See TracChangeset for help on using the changeset viewer.