Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
User relationship module is super. but i think we need a search box in it so that we can search users in our relationships, and users throughout the site so as we add relationships with them. For this i will work on creating a small module in UR API or submit a patch for this. I think this will be the great improvement in user relationships
Comment | File | Size | Author |
---|---|---|---|
#17 | user_relationships_search.zip | 4.74 KB | 63reasons-LS |
#8 | user_relationships_search.zip | 4.06 KB | 63reasons-LS |
Comments
Comment #1
63reasons-AS CreditAttribution: 63reasons-AS commentedComment #2
alex.k CreditAttribution: alex.k commentedJust came across this issue. Could you explain why core user search would not work for this? Curious to know how discoverability would be improved. Although a solid suggestion feature would probably go a longer way to get social networks built.
Comment #3
MisterSpeed CreditAttribution: MisterSpeed commentedThe issue with the generic search is that a) It is not hinted; I cannot limit my search among friends of friends for example; b) It falls under the slightly less than entirely stellar Drupal Search experience (and becomes entirely irrelevant when you switch the search system), and c) looking at some actual users using a site with UR, not one of them thought of using the search box for finding users; all were diddling around the friends box hoping to find there the search functionality that they need.
In short, having a dedicated search facility that returns profile information a la Facebook instead of a (giant morass of everything on the site, unless as a casual user you happen to know the magic incantations, if any, to limit search to users) would improve the user experience and the search relevancy.
Comment #4
alex.k CreditAttribution: alex.k commentedWe've had pretty good results in general user search using Solr and keeping profile data in nodes with Content Profile. Search within friends of friends would be a great use case. Looking forward to see what you come up with - should likely be a module rather than a patch unless it's small. Appreciate the background info.
Comment #5
ajayg CreditAttribution: ajayg commentedGenric Search is expensive (CPU Cycles) so we use google custom search instead drupal search. So the user search is disabled for us (since default drupal search is disabled). I would love to see a module. We currently use members module for user search so this could be a bridge between UR and some kind of members module.
The more I am thinking about this, why you would need a module? Would a more customzed view or a plugin for views2 would be a better option? You cna use views2 built in search for searching on all users and perhaps a custom filter for searching among the visitor's (logged in user's) friends.
Comment #6
63reasons-AS CreditAttribution: 63reasons-AS commentedComment #7
63reasons-LS CreditAttribution: 63reasons-LS commentedComment #8
63reasons-LS CreditAttribution: 63reasons-LS commentedIm adding a module here as attachment for searching users in and outside relationships and manage them. The search contains different filters.
1) Searching users of the site and add them to relationships.
2) Searching users within relationships.
3) Searching users within pending relationships.
4) Searching users in particular relationships.
We can set number of search results per page from user relationships settings search options.
Let me know if it needs further improvement.
Thanks
Comment #9
MisterSpeed CreditAttribution: MisterSpeed commentedGood work Lakhvinder !
Comment #10
Plazmus CreditAttribution: Plazmus commentedThanks 63reasons-LS it's useful feature.
I've tested it and tab appears when you go to the "relationships" path but it's not visible when you go to "user/%/realationships" (when I'm looking on friends list for other users.)
Can you please fix it ?
Cheers
Comment #11
63reasons-LS CreditAttribution: 63reasons-LS commentedThanks Plazmus,
I will check this and update the module as soon as possible.
Thanks
Comment #12
Plazmus CreditAttribution: Plazmus commentedI just want to ask one more thing as I hope this functionality will be included in next 'User Relationships' beta release.
I use realname module and don't display usernames anywhere, is it possible to use realnames for this search module?
Thanks
Comment #13
alex.k CreditAttribution: alex.k commentedApologies for the delay in reviewing the module. It looks pretty good and works well. I would only do a couple of things before it's ready for more general usage:
* Use theming functions and a template page for showing search results. Pls. see for an example how relationship listing pages are done. This will allow themers to override how results are displayed. Relevant sequence of functions are user_relationships_page(), user_relationships_page() (where actual search would take place), and then user_relationships.tpl.php
* Please format using Drupal code formatting guidelines, and run it through coder.module suggestions
If you don't have any more developer cycles to dedicate to it, let me know. Thanks much!
Comment #14
alex.k CreditAttribution: alex.k commentedAlso, if I select 'All users' it does not include my relationships in search results. Is it intended? When I select "All in relationships" it correctly searches only within my relationships.
Comment #15
MisterSpeed CreditAttribution: MisterSpeed commentedHey Alex,
Lakhvinder is working on an internal project for a few more days but will be available for this right afterwards. Lots of momentum on the Issue list in the last few days so we'll try to get it in for your next release.
Cheers,
Louis-Eric
Comment #16
alex.k CreditAttribution: alex.k commentedGreat, thanks for the heads up.
Comment #17
63reasons-LS CreditAttribution: 63reasons-LS commentedI have done with the necessary changes of adding template files, theming functions and search criteria. Also there is search tab in other users relationships for searching (For admin and user as they has access to the relationships). All the changes are in the attachment
Let me know if it has any issue or need further improvement.
Thanks
Comment #18
ezar CreditAttribution: ezar commentedI add content_profile search for user.
Add in template_preprocess_user_relationships_search()
With this you can search every field in profile and list user/users.
Comment #19
southsideslim03 CreditAttribution: southsideslim03 commentedCan you add this to search the regular profile fields instead of content_profile
Comment #20
apmsooner CreditAttribution: apmsooner commentedAn option:
I've created a search block based on exposed filters in views with exposed form in block checked as a feature. I havn't figured out a way for the search results to only show users that aren't already related to the logged in user so I just have it return all users filtered by user profile and it serves me fine. In this way, clicking on a user in the search results loads the user's profile and then the logged in user can then request relationship with the user there. I've used panels with rules applied to panes that only certain profile content is displayed when logged in user has relationship with user being viewed. It works great this way. If anyone needs detailed instruction on how to do this, i could explain further.
Comment #21
ebtjoe CreditAttribution: ebtjoe commentedI installed the module and when I search for someone on it I get the following error:
user warning: Table 'ebt48_drpl1.users' doesn't exist query: select count(*) from users u where u.name like '%joe%' and u.uid!=3 in /home/ebt48/public_html/sites/all/modules/user_relationships_search/user_relationships_search.module on line 280.
user warning: Table 'ebt48_drpl1.users' doesn't exist query: select u.uid,u.name from users u where u.name like '%joe%' and u.uid!=3 LIMIT 0, 15 in /home/ebt48/public_html/sites/all/modules/user_relationships_search/user_relationships_search.module on line 280.
Comment #22
bfvr074 CreditAttribution: bfvr074 commentedapmsooner! I need to do that too please help me!
Comment #23
apmsooner CreditAttribution: apmsooner commentedAnswer to bfvr074,
Are you comfortable using panels? I'll touch on how I set this up but will leave it up to you to learn more about panels if you are unfamiliar.
As far as the search user setup, you can setup a really basic view based on either user or node (if you use the content profile module). You can either setup exposed filters on that view and specify in the exposed form in block option... or you can use the finder module which I'm actually doing now to pull that view into a finder form which looks and acts a little better in my opinion. Since its just a form to search all users, you don't have to specify any user-relationship fields in the view but rather just setup filters based on roles or any other criteria you want. The search box would just appear as a block or within a page on your site. The output should show a list of names associated with the filtered search and when you click on a name, it goes to the user profile linked to the panel user profile template. This template basically allows you to customize what is shown in a user's profile page based on the content you add to each variant described below.
Panels Example- What I'm doing with panels is just modifying the User Profile Template that comes with panels and setup 3 different variants. Theres other approaches but this is just an example of mine...
1. self - variant to show user profile for logged in user only.
Example usage - This page could contain all private information that only the logged in user has access to. You could for example display a view here of all related users to the logged in user like you would see on facebook.
* selection rules - user:compare = logged in user is user being viewed.
2. related - variant to show profile for related users to the logged in user.
Example usage - This page could contain all information that a related user should see for the user being viewed. Example, if user has photo albums that only "friends" should have access to, then set this page up accordingly. You could also add view here showing all related users to the user being viewed like facebook.
* selection rules - User Relationship = Logged in user can have relationships: "friend" to User being viewed
NOTE: "friend" is the name of the relationship type I setup, yours may be different.
3. unrelated - variant to show profile for unrelated users to the logged in user
Example usage - This page could serve as a message to the logged in user that says the user they are trying to view only shares information with "friends". You could place the user relationship actions links in this variant along with a custom message to the user. If user being viewed approves relationship request for the logged in user then the logged in user will of course see variant 2 the next time they view that user's profile.
* no selection rule because this variant serves as a catch all for profiles that do not belong to the logged in user and are not related to the logged in user.
As you can see, the selection rules control the behavior of who sees what based on relationship status. This setup really functions very similarly to facebook as long as you have the selection rules correctly applied. I've never seen any better or easier way of creating a social network type site with drupal but let me know if anyone has a better solution. Hope that helps.
Comment #24
bfvr074 CreditAttribution: bfvr074 commentedThanks!! apmsooner!! finder module is great!!, I use with views, now I want that search box show in my appbar!!! But thanks!
Comment #25
okday CreditAttribution: okday commentedsubscribing
Comment #26
oxford-dev CreditAttribution: oxford-dev commentedI also get the error described in #21.
I also have error:Warning: Call-time pass-by-reference has been deprecated in C:\Websites\Qinqime\sites\all\modules\user_relationships\user_relationships_search\user_relationships_search.module on line 288
At the top of every page.
This is a really useful add-on when its working fully. As an extra note, it does not return anyone which in not in my relationships (All Users)
good effort
Comment #27
alex.k CreditAttribution: alex.k commentedIf someone wants to bring this module up to date and post as a separate project that would be great. I can't accept maintainership of this feature as I don't use it, and including it in UR proper will make the package too big with an additional feature that only some sites will use.
Comment #28
mrf CreditAttribution: mrf commentedNot going o be included in the main module.