Changeset 653372
- Timestamp:
- 01/16/2013 04:44:50 AM (13 years ago)
- Location:
- syndicate-press/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
syndicate-press-plugin.php (modified) (42 diffs)
Legend:
- Unmodified
- Added
- Removed
-
syndicate-press/trunk/readme.txt
r648984 r653372 5 5 Requires at least: 2.8 6 6 Tested up to: 3.5 7 Stable tag: 1.0.2 17 Stable tag: 1.0.22 8 8 9 9 Syndicate Press lets you include RSS, RDF or Atom feeds directly in your Wordpress posts, pages, widgets or theme. … … 47 47 48 48 http://syndicatepress.henryranch.net/documentation/changelog/ 49 50 1.0.22: New feature release<br> 51 - Custom cache directory:<br> 52 --- The admin can now set a custom cache root directory in the "Cache" tab. This may be useful for Wordpress multi-site configurations.<br> 53 --- The "Cache" tab now shows the cache root, input and output directories along with their current permissions and how many cache files are in each dir.<br> 54 - Bug fix:<br> 55 --- Fixed a bug in which the clear cache buttons were not working as expected.<br> 49 56 50 57 1.0.21: New feature release<br> -
syndicate-press/trunk/syndicate-press-plugin.php
r648984 r653372 5 5 Description: This plugin provides a high performance, highly configurable and easy to use news syndication aggregator which supports RSS, RDF and ATOM feeds. 6 6 Author: HenryRanch LLC (henryranch.net) 7 Version: 1.0.2 17 Version: 1.0.22 8 8 Author URI: http://syndicatepress.henryranch.net/ 9 9 License: GPL2 … … 63 63 64 64 if (!class_exists("SyndicatePressPlugin")) { 65 class SyndicatePressPlugin {66 var $version = "1.0.2 1";65 class SyndicatePressPlugin { 66 var $version = "1.0.22"; 67 67 var $homepageURL = "http://syndicatepress.henryranch.net/"; 68 68 … … 71 71 var $formattedOutputCacheDir = "/cache/output"; 72 72 var $linkBackImagesDir = "/images"; 73 var $adminOptionsName = "SyndicatePressPluginAdminOptions";73 var $adminOptionsName = "SyndicatePressPluginAdminOptions"; 74 74 75 75 var $feedListCustomNameDelimiter = '|'; 76 function SyndicatePressPlugin() {} 77 function init() { 78 $this->sp_getConfigOptions(); 79 } 80 //Returns an array of admin options 81 function sp_getConfigOptions() { 82 $adminOptions = array('enable' => 'true', 76 function SyndicatePressPlugin() {} 77 function init() { 78 $this->sp_getConfigOptions(); 79 } 80 //Returns an array of admin options 81 function sp_getConfigOptions() { 82 $adminOptions = array( 83 'enable' => 'true', 83 84 'enableFeedCache' => 'true', 84 85 'enableOutputCache' => 'true', 86 'customCacheDirectory' => '', 85 87 'useDownloadClient' => 'true', 86 88 'displayImages' => 'false', … … 110 112 'feedNotAvailableHTMLCode' => 'Sorry, the {feedname} feed is not available at this time.' 111 113 ); 112 $configOptions = get_option($this->adminOptionsName); 113 if (!empty($configOptions)) { 114 foreach ($configOptions as $key => $option) 115 $adminOptions[$key] = $option; 116 } 117 update_option($this->adminOptionsName, $adminOptions); 118 return $adminOptions; 119 } 120 114 $configOptions = get_option($this->adminOptionsName); 115 if (!empty($configOptions)) 116 { 117 foreach ($configOptions as $key => $option) 118 { 119 $adminOptions[$key] = $option; 120 } 121 } 122 update_option($this->adminOptionsName, $adminOptions); 123 return $adminOptions; 124 } 125 121 126 /* Find and match the bbcodes that are related to syndicate press in pages and posts. 122 * Will match syndicate press bbcodes in pages/posts and replace the bbcode with the referenced RSS feed content123 * <!--syn-press#name--> or <!--sp#name--> or [sp# name]124 * This syntax allows you to reference an RSS feed URL that has been defined in the rss feed url list.125 * @package WordPress126 * @since version 2.8.4127 * @param string $content the post/page content128 * @return string the post/page content with relevant RSS feeds embedded in place of syndicate press bbcodes129 */127 * Will match syndicate press bbcodes in pages/posts and replace the bbcode with the referenced RSS feed content 128 * <!--syn-press#name--> or <!--sp#name--> or [sp# name] 129 * This syntax allows you to reference an RSS feed URL that has been defined in the rss feed url list. 130 * @package WordPress 131 * @since version 2.8.4 132 * @param string $content the post/page content 133 * @return string the post/page content with relevant RSS feeds embedded in place of syndicate press bbcodes 134 */ 130 135 function sp_ContentFilter($content) 131 136 { … … 143 148 144 149 /* get the current time 145 * @package WordPress146 * @since version 2.8.4147 * @return string the current time148 */150 * @package WordPress 151 * @since version 2.8.4 152 * @return string the current time 153 */ 149 154 function sp_getCurrentTime() 150 155 { … … 156 161 157 162 /* given the start time, calculate the elapsed time based on the current time 158 * @package WordPress159 * @since version 2.8.4160 * @return string the elaspsed time with 5 decimal place resolution161 */163 * @package WordPress 164 * @since version 2.8.4 165 * @return string the elaspsed time with 5 decimal place resolution 166 */ 162 167 function sp_getTotalProcessTime($startTime) 163 168 { … … 193 198 194 199 /* get the custom feedname for the given url. 195 * @package WordPress196 * @since version 2.8.4197 * @return string the custom feedname if one exists, else ""198 */200 * @package WordPress 201 * @since version 2.8.4 202 * @return string the custom feedname if one exists, else "" 203 */ 199 204 function sp_getCustomFeednameForUrl($url) 200 205 { … … 223 228 224 229 /* Filter callback which actually does the main work of the plugin. 225 * Will match syndicate press bbcodes in pages/posts and replace the bbcode with the referenced RSS feed content226 * <!--syn-press#name--> or <!--sp#name--> or [sp# name]227 * This syntax allows you to reference an RSS feed URL that has been defined in the rss feed url list.228 * @package WordPress229 * @since version 2.8.4230 * @param string $bbCodeTagArray the values passed in from the bbcode: [sp# match1,match2,match3]231 * @return string the post/page content with relevant RSS feeds embedded in place of syndicate press bbcodes232 */230 * Will match syndicate press bbcodes in pages/posts and replace the bbcode with the referenced RSS feed content 231 * <!--syn-press#name--> or <!--sp#name--> or [sp# name] 232 * This syntax allows you to reference an RSS feed URL that has been defined in the rss feed url list. 233 * @package WordPress 234 * @since version 2.8.4 235 * @param string $bbCodeTagArray the values passed in from the bbcode: [sp# match1,match2,match3] 236 * @return string the post/page content with relevant RSS feeds embedded in place of syndicate press bbcodes 237 */ 233 238 function sp_filterCallback($bbCodeTagArray) 234 239 { … … 258 263 { 259 264 $feedNameReference = trim($feedNameReference);//,"\x7f..\xff\x0..\x1f"); 260 //echo 'pre exploded feed name ref: \''.$feedNameReference.'\'<br>';265 //echo 'pre exploded feed name ref: \''.$feedNameReference.'\'<br>'; 261 266 //ignore array element s that are just the bbcode text. we don't need the bbcode text b/c the following text is the bbcode parameters as extracted by the sp bbcode filter 262 267 if(strpos($feedNameReference, '[') !== false) … … 308 313 } 309 314 //split the reference string on ',' (comma). this is the feed reference list provided in the bbcode: [sp# feed1,feed2,feed3,etc...] 310 //echo 'feed name ref: '.$feedNameReference.'<br>';311 $feedNameList = explode(',', $feedNameReference);312 315 //echo 'feed name ref: '.$feedNameReference.'<br>'; 316 $feedNameList = explode(',', $feedNameReference); 317 313 318 foreach($feedNameList as $feedName) 314 319 { 315 $feedName = trim($feedName);320 $feedName = trim($feedName); 316 321 //print "Checking feedname: '$feedName' against available feed: '$availableFeed'<br>"; 317 322 if(strpos($availableFeed, $feedName) !== false || ($feedName == 'all')) … … 359 364 360 365 /* Get the time when the given url was last cached. 361 * @package WordPress362 * @since version 2.8.4363 * @param string $url the rss url364 * @return string time stamp of when the feed was last cached.365 */366 * @package WordPress 367 * @since version 2.8.4 368 * @param string $url the rss url 369 * @return string time stamp of when the feed was last cached. 370 */ 366 371 function sp_getFeedCacheTime($url) 367 372 { 368 $pluginDir = dirname(__FILE__); 369 $cacheFile = $pluginDir.'/'.$this->inputFeedCacheDir . '/' . md5($url); 373 $cacheFile = $this->sp_getInputFeedCacheDir() . '/' . md5($url); 370 374 371 375 if(file_exists($cacheFile)) … … 380 384 381 385 /* Make sure that the cache dirs are ready to be used. 382 * Initialize the cache dirs. If they don't exist, create them, else do nothing.383 * @package WordPress384 * @since version 2.8.4385 */386 * Initialize the cache dirs. If they don't exist, create them, else do nothing. 387 * @package WordPress 388 * @since version 2.8.4 389 */ 386 390 function sp_prepCache() 387 391 { 392 $cacheRootDir = $this->sp_getRootCacheDir(); 393 if(!is_dir($cacheRootDir)) 394 { 395 mkdir($cacheRootDir); 396 } 397 if(!is_dir($this->sp_getInputFeedCacheDir())) 398 { 399 mkdir($this->sp_getInputFeedCacheDir()); 400 } 401 if(!is_dir($this->sp_getOutputFeedCacheDir())) 402 { 403 mkdir($this->sp_getOutputFeedCacheDir()); 404 } 405 } 406 407 function sp_getNumInputCacheFiles() 408 { 409 return $this->sp_countFilesInDir($this->sp_getInputFeedCacheDir() . '/'); 410 } 411 412 function sp_getNumOutputCacheFiles() 413 { 414 return $this->sp_countFilesInDir($this->sp_getOutputFeedCacheDir() . '/'); 415 } 416 417 function sp_getInputFeedCacheDir() 418 { 419 return $this->sp_getRootCacheDir().'/input'; 420 } 421 422 function sp_getOutputFeedCacheDir() 423 { 424 return $this->sp_getRootCacheDir().'/output'; 425 } 426 427 function sp_getCacheDefaultRootDir() 428 { 388 429 $pluginDir = dirname(__FILE__); 389 if(!is_dir($pluginDir.'/'.$this->cacheDir)) 390 { 391 mkdir($pluginDir.'/'.$this->cacheDir); 392 } 393 if(!is_dir($pluginDir.'/'.$this->inputFeedCacheDir)) 394 { 395 mkdir($pluginDir.'/'.$this->inputFeedCacheDir); 396 } 397 if(!is_dir($pluginDir.'/'.$this->formattedOutputCacheDir)) 398 { 399 mkdir($pluginDir.'/'.$this->formattedOutputCacheDir); 400 } 401 } 402 430 $rootCacheDir = $pluginDir.$this->cacheDir; 431 return $rootCacheDir; 432 } 433 434 function sp_getRootCacheDir() 435 { 436 $configOptions = $this->sp_getConfigOptions(); 437 if($configOptions['customCacheDirectory'] != '') 438 { 439 return $configOptions['customCacheDirectory']; 440 } 441 else 442 { 443 return $this->sp_getCacheDefaultRootDir(); 444 } 445 } 446 403 447 function sp_checkCachePermissions() 404 448 { 405 449 $pluginDir = dirname(__FILE__); 406 $mainCacheDir = $ pluginDir.'/'.$this->cacheDir;407 $inputCacheDir = $ pluginDir.'/'.$this->inputFeedCacheDir;408 $outputCacheDir = $ pluginDir.'/'.$this->formattedOutputCacheDir;450 $mainCacheDir = $this->sp_getRootCacheDir(); 451 $inputCacheDir = $this->sp_getInputFeedCacheDir(); 452 $outputCacheDir = $this->sp_getOutputFeedCacheDir(); 409 453 $mainCacheDirPerm = $this->sp_getFilePermissions($mainCacheDir); 410 454 $inputCacheDirPerm = $this->sp_getFilePermissions($inputCacheDir); … … 430 474 431 475 /* Get the domain name from the given url. 432 * @package WordPress433 * @since version 2.8.4434 * @param string $url the rss url435 * @return string domain name or ip address.436 */476 * @package WordPress 477 * @since version 2.8.4 478 * @param string $url the rss url 479 * @return string domain name or ip address. 480 */ 437 481 function sp_getDomainFromUrl($url) 438 482 { … … 442 486 443 487 /* Get the file path from the given url. 444 * @package WordPress445 * @since version 2.8.4446 * @param string $url the rss url447 * @return string file path from the url448 */488 * @package WordPress 489 * @since version 2.8.4 490 * @param string $url the rss url 491 * @return string file path from the url 492 */ 449 493 function sp_getFilePathFromUrl($url) 450 494 { … … 455 499 456 500 /* Get the local servers hostname that this plugin is running on. 457 * @package WordPress458 * @since version 2.8.4459 * @return string domain name of the server that this wordpress installation is running on.460 */501 * @package WordPress 502 * @since version 2.8.4 503 * @return string domain name of the server that this wordpress installation is running on. 504 */ 461 505 function sp_getServerHostname() 462 506 { … … 467 511 468 512 /* Determine if the cache for the given feed URL has expired and needs to be refreshed. 469 * @package WordPress470 * @since version 2.8.4471 * @return boolean - true if the cache is expired else false.472 */513 * @package WordPress 514 * @since version 2.8.4 515 * @return boolean - true if the cache is expired else false. 516 */ 473 517 function sp_incomingFeedCacheExpired($url) 474 518 { … … 488 532 489 533 /* Cache the given rss feed if needed 490 * Cache the contents of the given rss feed if it is not already cached.491 * If already cached and the timeout period has expired, re-download the feed and cache it.492 * @package WordPress493 * @since version 2.8.4494 * @param string $url the rss url495 * @return string the locally available path to the cache file.496 */534 * Cache the contents of the given rss feed if it is not already cached. 535 * If already cached and the timeout period has expired, re-download the feed and cache it. 536 * @package WordPress 537 * @since version 2.8.4 538 * @param string $url the rss url 539 * @return string the locally available path to the cache file. 540 */ 497 541 function sp_cacheIncomingRssFeed($url) 498 542 { … … 502 546 $useDownloadClient = $configOptions['useDownloadClient']; 503 547 $this->sp_prepCache(); 504 $cacheFile = dirname(__FILE__) . $this->inputFeedCacheDir.'/'. md5($url);548 $cacheFile = $this->sp_getInputFeedCacheDir() .'/'. md5($url); 505 549 if($this->sp_incomingFeedCacheExpired($url)) 506 550 { … … 550 594 551 595 /* Cache the parsed and "rendered" html feed information 552 * @package WordPress553 * @since version 2.8.4554 * @param string $url the rss url555 * @return string the locally available path to the cache file.556 */596 * @package WordPress 597 * @since version 2.8.4 598 * @param string $url the rss url 599 * @return string the locally available path to the cache file. 600 */ 557 601 function sp_cacheRenderedHtml($feedReference, $htmlContent) 558 602 { … … 562 606 563 607 /* Get the filename of the output cache file for the given feed reference name 564 * @package WordPress565 * @since version 2.8.4566 * @param string $feedNameReference comma separated list of feeds that make up the formatted output for the bbcode that this bbcode instance refers to567 * @return string the locally available path to the cache file.568 */608 * @package WordPress 609 * @since version 2.8.4 610 * @param string $feedNameReference comma separated list of feeds that make up the formatted output for the bbcode that this bbcode instance refers to 611 * @return string the locally available path to the cache file. 612 */ 569 613 function sp_getOutputCacheFilename($feedNameReference) 570 614 { 571 return dirname(__FILE__) . $this->formattedOutputCacheDir.'/'. md5($feedNameReference);615 return $this->sp_getOutputFeedCacheDir() .'/'. md5($feedNameReference); 572 616 } 573 617 574 618 /* Get the filename of the input cache file for the given feed url 575 * @package WordPress576 * @since version 2.8.4577 * @param string $url the url of the incoming feed578 * @return string the locally available path to the cache file.579 */619 * @package WordPress 620 * @since version 2.8.4 621 * @param string $url the url of the incoming feed 622 * @return string the locally available path to the cache file. 623 */ 580 624 function sp_getInputCacheFilename($url) 581 625 { 582 return dirname(__FILE__) . $this->inputFeedCacheDir.'/'. md5($url);626 return $this->sp_getInputFeedCacheDir() .'/'. md5($url); 583 627 } 584 628 585 629 /* write the given content to the given filename 586 * @package WordPress587 * @since version 2.8.4588 * @param string $fileName the local path to the file to be written589 * @param string $content the content to be writting into the file590 */630 * @package WordPress 631 * @since version 2.8.4 632 * @param string $fileName the local path to the file to be written 633 * @param string $content the content to be writting into the file 634 */ 591 635 function sp_writeFile($fileName, $content) 592 636 { … … 595 639 fclose($fp); 596 640 } 597 641 642 function sp_countFilesInDir($dir) 643 { 644 try 645 { 646 $filesInDir = glob($dir.'*'); 647 if($filesInDir) 648 { 649 return count($filesInDir); 650 } 651 else 652 { 653 return 0; 654 } 655 } catch(Exception $e) 656 { 657 return -2; 658 } 659 } 660 598 661 /* Delete all of the files in the given directory 599 * @package WordPress600 * @since version 2.8.4601 * @param string $dir the local path to the dir from which the files will be deleted602 */662 * @package WordPress 663 * @since version 2.8.4 664 * @param string $dir the local path to the dir from which the files will be deleted 665 */ 603 666 function sp_deleteFilesInDir($dir) 604 667 { … … 606 669 { 607 670 $filesInDir = glob($dir.'*'); 608 if($file InDir)671 if($filesInDir) 609 672 { 610 673 foreach($filesInDir as $filename) … … 618 681 619 682 /* Delete the incoming feed cache files 620 * @package WordPress621 * @since version 2.8.4622 */683 * @package WordPress 684 * @since version 2.8.4 685 */ 623 686 function sp_clearIncomingFeedCache() 624 687 { 625 $this->sp_deleteFilesInDir( dirname(__FILE__) . $this->inputFeedCacheDir.'/');688 $this->sp_deleteFilesInDir($this->sp_getInputFeedCacheDir() .'/'); 626 689 } 627 690 628 691 /* Delete the formatted output cache files 629 * @package WordPress630 * @since version 2.8.4631 */692 * @package WordPress 693 * @since version 2.8.4 694 */ 632 695 function sp_clearFormattedOutputCache() 633 696 { 634 $this->sp_deleteFilesInDir( dirname(__FILE__) . $this->formattedOutputCacheDir.'/');697 $this->sp_deleteFilesInDir($this->sp_getOutputFeedCacheDir() .'/'); 635 698 } 636 699 637 700 /* Get the html formatted rss feed. 638 * @package WordPress639 * @since version 2.8.4640 * @param string $url the rss url641 * @return string html formatted rss feed content from the given url.642 */701 * @package WordPress 702 * @since version 2.8.4 703 * @param string $url the rss url 704 * @return string html formatted rss feed content from the given url. 705 */ 643 706 function sp_getFormattedRssContent($url, $customConfigOverrides = NULL) 644 707 { … … 741 804 742 805 /* Get the list of link back images 743 * Not currently used.744 * @package WordPress745 * @since version 2.8.4746 * @return string an array of file paths to the link back images.747 */806 * Not currently used. 807 * @package WordPress 808 * @since version 2.8.4 809 * @return string an array of file paths to the link back images. 810 */ 748 811 function sp_getLinkbackImages() 749 812 { … … 766 829 767 830 /* Determine if the given string ends with the gven end string. 768 * @package WordPress769 * @since version 2.8.4770 * @param string $str the string to check771 * @param string $end the string to see if $str ends with772 * @return boolean true if the tring ends wit the given end, else false.773 */831 * @package WordPress 832 * @since version 2.8.4 833 * @param string $str the string to check 834 * @param string $end the string to see if $str ends with 835 * @return boolean true if the tring ends wit the given end, else false. 836 */ 774 837 function sp_endsWith($str, $end) 775 838 { … … 780 843 781 844 /* Add the given content to a new wordpress post. 782 * @package WordPress783 * @since version 2.8.4784 * @param string $content the content to add as a new post785 */845 * @package WordPress 846 * @since version 2.8.4 847 * @param string $content the content to add as a new post 848 */ 786 849 function sp_postContent($content) 787 850 { … … 800 863 801 864 /* Verify the given nonce or kill the script. this helps prevent nefarious evil doers from making direct URL calls into the plugin configuration page 802 * @package WordPress803 * @since version 2.8.4804 */865 * @package WordPress 866 * @since version 2.8.4 867 */ 805 868 function verifyNonceOrDie($nonceName) 806 869 { … … 820 883 function sp_getSPNews() 821 884 { 822 $url = "http://henryranch.net/feed/"; 885 //$url = "http://henryranch.net/feed/"; 886 $url = "http://syndicatepress.henryranch.net/feed/"; 823 887 //return $this->sp_getFormattedRssContent($url); 824 888 … … 871 935 } 872 936 873 /* Display the plugin admin page874 * @package WordPress875 * @since version 2.8.4876 */877 function sp_printAdminPage()878 { 879 $configOptions = $this->sp_getConfigOptions();937 /* Display the plugin admin page 938 * @package WordPress 939 * @since version 2.8.4 940 */ 941 function sp_printAdminPage() 942 { 943 $configOptions = $this->sp_getConfigOptions(); 880 944 881 if (isset($_POST['update_SyndicatePressPluginSettings']))945 if (isset($_POST['update_SyndicatePressPluginSettings'])) 882 946 { 883 947 //nonce security check... 884 948 $this->verifyNonceOrDie('synPress-update_settings'); 885 949 886 if (isset($_POST['syndicatePressEnableFeedCache'])) { 887 $configOptions['enableFeedCache'] = $_POST['syndicatePressEnableFeedCache']; 888 } 889 if (isset($_POST['syndicatePressEnableOutputCache'])) { 890 $configOptions['enableOutputCache'] = $_POST['syndicatePressEnableOutputCache']; 891 } 892 if (isset($_POST['syndicatePressCacheTimeoutSeconds'])) { 893 $configOptions['cacheTimeoutSeconds'] = $_POST['syndicatePressCacheTimeoutSeconds']; 894 } 895 if (isset($_POST['syndicatePressLimitFeedItemsToDisplay'])) { 896 $configOptions['limitFeedItemsToDisplay'] = $_POST['syndicatePressLimitFeedItemsToDisplay']; 897 } 898 if (isset($_POST['syndicatePressLimitFeedDescriptionCharsToDisplay'])) { 899 $configOptions['limitFeedDescriptionCharsToDisplay'] = $_POST['syndicatePressLimitFeedDescriptionCharsToDisplay']; 900 } 901 if (isset($_POST['syndicatePressMaxHeadlineLength'])) { 902 $configOptions['maxHeadlineLength'] = $_POST['syndicatePressMaxHeadlineLength']; 903 } 904 if (isset($_POST['syndicatePressTimestampFormat'])) { 905 $configOptions['timestampFormat'] = trim(mysql_real_escape_string($_POST['syndicatePressTimestampFormat'])); 906 } 907 if (isset($_POST['syndicatePressUseDownloadClient'])) { 908 $configOptions['useDownloadClient'] = $_POST['syndicatePressUseDownloadClient']; 909 } 910 if (isset($_POST['syndicatePressshowArticlePublishTimestamp'])) { 911 $configOptions['showArticlePublishTimestamp'] = $_POST['syndicatePressshowArticlePublishTimestamp']; 912 } 913 if (isset($_POST['syndicatePressEnable'])) { 914 $configOptions['enable'] = $_POST['syndicatePressEnable']; 915 } 916 if (isset($_POST['syndicatePressShowContentOnlyInLinkTitle'])) { 917 $configOptions['showContentOnlyInLinkTitle'] = $_POST['syndicatePressShowContentOnlyInLinkTitle']; 918 } 919 if (isset($_POST['syndicatePressAddNoFollowTag'])) { 920 $configOptions['addNoFollowTag'] = $_POST['syndicatePressAddNoFollowTag']; 921 } 922 if (isset($_POST['syndicatePressShowSyndicatePressLinkback'])) { 923 $configOptions['showSyndicatePressLinkback'] = $_POST['syndicatePressShowSyndicatePressLinkback']; 924 } 925 if (isset($_POST['syndicatePressShowProcessingMetrics'])) { 926 $configOptions['showProcessingMetrics'] = $_POST['syndicatePressShowProcessingMetrics']; 927 } 928 if (isset($_POST['syndicatePressShowFeedChannelTitle'])) { 929 $configOptions['showFeedChannelTitle'] = $_POST['syndicatePressShowFeedChannelTitle']; 930 } 931 if (isset($_POST['syndicatePressUseCustomFeednameAsChannelTitle'])) { 932 $configOptions['useCustomFeednameAsChannelTitle'] = $_POST['syndicatePressUseCustomFeednameAsChannelTitle']; 933 } 934 if (isset($_POST['syndicatePressDisplayImages'])) { 935 $configOptions['displayImages'] = $_POST['syndicatePressDisplayImages']; 936 } 937 if (isset($_POST['syndicatePressAllowMarkup'])) { 938 $configOptions['allowMarkupInDescription'] = $_POST['syndicatePressAllowMarkup']; 939 } 940 if (isset($_POST['syndicatePressFeedUrlList'])) { 941 $configOptions['feedUrlList'] = apply_filters('feedUrlList_save_pre', $_POST['syndicatePressFeedUrlList']); 950 951 if (isset($_POST['syndicatePressCustomCacheDirectory'])) { 952 $configOptions['customCacheDirectory'] = trim(mysql_real_escape_string($_POST['syndicatePressCustomCacheDirectory'])); 953 } 954 if (isset($_POST['syndicatePressEnableFeedCache'])) { 955 $configOptions['enableFeedCache'] = $_POST['syndicatePressEnableFeedCache']; 956 } 957 if (isset($_POST['syndicatePressEnableOutputCache'])) { 958 $configOptions['enableOutputCache'] = $_POST['syndicatePressEnableOutputCache']; 959 } 960 if (isset($_POST['syndicatePressCacheTimeoutSeconds'])) { 961 $configOptions['cacheTimeoutSeconds'] = $_POST['syndicatePressCacheTimeoutSeconds']; 962 } 963 if (isset($_POST['syndicatePressLimitFeedItemsToDisplay'])) { 964 $configOptions['limitFeedItemsToDisplay'] = $_POST['syndicatePressLimitFeedItemsToDisplay']; 965 } 966 if (isset($_POST['syndicatePressLimitFeedDescriptionCharsToDisplay'])) { 967 $configOptions['limitFeedDescriptionCharsToDisplay'] = $_POST['syndicatePressLimitFeedDescriptionCharsToDisplay']; 968 } 969 if (isset($_POST['syndicatePressMaxHeadlineLength'])) { 970 $configOptions['maxHeadlineLength'] = $_POST['syndicatePressMaxHeadlineLength']; 971 } 972 if (isset($_POST['syndicatePressTimestampFormat'])) { 973 $configOptions['timestampFormat'] = trim(mysql_real_escape_string($_POST['syndicatePressTimestampFormat'])); 974 } 975 if (isset($_POST['syndicatePressUseDownloadClient'])) { 976 $configOptions['useDownloadClient'] = $_POST['syndicatePressUseDownloadClient']; 977 } 978 if (isset($_POST['syndicatePressshowArticlePublishTimestamp'])) { 979 $configOptions['showArticlePublishTimestamp'] = $_POST['syndicatePressshowArticlePublishTimestamp']; 980 } 981 if (isset($_POST['syndicatePressEnable'])) { 982 $configOptions['enable'] = $_POST['syndicatePressEnable']; 983 } 984 if (isset($_POST['syndicatePressShowContentOnlyInLinkTitle'])) { 985 $configOptions['showContentOnlyInLinkTitle'] = $_POST['syndicatePressShowContentOnlyInLinkTitle']; 986 } 987 if (isset($_POST['syndicatePressAddNoFollowTag'])) { 988 $configOptions['addNoFollowTag'] = $_POST['syndicatePressAddNoFollowTag']; 989 } 990 if (isset($_POST['syndicatePressShowSyndicatePressLinkback'])) { 991 $configOptions['showSyndicatePressLinkback'] = $_POST['syndicatePressShowSyndicatePressLinkback']; 992 } 993 if (isset($_POST['syndicatePressShowProcessingMetrics'])) { 994 $configOptions['showProcessingMetrics'] = $_POST['syndicatePressShowProcessingMetrics']; 995 } 996 if (isset($_POST['syndicatePressShowFeedChannelTitle'])) { 997 $configOptions['showFeedChannelTitle'] = $_POST['syndicatePressShowFeedChannelTitle']; 998 } 999 if (isset($_POST['syndicatePressUseCustomFeednameAsChannelTitle'])) { 1000 $configOptions['useCustomFeednameAsChannelTitle'] = $_POST['syndicatePressUseCustomFeednameAsChannelTitle']; 1001 } 1002 if (isset($_POST['syndicatePressDisplayImages'])) { 1003 $configOptions['displayImages'] = $_POST['syndicatePressDisplayImages']; 1004 } 1005 if (isset($_POST['syndicatePressAllowMarkup'])) { 1006 $configOptions['allowMarkupInDescription'] = $_POST['syndicatePressAllowMarkup']; 1007 } 1008 if (isset($_POST['syndicatePressFeedUrlList'])) { 1009 $configOptions['feedUrlList'] = apply_filters('feedUrlList_save_pre', $_POST['syndicatePressFeedUrlList']); 942 1010 //replace any occurrances of feed:// with http:// 943 1011 $configOptions['feedUrlList'] = str_replace("feed://", "http://", $configOptions['feedUrlList']); 944 1012 $configOptions['feedUrlList'] = trim($configOptions['feedUrlList']); 945 }946 if (isset($_POST['syndicatePressExclusiveKeywordFilter'])) {947 $configOptions['exclusiveKeywordFilter'] = apply_filters('exclusiveKeywordFilter_save_pre', $_POST['syndicatePressExclusiveKeywordFilter']);948 }949 if (isset($_POST['syndicatePressInclusiveKeywordFilter'])) {950 $configOptions['inclusiveKeywordFilter'] = apply_filters('inclusiveKeywordFilter_save_pre', $_POST['syndicatePressInclusiveKeywordFilter']);951 }952 if (isset($_POST['syndicatePressFeedTitleHTMLCodePre'])) {953 $configOptions['feedTitleHTMLCodePre'] = apply_filters('feedTitleHTMLCodePre_save_pre', $_POST['syndicatePressFeedTitleHTMLCodePre']);1013 } 1014 if (isset($_POST['syndicatePressExclusiveKeywordFilter'])) { 1015 $configOptions['exclusiveKeywordFilter'] = apply_filters('exclusiveKeywordFilter_save_pre', $_POST['syndicatePressExclusiveKeywordFilter']); 1016 } 1017 if (isset($_POST['syndicatePressInclusiveKeywordFilter'])) { 1018 $configOptions['inclusiveKeywordFilter'] = apply_filters('inclusiveKeywordFilter_save_pre', $_POST['syndicatePressInclusiveKeywordFilter']); 1019 } 1020 if (isset($_POST['syndicatePressFeedTitleHTMLCodePre'])) { 1021 $configOptions['feedTitleHTMLCodePre'] = apply_filters('feedTitleHTMLCodePre_save_pre', $_POST['syndicatePressFeedTitleHTMLCodePre']); 954 1022 $configOptions['feedTitleHTMLCodePre'] = mysql_real_escape_string($configOptions['feedTitleHTMLCodePre']); 955 1023 } 956 if (isset($_POST['syndicatePressFeedTitleHTMLCodePost'])) {957 $configOptions['feedTitleHTMLCodePost'] = apply_filters('feedTitleHTMLCodePost_save_pre', $_POST['syndicatePressFeedTitleHTMLCodePost']);1024 if (isset($_POST['syndicatePressFeedTitleHTMLCodePost'])) { 1025 $configOptions['feedTitleHTMLCodePost'] = apply_filters('feedTitleHTMLCodePost_save_pre', $_POST['syndicatePressFeedTitleHTMLCodePost']); 958 1026 $configOptions['feedTitleHTMLCodePost'] = mysql_real_escape_string($configOptions['feedTitleHTMLCodePost']); 959 1027 } 960 if (isset($_POST['syndicatePressArticleTitleHTMLCodePre'])) {961 $configOptions['articleTitleHTMLCodePre'] = apply_filters('articleTitleHTMLCodePre_save_pre', $_POST['syndicatePressArticleTitleHTMLCodePre']);1028 if (isset($_POST['syndicatePressArticleTitleHTMLCodePre'])) { 1029 $configOptions['articleTitleHTMLCodePre'] = apply_filters('articleTitleHTMLCodePre_save_pre', $_POST['syndicatePressArticleTitleHTMLCodePre']); 962 1030 $configOptions['articleTitleHTMLCodePre'] = mysql_real_escape_string($configOptions['articleTitleHTMLCodePre']); 963 1031 } 964 if (isset($_POST['syndicatePressArticleTitleHTMLCodePost'])) {965 $configOptions['articleTitleHTMLCodePost'] = apply_filters('articleTitleHTMLCodePost_save_pre', $_POST['syndicatePressArticleTitleHTMLCodePost']);1032 if (isset($_POST['syndicatePressArticleTitleHTMLCodePost'])) { 1033 $configOptions['articleTitleHTMLCodePost'] = apply_filters('articleTitleHTMLCodePost_save_pre', $_POST['syndicatePressArticleTitleHTMLCodePost']); 966 1034 $configOptions['articleTitleHTMLCodePost'] = mysql_real_escape_string($configOptions['articleTitleHTMLCodePost']); 967 1035 } 968 if (isset($_POST['syndicatePressArticleBodyHTMLCodePre'])) {969 $configOptions['articleBodyHTMLCodePre'] = apply_filters('articleBodyHTMLCodePre_save_pre', $_POST['syndicatePressArticleBodyHTMLCodePre']);1036 if (isset($_POST['syndicatePressArticleBodyHTMLCodePre'])) { 1037 $configOptions['articleBodyHTMLCodePre'] = apply_filters('articleBodyHTMLCodePre_save_pre', $_POST['syndicatePressArticleBodyHTMLCodePre']); 970 1038 $configOptions['articleBodyHTMLCodePre'] = mysql_real_escape_string($configOptions['articleBodyHTMLCodePre']); 971 1039 } 972 if (isset($_POST['syndicatePressArticleBodyHTMLCodePost'])) {973 $configOptions['articleBodyHTMLCodePost'] = apply_filters('articleBodyHTMLCodePost_save_pre', $_POST['syndicatePressArticleBodyHTMLCodePost']);1040 if (isset($_POST['syndicatePressArticleBodyHTMLCodePost'])) { 1041 $configOptions['articleBodyHTMLCodePost'] = apply_filters('articleBodyHTMLCodePost_save_pre', $_POST['syndicatePressArticleBodyHTMLCodePost']); 974 1042 $configOptions['articleBodyHTMLCodePost'] = mysql_real_escape_string($configOptions['articleBodyHTMLCodePost']); 975 1043 } 976 if (isset($_POST['syndicatePressFeedSeparationHTMLCode'])) {977 $configOptions['feedSeparationHTMLCode'] = apply_filters('feedSeparationHTMLCode_save_pre', $_POST['syndicatePressFeedSeparationHTMLCode']);1044 if (isset($_POST['syndicatePressFeedSeparationHTMLCode'])) { 1045 $configOptions['feedSeparationHTMLCode'] = apply_filters('feedSeparationHTMLCode_save_pre', $_POST['syndicatePressFeedSeparationHTMLCode']); 978 1046 $configOptions['feedSeparationHTMLCode'] = mysql_real_escape_string($configOptions['feedSeparationHTMLCode']); 979 }980 if (isset($_POST['syndicatePressFeedNotAvailableHTMLCode'])) {981 $configOptions['feedNotAvailableHTMLCode'] = apply_filters('feedNotAvailableHTMLCode_save_pre', $_POST['syndicatePressFeedNotAvailableHTMLCode']);982 $configOptions['feedNotAvailableHTMLCode'] = mysql_real_escape_string($configOptions['feedNotAvailableHTMLCode']);1047 } 1048 if (isset($_POST['syndicatePressFeedNotAvailableHTMLCode'])) { 1049 $configOptions['feedNotAvailableHTMLCode'] = apply_filters('feedNotAvailableHTMLCode_save_pre', $_POST['syndicatePressFeedNotAvailableHTMLCode']); 1050 $configOptions['feedNotAvailableHTMLCode'] = mysql_real_escape_string($configOptions['feedNotAvailableHTMLCode']); 983 1051 } 984 1052 … … 986 1054 $this->sp_clearFormattedOutputCache(); 987 1055 ?> 988 <div class="updated"><p><strong><?php _e("Settings Updated.", "SyndicatePressPlugin");?></strong></p></div> 1056 <div class="updated"><p><strong><?php _e("Settings Updated.", "SyndicatePressPlugin");?></strong></p></div> 989 1057 <?php 990 1058 } … … 995 1063 $this->sp_clearIncomingFeedCache(); 996 1064 ?> 997 <div class="updated"><p><strong><?php _e("Input feed cache cleared.", "SyndicatePressPlugin");?></strong></p></div> 1065 <div class="updated"><p><strong><?php _e("Input feed cache cleared.", "SyndicatePressPlugin");?></strong></p></div> 998 1066 <?php 999 1067 } … … 1004 1072 $this->sp_clearFormattedOutputCache(); 1005 1073 ?> 1006 <div class="updated"><p><strong><?php _e("Output cache cleared.", "SyndicatePressPlugin");?></strong></p></div> 1074 <div class="updated"><p><strong><?php _e("Output cache cleared.", "SyndicatePressPlugin");?></strong></p></div> 1007 1075 <?php 1008 1076 } … … 1010 1078 { 1011 1079 ?> 1012 <div id="notice" class="error"><p><strong><?php _e("Syndicate Press output is currently disabled.", "SyndicatePressPlugin");?></strong></p></div> 1080 <div id="notice" class="error"><p><strong><?php _e("Syndicate Press output is currently disabled.", "SyndicatePressPlugin");?></strong></p></div> 1013 1081 <?php 1014 1082 } … … 1140 1208 <label for="syndicatePressEnableOutputCache_no"><input type="radio" id="syndicatePressEnableOutputCache_no" name="syndicatePressEnableOutputCache" value="false" <?php if ($configOptions['enableOutputCache'] == "false") { _e('checked="checked"', "SyndicatePressPlugin"); }?>/> Disable - Parse and format the feed every time the page/post is requested. <em>This is NOT recommended!</em></label> 1141 1209 </div> 1210 <br> <br> 1211 <b><u>Cache directory</u></b> 1212 <div style="padding-left: 20px;"> 1213 <b>Current cache root directory:</b><br> 1214 <div style="padding-left: 20px;"> 1215 <?php print $this->sp_getRootCacheDir(); ?><br>Permissions: <?php print $this->sp_getFilePermissions($this->sp_getRootCacheDir())?><br> 1216 </div> 1217 <b>Current input cache directory:</b><br> 1218 <div style="padding-left: 20px;"> 1219 <?php print $this->sp_getInputFeedCacheDir(); ?><br>Permissions: <?php print $this->sp_getFilePermissions($this->sp_getInputFeedCacheDir())?><br> 1220 <?php print $this->sp_getNumInputCacheFiles(); ?> cached files.<br> 1221 </div> 1222 <b>Current output cache directory:</b><br> 1223 <div style="padding-left: 20px;"> 1224 <?php print $this->sp_getOutputFeedCacheDir(); ?><br>Permissions: <?php print $this->sp_getFilePermissions($this->sp_getOutputFeedCacheDir())?><br> 1225 <?php print $this->sp_getNumOutputCacheFiles(); ?> cached files.<br> 1226 </div> 1227 <b>Syndicate Press default cache directory:</b><br> 1228 <div style="padding-left: 20px;"> 1229 <?php print $this->sp_getCacheDefaultRootDir(); ?><br>Permissions: <?php print $this->sp_getFilePermissions($this->sp_getCacheDefaultRootDir())?><br> 1230 </div> 1231 <b>Custom cache root directory</b> (Leave blank to use the default plugin cache directory):<br> 1232 <div style="padding-left: 20px;"> 1233 <input name="syndicatePressCustomCacheDirectory" size="100" value="<?php _e(apply_filters('format_to_edit',$configOptions['customCacheDirectory']), 'SyndicatePressPlugin') ?>"><br> 1234 <i>If you set a custom cache directory, make sure that your server has read and write access to it.</i> 1235 </div> 1236 </div> 1142 1237 </div> 1143 1238 <div class="tabbertab"> … … 1155 1250 <div style="padding-left: 20px;"> 1156 1251 <label for="syndicatePressshowArticlePublishTimestamp_yes"><input type="radio" id="syndicatePressshowArticlePublishTimestamp_yes" name="syndicatePressshowArticlePublishTimestamp" value="true" <?php if ($configOptions['showArticlePublishTimestamp'] == "true") { _e('checked="checked"', "SyndicatePressPlugin"); }?> /> Show timestamp.</label><br> 1157 <div style="padding-left: 20px;">1158 Timestamp Format: <input name="syndicatePressTimestampFormat" size="50" value="<?php _e($this->sp_unescapeString(apply_filters('format_to_edit',$configOptions['timestampFormat'])), 'SyndicatePressPlugin') ?>"> Default: <?php $tfp = new TinyFeedParser(); echo '<b><i>'.$tfp->getDefaultTimestampFormatString().'</b></i>'; ?> <br>Example: The default format string create a timestamp like this: <i>Friday June 29th, 2012 04:12:01 AM</i> <br>For help with custom timestamp formatting, see <a href="http://php.net/manual/en/function.date.php" target="_blank">this documentation</a>.<br>1159 </div>1252 <div style="padding-left: 20px;"> 1253 Timestamp Format: <input name="syndicatePressTimestampFormat" size="50" value="<?php _e($this->sp_unescapeString(apply_filters('format_to_edit',$configOptions['timestampFormat'])), 'SyndicatePressPlugin') ?>"> Default: <?php $tfp = new TinyFeedParser(); echo '<b><i>'.$tfp->getDefaultTimestampFormatString().'</b></i>'; ?> <br>Example: The default format string create a timestamp like this: <i>Friday June 29th, 2012 04:12:01 AM</i> <br>For help with custom timestamp formatting, see <a href="http://php.net/manual/en/function.date.php" target="_blank">this documentation</a>.<br> 1254 </div> 1160 1255 <label for="syndicatePressshowArticlePublishTimestamp_no"><input type="radio" id="syndicatePressshowArticlePublishTimestamp_no" name="syndicatePressshowArticlePublishTimestamp" value="false" <?php if ($configOptions['showArticlePublishTimestamp'] == "false") { _e('checked="checked"', "SyndicatePressPlugin"); }?>/> Hide timestamp.</label><br> 1161 1256 </div><br> <br> … … 1226 1321 </div> 1227 1322 </div> 1228 <div class="tabbertab">1323 <div class="tabbertab"> 1229 1324 <h2>SEO</h2> 1230 1325 <b><u>No-follow directive:</u></b><br> … … 1233 1328 <label for="syndicatePressAddNoFollowTag_no"><input type="radio" id="syndicatePressAddNoFollowTag_no" name="syndicatePressAddNoFollowTag" value="false" <?php if ($configOptions['addNoFollowTag'] == "false") { _e('checked="checked"', "SyndicatePressPlugin"); }?>/> Do not add the no-follow tag to URL's.</label><br> 1234 1329 </div> 1235 </div>1330 </div> 1236 1331 </form> 1237 1332 <div class="tabbertab"> … … 1242 1337 <div style="padding-left: 20px;"> 1243 1338 [sp# feedList=all] - insert all of the feeds in the feed list<br> 1244 <i>In the following examples, <b>feedname</b> will match the name of a feed, or any word within the feed url</i><br>1339 <i>In the following examples, <b>feedname</b> will match the name of a feed, or any word within the feed url</i><br> 1245 1340 [sp# feedList=feedname] - insert only the feed with the given name<br> 1246 1341 [sp# feedList=feedname limitArticles=maxNumArticles] - limit the number of articles from the given feedname(s). Overrides the global article limit.<br> … … 1312 1407 <script language="javascript"> 1313 1408 function toggle(elementId) { 1314 var ele = document.getElementById(elementId);1315 var text = document.getElementById("displayText");1316 if(ele.style.display == "block") {1317 ele.style.display = "none";1318 text.innerHTML = "show";1319 }1320 else {1321 ele.style.display = "block";1322 text.innerHTML = "hide";1323 }1409 var ele = document.getElementById(elementId); 1410 var text = document.getElementById("displayText"); 1411 if(ele.style.display == "block") { 1412 ele.style.display = "none"; 1413 text.innerHTML = "show"; 1414 } 1415 else { 1416 ele.style.display = "block"; 1417 text.innerHTML = "hide"; 1418 } 1324 1419 } 1325 1420 </script> … … 1345 1440 A donation is a great way to show your support for this plugin. Donations help offset the cost of maintenance, development and hosting.<br><br> 1346 1441 Donations also help keep the developer motivated to add new features. :-)<br><br> 1347 There is no minimum donation amount. If you like this plugin and find that it has saved you time or effort, you can be the judge of how much that is worth to you.<br><br>1442 There is no minimum donation amount. If you like this plugin and find that it has saved you time or effort, you can be the judge of how much that is worth to you.<br><br> 1348 1443 Thank you! 1349 1444 </p> 1350 1445 <p align="center"> 1351 1446 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 1352 <input type="hidden" name="cmd" value="_s-xclick">1353 <input type="hidden" name="hosted_button_id" value="G3XU76VEAWT4Y">1354 <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">1355 <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">1356 </form>1357 <br>Donations are securely processed by Paypal.<br>1447 <input type="hidden" name="cmd" value="_s-xclick"> 1448 <input type="hidden" name="hosted_button_id" value="G3XU76VEAWT4Y"> 1449 <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 1450 <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> 1451 </form> 1452 <br>Donations are securely processed by Paypal.<br> 1358 1453 </p> 1359 1454 <!--</div>--> … … 1382 1477 1383 1478 </div> 1384 <?php1385 } 1386 }1479 <?php 1480 } 1481 } 1387 1482 } //End Class SyndicatePressPlugin 1388 1483 1389 1484 //Create the object instance of the class... 1390 1485 if (class_exists("SyndicatePressPlugin")) { 1391 $syndicatePressPluginObjectRef = new SyndicatePressPlugin();1486 $syndicatePressPluginObjectRef = new SyndicatePressPlugin(); 1392 1487 } 1393 1488 1394 1489 //Init the admin panel by adding it to the WP settings menu... 1395 1490 if (!function_exists("SyndicatePressPlugin_ap")) { 1396 function SyndicatePressPlugin_ap() {1397 global $syndicatePressPluginObjectRef;1491 function SyndicatePressPlugin_ap() { 1492 global $syndicatePressPluginObjectRef; 1398 1493 global $adminPageHook; 1399 if (!isset($syndicatePressPluginObjectRef)) {1400 return;1401 }1402 if (function_exists('add_options_page')) {1494 if (!isset($syndicatePressPluginObjectRef)) { 1495 return; 1496 } 1497 if (function_exists('add_options_page')) { 1403 1498 $adminPageHook = add_options_page('Syndicate Press', 'Syndicate Press', 9, basename(__FILE__), array(&$syndicatePressPluginObjectRef, 'sp_printAdminPage')); 1404 1499 add_action( 'admin_enqueue_scripts', 'my_admin_enqueue_scripts' ); 1405 }1406 } 1500 } 1501 } 1407 1502 } 1408 1503 1409 //Actions and filters are registered with WP here. 1504 //Actions and filters are registered with WP here. 1410 1505 if (isset($syndicatePressPluginObjectRef)) { 1411 //Actions...1412 add_action('admin_menu', 'SyndicatePressPlugin_ap');1413 add_action('activate_syndicatePress-plugin/syndicatePress-plugin.php', array(&$syndicatePressPluginObjectRef, 'init'));1414 1415 //Filter...1416 add_filter('the_content', array(&$syndicatePressPluginObjectRef,'sp_ContentFilter'));1506 //Actions... 1507 add_action('admin_menu', 'SyndicatePressPlugin_ap'); 1508 add_action('activate_syndicatePress-plugin/syndicatePress-plugin.php', array(&$syndicatePressPluginObjectRef, 'init')); 1509 1510 //Filter... 1511 add_filter('the_content', array(&$syndicatePressPluginObjectRef,'sp_ContentFilter')); 1417 1512 add_filter('widget_text', array(&$syndicatePressPluginObjectRef,'sp_ContentFilter')); 1418 1513 } … … 1422 1517 if ( $adminPageHook == $hook_suffix ) 1423 1518 { 1424 wp_enqueue_style('sp_printAdminPage_TAB', plugins_url('syndicate-press/css/tabber.css'), false, '2.50', false);1425 wp_enqueue_script('sp_printAdminPage_TAB', plugins_url('syndicate-press/js/tabber-minimized.js'), false, '2.50', false);1519 wp_enqueue_style('sp_printAdminPage_TAB', plugins_url('syndicate-press/css/tabber.css'), false, '2.50', false); 1520 wp_enqueue_script('sp_printAdminPage_TAB', plugins_url('syndicate-press/js/tabber-minimized.js'), false, '2.50', false); 1426 1521 } 1427 1522 }
Note: See TracChangeset
for help on using the changeset viewer.