Simple status box for the sidebar.
[elgg_plugins.git] / forum / forum_user_info_menu.php
blobdae2218b7910f24759627279ea84309dd8a1472e
1 <?php
3 global $page_owner;
4 global $CFG;
5 $profile_id = $page_owner;
6 $sitename = sitename;
7 include(dirname(__FILE__) . '/config.php');
10 if (logged_on && $page_owner == $_SESSION['userid']) {
12 $title = __gettext("Recent Activity");
13 $body = "<ul><li>";
14 $body .= "<a href=\"".url."_activity/\">".__gettext("View your activity") . "</a></li></ul>";
16 $run_result .= "<li id=\"recent_activity\">";
17 $run_result .= templates_draw(array(
18 'context' => 'sidebarholder',
19 'title' => $title,
20 'body' => $body,
23 $run_result .= "</li>";
25 } else {
27 //$posts = count_records_select('weblog_posts','('.run("users:access_level_sql_where",$profile_id).") and owner = $profile_id");
29 if (logged_on || (isset($page_owner) && $page_owner != -1)) {
31 $title = __gettext("Forum & Blogs");
33 $weblog_username = user_info('username', $profile_id);
34 $body = <<< END
35 <ul>
36 END;
37 if (user_type($page_owner) == "person") {
38 $personalWeblog = __gettext("Personal blog");
39 $body .= <<< END
40 <li><a href="{$CFG->wwwroot}{$weblog_username}/weblog/">$personalWeblog</a> (<a href="{$CFG->wwwroot}{$weblog_username}/weblog/rss">RSS</a>)</li>
41 END;
42 } else if (user_type($page_owner) == "community") {
46 $forum_flag = user_flag_get('forum', $profile_id);
47 //echo $forum_flag;
48 //echo $forum_default;
50 if ((!$forum_flag) && ($forum_default == 0))
52 $use_forum= "yes";
54 else if ((!$forum_flag) && ($forum_default == 1))
56 $use_forum= "no";
58 else
60 $use_forum= $forum_flag;
63 if ($use_forum=="yes"){
65 $communityWeblog = __gettext("Community Forum");
66 $body .= <<< END
67 <li>
68 <a href="{$CFG->wwwroot}mod/forum/forum.php?weblog=$weblog_username">$communityWeblog</a>
69 (<a href="{$CFG->wwwroot}{$weblog_username}/weblog/rss"><img src="{$CFG->wwwroot}mod/template/icons/rss.png" alt="RSS" border="0" /></a>)</li>
70 END;
72 $blogArchive = __gettext("Archive");
73 $membersWeblog = __gettext("Members blog");
74 $body .= <<< END
75 <li><a href="{$CFG->wwwroot}{$weblog_username}/weblog/archive/">$blogArchive</a></li>
76 <li><a href="{$CFG->wwwroot}{$weblog_username}/weblog/friends/">$membersWeblog</a></li>
77 END;
78 } else {
80 $communityWeblog = __gettext("Community Blog");
81 $body .= <<< END
82 <li>
83 <a href="{$CFG->wwwroot}{$weblog_username}/weblog">$communityWeblog</a>
84 (<a href="{$CFG->wwwroot}{$weblog_username}/weblog/rss"><img src="{$CFG->wwwroot}mod/template/icons/rss.png" alt="RSS" border="0" /></a>)</li>
85 END;
87 $blogArchive = __gettext("Archive");
88 $membersWeblog = __gettext("Friends blog");
89 $body .= <<< END
90 <li><a href="{$CFG->wwwroot}{$weblog_username}/weblog/archive/">$blogArchive</a></li>
91 <li><a href="{$CFG->wwwroot}{$weblog_username}/weblog/friends/">$membersWeblog</a></li>
92 END;
99 $run_result .= "<li id=\"sidebar_weblog\">";
100 $run_result .= templates_draw(array(
101 'context' => 'sidebarholder',
102 'title' => $title,
103 'body' => $body,
106 $run_result .= "</ul></li>";