diff --git a/_prepend.php b/_prepend.php index faa8b2b..25d109a 100644 --- a/_prepend.php +++ b/_prepend.php @@ -12,44 +12,26 @@ */ if (!defined('DC_RC_PATH')) { - - return null; -} - -if ($core->getVersion('zoneclearFeedServer') != - $core->plugins->moduleInfo('zoneclearFeedServer', 'version')) { - return null; } $d = dirname(__FILE__).'/inc/'; -$__autoload['zoneclearFeedServer'] = $d.'class.zoneclear.feed.server.php'; -$__autoload['zcfsFeedsList'] = $d.'lib.zcfs.list.php'; -$__autoload['zcfsEntriesList'] = $d.'lib.zcfs.list.php'; -$__autoload['zcfsFeedsActionsPage'] = $d.'class.zcfs.feedsactions.php'; -$__autoload['zcfsDefaultFeedsActions'] = $d.'class.zcfs.feedsactions.php'; +$__autoload['zoneclearFeedServer'] = $d . 'class.zoneclear.feed.server.php'; +$__autoload['zcfsFeedsList'] = $d . 'lib.zcfs.list.php'; +$__autoload['zcfsEntriesList'] = $d . 'lib.zcfs.list.php'; +$__autoload['zcfsFeedsActionsPage'] = $d . 'class.zcfs.feedsactions.php'; +$__autoload['zcfsDefaultFeedsActions'] = $d . 'class.zcfs.feedsactions.php'; -# public url for page of description of the flux +// public url for page of description of the flux $core->url->register( 'zoneclearFeedsPage', 'zcfeeds', '^zcfeeds(.*?)$', array('zcfsUrlHandler', 'zcFeedsPage') ); -/* -# Add to plugn soCialMe (writer part) -$__autoload['zcfsSoCialMeWriter'] = $d.'lib.zcfs.socialmewriter.php'; -$core->addBehavior( - 'soCialMeWriterMarker', - array('zcfsSoCialMeWriter', 'soCialMeWriterMarker') -); -$core->addBehavior( - 'zoneclearFeedServerAfterFeedUpdate', - array('zcfsSoCialMeWriter', 'zoneclearFeedServerAfterFeedUpdate') -); -//*/ -# Add to report on plugin activityReport + +// Add to report on plugin activityReport if (defined('ACTIVITY_REPORT')) { - require_once $d.'lib.zcfs.activityreport.php'; + require_once $d .'lib.zcfs.activityreport.php'; } \ No newline at end of file diff --git a/inc/lib.zcfs.socialmewriter.php b/inc/lib.zcfs.socialmewriter.php deleted file mode 100644 index c28536f..0000000 --- a/inc/lib.zcfs.socialmewriter.php +++ /dev/null @@ -1,148 +0,0 @@ - __('New Zoneclear post'), - 'description' => __('When a feed has new entry'), - 'action' => array('Message','Link'), - 'format' => array('Message'), - 'wildcards' => array('Message' => array( - '%posttitle%', - '%postlink%', - '%postauthor%', - '%posttweeter%', - '%sitetitle%', - '%sitelink%', - '%tags' - )) - ); - } - - public static function zoneclearFeedServerAfterFeedUpdate($core, $is_new_published_entry, $post, $meta) - { - // for now only new post - if(!$is_new_published_entry) { - - return null; - } - - $key = 'zcfscreate'; - - # Is install - if (!$core->plugins->moduleExists('soCialMe')) { - - return null; - } - - # Is active - if (!$core->blog->settings->soCialMeWriter->active) { - - return null; - } - - # Load services - $soCialMeWriter = new soCialMeWriter($core); - - # List of service per action - $actions = $soCialMeWriter->getMarker('action'); - - # List of format per type - $formats = $soCialMeWriter->getMarker('format'); - - # prepare data - $shortposturl = soCialMeUtils::reduceURL($meta->url); - $shortposturl = $shortposturl ? $shortposturl : $meta->url; - - $shortsiteurl = soCialMeUtils::reduceURL($meta->site); - $shortsiteurl = $shortsiteurl ? $shortsiteurl : $meta->site; - - // need this? - foreach($meta->tags as $k => $tag) { - $tags[$k] = '#'.$tag; - } - - # sendMessage - if (!empty($formats[$key]['Message']) - && !empty($actions[$key]['Message']) - ) { - // parse message - $message_txt = str_replace( - array( - '%posttitle%', - '%postlink%', - '%postauthor%', - '%posttweeter%', - '%sitetitle%', - '%sitelink%', - '%tags' - ), - array( - $post->post_title, - $shortposturl, - $meta->author, - $meta->tweeter, - $meta->sitename, - $shortsiteurl, - implode(',', $meta->tags) - ), - $formats[$key]['Message'] - ); - - // send message - if (!empty($message_txt)) { - foreach($actions[$key]['Message'] as $service_id) { - $soCialMeWriter->play( - $service_id, - 'Message', - 'Content', - $message_txt - ); - } - } - } - - # sendLink - if (!empty($actions[$key]['Link'])) { - foreach($actions[$key]['Link'] as $service_id) { - $soCialMeWriter->play( - $service_id, - 'Link', - 'Content', - $cur->post_title,$shortposturl - ); - } - } - - # sendData - // not yet implemented - - #sendArticle - // not yet implemented - } -} \ No newline at end of file