News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Easiest way to display a list of everyone whos added me as a buddy on my profile

Started by samborabora, July 07, 2014, 06:49:05 PM

Previous topic - Next topic

samborabora

Is there a built in function to recall a basic list of every user who's added me as a buddy, so I can put this on the profile page? There's a few mods, but most of them are old and I don't need avatars or any stats, just a list of consecutive buddies separated by commas.

Arantor

No, there isn't and it depends on whether you're using Ultimate Profile or not.

Just for fun, there's also a privacy angle because not everyone uses buddies for the purpose you might think...

samborabora

Quote from: ‽ on July 07, 2014, 06:51:59 PM
No, there isn't and it depends on whether you're using Ultimate Profile or not.

Just for fun, there's also a privacy angle because not everyone uses buddies for the purpose you might think...

I was using ultimate profile, but I removed it because it had too much stuff I didn't need. I have no idea what others use buddies for, other than, buddies? There's a couple of mods that seem to take care of this in a sense, would you recommend one of them at all?

Arantor

The predominant use of buddies is to filter out PMs. Users can block PMs from everything except from buddies.

samborabora

Quote from: ‽ on July 08, 2014, 02:51:55 PM
The predominant use of buddies is to filter out PMs. Users can block PMs from everything except from buddies.

I understand, but I'd love to be able to just spit out the list on profiles, nothing fancy. Is there nothing that can check a table in the database and just print the names, linked to the profiles, soemwhere in profile.template.php?

If not by default, does anyone have any knowledge of if this: http://custom.simplemachines.org/mods/index.php?mod=3068 is simplifiable? Or http://custom.simplemachines.org/mods/index.php?mod=3681 with text links instead of avatars?

Arantor

There is no magic function for it  because SMF never needs it itself and it's not the easiest (and *certainly* not the fastest) query. To get a list of people who added you, it has to check every single member, and there's no way without rewriting the feature to optimise it.

As for the mods, you'd have to ask the authors.

samborabora

The mods appear to only show my buddys, ie: buddies I have added to my buddies list. Is this a massive piece of scripting or is it something that you could give a bit of a suggestion for? I know it's not a light query for a server, but I'd appreciate it if you had a rough idea as to how I could implement this feature?

Roph

You'd go through every member's row in the table, parse their buddy list, and check if the relevant user ID is in it. Even for a small forum, this is NOT something you want to do. I'm sure I could do it, but I won't on principle.

You might instead do a simple check when viewing someone else's profile to see if they have you on their buddy list.

Why do you want to expose your users' private information, though?

samborabora

Quote from: Roph on July 09, 2014, 10:19:00 AM
You'd go through every member's row in the table, parse their buddy list, and check if the relevant user ID is in it. Even for a small forum, this is NOT something you want to do. I'm sure I could do it, but I won't on principle.

You might instead do a simple check when viewing someone else's profile to see if they have you on their buddy list.

Why do you want to expose your users' private information, though?

I'm using the buddy system and rewording it so it's basically like 'followers' instead of buddys. I mean, on both twitter and facebook, anyone can view anyones list of followers or friends, and it would be established that you could see everybodies buddies/followers before you added anyone, anyways. I appreciate your principle, but if it's well established with a forum users that anyone they follow will be known to another, how could it be an invasion of privacy?

And if it's a server strain you're worried about, well, it's not like everyone views everyones profiles all the time, is it?

Arantor

Example: whose business is it who I follow, except mine?

As for strain, there's consequences. There are consequences on a slow query, especially how it limits access to the members table (which knocks on to everyone else)...

samborabora

Quote from: ‽ on July 09, 2014, 02:22:53 PM
Example: whose business is it who I follow, except mine?

As for strain, there's consequences. There are consequences on a slow query, especially how it limits access to the members table (which knocks on to everyone else)...

Would it help if when a user buddies or unbuddies someone, it was hardwritten to a list that could then be recalled, rather than having to dynamically collect the entries each time?

Arantor

Not for the privacy angle. There are ways to mitigate the performance headaches but they're all fairly terrible.

samborabora

Quote from: ‽ on July 09, 2014, 06:02:29 PM
Not for the privacy angle. There are ways to mitigate the performance headaches but they're all fairly terrible.

Privacy? What if it was very much common knowledge that by clicking 'follow this user' it would be visable on your profile, mainly because you'd be clicking on 'follow this user' and directly under it would be that users followers. There could be a disclaimer or anything that would ensure that this wasn't a privacy issue, since the buddies list is merely being used as a backend for a following system. If every 'follow' were hard added or 'unfollow' was hard removed from a table, surely then all that would be called for on each load of whichever users profile would be the string on 'followers' contained within the table? No performance issues there, I assume?

Arantor

Aside from completely misunderstanding how it works, that is.

Bastardising a system into something other than what it is, is never going to work properly.

samborabora

Quote from: ‽ on July 09, 2014, 07:17:56 PM
Aside from completely misunderstanding how it works, that is.

Bastardising a system into something other than what it is, is never going to work properly.

Okay, I assume there isn't a similar thing to a following system available for SMF, is there? And, I'm not aware that I was trying to "bastardize" the system, in fact, the system would remain untouched, merely being tapped into by external queries.

margarett

@samborabora, what is wrong with the second MOD you pointed out? It seems to do what you want...
If you wish to simplify the layout, just ask in the MOD support topic. It should be pretty easy to change Profile.template.php to show just a list of names instead of avatars (didn't check, just guessing)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Arantor

QuoteAnd, I'm not aware that I was trying to "bastardize" the system, in fact, the system would remain untouched, merely being tapped into by external queries.

I thought I had made this fairly clear that you're doing something it simply wasn't designed to be used for. If it was designed for your use, it would be designed with your use in mind.

samborabora

Quote from: margarett on July 10, 2014, 01:18:46 PM
@samborabora, what is wrong with the second MOD you pointed out? It seems to do what you want...
If you wish to simplify the layout, just ask in the MOD support topic. It should be pretty easy to change Profile.template.php to show just a list of names instead of avatars (didn't check, just guessing)

Thanks, I gave it a try, but unfortunately, it only lists my current buddies, ie: buddies I have added, rather than people who have added me. I'd be able to hack a mod a bit to display it correctly, if there were such a mod to display users who have added me.

Quote from: ‽ on July 10, 2014, 01:40:24 PM
QuoteAnd, I'm not aware that I was trying to "bastardize" the system, in fact, the system would remain untouched, merely being tapped into by external queries.

I thought I had made this fairly clear that you're doing something it simply wasn't designed to be used for. If it was designed for your use, it would be designed with your use in mind.

My usage of the system does not drastically differ from it's intended usage, I merely wish to expand the capabilities of the information which it reports. A simple writing of each added buddy to a table and the removal of that buddy with every un-buddy would suffice to record the data. If that differs too greatly from it's fundamental indended purpose, I'd be willing to accept a server call for all users and cross check if they've added me as a buddy.

Since it records, obviously, all the people who you've added as a buddy so it can display these to you, I can't see why it would be difficult to fork those adds into separate tables for recalling for a user to see who have added them.

Quote from: ‽ on July 09, 2014, 06:02:29 PM
Not for the privacy angle.

IF it makes you feel any better, it could be invisible to anyone but yourself. Then I'll just make it visible and treat it re-branded (name change, perception for others, no differ in intended usage) as followers and it'll be hunky dorey.

Arantor

There are precisely 6 places in SMF where it cares if people are buddies, and four of those are 'are they buddies of yours', not 'are you their buddy'.

1. Display (uses different icon next to username if they're a buddy)
2. Profile main display (uses different icon next to username, offers 'add to buddy list')
3. Profile buddies page (for adding/removing)
4. Users online list (shows them in bold)
5. Who's online (uses different icon next to username if they're a buddy)
and
6. To see if they have set their account to 'only admins and buddies can PM me' and in that situation and ONLY that situation does it care if they have set *you* as *their* buddy. In which case you're dealing with a very small number of users and the query isn't insane to run in that situation.

What you're asking for is still nobody's business but their own. Why do you care who follows whom? Why do you care, for example, who is following you on the forum? In any case unless you're building extra functionality around it, this is largely a waste of time.

samborabora

There are precisely 6 places in SMF where it cares if people are buddies, and four of those are 'are they buddies of yours', not 'are you their buddy'.

1. Display (uses different icon next to username if they're a buddy)
2. Profile main display (uses different icon next to username, offers 'add to buddy list')
3. Profile buddies page (for adding/removing)
4. Users online list (shows them in bold)
5. Who's online (uses different icon next to username if they're a buddy)
and
6. To see if they have set their account to 'only admins and buddies can PM me' and in that situation and ONLY that situation does it care if they have set *you* as *their* buddy. In which case you're dealing with a very small number of users and the query isn't insane to run in that situation.

What you're asking for is still nobody's business but their own. Why do you care who follows whom? Why do you care, for example, who is following you on the forum? In any case unless you're building extra functionality around it, this is largely a waste of time.

QuoteWhy do you care, for example, who is following you on the forum?
My ego?

QuoteIn any case unless you're building extra functionality around it, this is largely a waste of time.
Okay, let's say I am building extra functionality around it. Let's say I'm building a forum RPG system, or an awards system or a badges system or whatever.

QuoteThis is largely a waste of time.
Opinion.

Quote4. Users online list (shows them in bold)
5. Who's online (uses different icon next to username if they're a buddy)
So, here are two places that I can see where we would run into a run query set for checking if they are buddies or not. I'm not asking for anything amazing here, just if we can reverse the angle from "oh, I'm YOUR buddy" to "oh, you're MY buddy". The word buddy has lost all meaning anyways.

Advertisement: