Plugin Directory

Changeset 653372


Ignore:
Timestamp:
01/16/2013 04:44:50 AM (13 years ago)
Author:
hranchFundi
Message:

1.0.22: New feature release

  • Custom cache directory:

--- The admin can now set a custom cache root directory in the "Cache" tab. This may be useful for Wordpress multi-site configurations.
--- 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.<

  • Bug fix:

--- Fixed a bug in which the clear cache buttons were not working as expected.

Location:
syndicate-press/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • syndicate-press/trunk/readme.txt

    r648984 r653372  
    55Requires at least: 2.8
    66Tested up to: 3.5
    7 Stable tag: 1.0.21
     7Stable tag: 1.0.22
    88
    99Syndicate Press lets you include RSS, RDF or Atom feeds directly in your Wordpress posts, pages, widgets or theme.
     
    4747
    4848http://syndicatepress.henryranch.net/documentation/changelog/
     49
     501.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>
    4956
    50571.0.21: New feature release<br>
  • syndicate-press/trunk/syndicate-press-plugin.php

    r648984 r653372  
    55Description: This plugin provides a high performance, highly configurable and easy to use news syndication aggregator which supports RSS, RDF and ATOM feeds.
    66Author: HenryRanch LLC (henryranch.net)
    7 Version: 1.0.21
     7Version: 1.0.22
    88Author URI: http://syndicatepress.henryranch.net/
    99License: GPL2
     
    6363
    6464if (!class_exists("SyndicatePressPlugin")) {
    65     class SyndicatePressPlugin {
    66         var $version = "1.0.21";
     65  class SyndicatePressPlugin {
     66        var $version = "1.0.22";
    6767        var $homepageURL = "http://syndicatepress.henryranch.net/";
    6868       
     
    7171        var $formattedOutputCacheDir = "/cache/output";
    7272        var $linkBackImagesDir = "/images";
    73         var $adminOptionsName = "SyndicatePressPluginAdminOptions";
     73        var $adminOptionsName = "SyndicatePressPluginAdminOptions";
    7474       
    7575        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',
    8384            'enableFeedCache' => 'true',
    8485            'enableOutputCache' => 'true',
     86            'customCacheDirectory' => '',
    8587            'useDownloadClient' => 'true',
    8688            'displayImages' => 'false',
     
    110112            'feedNotAvailableHTMLCode' => 'Sorry, the {feedname} feed is not available at this time.'
    111113            );
    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   
    121126         /* 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 content
    123                         * <!--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 WordPress
    126                         * @since version 2.8.4
    127                         * @param    string    $content    the post/page content
    128                         * @return   string     the post/page content with relevant RSS feeds embedded in place of syndicate press bbcodes
    129                         */
     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         */
    130135        function sp_ContentFilter($content)
    131136        {
     
    143148       
    144149        /* get the current time
    145                         * @package WordPress
    146                         * @since version 2.8.4
    147                         * @return   string     the current time
    148                         */
     150         * @package WordPress
     151         * @since version 2.8.4
     152         * @return   string     the current time
     153         */
    149154        function sp_getCurrentTime()
    150155        {
     
    156161       
    157162        /* given the start time, calculate the elapsed time based on the current time
    158                         * @package WordPress
    159                         * @since version 2.8.4
    160                         * @return   string     the elaspsed time with 5 decimal place resolution
    161                         */
     163         * @package WordPress
     164         * @since version 2.8.4
     165         * @return   string     the elaspsed time with 5 decimal place resolution
     166         */
    162167        function sp_getTotalProcessTime($startTime)
    163168        {
     
    193198       
    194199        /* get the custom feedname for the given url.
    195                         * @package WordPress
    196                         * @since version 2.8.4
    197                         * @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         */
    199204        function sp_getCustomFeednameForUrl($url)
    200205        {
     
    223228
    224229        /* 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 content
    226                         * <!--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 WordPress
    229                         * @since version 2.8.4
    230                         * @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 bbcodes
    232                         */
     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         */
    233238        function sp_filterCallback($bbCodeTagArray)
    234239        {
     
    258263                { 
    259264                    $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>';
    261266                    //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
    262267                    if(strpos($feedNameReference, '[') !== false)
     
    308313                        }
    309314                        //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           
    313318                        foreach($feedNameList as $feedName)
    314319                        {
    315                             $feedName = trim($feedName);
     320              $feedName = trim($feedName);
    316321                            //print "Checking feedname: '$feedName' against available feed: '$availableFeed'<br>";
    317322                            if(strpos($availableFeed, $feedName) !== false || ($feedName == 'all'))
     
    359364       
    360365        /* Get the time when the given url was last cached.
    361                         * @package WordPress
    362                         * @since version 2.8.4
    363                         * @param    string    $url    the rss url
    364                         * @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         */
    366371        function sp_getFeedCacheTime($url)
    367372        {
    368             $pluginDir = dirname(__FILE__);
    369             $cacheFile = $pluginDir.'/'.$this->inputFeedCacheDir . '/' . md5($url);
     373            $cacheFile = $this->sp_getInputFeedCacheDir() . '/' . md5($url);
    370374           
    371375            if(file_exists($cacheFile))
     
    380384       
    381385        /* 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 WordPress
    384                         * @since version 2.8.4
    385                         */
     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         */
    386390        function sp_prepCache()
    387391        {
     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        {
    388429            $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
    403447        function sp_checkCachePermissions()
    404448        {
    405449            $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();
    409453            $mainCacheDirPerm = $this->sp_getFilePermissions($mainCacheDir);
    410454            $inputCacheDirPerm = $this->sp_getFilePermissions($inputCacheDir);
     
    430474   
    431475        /* Get the domain name from the given url.
    432                         * @package WordPress
    433                         * @since version 2.8.4
    434                         * @param    string    $url    the rss url
    435                         * @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         */
    437481        function sp_getDomainFromUrl($url)
    438482        {
     
    442486       
    443487        /* Get the file path from the given url.
    444                         * @package WordPress
    445                         * @since version 2.8.4
    446                         * @param    string    $url    the rss url
    447                         * @return   string     file path from the url
    448                         */
     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         */
    449493        function sp_getFilePathFromUrl($url)
    450494        {
     
    455499       
    456500        /* Get the local servers hostname that this plugin is running on.
    457                         * @package WordPress
    458                         * @since version 2.8.4
    459                         * @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         */
    461505        function sp_getServerHostname()
    462506        {
     
    467511   
    468512        /* Determine if the cache for the given feed URL has expired and needs to be refreshed.
    469                         * @package WordPress
    470                         * @since version 2.8.4
    471                         * @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         */
    473517        function sp_incomingFeedCacheExpired($url)
    474518        {
     
    488532   
    489533        /* 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 WordPress
    493                         * @since version 2.8.4
    494                         * @param    string    $url    the rss url
    495                         * @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         */
    497541        function sp_cacheIncomingRssFeed($url)
    498542        {
     
    502546            $useDownloadClient = $configOptions['useDownloadClient'];             
    503547            $this->sp_prepCache();
    504             $cacheFile = dirname(__FILE__) . $this->inputFeedCacheDir .'/'. md5($url);
     548            $cacheFile = $this->sp_getInputFeedCacheDir() .'/'. md5($url);
    505549            if($this->sp_incomingFeedCacheExpired($url))
    506550            {   
     
    550594       
    551595        /* Cache the parsed and "rendered" html feed information
    552                         * @package WordPress
    553                         * @since version 2.8.4
    554                         * @param    string    $url    the rss url
    555                         * @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         */
    557601        function sp_cacheRenderedHtml($feedReference, $htmlContent)
    558602        { 
     
    562606       
    563607        /* Get the filename of the output cache file for the given feed reference  name
    564                         * @package WordPress
    565                         * @since version 2.8.4
    566                         * @param    string    $feedNameReference    comma separated list of feeds that make up the formatted output for the bbcode that this bbcode instance refers to
    567                         * @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         */
    569613        function sp_getOutputCacheFilename($feedNameReference)
    570614        {
    571             return dirname(__FILE__) . $this->formattedOutputCacheDir .'/'. md5($feedNameReference);
     615            return $this->sp_getOutputFeedCacheDir() .'/'. md5($feedNameReference);
    572616        }
    573617       
    574618        /* Get the filename of the input cache file for the given feed url
    575                         * @package WordPress
    576                         * @since version 2.8.4
    577                         * @param    string    $url    the url of the incoming feed
    578                         * @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         */
    580624        function sp_getInputCacheFilename($url)
    581625        {
    582             return dirname(__FILE__) . $this->inputFeedCacheDir .'/'. md5($url);
     626            return $this->sp_getInputFeedCacheDir() .'/'. md5($url);
    583627        }
    584628         
    585629        /* write the given content to the given filename
    586                         * @package WordPress
    587                         * @since version 2.8.4
    588                         * @param    string    $fileName    the local path to the file to be written
    589                         * @param    string    $content    the content to be writting into the file
    590                         */
     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         */
    591635        function sp_writeFile($fileName, $content)
    592636        {
     
    595639            fclose($fp);
    596640        }
    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
    598661        /* Delete all of the files in the given directory
    599                         * @package WordPress
    600                         * @since version 2.8.4
    601                         * @param    string    $dir    the local path to the dir from which the files will be deleted
    602                         */
     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         */
    603666        function sp_deleteFilesInDir($dir)
    604667        {
     
    606669            {
    607670                $filesInDir = glob($dir.'*');
    608                 if($fileInDir)
     671                if($filesInDir)
    609672                {
    610673                    foreach($filesInDir as $filename)
     
    618681       
    619682        /* Delete the incoming feed cache files
    620                         * @package WordPress
    621                         * @since version 2.8.4
    622                         */
     683         * @package WordPress
     684         * @since version 2.8.4
     685         */
    623686        function sp_clearIncomingFeedCache()
    624687        {
    625             $this->sp_deleteFilesInDir(dirname(__FILE__) . $this->inputFeedCacheDir .'/');
     688            $this->sp_deleteFilesInDir($this->sp_getInputFeedCacheDir() .'/');
    626689        }
    627690       
    628691        /* Delete the formatted output cache files
    629                         * @package WordPress
    630                         * @since version 2.8.4
    631                         */
     692         * @package WordPress
     693         * @since version 2.8.4
     694         */
    632695        function sp_clearFormattedOutputCache()
    633696        {
    634             $this->sp_deleteFilesInDir(dirname(__FILE__) . $this->formattedOutputCacheDir .'/');
     697            $this->sp_deleteFilesInDir($this->sp_getOutputFeedCacheDir() .'/');
    635698        }
    636699       
    637700        /* Get the html formatted rss feed.
    638                         * @package WordPress
    639                         * @since version 2.8.4
    640                         * @param    string    $url    the rss url
    641                         * @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         */
    643706        function sp_getFormattedRssContent($url, $customConfigOverrides = NULL)
    644707        {
     
    741804   
    742805        /* Get the list of link back images
    743                         *  Not currently used.                     
    744                         * @package WordPress
    745                         * @since version 2.8.4
    746                         * @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         */
    748811        function sp_getLinkbackImages()
    749812        {
     
    766829       
    767830        /* Determine if the given string ends with the gven end string.
    768                         * @package WordPress
    769                         * @since version 2.8.4
    770                         * @param    string    $str the string to check
    771                         * @param    string    $end the string to see if $str ends with
    772                         * @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         */
    774837        function sp_endsWith($str, $end)
    775838        {
     
    780843   
    781844        /* Add the given content to a new wordpress post.
    782                         * @package WordPress
    783                         * @since version 2.8.4
    784                         * @param    string    $content the content to add as a new post
    785                         */
     845         * @package WordPress
     846         * @since version 2.8.4
     847         * @param    string    $content the content to add as a new post
     848         */
    786849        function sp_postContent($content)
    787850        {
     
    800863
    801864        /* 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 WordPress
    803                         * @since version 2.8.4
    804                         */
     865         * @package WordPress
     866         * @since version 2.8.4
     867         */
    805868        function verifyNonceOrDie($nonceName)
    806869        {
     
    820883        function sp_getSPNews()
    821884        {
    822             $url = "http://henryranch.net/feed/";
     885            //$url = "http://henryranch.net/feed/";
     886            $url = "http://syndicatepress.henryranch.net/feed/";
    823887            //return $this->sp_getFormattedRssContent($url);
    824888           
     
    871935        }
    872936       
    873         /* Display the plugin admin page
    874                         * @package WordPress
    875                         * @since version 2.8.4
    876                         */
    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();
    880944                       
    881             if (isset($_POST['update_SyndicatePressPluginSettings']))
     945      if (isset($_POST['update_SyndicatePressPluginSettings']))
    882946            {
    883947                //nonce security check...
    884948                $this->verifyNonceOrDie('synPress-update_settings');
    885949           
    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']);
    9421010          //replace any occurrances of feed:// with http://
    9431011          $configOptions['feedUrlList'] = str_replace("feed://", "http://", $configOptions['feedUrlList']);
    9441012          $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']);
    9541022          $configOptions['feedTitleHTMLCodePre'] = mysql_real_escape_string($configOptions['feedTitleHTMLCodePre']);
    9551023        }
    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']);
    9581026          $configOptions['feedTitleHTMLCodePost'] = mysql_real_escape_string($configOptions['feedTitleHTMLCodePost']);
    9591027        }
    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']);
    9621030          $configOptions['articleTitleHTMLCodePre'] = mysql_real_escape_string($configOptions['articleTitleHTMLCodePre']);
    9631031        }
    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']);
    9661034          $configOptions['articleTitleHTMLCodePost'] = mysql_real_escape_string($configOptions['articleTitleHTMLCodePost']);
    9671035        }
    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']);
    9701038          $configOptions['articleBodyHTMLCodePre'] = mysql_real_escape_string($configOptions['articleBodyHTMLCodePre']);
    9711039        }
    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']);
    9741042          $configOptions['articleBodyHTMLCodePost'] = mysql_real_escape_string($configOptions['articleBodyHTMLCodePost']);
    9751043        }
    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']);
    9781046          $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']);
    9831051        }
    9841052               
     
    9861054        $this->sp_clearFormattedOutputCache();
    9871055?>
    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>             
    9891057<?php   
    9901058        }
     
    9951063            $this->sp_clearIncomingFeedCache();
    9961064?>
    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>   
    9981066<?php           
    9991067        }
     
    10041072            $this->sp_clearFormattedOutputCache();
    10051073?>
    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>   
    10071075<?php
    10081076        }
     
    10101078        {
    10111079?>
    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>             
    10131081<?php
    10141082        }
     
    11401208        <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>
    11411209        </div>
     1210        <br>&nbsp;<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>
    11421237     </div>
    11431238     <div class="tabbertab">
     
    11551250        <div style="padding-left: 20px;">
    11561251        <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') ?>"> &nbsp;&nbsp;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') ?>"> &nbsp;&nbsp;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>
    11601255        <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>
    11611256        </div><br>&nbsp;<br>
     
    12261321        </div>
    12271322     </div>
    1228     <div class="tabbertab">
     1323  <div class="tabbertab">
    12291324        <h2>SEO</h2>
    12301325        <b><u>No-follow directive:</u></b><br>
     
    12331328        <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>
    12341329        </div>
    1235     </div>
     1330  </div>
    12361331</form>
    12371332     <div class="tabbertab">
     
    12421337        <div style="padding-left: 20px;">
    12431338        [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>
    12451340        [sp# feedList=feedname] - insert only the feed with the given name<br>
    12461341        [sp# feedList=feedname limitArticles=maxNumArticles] - limit the number of articles from the given feedname(s).  Overrides the global article limit.<br>
     
    13121407<script language="javascript">
    13131408function 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  }
    13241419}
    13251420</script>
     
    13451440        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>
    13461441        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>
    13481443        Thank you!
    13491444        </p>
    13501445        <p align="center">
    13511446        <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>
    13581453        </p>
    13591454        <!--</div>-->
     
    13821477
    13831478 </div>
    1384                     <?php
    1385                 }   
    1386     }
     1479          <?php
     1480        } 
     1481  }
    13871482} //End Class SyndicatePressPlugin
    13881483
    13891484//Create the object instance of the class...
    13901485if (class_exists("SyndicatePressPlugin")) {
    1391     $syndicatePressPluginObjectRef = new SyndicatePressPlugin();
     1486  $syndicatePressPluginObjectRef = new SyndicatePressPlugin();
    13921487}
    13931488
    13941489//Init the admin panel by adding it to the WP settings menu...
    13951490if (!function_exists("SyndicatePressPlugin_ap")) {
    1396     function SyndicatePressPlugin_ap() {
    1397         global $syndicatePressPluginObjectRef;
     1491  function SyndicatePressPlugin_ap() {
     1492    global $syndicatePressPluginObjectRef;
    13981493        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')) {
    14031498            $adminPageHook = add_options_page('Syndicate Press', 'Syndicate Press', 9, basename(__FILE__), array(&$syndicatePressPluginObjectRef, 'sp_printAdminPage'));
    14041499            add_action( 'admin_enqueue_scripts', 'my_admin_enqueue_scripts' );
    1405         }
    1406     }   
     1500    }
     1501  } 
    14071502}
    14081503
    1409 //Actions and filters are registered with WP here. 
     1504//Actions and filters are registered with WP here. 
    14101505if (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'));
    14171512    add_filter('widget_text', array(&$syndicatePressPluginObjectRef,'sp_ContentFilter'));
    14181513}
     
    14221517    if ( $adminPageHook == $hook_suffix )
    14231518    {
    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);
    14261521    }       
    14271522}
Note: See TracChangeset for help on using the changeset viewer.