hi,
is it possible to replace the following code
<?php
if (isloggedin()) forward('activity');
?>
with
<?php
if (isloggedin()) forward("profile/$username");
?>
is i replace this code i can see the url something like this
localhost/ssn/profile/$username
it does not read the username which is given in the username field
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- iionly@iionly
iionly - 0 likes
- Bennett@deepakr
Bennett - 0 likes
- Brett@brett.profitt
Brett - 0 likes
- Brett@brett.profitt
Brett - 0 likes
You must log in to post replies.Try it with
<?php
if (isloggedin()) forward("profile/" . $_SESSION['user']->username);
?>
great :) tnx a lot dude it works fine....
Using $_SESSION is discouraged. If you're on 1.8, do this:
$logged_in_user = elgg_get_logged_in_user_entity();
if (elgg_instanceof($logged_in_user, 'user')) {
forward('profile/' . $logged_in_user->username);
}
Also, I've changed the title of this topic to be more meaningful.