Here's way of displaying the correct link in all listings. Note: It's always a good idea to use drupals function l(...) (that is a small L), because you can, for example, make proper use of pathauto! See http://api.drupal.org/api/5/function/l
These lines replace the top, you get the idea. If necessary you can keep the 301 redirect too...
Another way I have solved this problem is to use the Computed Field Module.
Edit the "User Profile Content Type" and create a computed field.
Give it a name. I called mine account_url
In the Computed Code section, put this php code:
global $user; $node_field[0]['value'] = l( t($user->name), 'user/' . $user->uid);
Select the Display Field check box and set the Display Format to :
$display = $node_field_item['value'];
Select Store using the database settings below, set the Data Type to Text.
This field should now be available in the User Listing Views Module and should link to the user's profile page, instead of the user profile node page.
Hoping someone can help me, as I don't know php and have a new drupal site - a lot to learn! I need some php code for a new page called MYURL:
1. Check to see if the user has made a profile ("profile" content type)
2. If user has a "profile" content type, display the MYURL page, if not, display a message with a link for user to create a profile
3. Display on MYURL page:
print 'http://www.site.com/account_url
(NOT a link)
where the "account_url is the path of the user's profile page.
Any help is appreciated! This post is as close as I could find to something like what I'm looking for.
I solved the problem in my
I solved the problem in my particular situation. see my post: http://shellmultimedia.com/node/10
I disabled the title and added the names to the teaser.
Redirect
I solved this by using a redirect... You can see it in the revised version of the tutorial.
Michelle
Listing links
Here's way of displaying the correct link in all listings. Note: It's always a good idea to use drupals function l(...) (that is a small L), because you can, for example, make proper use of pathauto! See http://api.drupal.org/api/5/function/l
These lines replace the top, you get the idea. If necessary you can keep the 301 redirect too...
<?php
$loggedinuser = $GLOBALS['user'];
$profileuser = user_load(array('uid' => $node->uid));
?>
<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print 'sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">
<?php if ($page == 0): ?>
<h2><?php print l($profileuser->name, 'user/'. $profileuser->uid , array('title' => $profileuser->name)) ?></h2>
<?php endif; ?>
Thanks for the great tutorial!
Another way I have solved
Another way I have solved this problem is to use the Computed Field Module.
Edit the "User Profile Content Type" and create a computed field.
Give it a name. I called mine account_url
In the Computed Code section, put this php code:
global $user;$node_field[0]['value'] = l( t($user->name), 'user/' . $user->uid);
Select the Display Field check box and set the Display Format to :
$display = $node_field_item['value'];Select Store using the database settings below, set the Data Type to Text.
This field should now be available in the User Listing Views Module and should link to the user's profile page, instead of the user profile node page.
display account_url to user
Hoping someone can help me, as I don't know php and have a new drupal site - a lot to learn! I need some php code for a new page called MYURL:
1. Check to see if the user has made a profile ("profile" content type)
2. If user has a "profile" content type, display the MYURL page, if not, display a message with a link for user to create a profile
3. Display on MYURL page:
print 'http://www.site.com/account_url
(NOT a link)
where the "account_url is the path of the user's profile page.
Any help is appreciated! This post is as close as I could find to something like what I'm looking for.