function groups_get_action($url) { $explosion = explode('/', $url); if ($url == '/grupper/ny_grupp.php') { $request['group_info'] = $_POST; $request['action'] = 'create_group'; return $request; } if ($url == '/grupper/skapa_grupp') { $request['action'] = 'new_group'; return $request; } if (strlen($explosion[2]) > 0) { $request['action'] = 'view_group'; $request['group'] = groups_fetch(array('handle' => $explosion[2])); if (count($request['group']) == 1) { $request['group'] = array_pop($request['group']); } else { $request['action'] = 'group_not_found'; $request['group_handle'] = $explosion[2]; } return $request; } else { $request['action'] = 'index'; } return $request; }
/* $content .= rounded_corners_top(array('color' => 'blue'), true); $content .= '<h2>Hamsterpajs aktivaste grupper</h2>' . "\n"; $groups = groups_fetch(array('limit' => 6)); $content .= groups_list($groups); $content .= rounded_corners_bottom(array('color' => 'blue'), true); $content .= rounded_corners_top(array('color' => 'blue'), true); $content .= '<h2>Hamsterpajs största grupper</h2>' . "\n"; $groups = groups_fetch(array('limit' => 6, 'order-by' => 'member_count', 'order-direction' => 'DESC')); $content .= groups_list($groups); $content .= rounded_corners_bottom(array('color' => 'blue'), true); */ $content .= rounded_corners_top(array('color' => 'blue'), true); $content .= '<h2>Mina grupper</h2>' . "\n"; $groups = groups_fetch(array('founder' => $_SESSION['login']['id'], 'order-by' => 'id', 'order-direction' => 'DESC')); $content .= groups_list($groups); $content .= rounded_corners_bottom(array('color' => 'blue'), true); $content .= rounded_corners_top(array('color' => 'blue'), true); $content .= '<h2>Hamsterpajs senaste skapade grupper</h2>' . "\n"; $groups = groups_fetch(array('limit' => 6, 'order-by' => 'id', 'order-direction' => 'DESC')); $content .= groups_list($groups); $content .= rounded_corners_bottom(array('color' => 'blue'), true); $content .= '<a href="skapa_grupp">Skapa ny grupp</a>' . "\n"; break; } $content .= '<a href="/grupper/">Tillbaka</a>'; ui_top($ui_options); echo $content; preint_r($request); ui_bottom();