aboutsummaryrefslogtreecommitdiffstats
path: root/include/group.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-11 02:52:47 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-11 02:52:47 -0700
commit7a21a000a2b02e7dd443fd0f3ee09172de825b08 (patch)
treea73734b36b404da7f3028a12c5e10e2a3a7a35fa /include/group.php
parenta42c9616f97125b059f395b9b023fe1516a52d75 (diff)
downloadvolse-hubzilla-7a21a000a2b02e7dd443fd0f3ee09172de825b08.tar.gz
volse-hubzilla-7a21a000a2b02e7dd443fd0f3ee09172de825b08.tar.bz2
volse-hubzilla-7a21a000a2b02e7dd443fd0f3ee09172de825b08.zip
lots of little stuff
Diffstat (limited to 'include/group.php')
-rw-r--r--include/group.php34
1 files changed, 33 insertions, 1 deletions
diff --git a/include/group.php b/include/group.php
index e92e4480b..598d09c2e 100644
--- a/include/group.php
+++ b/include/group.php
@@ -25,7 +25,7 @@ function group_rmv($uid,$name) {
$r = q("SELECT * FROM `group` WHERE `uid` = %d AND `name` = '%s' LIMIT 1",
intval($uid),
dbesc($name)
- }
+ );
if(count($r))
$group_id = $r[0]['id'];
if(! $group_id)
@@ -102,4 +102,36 @@ function group_add_member($uid,$name,$member) {
intval($member)
);
return $r;
+}
+
+
+
+function group_side() {
+
+ if(! local_user())
+ return;
+$o .= <<< EOT
+
+<div id="group-sidebar">
+<h3>Groups</h3>
+
+<div id="sidebar-new-group">
+<a href="group/new">Create a new group</a>
+</div>
+
+<div id="sidebar-group-list">
+<ul id="sidebar-group-ul">
+<li class="sidebar-group-li"><a href="contacts">Everybody</a></li>
+EOT;
+
+ $r = q("SELECT * FROM `group` WHERE `uid` = %d",
+ intval($_SESSION['uid'])
+ );
+ if(count($r)) {
+ foreach($r as $rr)
+ $o .= "<li class=\"sidebar-group-li\"><a href=\"group/{$rr['id']}\">{$rr['name']}</li>";
+ }
+ $o .= '</ul></div></div>';
+
+ return $o;
} \ No newline at end of file