diff --git a/dcstore.xml b/dcstore.xml new file mode 100644 index 0000000..6754803 --- /dev/null +++ b/dcstore.xml @@ -0,0 +1,12 @@ + + +zoneclearFeedServer +2015.07.19 +Jean-Christian Denis, BG, Pierre Van Glabeke +Mix your blog with a feeds planet +https://github.com/JcDenis/zoneclearFeedServer/releases/download/v2015.07.19/plugin-zoneclearFeedServer.zip +2.19 +https://plugins.dotaddict.org/dc2/details/pacKman +https://github.com/JcDenis/zoneclearFeedServer + + \ No newline at end of file diff --git a/inc/lib.zcfs.activityreport.php b/inc/lib.zcfs.activityreport.php new file mode 100644 index 0000000..e1bcae2 --- /dev/null +++ b/inc/lib.zcfs.activityreport.php @@ -0,0 +1,169 @@ +activityReport->addGroup( + 'zoneclearFeedServer', + __('Plugin zoneclearFeedServer') +); + +# from BEHAVIOR zoneclearFeedServerAfterAddFeed in zoneclearFeedServer/inc/class.zoneclear.feed.server.php +$core->activityReport->addAction( + 'zoneclearFeedServer', + 'create', + __('feed creation'), + __('A new feed named "%s" point to "%s" was added by "%s"'), + 'zoneclearFeedServerAfterAddFeed', + array('zoneclearFeedServerActivityReportBehaviors', 'addFeed') +); +# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php +$core->activityReport->addAction( + 'zoneclearFeedServer', + 'updatefeedinfo', + __('updating feed info'), + __('Feed named "%s" point to "%s" has been updated by "%s"'), + 'zoneclearFeedServerAfterUpdFeed', + array('zoneclearFeedServerActivityReportBehaviors', 'updFeedInfo') +); +# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php +$core->activityReport->addAction( + 'zoneclearFeedServer', + 'updatefeedrecords', + __('updating feed records'), + __('Records of the feed named "%s" have been updated automatically'), + 'zoneclearFeedServerAfterUpdFeed', + array('zoneclearFeedServerActivityReportBehaviors', 'updFeedRecord') +); +# from BEHAVIOR zoneclearFeedServerAfterDelFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php +$core->activityReport->addAction( + 'zoneclearFeedServer', + 'delete', + __('feed deletion'), + __('Feed named "%s" point to "%s" has been deleted by "%s"'), + 'zoneclearFeedServerAfterDelFeed', + array('zoneclearFeedServerActivityReportBehaviors', 'delFeed') +); +# from BEHAVIOR zoneclearFeedServerAfterEnableFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php +$core->activityReport->addAction( + 'zoneclearFeedServer', + 'status', + __('feed status'), + __('Feed named "%s" point to "%s" has been set to "%s"'), + 'zoneclearFeedServerAfterEnableFeed', + array('zoneclearFeedServerActivityReportBehaviors', 'enableFeed') +); + +class zoneclearFeedServerActivityReportBehaviors +{ + public static function addFeed($cur) + { + global $core; + + $logs = array( + $cur->feed_name, + $cur->feed_feed, + $core->auth->getInfo('user_cn') + ); + + $core->activityReport->addLog( + 'zoneclearFeedServer', + 'create', + $logs + ); + } + + public static function updFeedInfo($cur, $id) + { + if (defined('DC_CONTEXT_ADMIN')) { + global $core; + $zc = new zoneclearFeedServer($core); + $rs = $zc->getFeeds(array('feed_id' => $id)); + + $logs = array( + $rs->feed_name, + $rs->feed_feed, + $core->auth->getInfo('user_cn') + ); + + $core->activityReport->addLog( + 'zoneclearFeedServer', + 'updatefeedinfo', + $logs + ); + } + } + + public static function updFeedRecord($cur,$id) + { + if (!defined('DC_CONTEXT_ADMIN')) { + global $core; + $zc = new zoneclearFeedServer($core); + $rs = $zc->getFeeds(array('feed_id' => $id)); + + $logs = array( + $rs->feed_name + ); + + $core->activityReport->addLog( + 'zoneclearFeedServer', + 'updatefeedrecords', + $logs + ); + } + } + + public static function delFeed($id) + { + global $core; + + $zc = new zoneclearFeedServer($core); + $rs = $zc->getFeeds(array('feed_id' => $id)); + + $logs = array( + $rs->feed_name, + $rs->feed_feed, + $core->auth->getInfo('user_cn') + ); + + $core->activityReport->addLog( + 'zoneclearFeedServer', + 'delete', + $logs + ); + } + + public static function enableFeed($id, $enable, $time) + { + global $core; + + $zc = new zoneclearFeedServer($core); + $rs = $zc->getFeeds(array('feed_id' => $id)); + + $logs = array( + $rs->feed_name, + $rs->feed_feed, + $enable ? 'enable' : 'disable' + ); + + $core->activityReport->addLog( + 'zoneclearFeedServer', + 'status', + $logs + ); + } +} \ No newline at end of file