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

global $theme;
add_css(get_path('theme', $theme) . '/anet_guest.css');
add_css(get_path('theme', $theme) . '/anet_grps_directory.css');
?>
<ul class="groupdir">
  <?php
  switch ($filter) {
    case 'all':
      $result = db_query("SELECT * FROM {groups} WHERE nid = %d", $network->nid);
      break;
    case 'my':
      global $user;
      $result = db_query("SELECT g.* FROM {groups} g INNER JOIN {group_members} gm ON gm.gid = g.gid WHERE g.nid = %d AND gm.uid = %d", $network->nid, $user->uid);
      break;
  }
  ?>
  <?php while ($group = db_fetch_object($result)) { ?>
  <?php group_prepare($group) ?>
  <li>
    <a class="logo" href="<?php print url('network/' . $network->nid . '/group/' . $group->gid) ?>">
      <img width="100" height="50" title="<?php print $group->name ?>" alt="<?php print $group->name ?>" src="<?php print $group->picture ?>">
    </a>
    <div class="content">
      <?php if ($group->joined) { ?>
      <a class="join btn-ternary" href="<?php print url('network/' . $network->nid . '/group/' . $group->gid . '/leave', array('query' => drupal_get_destination())) ?>"><?php print t('Leave Group') ?></a>
      <?php } else if ($group->requested) { ?>
      <a class="join btn-ternary" href="<?php print url('network/' . $network->nid . '/group/' . $group->gid . '/withdraw', array('query' => drupal_get_destination())) ?>"><?php print t('Withdraw Request') ?></a>
      <?php } else { ?>
      <a class="join btn-ternary" href="<?php print url('network/' . $network->nid . '/group/' . $group->gid . '/join', array('query' => drupal_get_destination())) ?>"><?php print t('Join Group') ?></a>
      <?php } ?>
      <h3>
        <a class="<?php print $group->is_public ? 'public' : 'private' ?>" href="<?php print url('network/' . $network->nid . '/group/' . $group->gid) ?>"><?php print $group->name ?></a>
      </h3>
      <p class="desc"><?php print $group->description ?></p>
      <div class="meta">
        <?php
        $metas = array();
        $metas[] = t('@count members', array('@count' => $group->member_count));
        $metas[] = l(t('Share'), '');
        print implode(' | ', $metas);
        ?>
      </div>
    </div>
  </li>
  <?php } ?>
</ul>
Return current item: Teampopor