[Solved] User listing view sends you to the nodeprofile node

[Solved] User listing view sends you to the nodeprofile node

  • Visitor
  • 604
  • 1969-12-31
  • Offline
  • Sat, 06/23/2007 - 00:13

Any one has solved the above problem..


I solved the problem in my

  • ipwa (not verified)
  • 604
  • 1969-12-31
  • Offline
  • Sat, 06/23/2007 - 00:18

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

  • Sun, 06/24/2007 - 12:42

I solved this by using a redirect... You can see it in the revised version of the tutorial.

Michelle


Listing links

  • Anonymous (not verified)
  • 604
  • 1969-12-31
  • Offline
  • Mon, 06/25/2007 - 11:13

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

  • kreaper
  • 1
  • 2007-07-06
  • Offline
  • Fri, 07/06/2007 - 14:32

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

  • Visitor (not verified)
  • 604
  • 1969-12-31
  • Offline
  • Sat, 08/02/2008 - 04:04

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.


Post new comment
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><blockquote>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options