Username in url?!?
Username in url?!?
Is it possible to make a "page" which is named by the username loged in? Example. If a user logs he or she should be redirected to a page called "index.php?page=username"... Can this be done?
Re: Username in url?!?
The FrontendUsers module has a returnto parameter you can use for that, from the module help:
D
Regards,# (optional) returnto="page"
Used with the login, logout, and changesettings forms, this parameter contains the page id or alias of a page to redirect to, when the form has been successfully completed
D
Re: Username in url?!?
... and in the returnto property Dee mentions, you can assign $customcontent_loginname. This of course assumes that a page with a matching page alias already exists.
Then, to make it even more secure, you can use something like this in your page template:
If you want the page automatically created upon user creation, I think it is more difficult.
See this thread for more info: http://forum.cmsmadesimple.org/index.php?topic=19152.0;prev_next=prev
Then, to make it even more secure, you can use something like this in your page template:
Code: Select all
{if $ccuser->loggedin() && $customcontent_loginname eq $page_alias }
{content}
{else}
Please log in.
{/if}
See this thread for more info: http://forum.cmsmadesimple.org/index.php?topic=19152.0;prev_next=prev
Re: Username in url?!?
That allmost did the job, but... Isn't it possible to make 1 dynamic page called ex. "username", and then when a user logs in it changes to the username of the user. In that way I only have to create on page instead of many new pages???
Re: Username in url?!?
It sounds like you want to reassign the page alias based on the username of the logged in user, which I don't think is possible (or at least not practical).
If you only want to create one page, then just create one page and have all the users directed to that page after login. If you want different content on that page, based on the logged in user, you could probably do something with content blocks and a little Smarty magic.
If you only want to create one page, then just create one page and have all the users directed to that page after login. If you want different content on that page, based on the logged in user, you could probably do something with content blocks and a little Smarty magic.
Re: Username in url?!?
I might end up doing so, but what I want to do is to make a littke community site where each user has a page showned to others with blogs, gallery, etc. etc. and it would be nice if they could teel there friends to go to "www.site.com/username". But this might not be possible???