[Solved]: Add link out of user profile to picinfo [Solved]: Add link out of user profile to picinfo
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

[Solved]: Add link out of user profile to picinfo

Started by dwo, June 27, 2008, 01:54:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dwo

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

dawid8

test it with:

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

dwo

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

dwo

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