Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Buddy List Viewable in profile?  (Read 6950 times)

0 Members and 1 Guest are viewing this topic.

bitcloud

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Buddy List Viewable in profile?
« on: November 18, 2006, 02:47:45 pm »

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...
« Last Edit: March 26, 2007, 08:20:56 pm by GauGau »
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Buddy List Viewable in profile?
« Reply #1 on: December 03, 2006, 11:25:01 am »

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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Buddy List Viewable in profile?
« Reply #2 on: December 03, 2006, 11:50:52 pm »

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)
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Buddy List Viewable in profile?
« Reply #3 on: December 04, 2006, 07:36:28 pm »

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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Buddy List Viewable in profile?
« Reply #4 on: March 22, 2007, 03:23:37 pm »

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
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Buddy List Viewable in profile?
« Reply #5 on: March 23, 2007, 12:31:12 pm »

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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Buddy List Viewable in profile?
« Reply #6 on: March 26, 2007, 08:15:42 pm »

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
Logged

bitcloud

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Buddy List Viewable in profile?
« Reply #7 on: March 27, 2007, 04:33:43 am »

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
Logged

bitcloud

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Buddy List Viewable in profile?
« Reply #8 on: March 27, 2007, 04:52:56 am »

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:
Code: [Select]
if (!USER_ID || $CONFIG['enable_buddy'] == 0) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
then find
Code: [Select]
if($CONFIG['enable_buddy'] != 0 && (USER_ID)){
replace with
Code: [Select]
$allow = 1;
if($allow == 1){
(or just remove the if statement alltogether if you don't want easy switchoffability)

Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Buddy List Viewable in profile?
« Reply #9 on: March 27, 2007, 05:12:15 pm »

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

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Buddy List Viewable in profile?
« Reply #10 on: July 28, 2007, 08:22:32 pm »

i canīt do it

could you tell me how

jusīt find this and replace with this

please ...................  thanks
Logged

bitcloud

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Buddy List Viewable in profile?
« Reply #11 on: July 29, 2007, 01:19:46 pm »

It's probably a bit beyond me to help out with the specifics of this... I really didn't document the process...
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.