Q: How to link from Profile page Username to the Home Page Q: How to link from Profile page Username to the Home Page
 

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

Q: How to link from Profile page Username to the Home Page

Started by MikaK, October 25, 2004, 04:12:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MikaK

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

Joachim Müller

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

MikaK

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

Joachim Müller

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

MikaK