/** * display_home * This display the module in home page */ public function display_home() { if (AmpConfig::get('sociable')) { echo "<div id='shout_objects'>\n"; $shouts = Shoutbox::get_top($this->maxitems); if (count($shouts)) { require_once AmpConfig::get('prefix') . UI::find_template('show_shoutbox.inc.php'); } echo "</div>\n"; } }
<?php UI::show_box_top(T_('Albums of the Moment')); echo T_('Loading...'); UI::show_box_bottom(); ?> </div> <?php } ?> <!-- Recently Played --> <div id="recently_played"> <?php $data = Song::get_recently_played(); Song::build_cache(array_keys($data)); require_once AmpConfig::get('prefix') . '/templates/show_recently_played.inc.php'; ?> </div> <!-- Shoutbox Objects, if shoutbox is enabled --> <?php if (AmpConfig::get('sociable')) { ?> <div id="shout_objects"> <?php $shouts = Shoutbox::get_top('5'); if (count($shouts)) { require_once AmpConfig::get('prefix') . '/templates/show_shoutbox.inc.php'; } ?> </div> <?php }
/** * load_latest_shout * This loads in the latest added shouts * @return array */ public static function load_latest_shout() { $ids = Shoutbox::get_top(10); $results = array(); foreach ($ids as $id) { $shout = new Shoutbox($id); $shout->format(); $object = Shoutbox::get_object($shout->object_type, $shout->object_id); $object->format(); $user = new User($shout->user); $user->format(); $xml_array = array('title' => $user->username . ' ' . T_('on') . ' ' . $object->get_fullname(), 'link' => $object->link, 'description' => $shout->text, 'image' => Art::url($shout->object_id, $shout->object_type, null, 2), 'comments' => '', 'pubDate' => date("c", $shout->date)); $results[] = $xml_array; } // end foreach return $results; }
/** * last_shouts * This get the latest posted shouts * @param array $input */ public static function last_shouts($input) { $limit = intval($input['limit']); if ($limit < 1) { $limit = AmpConfig::get('popular_threshold'); } if (AmpConfig::get('sociable')) { $username = $input['username']; if (!empty($username)) { $shouts = Shoutbox::get_top($limit, $username); } else { $shouts = Shoutbox::get_top($limit); } ob_end_clean(); echo XML_Data::shouts($shouts); } else { debug_event('api', 'Sociable feature is not enabled.', 3); } }