Changeset 1111122
- Timestamp:
- 03/12/2015 02:11:23 PM (11 years ago)
- Location:
- expresscurate/trunk
- Files:
-
- 11 edited
-
ExpressCurate.php (modified) (2 diffs)
-
ExpressCurate_Actions.php (modified) (2 diffs)
-
ExpressCurate_CronManager.php (modified) (4 diffs)
-
ExpressCurate_FeedManager.php (modified) (2 diffs)
-
ExpressCurate_HtmlParser.php (modified) (2 diffs)
-
ExpressCurate_Util.php (modified) (2 diffs)
-
css/expresscurate.css (modified) (2 diffs)
-
js/Dialog.js (modified) (9 diffs)
-
js/keywords/SEOControlCenter.js (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
templates/dashboard/feed_widget.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
expresscurate/trunk/ExpressCurate.php
r1109426 r1111122 5 5 Plugin URI: http://www.expresscurate.com/products 6 6 Description: ExpressCurate plugin is a content curation tool for WordPress. It enables you to create and publish high quality content within minutes. 7 Version: 2.0. 77 Version: 2.0.8 8 8 Author: ExpressCurate 9 9 Author URI: http://www.expresscurate.com … … 56 56 $cronManager->deactivate_events(); 57 57 } 58 59 58 } 60 59 -
expresscurate/trunk/ExpressCurate_Actions.php
r1106118 r1111122 191 191 add_action('update_option_permalink_structure', array(&$this, 'permalink_changes'), 10, 2); 192 192 if ($_REQUEST['page'] == 'expresscurate_settings') { 193 $cronManager = new ExpressCurate_CronManager(); 194 $cronManager->schedule_events(); 193 $this->cronManager->schedule_events(); 195 194 196 195 // Generate sitemap … … 1639 1638 $warnings = array(); 1640 1639 $extWarnings = array(); 1641 $cronManager = new ExpressCurate_CronManager();1642 1640 $homeUrl = get_site_url(); 1643 1641 -
expresscurate/trunk/ExpressCurate_CronManager.php
r1106118 r1111122 13 13 public $websiteUrlCallCronjob = null; 14 14 15 private $tmpForCron = null;16 17 15 public function __construct() { 18 $temp_file = ExpressCurate_Util::tmpname('.tmp', 'cron');19 20 $this->tmpForCron = $temp_file;21 22 16 $this->websiteUrlCallCronjob ='0 * * * * wget '.get_site_url().' > /dev/null 2>&1'; 23 17 } … … 46 40 $output = implode(PHP_EOL, $output); 47 41 $output = $output . PHP_EOL . $this->websiteUrlCallCronjob . PHP_EOL; 48 file_put_contents($this->tmpForCron, $output); 49 ExpressCurate_Util::exec('crontab ' . $this->tmpForCron, $output); 50 unlink($this->tmpForCron); 42 43 $tempFile = ExpressCurate_Util::tmpname('cron'); 44 file_put_contents($tempFile, $output); 45 ExpressCurate_Util::exec('crontab ' . $tempFile, $output); 46 unlink($tempFile); 51 47 } 52 48 } … … 80 76 wp_clear_scheduled_hook('expresscurate_sitemap_push'); 81 77 82 if($this->check_if_exist($this->websiteUrlCallCronjob)){ 83 ExpressCurate_Util::exec('crontab -l' ,$output); 84 $output = implode(PHP_EOL,$output); 85 $newCron = str_replace($this->websiteUrlCallCronjob,"",$output); 86 file_put_contents($this->tmpForCron, $newCron.PHP_EOL); 87 ExpressCurate_Util::exec('crontab '.$this->tmpForCron); 88 unlink($this->tmpForCron); 78 if($this->check_if_exist($this->websiteUrlCallCronjob)) { 79 ExpressCurate_Util::exec('crontab -l', $output); 80 $output = implode(PHP_EOL, $output); 81 $output = str_replace($this->websiteUrlCallCronjob, "", $output) . PHP_EOL; 82 83 $tempFile = ExpressCurate_Util::tmpname('cron'); 84 file_put_contents($tempFile, $output); 85 ExpressCurate_Util::exec('crontab ' . $tempFile); 86 unlink($tempFile); 89 87 } 90 88 } … … 92 90 93 91 public function set_permission_status() { 94 // $status = $_REQUEST['status'];95 // update_option('expresscurate_exec_function_permission_status', $status);96 97 92 $status = $_REQUEST['status'] === 'seen' ? 'ignore' : 'manual'; 98 93 update_option('expresscurate_cronjob_status', $status); -
expresscurate/trunk/ExpressCurate_FeedManager.php
r1109426 r1111122 459 459 $html_parser = new ExpressCurate_HtmlParser($link); 460 460 $keywords = $html_parser->analyzeKeywords(); 461 461 $media = $html_parser->isMediaExists(); 462 462 $publishDate = isset($story['publishedDate']) ? $story['publishedDate'] : $story['date']; 463 463 $expressCurateDate = new ExpressCurate_Date(); … … 472 472 'curated' => 0, 473 473 'keywords' => $keywords, 474 'media' => $media 474 475 ); 475 476 -
expresscurate/trunk/ExpressCurate_HtmlParser.php
r1109426 r1111122 129 129 /*$this->html = preg_replace('/<noscript[^>]*>[\S\s]*?' . 130 130 '<\/noscript>/msi', '', $this->html);*/ 131 $this->html = preg_replace('/<noscript[^>]*>[\s]*?' . 132 '<\/noscript>/msi', '', $this->html); 131 $this->html = preg_replace('/(<noscript[^>]*>|<\/noscript>)/msi', '', $this->html); 133 132 $this->html = preg_replace('~>\s+<~', '><', $this->html); 134 133 $this->html = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $this->html); … … 464 463 return $this->keywords; 465 464 } 465 466 public function isMediaExists(){ 467 $dom = new DOMDocument('1.0', 'UTF-8'); 468 @$dom->loadHTML($this->html); 469 $xpath = new DomXPath($dom); 470 $this->removeElementsByTagName('script', $dom); 471 $this->removeElementsByTagName('style', $dom); 472 $this->removeElementsByTagName('link', $dom); 473 $imgTags = $xpath->query("//img"); 474 $img_array = array(); 475 foreach ($imgTags as $t) { 476 $src = $t->getAttribute('src'); 477 $img_array[] = $src; 478 } 479 $obj = $xpath->query("//node()[(name()='iframe' or name()='video' or name()='source' or name()= 'object' or name()='embed') and (contains(@src,'youtube.com') or contains(@src ,'vimeo.com') or contains(@src,'youtu.be'))]"); 480 $videoArrays = array(); 481 foreach($obj as $objs){ 482 array_push($videoArrays,$objs->getAttribute('src')); 483 } 484 $mediaTags = array("images"=>count($img_array),"videos"=>count($videoArrays)); 485 return $mediaTags; 486 } 466 487 467 488 function getTextBetweenTags($tag, $html, $strict=0) -
expresscurate/trunk/ExpressCurate_Util.php
r1106118 r1111122 21 21 22 22 23 public static function tmpname($p ostfix = '.tmp', $prefix = 'tmp', $dir = null) {23 public static function tmpname($prefix = 'tmp', $dir = null) { 24 24 // validate arguments 25 if (! (isset($postfix) && is_string($postfix))) {26 return false;27 }28 25 if (! (isset($prefix) && is_string($prefix))) { 29 26 return false; … … 40 37 } 41 38 42 // tack on the extension 43 $newFileName = $sysFileName . $postfix; 44 if ($sysFileName == $newFileName) { 45 return $sysFileName; 46 } 47 48 $newFileCreated = @link($sysFileName, $newFileName); 49 if ($newFileCreated) { 50 return $newFileName; 51 } 52 53 unlink ($sysFileName); 54 }catch (Exception $e){ 39 return $sysFileName; 40 } catch (Exception $e) { 55 41 return false; 56 42 } 57 58 59 return false;60 43 } 61 44 } -
expresscurate/trunk/css/expresscurate.css
r1109426 r1111122 669 669 border-top: solid 1px #dddddd; 670 670 } 671 672 .pageDesc{ 673 width: 56%; 674 } 671 @media (max-width: 680px){ 672 .pageDesc{ 673 width: 100%; 674 } 675 } 676 @media (min-width: 680px){ 677 .pageDesc{ 678 width: 60%; 679 } 680 } 681 682 675 683 676 684 .express_curate_selected_list_item { … … 3489 3497 width: inherit; 3490 3498 } 3491 @media (max-width: 782px) {3499 @media (max-width:600px) { 3492 3500 .expresscurate_headBorderBottom .controlsWrap.fixedControls{ 3493 3501 top:0; 3494 3502 } 3495 3503 } 3496 @media (min-width:782px) { 3504 @media (min-width:600px) and (max-width: 782px){ 3505 .expresscurate_headBorderBottom .controlsWrap.fixedControls{ 3506 top:46px; 3507 } 3508 } 3509 @media (min-width:782px){ 3497 3510 .expresscurate_headBorderBottom .controlsWrap.fixedControls{ 3498 3511 top:30px; -
expresscurate/trunk/js/Dialog.js
r1109426 r1111122 31 31 32 32 function displayCuratedImages(images) { 33 var $editor = $('.expresscurate_dialog .editor'); 33 var $editor = $('.expresscurate_dialog .editor'), 34 count = images.length, 35 validImgCount = 0, 36 $counter = $('.expresscurate_dialog .imageCount'); 34 37 $('.imgContainer').hide(); 35 38 $editor.removeClass('small'); … … 43 46 width = this.width; 44 47 if (width > 150 && height > 100) { 48 validImgCount++; 45 49 var data = { 46 50 index: index, … … 48 52 }; 49 53 $('#curated_images').append(ExpressCurateUtils.getTemplate('dialogCuratedImage', data)); 54 $counter.text('1/' + validImgCount).removeClass('expresscurate_displayNone'); 50 55 // show image container 51 56 $editor.addClass('small'); … … 54 59 }; 55 60 img.src = value; 56 }); 57 setTimeout(function () { 58 var $curatedImages = $('ul#curated_images li'), 59 numberOfImages = $curatedImages.length, 60 $counter = $('.expresscurate_dialog .imageCount'), 61 errorHTML = ''; 62 if (numberOfImages > 0) { 63 $('.content .img').removeClass("noimage").css('background-image', $curatedImages.first().css('background-image')); 64 $counter.text('1/' + numberOfImages).removeClass('expresscurate_displayNone'); 65 } else { 66 errorHTML = '<div class="error">No image (of 120x100 or higher res) found in the original article.</div>'; 67 $('#expresscurate_post_form').before(errorHTML); 68 } 69 }, 300); 70 } 71 61 if (index === images.length - 1) { 62 setTimeout(function () { 63 var $curatedImages = $('ul#curated_images li'), 64 numberOfImages = $curatedImages.length, 65 errorHTML = ''; 66 if (numberOfImages > 0) { 67 $('.content .img').removeClass("noimage").css('background-image', $curatedImages.first().css('background-image')); 68 } else { 69 errorHTML = '<div class="error">No image (of 120x100 or higher res) found in the original article.</div>'; 70 $('#expresscurate_post_form').before(errorHTML); 71 } 72 }, 300); 73 } 74 }); 75 } 72 76 function displayCuratedParagraphs(paragraphs, count, shortPar) { 73 77 var $paragraphsContainer = $('.paragraphs_preview'), … … 148 152 keywordsHTML += ExpressCurateUtils.getTemplate('dialogCuratedtags', data); 149 153 }); 150 keywordsHTML += ExpressCurateUtils.getTemplate('dialogMarkButton', null);154 keywordsHTML += ExpressCurateUtils.getTemplate('dialogMarkButton', null); 151 155 $("#curated_tags").append(keywordsHTML); 152 156 } … … 169 173 specialsHTML += displayCuratedHeadings(data.headings); 170 174 specialsHTML += displayCuratedDescription(data.metas.description); 171 specialsHTML += ExpressCurateUtils.getTemplate('dialogSearchParagraphs', null);175 specialsHTML += ExpressCurateUtils.getTemplate('dialogSearchParagraphs', null); 172 176 if (specialsHTML.length === 0) { 173 177 specialsHTML += '<li>No specal data</li>'; … … 178 182 function displayCuratedHeadings(headings) { 179 183 var headingsHTML = ''; 180 $.each(headings, function(index,value){184 $.each(headings, function (index, value) { 181 185 if (index && value.length > 0) { 182 var data ={183 index: index,184 content: value186 var data = { 187 index: index, 188 content: value 185 189 }; 186 headingsHTML += ExpressCurateUtils.getTemplate('dialogCuratedHeadings', data);190 headingsHTML += ExpressCurateUtils.getTemplate('dialogCuratedHeadings', data); 187 191 } 188 192 }); … … 193 197 var descriptionHTML = ''; 194 198 if (description && description.length > 0) { 195 descriptionHTML += ExpressCurateUtils.getTemplate('dialogCuratedDescription', description);199 descriptionHTML += ExpressCurateUtils.getTemplate('dialogCuratedDescription', description); 196 200 } 197 201 return descriptionHTML; … … 212 216 paragraph += "</ul>"; 213 217 } else { 214 paragraph += "<" + tag + ">" + $('#' + id).attr('title').replace(/\r\n/g, "<br />").replace(/\n/g, "<br />") + "</" + tag + "> ";218 paragraph += "<" + tag + ">" + $('#' + id).attr('title').replace(/\r\n/g, "<br />").replace(/\n/g, "<br />") + "</" + tag + "> "; 215 219 } 216 220 generateTags(paragraph); -
expresscurate/trunk/js/keywords/SEOControlCenter.js
r1109426 r1111122 97 97 $addInput = $('.addKeywords input'), 98 98 $keywordWrap = $('.statisticsTitle span'), 99 $description = $ widgetWraper.find('.description'),99 $description = $('.expresscurate_widget .description'), 100 100 $descriptionContainer = $description.find('.descriptionWrap'); 101 101 -
expresscurate/trunk/readme.txt
r1109426 r1111122 5 5 Requires at least: 3.9 6 6 Tested up to: 4.1 7 Stable tag: 2.0. 77 Stable tag: 2.0.8 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl.html … … 81 81 82 82 = How To Get Started = 83 [Download ExpressCurate plugin](http://downloads.wordpress.org/plugin/expresscurate.2.0. 7.zip "Your favorite content marketing tools") for WordPress.83 [Download ExpressCurate plugin](http://downloads.wordpress.org/plugin/expresscurate.2.0.8.zip "Your favorite content marketing tools") for WordPress. 84 84 You 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. 85 85 … … 129 129 == Changelog == 130 130 131 = 2.0.8 = 132 * The problem with temporary files flooding is fixed. 133 * Miscellaneous bug fixes and improvements. 134 131 135 = 2.0.7 = 132 136 * Miscellaneous bug fixes and improvements. -
expresscurate/trunk/templates/dashboard/feed_widget.php
r1109426 r1111122 24 24 </ul> 25 25 <?php if(!empty($feeds) && !empty($feeds['content'])){ ?> 26 <a class="settingsLink" href="admin.php?page=expresscurate_feed_list">More Content (<?php echo count($feeds['content']); ?>)</a>26 <a class="settingsLink" href="admin.php?page=expresscurate_feed_list">More Content (<?php echo count($feeds['content']); ?>)</a> 27 27 <?php } ?> 28 28 </div>
Note: See TracChangeset
for help on using the changeset viewer.