- foreach(array_unique($feeds) as $feed){
- if(! $publisher->publish_update($feed)){
- common_log_line(LOG_WARNING,$feed.' was not published to hub at '.$this->hub.':'.$publisher->last_response());
- }
+ ob_start();
+ $ok = $publisher->publish_update($feeds);
+ $push_last_response = ob_get_clean();
+
+ if (!$ok) {
+ common_log(LOG_WARNING,
+ 'Failure publishing ' . count($feeds) . ' feeds to hub at '.
+ $this->hub.': '.$push_last_response);
+ } else {
+ common_log(LOG_INFO,
+ 'Published ' . count($feeds) . ' feeds to hub at '.
+ $this->hub.': '.$push_last_response);
+ }
+
+ return true;
+ }
+
+ /**
+ * Provide version information
+ *
+ * Adds this plugin's version data to the global
+ * version array, for e.g. displaying on the version page.
+ *
+ * @param array &$versions array of array of versions
+ *
+ * @return boolean hook value
+ */
+
+ function onPluginVersion(&$versions)
+ {
+ $about = _m('The PubSubHubBub plugin pushes RSS/Atom updates '.
+ 'to a <a href = "'.
+ 'http://pubsubhubbub.googlecode.com/'.
+ '">PubSubHubBub</a> hub.');
+ if (!$this->enabled()) {
+ $about = '<span class="disabled" style="color:gray">' . $about . '</span> ' .
+ _m('(inactive on private site)');