Location: PHPKode > projects > Teampopor > teampopor-0.5/teampopor/modules/network/network-profile-messages.tpl.php
<?php
/**
 * page callback: network/%network/profile/%user/%
 * arguments: $network, $profile
 */

add_js(get_path('module', 'network') . '/network_updates.js');

global $theme;
add_css(get_path('theme', $theme) . '/network_updates.css');

// joined groups
global $user;
$gids = array();
$result = db_query("SELECT gm.gid FROM {group_members} gm LEFT JOIN {groups} g ON g.gid = gm.gid WHERE g.nid = %d AND gm.uid = %d", $network->nid, $user->uid);
while ($row = db_fetch_object($result)) {
  $gids[] = $row->gid;
}

$result = db_query("SELECT * FROM {messages} WHERE type >= 0 AND nid = %d AND gid in (" . implode(',', array_merge($gids, array(0))) . ") AND uid = %d ORDER BY created DESC", $network->nid, $profile->uid);
?>
<div class="feed">
  <div class="content">
    <div id="feed-content">
      <ul class="chron">
        <?php while ($message = db_fetch_object($result)) { ?>
          <?php message_prepare($message) ?>
          <?php print theme('feed_item', $message, $network) ?>
        <?php } ?>
      </ul>
    </div>
  </div>
</div>

Return current item: Teampopor