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: [Solved]: Add link out of user profile to picinfo  (Read 4190 times)

0 Members and 1 Guest are viewing this topic.

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
[Solved]: Add link out of user profile to picinfo
« on: June 27, 2008, 01:54:14 pm »

Hello.

Under the picture title, I want to show a link to the website of the photographer.
The link adress is written by the user in the user profile field 1.

I changed inserted code like this in displayimage.php

Code: [Select]
$info['link to photographer website'] = $CONFIG['user_profile1_name'];
But this only gives me back the description of the user field, not its content.

Code: [Select]
$info['link to photographer website'] = $CONFIG['user_profile1'];
does not work either.

Anyone could further help, please?

Thank You.

Best, Dietmar
« Last Edit: July 08, 2008, 06:46:44 am by Joachim Müller »
Logged

dawid8

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 57
Re: Add link out of user profile to picinfo
« Reply #1 on: June 27, 2008, 02:36:53 pm »

test it with:

Code: [Select]
$info['link to photographer website'] = $user['user_profile1'];
Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: Add link out of user profile to picinfo
« Reply #2 on: June 27, 2008, 04:31:31 pm »

no.

and an array like

 
Code: [Select]
for ($i = 1; $i <= 4; $i++) {
        if ($CONFIG['user_profile' . $i . '_name']) {
            if ($CURRENT_PIC_DATA['user' . $i] != "") {
                $info[$CONFIG['user_profile' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);
            }
        }
    }

does not work either

regards, Dietmar
Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: Add link out of user profile to picinfo
« Reply #3 on: July 07, 2008, 08:40:47 pm »

Hello.

Thanks to eenemeenemuu this is the solution to the problem:

Enter following code in displayimage.php

Code: [Select]
    global $cpg_udb;
    $user_data = $cpg_udb->get_user_infos($CURRENT_PIC_DATA['owner_id']);
    for ($i=1; $i<=6; $i++)
    {
        if ($CONFIG['user_profile'.$i.'_name'] && $user_data['user_profile'.$i])
           $info[$CONFIG['user_profile'.$i.'_name']] = process_smilies(bb_decode(make_clickable($user_data['user_profile'.$i])));
    }

if you have smilies enabled, and following code if not

Code: [Select]
    global $cpg_udb;
    $user_data = $cpg_udb->get_user_infos($CURRENT_PIC_DATA['owner_id']);
    for ($i=1; $i<=6; $i++)
    {
        if ($CONFIG['user_profile'.$i.'_name'] && $user_data['user_profile'.$i])
           $info[$CONFIG['user_profile'.$i.'_name']] = bb_decode(make_clickable($user_data['user_profile'.$i]));
    }


After

// Display picture information
function html_picinfo()
{



Thank you all for making this possible, regards, Dietmar
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.