forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: MikaK on October 25, 2004, 04:12:39 pm

Title: Q: How to link from Profile page Username to the Home Page
Post by: MikaK on October 25, 2004, 04:12:39 pm
My profile page currently shows the Home Page link defined by the user right below the User Name.

How could I create a profile view where the link would appear as a clickable phrase "Link To Main Profile" or such while the actual link url would not show (a matter of hiding ugly stuff - no security issues involved).

My php skills are next to nada - a practical example or even better a hack would be really appreciated!

Thanks for any feedback,
-Mika
Title: Re: Q: How to link from Profile page Username to the Home Page
Post by: Joachim Müller on October 26, 2004, 05:44:15 am
There are multiple instances in coppermine where the user name is being displayed - please post in detail on what page the link should be something different but the user name - a screenshot where the address bar is visible might help.

Joachim
Title: Re: Q: How to link from Profile page Username to the Home Page
Post by: MikaK on October 26, 2004, 11:09:52 am
...please post in detail on what page the link should be something different but the user name - a screenshot where the address bar is visible might help.

Here is a screen:
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.soundchilds.net%2Fgalleryprofilemod.jpg&hash=6bf05afa5f20ad8afbb9c9cd4244f5724d29115b)

I mean the link inside the green circle (that is the usal Home Page 'website' based link).

-Mika
Title: Re: Q: How to link from Profile page Username to the Home Page
Post by: Joachim Müller on October 27, 2004, 06:52:00 am
Haven't tested this, but a quick-and-dirty hack might look like this:

edit profile.php, find
Code: [Select]
        case 'text' :
            if ($form_data[$element[1]] == '') break;
            echo <<<EOT
    <tr>
        <td width="40%" class="tableb" height="25">
            {$element[2]}
        </td>
        <td width="60%" class="tableb">
            {$form_data[$element[1]]}
        </td>
    </tr>

EOT;

            break;
and replace with
Code: [Select]
        case 'text' :
            if ($form_data[$element[1]] == '') break;
            if ($element[2] == $lang_register_php['website']) {
                $wrapper_start = '<a href="';
                $wrapper_end = '">Link To Main Profile</a>';
            } else {
                $wrapper_start = '';
                $wrapper_end = '';
            }
            echo <<<EOT
    <tr>
        <td width="40%" class="tableb" height="25">
            {$element[2]}
        </td>
        <td width="60%" class="tableb">
            $wrapper_start{$form_data[$element[1]]}$wrapper_end
        </td>
    </tr>

EOT;

            break;

Then find
Code: [Select]
'website' => make_clickable($user_data['user_website']),and replace with
Code: [Select]
'website' => $user_data['user_website'],
Please report if this works for you.

Joachim
Title: Re: Q: How to link from Profile page Username to the Home Page
Post by: MikaK on October 28, 2004, 09:12:45 am
Please report if this works for you.

Worked like a charm:) Thank you!
-Mika