Buddy List Viewable in profile? Buddy List Viewable in profile?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Buddy List Viewable in profile?

Started by bitcloud, November 18, 2006, 02:47:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bitcloud

Hi,

I know this has been touched on briefly before in the forums - editing a copy of buddy_manage.php for general viewing purposes, but has anyone managed to get such a thing working? I don't really know where to start with this one, and I thought I'd ask before I embark on pulling the code apart...

Stramm

cause of privacy reasons I haven't implemented that. There was another buddy mod that exactly did what you're looking to do(1.3.x). Maybe it's from help for you. However the two mods are entirely different

bitcloud

I don't know if i'd want to jump ship to a new buddy mod altogether...

am I barking up the right tree pulling buddymanage.php apart though? (none of my users would have any problems with having their buddies list public)

Stramm

yup, should be the easiest way.
remove all code that manages and/or deletes buddies... just leave the code that displays the (active) buddies

bitcloud

Hey stramm..

I havent played with this for a while, but I've been trying now to get this to work.

I got it displaying the currently logged in user's buddylist, but I can't seem to decipher how to make it display buddies for the current ?uid= value
I can 'get' the value, and I assume its "user_id" i'm wanting to set it to, but i'm unfamiliar with how this is set as a variable (I'm used to variables being set as something like $user_id)

I've duplicated buddy_manage.php to buddy_view.php, so basically if you could tell me how (and where) to modify buddy_manage.php to display a specific UID's buddies (instead of the currently logged in user) that would really solve this one for me :)

as always, any help you can offer would really be appreciated

Stramm

it's more difficult now with the bridge compatibility
you need to copy the function get_buddy_infos() (udb_base.inc.php) and resave it under another name. Give it a third parameter eg. $uid, that you can use to send a certain users uid. Now replace the constant that holds the logged in users id (USER_ID) with the new parameter $uid

call the new function and send it the box ($view) 0 for the active buddies box. For sql2 send just a ; for now (you can use that later on to send search parameters and limits) and the uid of the user whoms buddies you want to show

bitcloud

genius stramm!

works a treat
thanks so much for your work on coppermine... without the stramm modpack and all the other work you've done for coppermine the project would be half what it is.. cheers

bitcloud

hey stramm...

I don't think this one is quite solved yet actually...
It works perfectly when viewing the buddy list of a selected UID, but only when a user (any user) is logged in...

when a user isn't logged in it gives a "You don't have permission to access this page." message...

If I comment out "if (!USER_ID || $CONFIG['enable_buddy'] == 0) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);"
I can get it to display a "There was an error while processing a database query" error message :)

I don't know quite where that permission is being set, but somewhere it's checking if a user is logged in or not and allowing/disallowing the info...
any ideas?
cheers

bitcloud

ok... once you've got the buddy viewing working as stramm describes, to get it to work for both logged in and unlogged in users, do the following (also stramm, if you see any problems with this, let me know... i'm a bit of a noob with the old PHP)

You have to comment out:
if (!USER_ID || $CONFIG['enable_buddy'] == 0) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

then find
if($CONFIG['enable_buddy'] != 0 && (USER_ID)){

replace with
$allow = 1;
if($allow == 1){

(or just remove the if statement alltogether if you don't want easy switchoffability)


Stramm

that way you remove the possibility to disable the buddy features in config. Would be enough to not check for a logged in user , that's again the constant USER_ID

aunmundo

i can´t do it

could you tell me how

jus´t find this and replace with this

please ...................  thanks

bitcloud

It's probably a bit beyond me to help out with the specifics of this... I really didn't document the process...