* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ UI::show_box_top(T_('Shoutbox')); ?> <div id="shoutbox"> <?php foreach ($shouts as $shout_id) { $shout = new Shoutbox($shout_id); $shout->format(); ?> <div id="shout<?php echo $shout->id; ?> " class="shout <?php echo UI::flip_class(); ?> "> <?php echo $shout->get_display(true, true); ?> </div> <?php } ?>
/** * shouts * * This handles creating an xml document for a shout list * * @param int[] $shouts Shout identifier list * @return string return xml */ public static function shouts($shouts) { $string = "<shouts>\n"; foreach ($shouts as $shout_id) { $shout = new Shoutbox($shout_id); $shout->format(); $user = new User($shout->user); $string .= "\t<shout id=\"" . $shout_id . "\">\n" . "\t\t<date>" . $shout->date . "</date>\n" . "\t\t<text><![CDATA[" . $shout->text . "]]></text>\n"; if ($user->id) { $string .= "\t\t<username><![CDATA[" . $user->username . "]]></username>"; } $string .= "\t</shout>n"; } $string .= "</shouts>\n"; $final = self::_header() . $string . self::_footer(); return $final; }
/** * 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; }
</th> <th class="cel_date"><?php echo T_('Date Added'); ?> </th> <th class="cel_action"><?php echo T_('Action'); ?> </th> </tr> </thead> <tbody> <?php foreach ($object_ids as $shout_id) { $libitem = new Shoutbox($shout_id); $libitem->format(); $object = Shoutbox::get_object($libitem->object_type, $libitem->object_id); $object->format(); $client = new User($libitem->user); $client->format(); require AmpConfig::get('prefix') . '/templates/show_shout_row.inc.php'; ?> <?php } if (!count($object_ids)) { ?> <tr class="<?php echo UI::flip_class(); ?> "> <td colspan="6" class="error"><?php