coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: dwo on June 27, 2008, 01:54:14 PM

Title: [Solved]: Add link out of user profile to picinfo
Post by: dwo 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

$info['link to photographer website'] = $CONFIG['user_profile1_name'];

But this only gives me back the description of the user field, not its content.

$info['link to photographer website'] = $CONFIG['user_profile1'];

does not work either.

Anyone could further help, please?

Thank You.

Best, Dietmar
Title: Re: Add link out of user profile to picinfo
Post by: dawid8 on June 27, 2008, 02:36:53 PM
test it with:

$info['link to photographer website'] = $user['user_profile1'];
Title: Re: Add link out of user profile to picinfo
Post by: dwo on June 27, 2008, 04:31:31 PM
no.

and an array like

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
Title: Re: Add link out of user profile to picinfo
Post by: dwo 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

    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

    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