Module rewrite and Drupal 5 Compatibility
| Project: | Profile Privacy |
| Version: | HEAD |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Heya Moshe,
I had a need for a similar functionality as included in pp.module, but the implementation in the was limited and a little clunky. Rather than displaying a separate tab, I wanted the privacy settings to be inline, right below the field they configured. I also didn't want the user to be able to hide all their information, but only a few fields. Lastly, I couldn't have the privacy handled in the theme layer (or preferred not to) as I would need to implement the privacy feature in all my existing themes which over ride theme_user_profile().
I rewrote pp.module as privacy_profile.module to implement these requirements. I would have made a patch but the approach was so entirely different no code remains from the original version. This approach should immediately work with the default profile page as well as any themed profiles using theme_user_profile(). It requires no patches and works on 5.0 and 4.7.
So the changes:
- Works on D5 and 4.7 no patches
- No separate settings page
- Fields may optionally have settings for privacy, not all of them.
- Doesn't use phptemplate_ theme hack
- Uses it's own database tables
- Works with both the default profile display and themed versions, no additional coding needed
I'll give these changes back to the community, but as this module provides the exact functionality of pp.module, I'd like to have it supersede the current version. The install file searches the user table for pp.module data and will update existing permissions to the new schema. If this isn't the place for releasing, I can make a new project. Thanks!
Here is a zip containing both 4.7 and 5 versions. You can view the source in my sandbox. For quick summary view screenshots.

#1
sounds great, nate. i'm giving you cvs access now. just blow away what i did with what you have. i didn't test it, but i can come to you now when there are bugs :).
note that i am about to submit a patch for user profile rendering for D6 so we'll need your help again. oh well.
thanks much.
#2
Doh! Well at least we'll have something that works for D4.7 and 5 :)
Thanks Moshe!
#3
I've tested this on a site being built that has a large number of custom profile elements under several categories. Works just fine (5.x version).
You might think about providing hooks into Buddylist for a later release, as many folks will allow authenticated users to view their profile while keeping the general public out (even if a logged in user).
#4
Additional note on testing of this...
I received the following error when deleting a user (whether the user had privacy values associated with it or not):
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE uid = 8' at line 1 query: DELETE FROM profile_privacy_values ppv WHERE uid = 8 in /home/sitename/public_html/includes/database.mysql.inc on line 172.
#5
This module is awesome!
I was wondering if it were possible to have it OG compatible. So for example, you could say don't show to everyone, just to the people who are in the same groups I am in ....Julie
#6
Moshe was kind enough to grant me commit access to this module. I've committed the new version to CVS and branched for Drupal 5 and 4.7. Please open a new issue for each item here. Thanks!
#7
@spyderpie Please open a new issue for your request. The idea is definitely a good feature (along with buddylist integration). In your new issue, please describe the UI which would be most effective for integrating these features. Thanks!
#8