if (count($groups)) { ?> <div style="font-size: 13px; padding: 1.5em; background-color: #fffff0; border: 1px solid #bbb;"> <span class="section_title">Research Groups</span> <span class="section_actions"><?php echo link_to('more', '@groups'); ?> </span> <?php foreach ($groups as $group) { ?> <div class="group-name"><?php echo group_link($group); ?> </div> <div class="group-blurb"><?php echo $group['blurb']; ?> </div> <?php } ?> </div> <br /> <br />
/** * function and show otpion links */ function group_opt_link($group, $type, $attr = '') { global $userquery; $gArray = array('group' => $group, 'groupid' => $group['group_id'], 'uid' => userid(), 'user' => $userquery->udetails, 'checkowner' => 'yes'); if (!$attr) { $attr = " class='btn btn-primary' "; } switch ($type) { case 'join': if ($this->is_joinable($group)) { if (SEO == "yes") { return '<a ' . $attr . ' href="' . group_link(array('details' => $group)) . '?join=yes">' . lang('join') . '</a>'; } else { return '<a ' . $attr . ' href="' . group_link(array('details' => $group)) . '&join=yes">' . lang('join') . '</a>'; } } else { return false; } break; case 'invite': if ($this->is_owner($group)) { return '<a ' . $class . ' href="' . BASEURL . '/invite_group.php?url=' . $group['group_url'] . '">' . lang('invite') . '</a>'; } break; case 'leave': if ($this->is_member(userid(), $group['group_id']) && !$this->is_owner($group)) { if (SEO == "yes") { return '<a ' . $class . ' href="' . group_link(array('details' => $group)) . '?leave=yes">' . lang('leave') . '</a>'; } else { return '<a ' . $class . ' href="' . group_link(array('details' => $group)) . '&leave=yes">' . lang('leave') . '</a>'; } } break; case 'remove_group': if ($this->is_owner($group)) { $gpID = $group['group_id']; $message = lang('are_you_sure_del_grp'); $url = BASEURL . '/manage_groups.php?mode=manage&gid_delete=' . $gpID; return "<a {$class} href='javascript:void(0)' id='delete_group-" . $gpID . "' onmousedown='delete_item(\"delete_group\",\"{$gpID}\",\"{$message}\",\"{$url}\")'>" . lang('grp_remove_group') . "</a>"; } break; case 'manage_members': if ($this->is_admin($gArray)) { return '<a ' . $class . ' href="' . BASEURL . '/manage_groups.php?mode=manage_members&gid=' . $group['group_id'] . '">' . lang('grp_manage_mems') . '</a>'; } break; case 'manage_videos': if ($this->is_admin($gArray)) { return '<a ' . $class . ' href="' . BASEURL . '/manage_groups.php?mode=manage_videos&gid=' . $group['group_id'] . '">' . lang('com_manage_vids') . '</a>'; } break; case 'add_videos': if ($this->is_member(userid(), $group['group_id'])) { return '<a ' . $class . ' href="' . BASEURL . '/add_group_videos.php?url=' . $group['group_url'] . '">' . lang('grp_add_vdos') . '</a>'; } break; case 'edit_group': if ($this->is_admin($gArray)) { return '<a ' . $class . ' href="' . BASEURL . '/edit_group.php?gid=' . $group['group_id'] . '">' . lang('grp_edit_grp_title') . '</a>'; } break; } return false; }
include_once 'ressources/class.users.menus.inc'; include_once 'ressources/class.mysql.inc'; include_once 'ressources/class.ini.inc'; include_once 'ressources/class.meta.squid.acls.inc'; $users = new usersMenus(); if (!$users->AsArticaMetaAdmin) { $tpl = new templates(); echo FATAL_ERROR_SHOW_128("{ERROR_NO_PRIVS}"); die; } if (isset($_GET["items-list"])) { items_list(); exit; } if (isset($_POST["acl-rule-link"])) { group_link(); exit; } if (isset($_POST["acl-rule-link-delete"])) { group_unlink(); exit; } if (isset($_POST["acl-rule-link-negation"])) { items_negation(); exit; } if (isset($_POST["acl-rule-link-order"])) { items_link_order(); exit; } if (isset($_POST["acl-rule-or"])) {
echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n"; echo "<td colspan='2' class='tbl2'><strong>" . $locale['u048'] . "</strong></td>\n"; echo "</tr>\n<tr>\n"; echo "<td width='1%' class='tbl1' style='white-space:nowrap'>" . $locale['u049'] . "</td>\n"; echo "<td align='right' class='tbl1'>" . $user_data['user_ip'] . "</td>\n"; echo "</tr>\n</table>\n"; } if ($user_data['user_groups']) { echo "<div style='margin:5px'></div>\n"; echo "<table cellpadding='0' cellspacing='1' width='400' class='center tbl-border'>\n<tr>\n"; echo "<td class='tbl2'><strong>" . $locale['401'] . "</strong></td>\n"; echo "</tr>\n<tr>\n"; echo "<td class='tbl1'>\n"; $user_groups = strpos($user_data['user_groups'], ".") == 0 ? explode(".", substr($user_data['user_groups'], 1)) : explode(".", $user_data['user_groups']); for ($i = 0; $i < count($user_groups); $i++) { echo "<div style='float:left'>" . group_link($user_groups[$i], getgroupname($user_groups[$i])) . "</div><div style='float:right'>" . getgroupname($user_groups[$i], true) . "</div><div style='float:none;clear:both'></div>\n"; // Pimped: url-rewrite } echo "</td>\n</tr>\n</table>\n"; } if (iADMIN && checkrights("M") && $user_data['user_id'] != $userdata['user_id']) { $user_groups_opts = ""; if (iSUPERADMIN || $user_data['user_level'] < nADMIN) { echo "<div style='margin:5px'></div>\n"; echo "<form name='admin_form' method='post' action='" . FUSION_SELF . "?lookup=" . $user_data['user_id'] . "'>\n"; echo "<table cellpadding='0' cellspacing='0' width='400' class='center tbl-border'>\n<tr>\n"; echo "<td class='tbl2' colspan='2'><strong>" . $locale['402'] . "</strong></td>\n"; echo "</tr>\n<tr>\n"; echo "<td class='tbl1'><!--profile_admin_options-->\n"; echo "<a href='" . ADMIN . "members.php" . $aidlink . "&step=edit&user_id=" . $user_data['user_id'] . "'>" . $locale['410'] . "</a> ::\n"; echo "<a href='" . ADMIN . "members.php" . $aidlink . "&action=1&user_id=" . $user_data['user_id'] . "'>" . $locale['411'] . "</a> ::\n";
function subcats($forum_id) { global $settings, $locale, $userdata, $lastvisited, $cache_subcats; $access = ''; // Pimped: access $aresult = dbquery("SELECT forum_access FROM " . DB_FORUMS . " WHERE forum_parent='" . (int) $_GET['forum_id'] . "' ORDER BY forum_order ASC"); while ($adata = dbarray($aresult)) { if ($access != '') { $access .= "|"; } $access .= $adata['forum_access']; } $a_result = dbquery("SELECT f.forum_id, f.forum_name, f.forum_description, f.forum_moderators, f.forum_lastpost, f.forum_image, f.forum_postcount, f.forum_threadcount, f.forum_lastuser, u.user_name, u.user_status FROM " . DB_FORUMS . " f LEFT JOIN " . DB_USERS . " u on f.forum_lastuser=u.user_id WHERE " . groupaccess('f.forum_access', $access) . " AND forum_parent='" . (int) $_GET['forum_id'] . "' ORDER BY forum_order"); if (dbrows($a_result) != 0) { echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_idx_table'>\n<tr>\n"; echo "<td width='1%' class='tbl2' style='white-space:nowrap'> </td>\n"; echo "<td class='tbl2' " . ($settings['forum_cat_icons'] == "1" ? "colspan='2' " : "") . ">" . $locale['413'] . "</td>\n"; echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['402'] . "</td>\n"; echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['403'] . "</td>\n"; echo "<td width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['404'] . "</td>\n"; echo "</tr>\n"; while ($a_data = dbarray($a_result)) { $cache_subcats[] = $a_data['forum_id']; // Pimped echo "<tr>\n"; $moderators = ''; if ($a_data['forum_moderators']) { $mod_groups = explode(".", $a_data['forum_moderators']); foreach ($mod_groups as $mod_group) { if ($moderators) { $moderators .= ", "; } $moderators .= $mod_group < nMEMBER ? group_link($mod_group, getgroupname($mod_group)) : getgroupname($mod_group); // Pimped: group_link() } } if ($a_data['forum_lastpost'] > $lastvisited) { $forum_match = "\\|" . $a_data['forum_lastpost'] . "\\|" . $a_data['forum_id']; if (iMEMBER && preg_match("({$forum_match}\\.|{$forum_match}\$)", $userdata['user_threads'])) { $fim = "<img src='" . get_image("folder") . "' alt='" . $locale['561'] . "' />"; } else { $fim = "<img src='" . get_image("foldernew") . "' alt='" . $locale['560'] . "' />"; } } else { $fim = "<img src='" . get_image("folder") . "' alt='" . $locale['561'] . "' />"; } echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>{$fim}</td>\n"; if ($settings['forum_cat_icons'] == "1") { echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>"; if ($a_data['forum_image'] != '' && file_exists(IMAGES_FC . $a_data['forum_image'])) { echo "<img src='" . IMAGES_FC . $a_data['forum_image'] . "' border='0' alt='' title='" . $a_data['forum_name'] . "' />"; } else { echo "<img src='" . IMAGES_FC . "default.png' border='0' alt='' title='" . $a_data['forum_name'] . "' />"; } echo "</td>"; } echo "<td class='tbl1 forum_name'><!--forum_name--><a href='" . make_url(FORUM . "viewforum.php?forum_id=" . $a_data['forum_id'], BASEDIR . "forum-" . $a_data['forum_id'] . "-", $a_data['forum_name'], ".html") . "'>" . $a_data['forum_name'] . "</a><br />\n"; // Pimped: make_url if ($a_data['forum_description'] || $moderators) { echo "<span class='small'>" . $a_data['forum_description'] . ($a_data['forum_description'] && $moderators ? "<br />\n" : ""); echo ($moderators ? "<strong>" . $locale['411'] . "</strong>" . $moderators . "</span>\n" : "</span>\n") . "<br />\n"; } whoishere_show("index", $a_data['forum_id']); // Pimped: Who is here echo "</td>\n"; echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $a_data['forum_threadcount'] . "</td>\n"; echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>" . $a_data['forum_postcount'] . "</td>\n"; echo "<td width='1%' class='tbl2' style='white-space:nowrap'>"; if ($a_data['forum_lastpost'] == 0) { echo $locale['405'] . "</td>\n</tr>\n"; } else { // Pimped -> $thread_data = dbarray(dbquery("SELECT t.thread_id, t.thread_subject, t.thread_lastpostid FROM " . DB_THREADS . " t\r\n\t\t\t\tleft join " . DB_POSTS . " p on p.post_id=t.thread_lastpostid\r\n\t\t\t\tWHERE t.thread_lastpost='" . $a_data['forum_lastpost'] . "'")); echo "<a href='" . make_url(FORUM . "viewthread.php?thread_id=" . $thread_data['thread_id'], BASEDIR . "forum-thread-" . $thread_data['thread_id'] . "-", $thread_data['thread_subject'], ".html") . "#post_" . $thread_data['thread_lastpostid'] . "' title='" . $thread_data['thread_subject'] . "'>" . trimlink($thread_data['thread_subject'], 35) . "</a><br />"; // Pimped: make_url echo showdate("forumdate", $a_data['forum_lastpost']) . "<br />\n"; echo "<span class='small'>" . $locale['406'] . profile_link($a_data['forum_lastuser'], $a_data['user_name'], $a_data['user_status']) . "</span></td>\n"; echo "</tr>\n"; // Pimped Sub Cats <-- } } echo "</table>"; echo "<div style='margin:5px'></div>"; } }
if ($data['forum_cat_name'] != $current_cat) { $current_cat = $data['forum_cat_name']; echo "<tr>\n<td colspan='" . ($settings['forum_cat_icons'] == "1" ? "3" : "2") . "' class='forum-caption forum_cat_name'><!--forum_cat_name-->" . $data['forum_cat_name'] . "</td>\n"; echo "<td align='center' width='1%' class='forum-caption' style='white-space:nowrap'>" . $locale['402'] . "</td>\n"; echo "<td align='center' width='1%' class='forum-caption' style='white-space:nowrap'>" . $locale['403'] . "</td>\n"; echo "<td width='1%' class='forum-caption' style='white-space:nowrap'>" . $locale['404'] . "</td>\n"; echo "</tr>\n"; } $moderators = ''; if ($data['forum_moderators']) { $mod_groups = explode(".", $data['forum_moderators']); foreach ($mod_groups as $mod_group) { if ($moderators) { $moderators .= ", "; } $moderators .= $mod_group < nMEMBER ? group_link($mod_group, getgroupname($mod_group)) : getgroupname($mod_group); // Pimped: group_link } } $last_data = dbarray(dbquery("SELECT forum_id, forum_lastpost FROM " . DB_FORUMS . " WHERE forum_id = '" . $data['forum_id'] . "' OR forum_parent='" . $data['forum_id'] . "' GROUP BY forum_lastpost DESC")); // Pimped: Sub-Cats $forum_match = "\\|" . $last_data['forum_lastpost'] . "\\|" . $last_data['forum_id']; // Pimped: Sub-Cats if ($last_data['forum_lastpost'] > $lastvisited) { // Pimped: Sub-Cats if (iMEMBER && preg_match("({$forum_match}\\.|{$forum_match}\$)", $userdata['user_threads'])) { $fim = "<img src='" . get_image("folder") . "' alt='" . $locale['561'] . "' />"; } else { $fim = "<img src='" . get_image("foldernew") . "' alt='" . $locale['560'] . "' />"; } } else {
echo "<td class='tbl2'><strong>" . $locale['401'] . "</strong></td>\n"; echo "<td class='tbl2'><strong>" . $locale['405'] . "</strong></td>\n"; echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['402'] . "</strong></td>\n"; echo "</tr>\n"; $result = dbquery("SELECT user_id, user_name, user_status, user_groups, user_level FROM " . DB_USERS . $insert . " ORDER BY user_level DESC, user_name LIMIT " . (int) $rowstart . "," . (int) $items_per_page); // Pimped while ($data = dbarray($result)) { $cell_color = $i % 2 == 0 ? "tbl1" : "tbl2"; $i++; echo "<tr>\n<td class='" . $cell_color . "'>\n" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</td>\n"; $groups = ""; $user_groups = explode(".", $data['user_groups']); $j = 0; foreach ($user_groups as $key => $value) { if ($value) { $groups .= group_link($value, getgroupname($value)) . ($j < count($user_groups) - 1 ? ", " : ""); // Pimped: Url-rewrite } $j++; } echo "<td class='" . $cell_color . "'>\n" . ($groups ? $groups : ($data['user_level'] == nSUPERADMIN ? $locale['407'] : $locale['406'])) . "</td>\n"; // Pimped echo "<td align='center' width='1%' class='" . $cell_color . "' style='white-space:nowrap'>" . getuserlevel($data['user_level']) . "</td>\n</tr>"; } echo "</table>\n"; } else { echo "<div style='text-align:center'><br />\n" . $locale['403'] . $_GET['sortby'] . "<br /><br />\n</div>\n"; } $search = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); echo "<hr />\n<table cellpadding='0' cellspacing='1' class='tbl-border center' style='margin-top:10px;'>\n<tr>\n"; echo "<td rowspan='2' class='tbl2'><a href='" . make_url(FUSION_SELF . "?sortby=all", "members", "", ".html") . "'>" . $locale['404'] . "</a></td>";
<tr class="hover"> <td class="padded"><strong><?php echo group_link($object); ?> </strong></td> <td class="padded"><?php echo $object['users']; ?> </td> <td class="padded"><?php echo $object['blurb']; ?> </td> <td class="padded"><nobr><?php echo date('M j, Y', strtotime($object['created_at'])); ?> </nobr></td> </tr>
/** * Function used to get user feed */ function getUserFeeds($user) { global $cbphoto, $userquery, $cbvid, $cbgroup, $cbcollection; $allowed_feeds = USER_ACTIVITY_FEEDS_LIMIT; $uid = $user['userid']; $feeds = $this->getUserFeedsFiles($uid); if (!$feeds) { return false; } $newFeeds = array(); $coutn = 0; foreach ($feeds as $feed) { $count++; if ($count > $allowed_feeds) { break; } $feedArray = json_decode($feed['content'], true); if ($feed && count($feedArray > 0)) { $remove_feed = false; $farr = $feedArray; $action = $farr['action']; $object = $farr['object']; $object_id = $farr['object_id']; $farr['user'] = $user; $farr['file'] = getName($feed['file']); $farr['datetime'] = nicetime($farr['time'], true); $userlink = '<a href="' . $userquery->profile_link($user) . '">' . $user['username'] . '</a>'; //Creating Links switch ($action) { case "upload_photo": $photo = $cbphoto->get_photo($object_id); //If photo does not exists, simply remove the feed if (!$photo) { $this->deleteFeed($uid, $feed['file']); $remove_feed = true; } else { $objectArr['details'] = $photo; $objectArr['size'] = 't'; $objectArr['output'] = 'non_html'; $objectArr['alt'] = $photo['photo_title']; $farr['thumb'] = $cbphoto->getFileSmarty($objectArr); $farr['link'] = $cbphoto->photo_links($photo, 'view_item'); //Content Title $farr['title'] = $photo['photo_title']; $farr['action_title'] = sprintf(lang('user_has_uploaded_new_photo'), $userlink); $farr['links'][] = array('link' => $cbphoto->photo_links($photo, 'view_item'), 'text' => lang('view_photo')); $farr['icon'] = 'images.png'; } break; case "upload_video": case "add_favorite": $video = $cbvid->get_video($object_id); //If photo does not exists, simply remove the feed if (!$video) { $this->deleteFeed($uid, $feed['file']); $remove_feed = true; } elseif (!video_playable($video)) { $remove_feed = true; } else { //Content Title $farr['title'] = $video['title']; if ($action == 'upload_video') { $farr['action_title'] = sprintf(lang('user_has_uploaded_new_video'), $userlink); } if ($action == 'add_favorite') { $farr['action_title'] = sprintf(lang('user_has_favorited_video'), $userlink); } $farr['link'] = videoLink($video); $farr['object_content'] = $video['description']; $farr['thumb'] = get_thumb($video); $farr['links'][] = array('link' => videoLink($video), 'text' => lang('watch_video')); $farr['icon'] = 'video.png'; if ($action == 'add_favorite') { $farr['icon'] = 'heart.png'; } } break; case "create_group": case "join_group": $group = $cbgroup->get_group($object_id); //If photo does not exists, simply remove the feed if (!$group) { $this->deleteFeed($uid, $feed['file']); $remove_feed = true; } elseif (!$cbgroup->is_viewable($group)) { $remove_feed = true; } else { //Content Title $farr['title'] = $group['group_name']; if ($action == 'create_group') { $farr['action_title'] = sprintf(lang('user_has_created_new_group'), $userlink); } if ($action == 'join_group') { $farr['action_title'] = sprintf(lang('user_has_joined_group'), $userlink); } $farr['link'] = group_link(array('details' => $group)); $farr['object_content'] = $group['group_description'] . "<br>" . lang('total_members') . " : " . $group['total_members'] . "<br>" . lang('total_videos') . " : " . $group['total_videos'] . "<br>" . lang('total_topics') . " : " . $group['total_topics'] . "<br>"; $farr['thumb'] = $cbgroup->get_group_thumb($group); $farr['icon'] = 'group.png'; $joinlink = $cbgroup->group_opt_link($group, 'join'); if ($joinlink) { if (SEO == "yes") { $joinlink = group_link(array('details' => $group)) . '?join=yes"'; } else { $joinlink = group_link(array('details' => $group)) . '&join=yes"'; } $farr['links'][] = array('link' => $joinlink, 'text' => lang('join')); } } break; case "signup": $farr['action_title'] = sprintf(lang("user_joined_us"), $userlink, TITLE, $userlink); $farr['icon'] = 'user.png'; break; case "add_friend": $friend = $userquery->get_user_details($object_id); if (!$friend) { $this->deleteFeed($uid, $feed['file']); $remove_feed = true; } else { $friendlink = '<a href="' . $userquery->profile_link($friend) . '">' . $friend['username'] . '</a>'; $farr['action_title'] = sprintf(lang("user_is_now_friend_with_other"), $userlink, $friendlink); $farr['icon'] = 'user_add.png'; } break; case "add_collection": $collection = $cbcollection->get_collection($object_id); if (!$collection) { $this->deleteFeed($uid, $feed['file']); $remove_feed = true; } else { $farr['action_title'] = sprintf(lang('user_has_created_new_collection'), $userlink); $farr['thumb'] = $cbcollection->get_thumb($collection, 'small'); $farr['title'] = $collection['collection_name']; $collection_link = $cbcollection->collection_links($collection, 'view'); $farr['link'] = $collection_link; $farr['object_content'] = $collection['collection_description'] . '<br>' . $collection['total_objects'] . " " . $collection['type']; $farr['icon'] = 'photos.png'; $farr['links'][] = array('link' => $collection_link, 'text' => lang('view_collection')); } } if (!$remove_feed) { $newFeeds[$feedArray['time']] = $farr; } } } return $newFeeds; }
/** * Get group link */ function get_link($group, $cond = NULL) { return group_link(array('details' => $group)); }