<?php
/**
* page callback: network/%network/communities/%
*/
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 'ours':
$result = db_query("SELECT * FROM {networks} WHERE is_external = 1 AND cid = %d", $network->cid);
break;
case 'mine':
global $user;
$result = db_query("SELECT n.* FROM {networks} n INNER JOIN {network_members} nm ON nm.nid = n.nid WHERE n.is_external = 1 AND n.cid = %d AND nm.uid = %d", $network->cid, $user->uid);
break;
}
?>
<?php while ($network = db_fetch_object($result)) { ?>
<?php network_prepare($network) ?>
<li>
<a class="logo" href="<?php print url('network/' . $network->nid) ?>">
<img width="100" height="50" title="<?php print $network->name ?>" alt="<?php print $network->name ?>" src="<?php print $network->picture ?>">
</a>
<div class="content">
<?php if ($network->joined) { ?>
<a class="join btn-ternary" href="<?php print url('network/' . $network->nid . '/leave', array('query' => drupal_get_destination())) ?>"><?php print t('Leave Network') ?></a>
<?php } else if ($network->requested) { ?>
<a class="join btn-ternary" href="<?php print url('network/' . $network->nid . '/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 . '/join', array('query' => drupal_get_destination())) ?>"><?php print t('Join Network') ?></a>
<?php } ?>
<h3>
<a href="<?php print url('network/' . $network->nid) ?>"><?php print $network->name ?></a>
</h3>
<p class="desc"><?php print $network->description ?></p>
<div class="meta">
<?php
$metas = array();
$metas[] = t('@count members', array('@count' => $network->member_count));
$metas[] = l(t('Share'), '');
print implode(' | ', $metas);
?>
</div>
</div>
</li>
<?php } ?>
</ul>