public function main() { $session = pathang::GetInstance('session'); $liveuser = $session->get('liveuser'); $username = pathang::getInstance('node')->get('n1'); $option = pathang::getInstance('node')->get('n2'); $allowedType = array("text", "photo", "video", "link"); $type = pathang::getInstance('node')->get('n2'); if ($username && !in_array($username, $allowedType)) { $allowedType = array('following', 'followers', 'edit', 'image', 'image_upload', 'image_dupload', 'crop', 'cropimage', 'notifications'); if ($option && in_array($option, $allowedType)) { pathang::getController('profile')->{$option}(); } else { pathang::GetController('profile')->page($username); } } else { if ($liveuser) { pathang::getInstance('pathang')->SITE->PAGE = 'index'; pathang::getController('feed')->wall(); } else { pathang::getInstance('pathang')->SITE->PAGE = 'frontpage'; pathang::render('general', 'frontpage'); } } }