User Profile Links Display Patch

hutch - February 28, 2009 - 14:47
Project:Ubercart Marketplace
Version:5.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

Here is a small patch that cleans up the user profile insertion so that it does not display if there are no links to display, also puts the breaks at the end of each link for tidier output.
This is on D6 dev version

AttachmentSize
user_profile_links.patch1.61 KB

#1

Turgrid - March 1, 2009 - 01:50

Thanks. This looks good, so I see no reason not to commit it to the next release (when I get a chance to update) d6.

#2

Turgrid - March 1, 2009 - 01:51
Title:patch for D6» User Profile Links Display Patch

#3

hutch - March 1, 2009 - 10:27

Here is an improvement on the previous patch, please have a look Turgrid and see if it fits with your logic.
It allows admin to see other user profiles without admin's ability to see everything getting in the way and attempts to ensure that users only get to see their own. Where $user and $account do not match $user is used.

What I am trying to set up is a market where all the products are being sold by all the sellers (salesmen in a more conventional sense)
Therefore I am enabling mp_products but not enabling 'view own products' for these salesmen. Many of the orders are going to be imported from other sources so I'm trying to figure out how best to do this. I'm not clear how an order is tagged as 'belonging' to a seller. uc_orders.uid is for the customer, node.uid (for a product) will be the uid of the Content Manager but how to store the seller uid?
The aim is also to allow a Sales Manager to see all the orders with the sellers uid (name) visible.

AttachmentSize
user_profile_links2.patch 2.03 KB

#4

hutch - March 3, 2009 - 13:45

Ooops, replying to my own posting, I have found a bug in user_profile_links2.patch.
For anyone who has already applied it, edit line 40 and change

$user->uid <> 1

to
$user->uid > 1

re-rolled patch is attached

AttachmentSize
user_profile_links3.patch 2.03 KB

#5

fehin - March 11, 2009 - 23:23

Can we have a patch like this for 5x please?

#6

hutch - March 12, 2009 - 01:01

untested, please report back so others will know

AttachmentSize
user_profile_links_D5.patch 1.33 KB

#7

fehin - March 13, 2009 - 00:59

Thank you for the patch. I tried it but now whenever I visit a user's profile I see my own profile instead even though the url shows the link to the other user

#8

jbrodbeck - October 6, 2009 - 00:50
Version:6.x-1.x-dev» 5.x-1.x-dev

A version of this was patched to 6.x but I will assume it's still active for 5.x

 
 

Drupal is a registered trademark of Dries Buytaert.