Welcome Guest, Not a member yet? Register   Sign In
User Profile URL
#6

[eluser]vadivelan[/eluser]
Second approach is to use a hook.
1. Create a pre-controller hook
2. From that hook access the total number of segments ( using uri library ).
3. If total segment is one, collect the uri_path (using uri's uri_string )
4. Check if this related to any real path using file's set_realpath. If this doesn't resolve to valid path then you shall verify and generate your user profile or redirect to their profile page.

if( $this->uri->total_rsegments() == 1 ) {
$uristring = $this->uri->uri_string();
if( ! $this->file->set_realpath('./system/application/'.$uristring . ".php" ) {
echo(" got it");
}
}

But like my above post, I don't know how to access CI's libraries within hook. lol.


Messages In This Thread
User Profile URL - by El Forum - 03-01-2008, 12:38 AM
User Profile URL - by El Forum - 03-01-2008, 01:20 AM
User Profile URL - by El Forum - 03-01-2008, 02:34 AM
User Profile URL - by El Forum - 03-01-2008, 02:53 AM
User Profile URL - by El Forum - 03-01-2008, 03:10 AM
User Profile URL - by El Forum - 03-01-2008, 03:18 AM
User Profile URL - by El Forum - 03-01-2008, 03:23 AM
User Profile URL - by El Forum - 03-01-2008, 04:05 AM
User Profile URL - by El Forum - 03-01-2008, 01:54 PM
User Profile URL - by El Forum - 03-03-2008, 08:13 AM
User Profile URL - by El Forum - 03-03-2008, 11:13 AM
User Profile URL - by El Forum - 03-03-2008, 03:04 PM
User Profile URL - by El Forum - 03-03-2008, 03:28 PM
User Profile URL - by El Forum - 03-03-2008, 03:32 PM
User Profile URL - by El Forum - 03-03-2008, 03:58 PM
User Profile URL - by El Forum - 03-03-2008, 07:53 PM
User Profile URL - by El Forum - 03-04-2008, 09:52 AM
User Profile URL - by El Forum - 03-04-2008, 10:07 AM
User Profile URL - by El Forum - 05-04-2008, 06:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB