By sunfish on
After user login, I want /user to display a different page instead of the default user page. I modified user.module as follows but it didn't seem to work. Any suggestions?
/* replace the default after-login user page with front page */
/* if ($user->uid) {
drupal_goto('user/'. $user->uid);
} */
if ($user->uid) {
drupal_goto('front');
}
/* replace the default after-login user page with front page */
/* if (!$admin && $user->uid) {
drupal_goto('user/'. $user->uid);
} */
if (!$admin && $user->uid) {
drupal_goto('front');
}
Btw, it's Drupal 6.9.
Comments
=-=
you shouldn't be modifying core files. Investigate the login destination.module
I would start over with any
I would start over with any changes you made to the user.module, thats really bad practice.
The best way to make changes to your user profile page is to:
1. create a user_profile.tpl.php file in your theme directory (/sites/all/themes/yourthemename/user_profile.tpl.php)
2. using the panels module, create a panel with a url of /user/$uid
For the first option, you would want to look at your user module and copy the file user-profile.tpl.php
Copy that file to your theme directory and rename it user_profile.tpl.php
Then edit that file. Drupal, by way of its hook and theme system, will check your theme directory before it finally defaults to the user.module directory.
Remember to flush your cache system. You can do this under the admin / performace section or download and use the devel module.
http://drupal.org/project/devel
Hope this helps
------------------------------
i do stuff
------------------------------
i do stuff