Exemple #1
0
function __wps__show_group_menu_tabs($gid, $member_of, $group) {
        	
	global $wpdb, $current_user;

		$structure = get_option(WPS_OPTIONS_PREFIX."_group_menu_structure");

		$str_arr = explode(chr(10), $structure);
				
		$menu = '<ul class="__wps__dropdown">';

		// Build menu		
		$started_top_level = false;
		foreach($str_arr as $item) {
			
			// Top level menu items
			if (strpos($item, '[') !== false) {
				$item = str_replace('[', '', $item);
				$item = str_replace(']', '', $item);
				if ($started_top_level) {
					$menu .= '</ul></li>';
				}
				$started_top_level = true;

				if ($member_of == "yes" || $group->content_private != "on") {			
					$menu .= '<li class="__wps__top_menu">'.$item;
				} else {
					$menu .= '<li class="__wps__top_menu" style="display:none">'.$item;
				}
				$menu .= '<ul class="__wps__sub_menu">';
			}
			
			// Child item
			if (strpos($item, '=') !== false) {
				list($title,$value) = explode('=', $item);
				$value = str_replace(chr(13), '', $value);
				$i = '';

				switch ($value) {
				case 'welcome' :
					$i = '<li id="group_menu_about" class="__wps__group_menu">'.$title.'</li>';
					break;
				case 'settings':
					if (__wps__group_admin($gid) == "yes" || __wps__get_current_userlevel() == 5) {
						$i = '<li id="group_menu_settings" class="__wps__group_menu" href="javascript:void(0)">'.$title.'</li>';
					}
					break;
				case 'invites' :
					if (__wps__group_admin($gid) == "yes" || __wps__get_current_userlevel() == 5) {
						if (get_option(WPS_OPTIONS_PREFIX.'_group_invites') == 'on')
							$i = '<li id="group_menu_invites" class="__wps__group_menu" href="javascript:void(0)">'.$title.'</li>';
					}
					break;				
				case 'activity' :
					$i = '<li id="group_menu_wall" class="__wps__group_menu" href="javascript:void(0)">'.$title.'</li>';
					break;
				case 'forum' :
					if ($group->group_forum == "on")
						$i = '<li id="group_menu_forum" class="__wps__group_menu" href="javascript:void(0)">'.$title.'</li>';
					break;
				case 'members' :
					$i = '<li id="group_menu_members" class="__wps__group_menu" href="javascript:void(0)">'.$title.'</li>';
					break;
				default :
					$i = apply_filters ( '__wps__group_menu_tabs', '', $title, $value, $gid, $member_of, $group);
					break;
				}
				if ($i) $menu .= $i;
			}
			
		}
		if ($started_top_level) {
			$menu .= '</ul></li>';
		}

		$menu .= '<div id="__wps__menu_tabs_wrapper"></div>';
			
		$menu .= '</ul><div style="clear:both;padding-bottom:20px;"></div>';
				
	return $menu;

}
				}
				
				if ($member['valid'] == "on" && $shown_members_title == false) {
					$html .= "<br /><p><strong>".__("Members", WPS_TEXT_DOMAIN)."</strong></p>";
				}
				
				$time_now = time();
				$last_active_minutes = strtotime($member['last_activity']);
				$last_active_minutes = floor(($time_now-$last_active_minutes)/60);
												
				$html .= "<div id='request_".$member['ID']."' class='wall_post_div members_row row_odd corners'>";		

					$html .= "<div class='members_info'>";

						// Delete icons
						if ( (__wps__get_current_userlevel() == 5 || __wps__group_admin($uid1) == "yes") && ($member['admin'] != 'on') ) {
							$html .= " <a title='".$member['ID']."' href='javascript:void(0);' style='display:none; float:right;' class='delete_group_member delete delete_post_top'><img src='".get_option(WPS_OPTIONS_PREFIX.'_images')."/delete.png' style='width:16px;height:16px' /></a>";
						}

						if ( ($member['ID'] == $me) || (is_user_logged_in() && strtolower($member['share']) == 'everyone') || (strtolower($member['share']) == 'public') || (strtolower($member['share']) == 'friends only' && __wps__friend_of($member['ID'], $current_user->ID)) ) {
							$html .= "<div class='members_location'>";
								if (isset($city) && $city != '') {
									$html .= $member['city'];
								}
								if (isset($country) && $country != '') {
									if ($city != '') {
										$html .= ', '.$member['country'];
									} else {
										$html .= $member['country'];
									}
								}