Plugin Directory

Changeset 1140784


Ignore:
Timestamp:
04/21/2015 02:52:21 PM (11 years ago)
Author:
expresscurate
Message:

new version v2.0.12 with changes:

  • Content Feed pull is fixed.
  • Sitemap Submit is fixed.
  • Other miscellaneous bug fixes and improvements.
Location:
expresscurate/trunk
Files:
3 added
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • expresscurate/trunk/ExpressCurate.php

    r1137344 r1140784  
    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.0.11
     7  Version: 2.0.12
    88  Author: ExpressCurate
    99  Author URI: http://www.expresscurate.com
     
    117117  }
    118118
    119 
    120 
    121   function extract_google_feed_url($url,$row=null){
    122       if(strpos(parse_url($url,PHP_URL_SCHEME)."://www.google.com/url",$url)==0 && !empty($row)) {
    123           $url_query = explode("&",parse_url($url,PHP_URL_QUERY));
    124           foreach($url_query as $param) {
    125               if(strpos($param, 'url=') === 0) {
    126                   if (!array_key_exists(str_replace("url=", "", $param), $row)){
    127                       $output_url = str_replace("url=", "", $param);
    128                   }
    129                   else{
    130                       unset($row[$url]);
    131                   }
    132                   break;
    133               }
    134           }
    135       }
    136       return $output_url;
    137   }
    138 
    139119  function cron_add_5min($schedules) {
    140120    $schedules['5min'] = array(
  • expresscurate/trunk/ExpressCurate_Actions.php

    r1137344 r1140784  
    7171        add_action('init', array(&$this, 'buttons')); //'wpc_buttons'
    7272        add_action('init', array(&$this, 'include_api'));
    73         add_action('init',array(&$this,'add_oembed_facebook'));
     73        add_action('init', array(&$this, 'add_oembed_facebook'));
    7474
    7575        add_filter('manage_edit-post_columns', array(&$this, 'curated_column_register'));
     
    125125        add_action('wp_ajax_expresscurate_export_api_send_google_key', array($this->ajaxExportAPI, 'send_google_key'));
    126126
    127         add_action('wp_ajax_expresscurate_get_article', array($this->contentManager, 'get_article'));
     127        add_action('wp_ajax_expresscurate_get_article', array($this->contentManager, 'getArticle'));
    128128        add_action('wp_ajax_expresscurate_keywords_get_post_keyword_stats', array($this->keywords, 'get_post_keyword_stats'));
    129129        add_action('wp_ajax_expresscurate_keywords_add_post_keyword', array($this->keywords, 'add_post_keyword'));
     
    216216        register_setting('expresscurate-smartpublish-group', 'expresscurate_manually_approve_smart');
    217217        register_setting('expresscurate-smartpublish-group', 'expresscurate_hours_interval');
     218        register_setting('expresscurate-smartpublish-group', 'expresscurate_social_publishing');
    218219        register_setting('expresscurate-sitemap-group', 'expresscurate_sitemap_generation_interval');
    219220        register_setting('expresscurate-sitemap-group', 'expresscurate_sitemap_include_new_posts');
     
    236237    }
    237238
    238     function add_oembed_facebook(){
    239         wp_oembed_add_provider( 'http://www.facebook.com/*', 'http://api.embed.ly/v1/api/oembed');
     239    function add_oembed_facebook()
     240    {
     241        wp_oembed_add_provider('http://www.facebook.com/*', 'http://api.embed.ly/v1/api/oembed');
    240242    }
    241243
     
    293295        array_push($buttons, 'righttextbox');
    294296        array_push($buttons, 'noFollow');
    295         if(get_option('expresscurate_seo', '') == "on"){
     297        if (get_option('expresscurate_seo', '') == "on") {
    296298            array_push($buttons, 'wordCount');
    297299        }
    298300        array_push($buttons, 'addKeyword');
     301        array_push($buttons, 'clearContent');
    299302        return $buttons;
    300303    }
     
    377380            return;
    378381        $curated = get_post_meta($post_id, '_is_expresscurate', true);
    379         //$cloned = get_post_meta($post_id, '_expresscurate_advanced_seo_post_copy', true);
    380         //if($cloned=='on'){
    381            // $curated = '<em>' . __('Cloned', self::PLUGIN_FOLDER) . '</em>';
    382        // }else{
     382        $cloned = get_post_meta($post_id, '_expresscurate_advanced_seo_post_copy', true);
     383        if ($cloned == 'on') {
     384            $curated = '<em>' . __('Cloned', self::PLUGIN_FOLDER) . '</em>';
     385        } else {
    383386            if ($curated == 1) {
    384387                $curated = '<em>' . __('Yes', self::PLUGIN_FOLDER) . '</em>';
     
    386389                $curated = '<em>' . __('No', self::PLUGIN_FOLDER) . '</em>';
    387390            }
    388        // }
     391        }
    389392        echo $curated;
    390393    }
     
    619622            $this->generate_sitemap();
    620623        }
    621         if ("publish" == $new_status && "publish" != $old_status && (!empty($_POST['expresscurate_sources']) || get_post_meta($post->ID, '_is_expresscurate', true)==1)) {
     624        if ("publish" == $new_status && "publish" != $old_status && (!empty($_POST['expresscurate_sources']) || get_post_meta($post->ID, '_is_expresscurate', true) == 1)) {
    622625            update_option('expresscurate_changed_post_status', 'publish');
    623626        }
     
    10271030    {
    10281031        $seo = get_option('expresscurate_seo', '') == 'on';
     1032        $social = get_option('expresscurate_social_publishing', '') == 'on';
    10291033        $post_types = array('post', 'page');
    10301034        $post_types = array_merge($post_types, get_post_types(array('_builtin' => false, 'public' => true), 'names'));
     
    10351039                add_meta_box('expresscurate_advanced_seo', ' Advanced SEO', array(&$this, 'advanced_seo'), $post_type, 'normal', 'high');
    10361040            }
     1041            /*if($social) {
     1042                add_meta_box('expresscurate_social_publishing', ' Social Posts', array(&$this, 'social_posts'), $post_type, 'normal', 'high');
     1043            }*/
    10371044        }
    10381045    }
     
    10571064
    10581065    <?php
     1066    }
     1067   
     1068    public function social_posts()
     1069    {
     1070        ?>
     1071        <div id="expresscurate_social_posts_widget" class="expresscurate_social_posts_widget">
     1072            <?php include(sprintf("%s/templates/social_posts_widget.php", dirname(__FILE__))); ?>
     1073        </div>
     1074        <?php
    10591075    }
    10601076
     
    12381254        }
    12391255        $_SESSION['sitemap_token'] = false;
    1240         /* if(get_option('expresscurate_seo', '' == "on") && get_option('expresscurate_sitemap_submit_webmasters') == 'on'){
    1241            // $googleAuth = new ExpressCurate_GoogleAuth();
    1242             // $responseToken = $googleAuth->getGoogleToken();
    1243              $responseToken =  get_option('expresscurate_google_refresh_token');
    1244              if($responseToken){
    1245                  $_SESSION['sitemap_token'] = true;
    1246              }
    1247          }*/
    12481256
    12491257        // Render the settings template
     
    16081616        $expresscurateWebsiteUrl = self::EXPRESSCURATE_URL;
    16091617        if (strlen(get_option('expresscurate_google_refresh_token')) < 3 && get_option('expresscurate_sitemap_submit') == 'on') {
    1610             $warnings[] = '<p>Authorise access to Google Webmasters. <a class="expresscurateLink" href="' . $expresscurateWebsiteUrl . 'api/getsitemapkey/' . $blogName . '">Authorize </a>  |  <a class="expresscurateLink" href="options-general.php?page=expresscurate_settings"> Sitemap Settings </a></p>';
     1618            $warnings[] = '<p>Authorise access to Google Webmaster Tools. <a class="expresscurateLink" href="' . $expresscurateWebsiteUrl . 'api/connector/google/webmasters/refreshtoken/' . $blogName . '">Authorize </a>  |  <a class="expresscurateLink" href="options-general.php?page=expresscurate_settings"> Sitemap Settings </a></p>';
    16111619        }
    16121620
  • expresscurate/trunk/ExpressCurate_ContentManager.php

    r1137344 r1140784  
    3535      }
    3636
    37       public function get_article($url = false, $echo = true) {
    38         if(!ExpressCurate_HtmlParser::supportsDownload()){
     37      public function getArticle($url = false, $echo = true) {
     38        if(!ExpressCurate_HtmlParser::supportsDownload()) {
    3939          echo json_encode(array('status' => 'error', 'error' => 'You should activate either curl extension or allow_url_fopen setting.'));
    4040          die;
    41         }else{
     41        } else {
    4242          if (!$url) {
    4343            $url = $this->_post('expresscurate_source', '');
  • expresscurate/trunk/ExpressCurate_FeedManager.php

    r1137344 r1140784  
    6969
    7070                        // construct the rss data
    71                         $curated_links_rss[$link]['feed_url'] = $result['feed_url'] = $rssUrl;
    72                         $curated_links_rss[$link]['link'] = $result['link'] = $link;
    73                         $curated_links_rss[$link]['post_count'] = $result['post_count'] = count($metas);
    74                         $curated_links_rss[$link]['feed_title'] = $result['feed_title'] = $feedMeta['title'];
     71                        $curated_links_rss[$rssUrl]['feed_url'] = $result['feed_url'] = $rssUrl;
     72                        $curated_links_rss[$rssUrl]['link'] = $result['link'] = $link;
     73                        $curated_links_rss[$rssUrl]['post_count'] = $result['post_count'] = count($metas);
     74                        $curated_links_rss[$rssUrl]['feed_title'] = $result['feed_title'] = $feedMeta['title'];
    7575                       
    7676                        // save
     
    425425            // save the latest feed
    426426            $feed_content = json_encode(array('date' => date('Y-m-d H:i:s'), 'content' => $feed_array));
    427            // update_option('expresscurate_feed_content', $feed_content);
     427            update_option('expresscurate_feed_content', $feed_content);
    428428            return $feed_content;
    429429        }
     
    454454            $protocol = $parsedLink['scheme'];
    455455            if (strpos($protocol . "://www.google.com/url", $url) == 0) {
     456                $query = $parsedLink['query'];
    456457                $url_query = explode("&", $query);
    457458                foreach ($url_query as $param) {
     
    525526       
    526527        // reschedule the cronjob
    527         if(!empty($feeds['content'])) {
    528             wp_clear_scheduled_hook('expresscurate_pull_feeds');
    529             $pull_feed_interval = (get_option('expresscurate_pull_hours_interval')) ? get_option('expresscurate_pull_hours_interval') : 1;
    530             wp_schedule_event(strtotime("+" . $pull_feed_interval . " hour"), 'hourly', 'expresscurate_pull_feeds');
    531             $feeds["minutes_to_next_pull"] = human_time_diff(wp_next_scheduled('expresscurate_pull_feeds'), time());
    532         }
     528        //if(!empty($feeds['content'])) {
     529        wp_clear_scheduled_hook('expresscurate_pull_feeds');
     530        $pull_feed_interval = (get_option('expresscurate_pull_hours_interval')) ? get_option('expresscurate_pull_hours_interval') : 1;
     531        wp_schedule_event(strtotime("+" . $pull_feed_interval . " hour"), 'hourly', 'expresscurate_pull_feeds');
     532        $feeds["minutes_to_next_pull"] = human_time_diff(wp_next_scheduled('expresscurate_pull_feeds'), time());
     533        //}
    533534       
    534535        // return
     
    638639                $bookmarks = array();
    639640            }
    640             $exists_url = array();
    641             foreach ($bookmarks as $bookmark) {
    642                 $exists_url[] = $bookmark['link'];
    643             }
     641
    644642            foreach ($items as $item) {
    645 
    646                 if (!in_array($item['link'], $exists_url)) {
     643                $bookmarkURL = $item['link'];
     644                if (isset($bookmarks[$bookmarkURL])) {
     645                        $result[$bookmarkURL]['status'] = 'warning';
     646                }else {
    647647                    $current_user = wp_get_current_user();
    648648                    $item['user'] = $current_user->display_name;
    649                     $this->collect_bookmark($bookmarks, $item);
    650                     $result[$item['link']]['status'] = 'success';
    651                 } else {
    652                     if ($bookmark['comment']) {
    653                         $bookmarks[$item['link']]['comment'] = $bookmark['comment'];
    654                         $result[$item['link']]['status'] = 'success';
    655                     } else {
    656                         $result[$item['link']]['status'] = 'warning';
    657                     }
    658                 }
    659             }
    660             $bookmarks = json_encode($bookmarks);
    661             update_option('expresscurate_bookmarks', $bookmarks);
     649                   
     650                    $this->collectBookmark($bookmarks, $item);
     651                   
     652                    $result[$bookmarkURL]['status'] = 'success';
     653                }
     654            }
     655           
     656            // save the updated bookmarks
     657            update_option('expresscurate_bookmarks', json_encode($bookmarks));
    662658        } else {
    663659            $result['status'] = 'error';
     
    671667        $data = $_REQUEST;
    672668        $result = array();
    673         if(!ExpressCurate_HtmlParser::supportsDownload()){
     669        if(!ExpressCurate_HtmlParser::supportsDownload()) {
    674670            $result['status'] = 'error';
    675671            $result['msg'] = 'You should activate either curl extension or allow_url_fopen setting.';
    676         }else {
     672        } else {
     673            // check if the url to bookmark is specified
    677674            if (isset($data['url'])) {
     675                // get the url
     676                $bookmarkURL = $data['url'];
     677               
     678                // clean-up the provided url
     679                // parse the post url
     680                $parsedLink = parse_url($bookmarkURL);
     681           
     682                // google alerts supportbookmarkURL   // check for google redirect urls and pick up the original post link
     683                $protocol = $parsedLink['scheme'];
     684                if (strpos($protocol . "://www.google.com/url", $bookmarkURL) == 0) {
     685                    $query = $parsedLink['query'];
     686                    $url_query = explode("&", $query);
     687                    foreach ($url_query as $param) {
     688                        if (strpos($param, 'url=') === 0) {
     689                            $bookmarkURL = str_replace("url=", "", $param);
     690                            $bookmarkURL = urldecode($bookmarkURL);
     691                            break;
     692                        }
     693                    }
     694                }
     695               
     696                // read the existing bookmarks
    678697                $bookmarks = get_option('expresscurate_bookmarks', '');
    679                 $data_url = $data['url'];
    680698                if ($bookmarks) {
    681699                    $bookmarks = json_decode($bookmarks, true);
     
    683701                    $bookmarks = array();
    684702                }
    685                 $exists_url = array();
    686                 foreach ($bookmarks as $bookmark) {
    687                     $exists_url[] = $bookmark['link'];
    688                 }
    689 
    690                 $extracted_url = extract_google_feed_url($data_url, $bookmarks);
    691                 if ($extracted_url) {
    692                     $data_url = $extracted_url;
    693                 }
    694                 $data_url = expresscurate_normalise_url($data_url, true);
    695 
    696                 if (!in_array($data_url, $exists_url)) {
    697 
     703               
     704                // check if the provided url is already bookmarked
     705                if (isset($bookmarks[$bookmarkURL])) {
     706                    // is a new comment provided?
     707                    if (isset($data['comment'])) {
     708                        // save the new comment
     709                        $bookmarks[$bookmarkURL]['comment'] = $data['comment'];
     710                       
     711                        // construct the result
     712                        $result['status'] = 'success';
     713                        $result['result'] = $bookmarkURL;
     714                       
     715                        // save the updated bookmarks
     716                        update_option('expresscurate_bookmarks', json_encode($bookmarks));
     717                    } else {
     718                        // construct the result
     719                        // nothing to do, and url is already bookmarked
     720                        $result['status'] = 'error';
     721                        $result['msg'] = 'This page is already bookmarked.';
     722                    }
     723                } else {
     724                    // the page is new, bookmark
     725                    // load the article
    698726                    $contentManager = new ExpressCurate_ContentManager();
    699                     $article = $contentManager->get_article($data_url, false);
     727                    $article = $contentManager->getArticle($bookmarkURL, false);
     728                   
     729                    // check if the article is loaded successfully
    700730                    if (isset($article['status']) && $article['status'] == 'success') {
     731                        // get the comment
    701732                        $comment = isset($data['comment']) ? $data['comment'] : '';
     733                       
     734                        // set the type and author
    702735                        $article['type'] = isset($data['type']) ? $data['type'] : 'user';
    703736                        $current_user = wp_get_current_user();
    704737                        $article['result']['user'] = $current_user->display_name;
    705                         $this->collect_bookmark($bookmarks, $article, $data_url, $comment);
     738                       
     739                        // ...
     740                        $this->collectBookmark($bookmarks, $article, $bookmarkURL, $comment);
     741                       
     742                        // construct the result
    706743                        $result['status'] = 'success';
    707                         $result['result'] = $bookmarks[$data_url];
    708                         $result['result']['curateLink'] = base64_encode(urlencode($data_url));
    709                         $bookmarks = json_encode($bookmarks);
    710                         update_option('expresscurate_bookmarks', $bookmarks);
     744                        $result['result'] = $bookmarks[$bookmarkURL];
     745                        $result['result']['curateLink'] = base64_encode(urlencode($bookmarkURL));
     746                       
     747                        // save the updated bookmarks
     748                        update_option('expresscurate_bookmarks', json_encode($bookmarks));
    711749                    } else {
    712750                        if (isset($article['status'])) {
     
    717755                            $result['msg'] = 'Article does not exists.';
    718756                        }
    719 
    720                     }
    721                 } else {
    722                     if (isset($data['comment'])) {
    723                         $bookmarks[$data['url']]['comment'] = $data['comment'];
    724                         $result['result'] = $bookmarks[$data_url];
    725                         $bookmarks = json_encode($bookmarks);
    726                         update_option('expresscurate_bookmarks', $bookmarks);
    727                         $result['status'] = 'success';
    728                     } else {
    729                         $result['status'] = 'error';
    730                         $result['msg'] = 'This page is already bookmarked.';
    731757                    }
    732758                }
    733759            } else {
    734760                $result['status'] = 'error';
     761                $result['msg'] = 'Please, provide URL to bookmark.';
    735762            }
    736763        }
     
    738765        die;
    739766    }
    740 
    741     public function get_bookmark()
    742     {
    743         $data = $_REQUEST;
    744         $result = array();
    745         $bookmark = '';
    746         if (isset($data['url'])) {
    747             $bookmarks = get_option('expresscurate_bookmarks', '');
    748             if ($bookmarks) {
    749                 $bookmarks = json_decode(stripslashes($bookmarks), true);
    750             } else {
    751                 $bookmarks = array();
    752             }
    753             if (isset($bookmarks[$data['url']])) {
    754                 $bookmark = $bookmarks[$data['url']];
    755                 if ($bookmark) {
    756                     $result['status'] = 'success';
    757                     $result['data'] = $bookmark;
    758                 } else {
    759                     $result['status'] = 'warning';
    760                     $result['msg'] = 'Bookmark not found';
    761                 }
    762             }
    763         } else {
    764             $result['status'] = 'error';
    765             $result['msg'] = 'Url is empty';
    766         }
    767         echo json_encode($result,JSON_UNESCAPED_SLASHES);
    768         die;
    769     }
    770 
    771     private function collect_bookmark(&$bookmarks, $item, $url = null, $comment = '')
    772     {
     767   
     768    private function collectBookmark(&$bookmarks, $item, $url = null, $comment = '') {
    773769        if ($url) {
    774770            if (isset($item['result']) && isset($item['result']['title'])) {
    775                 $url = expresscurate_normalise_url($url, true);
     771                // create the new bookmark
    776772                $bookmark = array();
    777773                $bookmark['link'] = $url;
     
    784780                $bookmark['keywords'] = array();
    785781                $bookmark['media'] = $item['result']['media'];
    786                 $bookmark['type'] = isset($item['result']['type']) ? $item['type'] : 'user';
    787782                $bookmark['comment'] = $comment;
    788783                $bookmark['curated'] = 0;
     784               
     785                $bookmark['type'] = isset($item['result']['type']) ? $item['type'] : 'user';
     786               
     787                // add the bookmark to the list
    789788                $bookmarks[$url] = $bookmark;
    790789            }
     
    796795                $item['comment'] = $comment;
    797796                $item['bookmark_date'] = date('Y-m-d H:i:s');
     797               
    798798                $bookmarks[$item['link']] = $item;
    799799            }
    800800        }
     801    }
     802
     803    public function get_bookmark()
     804    {
     805        $data = $_REQUEST;
     806        $result = array();
     807        $bookmark = '';
     808        if (isset($data['url'])) {
     809            $bookmarks = get_option('expresscurate_bookmarks', '');
     810            if ($bookmarks) {
     811                $bookmarks = json_decode(stripslashes($bookmarks), true);
     812            } else {
     813                $bookmarks = array();
     814            }
     815            if (isset($bookmarks[$data['url']])) {
     816                $bookmark = $bookmarks[$data['url']];
     817                if ($bookmark) {
     818                    $result['status'] = 'success';
     819                    $result['data'] = $bookmark;
     820                } else {
     821                    $result['status'] = 'warning';
     822                    $result['msg'] = 'Bookmark not found';
     823                }
     824            }
     825        } else {
     826            $result['status'] = 'error';
     827            $result['msg'] = 'Url is empty';
     828        }
     829        echo json_encode($result,JSON_UNESCAPED_SLASHES);
     830        die;
    801831    }
    802832
     
    928958            } else {
    929959                $contentManager = new ExpressCurate_ContentManager();
    930                 $article = $contentManager->get_article($data['url'], false);
     960                $article = $contentManager->getArticle($data['url'], false);
    931961                $result['status'] = $article['status'];
    932962                if ($article['status'] == 'success') {
  • expresscurate/trunk/ExpressCurate_HtmlParser.php

    r1137344 r1140784  
    304304    private static function sanitizeContent($content)
    305305    {
    306         $content = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content);
    307         $content = preg_replace('/<--[\S\s]*?-->/msi', '', $content);
    308         $content = preg_replace('/(<noscript[^>]*>|<\/noscript>)/msi', '', $content);
    309         $content = preg_replace('~>\s+<~', '><', $content);
    310         $content = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $content);
     306        //$content = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content);
     307        //$content = preg_replace('/<--[\S\s]*?-->/msi', '', $content);
     308        //$content = preg_replace('/(<noscript[^>]*>|<\/noscript>)/msi', '', $content);
     309        //$content = preg_replace('~>\s+<~', '><', $content);
     310        //$content = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $content);
    311311
    312312        $content = preg_replace('/^.*(?=<html>)/i', '', $content);
     
    327327            $this->removeElementsByTagName('style', $dom);
    328328            $this->removeElementsByTagName('link', $dom);
     329            $this->removeElementsByTagName('nocript', $dom);
    329330
    330331            // assign
     
    569570
    570571        // TODO this is a new xpath with the new modified dom, not sure if this is required if dom is passed with a reference
    571         $imgTags = $this->xpath->query(".//img",$this->article);
     572        $imgTags = $this->xpath->query(".//img", $this->article);
    572573        $i = 0;
    573574        foreach ($imgTags as $t) {
     
    598599        }
    599600        //get H1
    600         $h1Tag = $this->xpath->query(".//h1",$this->article);
     601        $h1Tag = $this->xpath->query(".//h1", $this->article);
    601602        foreach ($h1Tag as $h1) {
    602603            if (strlen($h1->nodeValue) > 3) {
     
    605606            $h1->parentNode->removeChild($h1);
    606607        }
     608        // TODO add bullets
    607609        //get H2
    608         $h2Tag = $this->xpath->query(".//h2",$this->article);
     610        $h2Tag = $this->xpath->query(".//h2", $this->article);
    609611        foreach ($h2Tag as $h2) {
    610612            if (strlen($h2->nodeValue) > 3) {
     
    614616        }
    615617        //get H3
    616         $h3Tag = $this->xpath->query(".//h3",$this->article);
     618        $h3Tag = $this->xpath->query(".//h3", $this->article);
    617619        foreach ($h3Tag as $h3) {
    618620            if (strlen($h3->nodeValue) > 3) {
     
    621623            $h3->parentNode->removeChild($h3);
    622624        }
    623         //get text
    624         /*$i = 0;
    625         $articleTags = $this->xpath->query('/html/body/article');
    626         foreach ($articleTags as $t) {
    627             $result_paragraphs[$i]['value'] = strip_tags(trim($t->nodeValue));
    628             $result_paragraphs[$i]['tag'] = 'article';
    629             $t->parentNode->removeChild($t);
     625
     626        // reset cursor for paragraphs
     627        $i = 0;
     628
     629        // get blockquotes
     630        $blockquoteTag = $this->xpath->query(".//blockquote", $this->article);
     631        foreach ($blockquoteTag as $blockquote) {
     632            $result_paragraphs[$i]['value'] = trim(strip_tags($blockquote->nodeValue));
     633            $result_paragraphs[$i]['tag'] = 'blockquote';
    630634            $i++;
    631         }*/
    632 
    633 
    634         $textTags = $this->xpath->query('//text()',$this->article);
     635           
     636            $blockquote->parentNode->removeChild($blockquote);
     637        }
     638       
     639        // get paragraphs
     640        $paragraphTag = $this->xpath->query(".//p", $this->article);
     641        foreach ($paragraphTag as $paragraph) {
     642            $result_paragraphs[$i]['value'] = trim(strip_tags($paragraph->nodeValue));
     643            $result_paragraphs[$i]['tag'] = 'p';
     644            $i++;
     645           
     646            $paragraph->parentNode->removeChild($paragraph);
     647        }
     648
     649        // get to floating texts
     650        $textTags = $this->xpath->query('//text()', $this->article);
    635651        foreach ($textTags as $t) {
    636             if ($t->length > 15 && $t->parentNode->tagName != 'a' && $t->parentNode->tagName != 'h1' && $t->parentNode->tagName != 'h2' && $t->parentNode->tagName != 'h3') {
    637                 if ($t->parentNode->nodeName == "blockquote" || $t->parentNode->parentNode->nodeName == "blockquote" || $t->parentNode->parentNode->parentNode->nodeName == "blockquote") {
    638                     if ($t->parentNode->nodeName == "blockquote") {
    639                         $result_paragraphs[$i]['value'] = strip_tags($t->parentNode->nodeValue);
    640                     } elseif ($t->parentNode->parentNode && $t->parentNode->parentNode->nodeName == "blockquote") {
    641                         $result_paragraphs[$i]['value'] = strip_tags($t->parentNode->parentNode->nodeValue);
    642                     } elseif ($t->parentNode->parentNode->parentNode && $t->parentNode->parentNode->parentNode->nodeName == "blockquote") {
    643                         $result_paragraphs[$i]['value'] = strip_tags($t->parentNode->parentNode->parentNode->nodeValue);
    644                     }
    645                     $result_paragraphs[$i]['tag'] = "blockquote";
    646                 } else {
    647                     $result_paragraphs[$i]['value'] = strip_tags($t->nodeValue);
    648                     $result_paragraphs[$i]['tag'] = $t->parentNode->nodeName;
    649                 }
    650                 $i++;
    651             }
     652            $result_paragraphs[$i]['value'] = strip_tags($t->nodeValue);
     653            $result_paragraphs[$i]['tag'] = $t->parentNode->nodeName;
     654            $i++;
    652655        }
    653656
    654657        //author
    655658        $article_author = '';
    656         $author = $this->xpath->query('.//*[@rel="author"][1]',$this->article)->item(0);
     659        $author = $this->xpath->query('.//*[@rel="author"][1]', $this->article)->item(0);
    657660        if ($author) {
    658661            $article_author = $author->nodeValue;
     
    660663        //date
    661664        $article_date = '';
    662         $date = $this->xpath->query('.//*[@datetime][1]',$this->article)->item(0);
     665        $date = $this->xpath->query('.//*[@datetime][1]', $this->article)->item(0);
    663666        if ($date) {
    664667            $article_date = $date->nodeValue;
    665668        }
    666 
    667669
    668670        //smart tags
  • expresscurate/trunk/ExpressCurate_Sitemap.php

    r1137344 r1140784  
    4545            $this->generateSitemap();
    4646        }
    47 
    48 
    4947    }
    5048
     
    6765            $this->submitToGoogle();
    6866        }
    69 
    70 
    7167    }
    7268
     
    151147    public function submitToGoogle()
    152148    {
    153         $googleAuth = new ExpressCurate_GoogleAuth();
     149        $googleAuth = new ExpressCurate_GoogleClient();
    154150        $submitToWebmastersStatus = get_option('expresscurate_sitemap_submit');
    155151        if ($submitToWebmastersStatus) {
    156             $response = $googleAuth->getAccessToken();
     152            //$response = $googleAuth->getAccessToken();
     153            $response = $googleAuth->accessToken();
    157154            if ($response) {
    158                 $response = $googleAuth->submit_sitemap(get_site_url(), get_site_url() . '/sitemap.xml');
    159                  return $response;
     155                $response = $googleAuth->submitSitemap(get_site_url(), get_site_url() . '/sitemap.xml');
     156                echo json_encode($response);
     157                die;
    160158            } else {
    161                 // @TODO notify user to get key
     159                $response = array('status'=> 3,'message' => 'ExpressCurate shall be authorized to access to Google Webmaster Tools.');
    162160            }
    163161       }
  • expresscurate/trunk/autoload.php

    r1137344 r1140784  
    3737//require_once 'ExpressCurate_HtmlParser.php';
    3838//require_once 'ExpressCurate_Date.php';
    39 //require_once 'ExpressCurate_GoogleAuth.php';
     39//require_once 'ExpressCurate_GoogleClient.php';
    4040//require_once 'ExpressCurate_SmartPublish.php';
    4141//require_once 'ExpressCurate_Tracker.php';
  • expresscurate/trunk/css/expresscurate.css

    r1137344 r1140784  
    19351935    height: 39px;
    19361936    width: 153px;
     1937    margin-left: 10px;
    19371938    cursor: pointer;
    19381939}
     
    28922893.expresscurate .tab-content > div{
    28932894    min-height: 70vh;
    2894     max-width: 700px;
     2895    max-width: 800px;
    28952896}
    28962897.expresscurate_advancedSEO_widget .tab-link.disabled,
     
    50465047}
    50475048
     5049.expresscurate_SettingsError{
     5050    font-size: 11px;
     5051    color: #e85e50;
     5052    margin: 0;
     5053}
     5054.expresscurate_SettingsSuccess{
     5055    font-size: 11px;
     5056    color: #1cbb9f;
     5057    margin: 0;
     5058}
  • expresscurate/trunk/js/Buttons.js

    r1129694 r1140784  
    305305        }
    306306    }
    307     function checkSocialTab(){
     307
     308    function checkSocialTab() {
    308309        var $this = $('#expresscurate_socialEmbed'),
    309310            content = $this.val().trim(),
     
    318319        });
    319320    }
     321
    320322    function setupButtons() {
    321323        var $page = $('html');
     
    351353                    onclick: function () {
    352354                        checkSocialTab();
    353                         var $input=$('#expresscurate_socialEmbed'),
     355                        var $input = $('#expresscurate_socialEmbed'),
    354356                            insertedValue = $input.val().trim(),
    355357                            selectedTab = $('.expresscurate_socialDialog .tabs li.current').data('tab');
     
    366368                        } else {
    367369                            var $elem,
    368                                 url='';
     370                                url = '';
    369371                            switch (selectedTab) {
    370372                                case 'facebook':
     
    395397                                }
    396398                            } else {
    397                                 var message='Embed code you have provided is wrong. Please check.';
    398                                 ExpressCurateUtils.validationMessages(message,$('.expresscurate_socialDialog .expresscurate_errorMessage'),$input);
     399                                var message = 'Embed code you have provided is wrong. Please check.';
     400                                ExpressCurateUtils.validationMessages(message, $('.expresscurate_socialDialog .expresscurate_errorMessage'), $input);
    399401                                /*The tab/ URL/ embed code you have provided is wrong. Please check.*/
    400402                            }
     
    405407        });
    406408        /*$page.on('click', '.expresscurate_socialDialog .tabs li', function () {
    407             $('.expresscurate_socialDialog .tabs li').removeClass('current');
    408             $(this).addClass('current');
    409         });*/
     409         $('.expresscurate_socialDialog .tabs li').removeClass('current');
     410         $(this).addClass('current');
     411         });*/
    410412        tinymce.create('tinymce.plugins.expresscurate', {
    411413            /**
     
    465467                    classes: "btn expresscurateCostom expresscurateAddKeyword"
    466468                });
     469                /*console.log(tinymce.EditorManager.get('expresscurate_dialog_content_editor'));
     470                tinymce.EditorManager.get('expresscurate_dialog_content_editor').addButton('clearContent', {
     471                    title: 'Clear editor content',
     472                    cmd: 'clearContent',
     473                    classes: "btn expresscurateCostom expresscurateAnnotate"
     474                });*/
    467475                ed.onKeyDown.add(function (ed, e) {
    468476                    if (e.altKey && e.keyCode === 75) {
  • expresscurate/trunk/js/Dialog.js

    r1137344 r1140784  
    44        shortestParagraphLength = 150,
    55        paragraphWidth = 93,
    6         html;
     6        html,
     7        alignImg,
     8        imgSize;
    79
    810    function sendWPEditor(html, insertedTags) {
     
    388390    }
    389391
     392    function insertContent(clone, addAndContinue) {
     393        var ed = tinyMCE.activeEditor,
     394            $dialog = $('#expresscurate_dialog'),
     395            highlightedElems = $(ed.getBody()).find('span.expresscurate_keywordsHighlight');
     396        if (clone) {
     397            ExpressCurateUtils.track('/post/content-dialog/cloneintopost', true);
     398        } else {
     399            ExpressCurateUtils.track('/post/content-dialog/curateintopost', true);
     400        }
     401        if (highlightedElems.length > 0) {
     402            highlightedElems.each(function (index, val) {
     403                $(val).replaceWith(this.childNodes);
     404            });
     405        }
     406        var insertedTagsTextarea = "",
     407            sourceVal = $('#expresscurate_source').val(),
     408            postTag = $("#tax-input-post_tag");
     409        insertedTagsTextarea = postTag.val();
     410        $('#curated_tags').find('li').each(function () {
     411            insertedTagsTextarea += "," + $(this).find('span.tag').text();
     412        });
     413        postTag.val(insertedTagsTextarea);
     414        $(".tagadd").trigger('click');
     415        $('.expresscurate_sources_coll_widget .addSource input').val(sourceVal);
     416        ExpressCurateSourceCollection.addNew();
     417        var html = "",
     418            bg = $('.img').css('background-image');
     419
     420        bg = bg.replace(/^url\(["']?/, '').replace(/["']?\)$/, '');
     421        if (bg.indexOf('images/noimage.png') === -1 && bg.length > 5) {
     422            html += '<img class="' + alignImg + ' ' + imgSize + '" src="' + bg + '" data-img-curated-from="' + sourceVal + '">'
     423        }
     424
     425        if (clone) {
     426            html += tinyMCE.get('expresscurate_dialog_content_clone_editor').getContent() + '<br />';
     427        } else {
     428            html += '<blockquote cite = "' + sourceVal + '">' + tinyMCE.get('expresscurate_dialog_content_editor').getContent() + '<br />';
     429        }
     430
     431        if (html.length > 0) {
     432            if (sourceVal.length > 0) {
     433                var domain = sourceVal;
     434                if (domain.indexOf('http://') === -1 && domain.indexOf('https://') === -1) {
     435                    domain = 'http://' + domain;
     436                }
     437                var title = $("#curated_title").val();
     438                domain = domain.match(/^(http|https)/) ? domain : 'http://' + domain;
     439
     440                if (domain) {
     441                    if (clone) {
     442                        html += '<footer><p class="expresscurate_source">Originally published at <cite><a class="expresscurated" rel="nofollow" data-cloned-url="' +
     443                        domain + '"  href = "' + domain +
     444                        '"' + ($("#expresscurate_from_target").val() == 'on' ? ' target="_blank"' : '') + '>' +
     445                        title + '</a></cite></p></footer><br/>';
     446                    } else {
     447                        html += '<footer><p class="expresscurate_source">' + $("#expresscurate_from").val() +
     448                        ' <cite><a class="expresscurated" rel="nofollow" data-curated-url="' + domain + '"  href = "' + domain +
     449                        '"' + ($("#expresscurate_from_target").val() == 'on' ? ' target="_blank"' : '') + '>' +
     450                        title + '</a></cite></p></footer><br/>';
     451                    }
     452                }
     453            }
     454
     455            if (clone) {
     456                var $canonicalURL = $('#expresscurate_advanced_seo_canonical_url'),
     457                    $noFollow = $('#expresscurate_advanced_seo_nofollow'),
     458                    $noIndex = $('#expresscurate_advanced_seo_noindex'),
     459                    $copyCheck = $('#expresscurate_advanced_seo_post_copy'),
     460                    $copyCheckVal = $('#expresscurate_advanced_seo_post_copy_value'),
     461                    $noIndexVal = $('#expresscurate_advanced_seo_noindex_value'),
     462                    $noFollowVal = $('#expresscurate_advanced_seo_nofollow_value'),
     463                    $copyControlWrap = $('#expresscurate_ClonePostWrap');
     464                if ($canonicalURL.length) {
     465                    $copyControlWrap.removeClass('expresscurate_displayNone');
     466                    $copyCheckVal.val('on');
     467                    $canonicalURL.attr('value', domain).attr('readonly', true);
     468                    $noFollow.add($noIndex).attr('checked', false).attr('disabled', true);
     469                    $noFollowVal.add($noIndexVal).val('off');
     470                    $copyCheck.attr('checked', true).attr('disabled', false);
     471                }
     472            } else {
     473                html += '</blockquote><br />';
     474            }
     475            var $title = $('#titlewrap').find('#title');
     476            if ($title.val().length === 0) {
     477                $title.trigger('focus');
     478                $title.val($("#curated_title").val());
     479            }
     480            sendWPEditor(html, insertedTagsTextarea);
     481            if (!addAndContinue) {
     482                $dialog.dialog('close');
     483            } else {
     484                $('#expresscurate_source').val('').text('');
     485                clearExpresscurateForm();
     486            }
     487
     488        } else {
     489            return false;
     490        }
     491    }
     492
    390493    function setupDialog() {
    391494        var $dialog = $('#expresscurate_dialog');
     
    513616
    514617
    515             var imgSize = 'sizeX';
     618            imgSize = 'sizeX';
    516619            $('.sizeS, .sizeM, .sizeX').on('click', function () {
    517620                var $this = $(this);
     
    521624            });
    522625
    523             var alignImg = 'alignnone';
     626            alignImg = 'alignnone';
    524627            $('.alignleft , .alignright , .alignnone').on('click', function () {
    525628                var $this = $(this);
     
    537640            });
    538641            $dialog.on('click', '#expresscurate_insert , #expresscurate_cloneInsert', function () {
    539                 var clone = $(this).is('#expresscurate_cloneInsert') ? true : false,
    540                     ed = tinyMCE.activeEditor,
    541                     highlightedElems = $(ed.getBody()).find('span.expresscurate_keywordsHighlight');
    542                 if (clone) {
    543                     ExpressCurateUtils.track('/post/content-dialog/cloneintopost', true);
    544                 } else {
    545                     ExpressCurateUtils.track('/post/content-dialog/curateintopost', true);
    546                 }
    547                 if (highlightedElems.length > 0) {
    548                     highlightedElems.each(function (index, val) {
    549                         $(val).replaceWith(this.childNodes);
    550                     });
    551                 }
    552                 var insertedTagsTextarea = "",
    553                     sourceVal = $('#expresscurate_source').val(),
    554                     postTag = $("#tax-input-post_tag");
    555                 insertedTagsTextarea = postTag.val();
    556                 $('#curated_tags').find('li').each(function () {
    557                     insertedTagsTextarea += "," + $(this).find('span.tag').text();
    558                 });
    559                 postTag.val(insertedTagsTextarea);
    560                 $(".tagadd").trigger('click');
    561                 $('.expresscurate_sources_coll_widget .addSource input').val(sourceVal);
    562                 ExpressCurateSourceCollection.addNew();
    563                 var html = "",
    564                     bg = $('.img').css('background-image');
    565 
    566                 bg = bg.replace(/^url\(["']?/, '').replace(/["']?\)$/, '');
    567                 if (bg.indexOf('images/noimage.png') === -1 && bg.length > 5) {
    568                     html += '<img class="' + alignImg + ' ' + imgSize + '" src="' + bg + '" data-img-curated-from="' + sourceVal + '">'
    569                 }
    570 
    571                 if (clone) {
    572                     html += tinyMCE.get('expresscurate_dialog_content_clone_editor').getContent() + '<br />';
    573                 } else {
    574                     html += '<blockquote cite = "' + sourceVal + '">' + tinyMCE.get('expresscurate_dialog_content_editor').getContent() + '<br />';
    575                 }
    576 
    577                 if (html.length > 0) {
    578                     if (sourceVal.length > 0) {
    579                         var domain = sourceVal;
    580                         if (domain.indexOf('http://') === -1 && domain.indexOf('https://') === -1) {
    581                             domain = 'http://' + domain;
    582                         }
    583                         var title = $("#curated_title").val();
    584                         domain = domain.match(/^(http|https)/) ? domain : 'http://' + domain;
    585 
    586                         if (domain) {
    587                             if (clone) {
    588                                 html += '<footer><p class="expresscurate_source">Originally published at <cite><a class="expresscurated" rel="nofollow" data-cloned-url="' +
    589                                 domain + '"  href = "' + domain +
    590                                 '"' + ($("#expresscurate_from_target").val() == 'on' ? ' target="_blank"' : '') + '>' +
    591                                 title + '</a></cite></p></footer><br/>';
    592                             } else {
    593                                 html += '<footer><p class="expresscurate_source">' + $("#expresscurate_from").val() +
    594                                 ' <cite><a class="expresscurated" rel="nofollow" data-curated-url="' + domain + '"  href = "' + domain +
    595                                 '"' + ($("#expresscurate_from_target").val() == 'on' ? ' target="_blank"' : '') + '>' +
    596                                 title + '</a></cite></p></footer><br/>';
    597                             }
    598                         }
    599                     }
    600 
    601                     if (clone) {
    602                         var $canonicalURL = $('#expresscurate_advanced_seo_canonical_url'),
    603                             $noFollow = $('#expresscurate_advanced_seo_nofollow'),
    604                             $noIndex = $('#expresscurate_advanced_seo_noindex'),
    605                             $copyCheck = $('#expresscurate_advanced_seo_post_copy'),
    606                             $copyCheckVal = $('#expresscurate_advanced_seo_post_copy_value'),
    607                             $noIndexVal = $('#expresscurate_advanced_seo_noindex_value'),
    608                             $noFollowVal = $('#expresscurate_advanced_seo_nofollow_value'),
    609                             $copyControlWrap = $('#expresscurate_ClonePostWrap');
    610                         if ($canonicalURL.length) {
    611                             $copyControlWrap.removeClass('expresscurate_displayNone');
    612                             $copyCheckVal.val('on');
    613                             $canonicalURL.attr('value', domain).attr('readonly', true);
    614                             $noFollow.add($noIndex).attr('checked', false).attr('disabled', true);
    615                             $noFollowVal.add($noIndexVal).val('off');
    616                             $copyCheck.attr('checked', true).attr('disabled', false);
    617                         }
    618                     } else {
    619                         html += '</blockquote><br />';
    620                     }
    621                     var $title = $('#titlewrap').find('#title');
    622                     if ($title.val().length === 0) {
    623                         $title.trigger('focus');
    624                         $title.val($("#curated_title").val());
    625                     }
    626                     sendWPEditor(html, insertedTagsTextarea);
    627                     $dialog.dialog('close');
    628                 } else {
    629                     return false;
    630                 }
     642                var clone = $(this).is('#expresscurate_cloneInsert') ? true : false;
     643                insertContent(clone, false);
     644            });
     645            $dialog.on('click', '#expresscurate_continue', function () {
     646                insertContent(false, true);
    631647            });
    632648        }
     
    732748            $load = $dialog.find('#expresscurate_submit'),
    733749            $clone = $dialog.find('#expresscurate_clone'),
    734             $insert = $dialog.find('#expresscurate_insert'),
     750            $insert = $dialog.find('#curateControlsWrap'),
    735751            $insertClone = $dialog.find('#expresscurate_cloneInsert'),
    736752            $contenttextarea = $dialog.find('#expresscurate_dialog_content_editor_container'),
     
    764780            ExpressCurateUtils.track('/post/content-dialog/startcurate');
    765781        }
     782
    766783        $dialog.dialog('open');
    767784    }
  • expresscurate/trunk/js/Settings.js

    r1106118 r1140784  
    4141        });
    4242        /*settings page traching*/
    43         $('#tab-1').on('change','input',function(){
     43        $('#tab-1').on('change', 'input', function () {
    4444            ExpressCurateUtils.track('/settings/general');
    4545        });
    46         $('#tab-2').on('change','input, select',function(){
     46        $('#tab-2').on('change', 'input, select', function () {
    4747            ExpressCurateUtils.track('/settings/smartpublishing');
    4848        });
    49         $('#tab-3').on('change','input, select',function(){
     49        $('#tab-3').on('change', 'input, select', function () {
    5050            ExpressCurateUtils.track('/settings/sitemap');
    5151        });
    52         $('#tab-4').on('change','input',function(){
     52        $('#tab-4').on('change', 'input', function () {
    5353            ExpressCurateUtils.track('/settings/extension');
    5454        });
    55         $('#tab-5').on('change','input, select',function(){
     55        $('#tab-5').on('change', 'input, select', function () {
    5656            ExpressCurateUtils.track('/settings/feed');
    5757        });
     
    7474            var status = '',
    7575                $submitSitemap = $('.expresscurate #submitSiteMap'),
    76                 $autorize=$('.getApiKey');
    77             status=($(this).is(':checked'))?'on':'off';
     76                $autorize = $('.getApiKey');
     77            status = ($(this).is(':checked')) ? 'on' : 'off';
    7878            if ($(this).is(':checked') && $submitSitemap.hasClass('generated')) {
    7979                $submitSitemap.removeClass('expresscurate_displayNone');
     
    8181                $submitSitemap.addClass('expresscurate_displayNone');
    8282            }
    83             if($submitSitemap.hasClass('generated')){
     83            if ($submitSitemap.hasClass('generated')) {
    8484                $autorize.addClass('expresscurate_displayNone');
    85             }else{
     85            } else {
    8686                $autorize.removeClass('expresscurate_displayNone');
    8787            }
     
    106106        });
    107107        $submitSitemap.on('click', function () {
     108            $('.expresscurate_Error').remove();
     109            var message = '',
     110                className = '';
    108111            $.ajax({
    109112                type: 'POST',
     
    111114            }).done(function (res) {
    112115                var data = $.parseJSON(res);
    113                 if (data.status === 'success') {
    114                     $submitSitemap.removeClass('expresscurate_displayNone').addClass('generated');
     116                if (data.status === 0) {
     117                    $submitSitemap.addClass('generated');
     118                    message = data.message;
     119                    className='expresscurate_SettingsSuccess';
     120                } else if (data.status === 1) {
     121                    message = data.message;
     122                    className='expresscurate_SettingsError';
     123                } else if (data.status === 2) {
     124                    message = data.message;
     125                    className='expresscurate_SettingsError';
     126                } else if (data.status === 3) {
     127                    message = data.message;
     128                    className='expresscurate_SettingsError';
    115129                }
     130            }).always(function () {
     131                $submitSitemap.after('<p class="expresscurate_Error '+className+'">' + message + '</p>');
    116132            });
    117133        });
     
    119135        /*SEO settings*/
    120136        $('#expresscurate_seo').click(function () {
    121             var $this=$(this),
     137            var $this = $(this),
    122138                $slider = $('#publisherWrap'),
    123139                $sitemapTab = $('#sitemapTab');
    124             showHideOptions($slider,$this);
     140            showHideOptions($slider, $this);
    125141            if ($this.is(':checked')) {
    126142                $sitemapTab.removeClass('expresscurate_displayNone');
  • expresscurate/trunk/js/bookmarks.js

    r1129694 r1140784  
    2424                var data = $.parseJSON(res);
    2525                if (data.status === 'success') {
    26                     if (data.result === null) {
     26                    /*if (data.result === null) {
    2727                        liHTML = '';
    2828                        message = 'Article does not exists.';
    29                     } else {
     29                    } else {*/
    3030                        $.extend(data.result, {
    3131                            'id': $bookmarkBoxes.find('> li').length
     
    5151                            $lastLi.removeClass('expresscurate_transparent');
    5252                        }, 700);
    53                     }
     53                    //}
    5454                } else if (data.status === 'error' && data.msg !== null) {
    5555                    message = data.msg;
  • expresscurate/trunk/js/feed/contentFeed.js

    r1137344 r1140784  
    4848
    4949        $.each(els, function (index, el) {
    50             var item = $(el).find('a.postTitle').data('fulllink');
     50            var item = $(el).find('a.postTitle').data('link');
    5151            items.push(item);
    5252        });
  • expresscurate/trunk/readme.txt

    r1137344 r1140784  
    55Requires at least: 3.9
    66Tested up to: 4.1
    7 Stable tag: 2.0.11
     7Stable tag: 2.0.12
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl.html
     
    8181
    8282= How To Get Started =
    83 [Download ExpressCurate plugin](http://downloads.wordpress.org/plugin/expresscurate.2.0.11.zip "Your favorite content marketing tools") for WordPress. 
     83[Download ExpressCurate plugin](http://downloads.wordpress.org/plugin/expresscurate.2.0.12.zip "Your favorite content marketing tools") for WordPress. 
    8484You can also [download](http://www.expresscurate.com/p/products/wordpress-theme "Your favorite WordPress Theme") a **free** [ExpressCurate WordPress theme](http://www.expresscurate.com/p/products/wordpress-theme "Your favorite WordPress Theme"). It will give your curated content a modern online news look.
    8585
     
    129129== Changelog ==
    130130
     131= 2.0.12 =
     132* Content Feed pull is fixed.
     133* Sitemap Submit is fixed.
     134* Other miscellaneous bug fixes and improvements.
     135
    131136= 2.0.11 =
    132137* New Setting: Open Original Article Link in a New Window/Tab.
  • expresscurate/trunk/templates/advanced_seo_widget.php

    r1137344 r1140784  
    2424
    2525        <div id="expresscurate_advancedSEO_widget">
    26             <div id="expresscurate_ClonePostWrap" class="<?php if(!$postCopy) {echo 'expresscurate_displayNone';} ?>">
     26            <!--<div id="expresscurate_ClonePostWrap" class="<?php /*if(!$postCopy) {echo 'expresscurate_displayNone';} */?>">
    2727                <div class="info">
    2828                    <label for="expresscurate_advanced_seo_canonical_url" class="label">Content cloned</label>
     
    3030                <div class="value">
    3131                    <input class="expresscurate_displayNone" id="expresscurate_advanced_seo_post_copy"
    32                            type='checkbox' <?php if(!$postCopy) {
     32                           type='checkbox' <?php /*if(!$postCopy) {
    3333                        echo 'disabled="disabled"';
    34                     } ?>
     34                    } */?>
    3535                           name='expresscurate_advanced_seo_post_copy'
    36                         <?php echo ($postCopy) ? 'checked' : '' ?>>
     36                        <?php /*echo ($postCopy) ? 'checked' : '' */?>>
    3737                    <label class="expresscurate_preventTextSelection" for="expresscurate_advanced_seo_post_copy"></label>
    3838                    <input type="hidden" id="expresscurate_advanced_seo_post_copy_value"
    3939                           name="expresscurate_advanced_seo_post_copy_value"
    40                            value="<?php echo ($postCopy) ? "on" : "off"; ?>">
     40                           value="<?php /*echo ($postCopy) ? "on" : "off"; */?>">
    4141                </div>
    42             </div>
     42            </div>-->
    4343            <div class="info">
    4444                <label for="expresscurate_advanced_seo_title" class="label">SEO Title</label>
  • expresscurate/trunk/templates/dialog.php

    r1137344 r1140784  
    11<?php
    22$settings = array('wpautop' => false, 'media_buttons' => false, 'teeny' => true, 'tinymce' => true, 'quicktags' => false);
    3 $settingsClone = array('wpautop' => false, 'media_buttons' => false, 'teeny' => true, 'tinymce' => true, 'quicktags' => false );
     3$settingsClone = array('wpautop' => false, 'media_buttons' => false, 'teeny' => true, 'tinymce' => true, 'quicktags' => false);
    44?>
    55<div>
     
    116116            </ul>
    117117            <div class="clear"></div>
    118             <button class="curate right" id="expresscurate_insert"
    119                     onclick="return false;"><?php echo __('Curate into post', ExpressCurate_Actions::PLUGIN_FOLDER) ?></button>
     118            <div id="curateControlsWrap">
     119                <button class="curate right" id="expresscurate_insert"
     120                        onclick="return false;"><?php echo __('Curate into post', ExpressCurate_Actions::PLUGIN_FOLDER) ?></button>
     121                <button class="curate right" id="expresscurate_continue"
     122                        onclick="return false;"><?php echo __('Add and continue', ExpressCurate_Actions::PLUGIN_FOLDER) ?></button>
     123            </div>
    120124            <button class="curate right expresscurate_displayNone" id="expresscurate_cloneInsert"
    121125                    onclick="return false;"><?php echo __('Clone Post', ExpressCurate_Actions::PLUGIN_FOLDER) ?></button>
  • expresscurate/trunk/templates/feed_list.php

    r1137344 r1140784  
    1717    if (is_array($feed_content) && count($feed_content) > 0) {
    1818        foreach ($feed_content as $content) {
    19             $content['fullLink'] = $content['link'];
    20             $extracted_url = extract_google_feed_url($content['link'], $feed_content);
    21             if ($extracted_url) {
    22                 $url = $extracted_url;
    23             } else {
    24                 $url = $content['link'];
    25             }
    26             $content['link'] = $url;
    27             $content['domain'] = parse_url($url, PHP_URL_SCHEME) . "://" . parse_url($url, PHP_URL_HOST);
     19            $content['domain'] = parse_url($content['link'], PHP_URL_SCHEME) . "://" . parse_url($content['link'], PHP_URL_HOST);
    2820            array_push($sorted_feeds, $content);
    2921        }
     
    128120                </ul>
    129121
    130                 <a data-fulllink="<?php echo $item['fullLink']; ?>" class="postTitle" href="<?php echo $item['link'] ?>"
     122                <a data-link="<?php echo $item['link']; ?>" class="postTitle" href="<?php echo $item['link'] ?>"
    131123                   target="_blank"><?php echo $item['title'] ?></a><br/>
    132124                <a class="url" href="<?php echo $item['link'] ?>"><?php echo $item['domain'] ?></a>
  • expresscurate/trunk/templates/settings.php

    r1137344 r1140784  
    300300                            </select>
    301301                    </li>
     302                    <!--<li>
     303                        <p class="title">Social publishing </p>
     304                        <input class="expresscurate_displayNone" type="checkbox" id="expresscurate_social_publishing"
     305                               name="expresscurate_social_publishing" <?php
     306/*                        if (get_option('expresscurate_social_publishing', '') == "on") {
     307                            echo 'checked';
     308                        }
     309                        */?> />
     310                        <label class="controls checkboxLabel" for="expresscurate_social_publishing"></label>
     311                       
     312                        <?php /*
     313                             $blogName = urlencode(urlencode(get_bloginfo('url')));
     314                        */?>
     315                        <a class="getApiKey  <?php /*if (strlen(get_option('expresscurate_buffer_refresh_token')) > 2) {echo 'expresscurate_displayNone';}*/?>" href="https://www.expresscurate.com/api/connector/buffer/refreshtoken/<?/*=$blogName*/?>">Authorize access to Buffer</a>
     316                    </li>-->
    302317                </ul>
    303318                <div class="centerSave">
  • expresscurate/trunk/templates/sitemap.php

    r1106118 r1140784  
    166166            </option>
    167167        </select>
    168         <?php //if(!$_SESSION['sitemap_token']){
     168        <?php
    169169        $blogName = urlencode(urlencode(get_bloginfo('url')));
    170170        ?>
    171             <a class="getApiKey  <?php if (strlen(get_option('expresscurate_google_refresh_token')) > 2) {echo 'expresscurate_displayNone';}?>" href="https://www.expresscurate.com/api/getsitemapkey/<?=$blogName?>">Authorize </a>
     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 Webmaster Tools</a>
    172172    </div>
    173173</li>
Note: See TracChangeset for help on using the changeset viewer.