Closed (won't fix)
Project:
User Relationships
Version:
5.x-2.8
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Jul 2008 at 17:47 UTC
Updated:
4 Nov 2017 at 12:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mariusooms commentedVery interested. In fact, not just profile fields, but even the whole profile page. Display a tiny teaser if not allowed to view. Just like facebook. Node Access already gives acces control over content types, but not user profile info. This would be great - I'm using Version 6 though!
Marius
Comment #2
scottgifford commentedI couldn't find a way to do this without patching
profile.module. Perhaps somebody with a better understanding of Drupal's hooks could find a better way, but here's my patch anyways.It defines a new visibility type of
PROFILE_FRIENDSONLY, adds it to the profile settings form, and selects fields of this visibility if the current user has a relationship with the user whose profile is being viewed.Comment #3
Jboo commentedHi, this is just what I'm looking for, but after applying the patch I can't seem to find any change. Whereabouts should I see the visibility option? Also, I was wondering would this work like facebook so that only the users picture and name (for example) would be shown, but a link to the user relationship option would be available?
Thanks for your help.
Comment #4
scottgifford commentedHi Jboo,
If you go to the "Profiles" page and select a particular field, you will see under "Visibility" the option "Friends only field, content only accessible by users we have a relationship with".
Any public fields will be shown before a relationship is established. This should include the name and picture, though I haven't tested it.
Comment #5
Jboo commentedHi, thanks for the reply Scott. I think this isn't working for me because a few errors occurred whilst patching. Using Cygwin the reject file looks like this:
Is there a patched copy available or any tips on manually patching? Is it as simple as inserting the plus (+) code and removing minus (-) code?
As another note, should this work on Drupal 6 like mariusooms requested above or this patch for D5 only?
Thanks again, your help's appreciated.
Comment #6
scottgifford commentedJboo,
Yes, it's basically as simple as removing the minus lines and adding the plus lines, although if patch failed the minus lines won't be exactly right.
Basically, you'll want to add the
PROFILE_FRIENDSONLY => t(...)part to the#optionslist of theVisibilityfield, and stick in thehave_relationshipfunction anywhere in the file.I have no idea whether this will work on D6, I don't have an installation handy to test with. If you're using version 6, please give it a try and post your results here.
Good luck!
Comment #7
Jboo commentedThanks Scott,
There still seems to be something missing. I've been able to add the lines needed from the patch apart from one line:
This doesn't seem like it appears anywhere in the module, so I'm guessing there needs to be another way for the PROFILE_FIELDSONLY to associate with the options. I'll play around with my limited knowledge of coding, but this is what I have so far in the profile.module...
Comment #8
scottgifford commentedJboo,
It looks like in Drupal 6 this code is moved to this file: profile.admin.inc
Comment #9
designwork commentedHi all
this should be done by the hook form alter, I will have a look at this code in the next week.
Dirk
Comment #10
Jboo commentedAh, thanks Scott. I've added the code to profile.admin.inc and I can see the option in the profile settings, but it doesn't hide/show the field yet. This is also probably because of the changes I've made but when going to a profile page i get this error:
Comment #11
mariusooms commentedMy advice...wait for a proper hook form alter solution, since changing core code is never a good idea.
Comment #12
scottgifford commentedJboo: You will have to take a closer look and see what's changed between Drupal 5 and Drupal 6 that's causing the errors you're seeing.
DesignWork/mariusooms: I can see how to modify the form with a hook, but not how to actually implement the policy. If you have any ideas please let me know.
Comment #13
Babalu commentedsubscribe (d6)
Comment #14
okday commentedsubscribing
Comment #15
xayberoptix commentedsubscribe
Comment #16
Crom commentedsubscribe
Comment #17
mediamike commentedSubscribe
Comment #18
berdirSorry for pinging the participants.
Now that Drupal 7 is out, there is no support for Drupal 5 and the corresponding modules anymore. Therefore, I'm closing all old issues which are still open.
I suggest you upgrade to Drupal 6 or 7 and figure out if you're feature is still needed or the bug still exists and open a new issue in that case.
Comment #19
zamir commentedI also suggest you upgrade to Drupal 6 or 7.
Comment #20
IamOnStage commentedIs this feature included in the D7 User Relationships module?