To change the default output of $user in Drupal 5 I use this template.php:
<?php
/**
* This snippet catches the default user name and looks
* for a username.tpl.php file in the same folder
* which has the new layout.
*/
function phptemplate_username($object) {
if ($object->in_preview) {
return theme_username($object);
}
return _phptemplate_callback('username', array('object' => $object));
}
?>
And in username.tpl.php I have:
<?php
if ($object->uid && $object->name) {
// If the user has a nickname defined and want to use that
$user = user_load(array(uid => $object->uid));
if ($user->profile_show_nickname && !empty($user->profile_nickname)) {
$object->name = $user->profile_nickname;
}
else {
// If the user has a full name defined, use that
if (!empty($user->profile_first_name)) {
$object->name = ($user->profile_first_name . " " . $user->profile_last_name);
}
}
// Shorten the name when it is too long or it will break many tables.
if (drupal_strlen($object->name) > 20) {
$name = drupal_substr($object->name, 0, 15) .'...';
}
else {
$name = $object->name;
}
i moved my installation to a new server. Now I have some troubles with a number of links.
I have multiple languages installed. On my old server I could call an url by
http://www.mysite.eu/node/5 and it would end up on the correct site.
now I get a ' The requested URL /node/5 was not found on this server.' error.
It only works when i use.
I have been searching through the forums now for about 2 hours and have not been able to find any answers to the problem I am having...so here my questions begin.
This morning I tried to upgrade from 5.7 to 6.1 via Fantastico (not a good way to upgrade as I found out today.) Previous to upgrading, I made a backup file of my site....logged into the admin, and took my site "offline" through the maintenance module, logged out and proceeded to upgrade. I should also mention I had installed a theme which was not the "default" Blue Marine theme which originally came with drupal when I downloaded it initially.
After the upgrade was complete, I refreshed and tried to login to the site via the user page - but I got a TON of error messages. I see that the upgrade removed the theme I was using and replaced it with the normal default themes. I already anticipated this, which is why I made a backup. I assume I can't log in - or view the site at all because it's looking for the wrong theme?
I have been searching through the forums now for about 2 hours and have not been able to find any answers to the problem I am having...so here my questions begin.
This morning I tried to upgrade from 5.7 to 6.1 via Fantastico (not a good way to upgrade as I found out today.) Previous to upgrading, I made a backup file of my site....logged into the admin, and took my site "offline" through the maintenance module, logged out and proceeded to upgrade. I should also mention I had installed a theme which was not the "default" Blue Marine theme which originally came with drupal when I downloaded it initially.
After the upgrade was complete, I refreshed and tried to login to the site via the user page - but I got a TON of error messages. I see that the upgrade removed the theme I was using and replaced it with the normal default themes. I already anticipated this, which is why I made a backup. I assume I can't log in - or view the site at all because it's looking for the wrong theme?
I have just upgraded a drupal 4.7 site to 5 following all steps however when I turned my theme back on it didn't seem to work and now my site looks as though it has no css working for it at all. The other default themes work fine...
I try to update my 5.2 to 5.7. As explained in the upgrade.txt i disabled the contributed modules.
But now I get a 'page not found' error and cannot do anything in the backend any more (like switching to a core theme), or activating the modules again.
I am completely locked out.
I have the feeling that the views module was the last one i deactivated. Is there a possibility to activate the module again from the database (if yes how do I do that?). What is going wrong there
Quick help really appreciated.