coppermine-gallery.com/forum

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
Quote from: GauGau on October 26, 2004, 05:44:15 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://coppermine-gallery.com/forum/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        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        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'website' => make_clickable($user_data['user_website']),and replace with'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
Quote from: GauGau on October 27, 2004, 06:52:00 AM
Please report if this works for you.

Worked like a charm:) Thank you!
-Mika