forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: Soong on June 30, 2004, 07:39:16 pm

Title: Adding html in the profile pages
Post by: Soong on June 30, 2004, 07:39:16 pm
Hi,

I'd like to add/replace a current field with one where I can enter HTML.

When I tried it, it just displayed the code. How is it possible to get html to actually work in profile fields?

Cheers.
Title: Re: Adding html in the profile pages
Post by: Casper on June 30, 2004, 08:42:03 pm
You cannot use html, but you can use bb code.  To do this, you need to edit your profile.php, as below;

open profile.php, and find;

Code: [Select]
'group' => $user_data['group_name'],
            'location' => $user_data['user_location'],
            'interests' => $user_data['user_interests'],
            'website' => make_clickable($user_data['user_website']),
            'occupation' => $user_data['user_occupation'],

Change the field you want to use bb code like this example;
Code: [Select]
'interests' => bb_decode($user_data['user_interests']),
Title: Re: Adding html in the profile pages
Post by: Soong on July 01, 2004, 06:45:45 pm
Tried that. It made the profile page not load up at all :( Any ideas?
Title: Re: Adding html in the profile pages
Post by: Casper on July 01, 2004, 08:11:16 pm
Works for me.  Sorry, no other ideas.
Title: Re: Adding html in the profile pages
Post by: webhostau on July 02, 2004, 05:31:54 am
Hi,

I'd like to add/replace a current field with one where I can enter HTML.

When I tried it, it just displayed the code. How is it possible to get html to actually work in profile fields?

Cheers.

What other details are you wanting to add??
Title: Re: Adding html in the profile pages
Post by: Soong on July 02, 2004, 01:47:06 pm
It's html code to see if the person is online with Yahoo! Messenger.

Title: Re: Adding html in the profile pages
Post by: Soong on July 07, 2004, 07:11:29 pm
Anyone got any ideas?

I tried putting that bbcode into my profiles.php page but it meant the page wouldn't load, regardless of whether anything was in the field or not.
Title: Re: Adding html in the profile pages
Post by: Joachim Müller on July 08, 2004, 06:29:58 am
What parts of the html code is dynamic, what is static? You could hack this easily, please post some sample html code and highlight the stuff that changes, depending on the users (the yahoo id presumably).

GauGau
Title: Re: Adding html in the profile pages
Post by: Soong on July 09, 2004, 05:22:22 pm
Here is the code, I'm not really sure what any of it does, just that it shows an appropriate image, depending on if the user is online or not.


Code: [Select]
<image src="http://opi.yahoo.com/online?u=NAME">

<a href="http://edit.yahoo.com/config/send_webmesg?.target=NAME&.src=pg"><img border="0" src="http://opi.yahoo.com/online?u=NAME&m=g&t=2"></a>
Title: Re: Adding html in the profile pages
Post by: Joachim Müller on July 09, 2004, 11:08:04 pm
you should get a yahoo account to be able to test this...

GauGau
Title: Re: Adding html in the profile pages
Post by: Soong on July 10, 2004, 03:48:21 am
Yep, have done. The name's can_anybody_fly_this_thing on Yahoo! Messenger.

It works if I just put that html in a page and publish it, no problems there.

It's just when I try enabling BBCode on profile pages that I get trouble. The profile pages themselves won't load up at all, just a blank screen.
Title: Re: Adding html in the profile pages
Post by: Joachim Müller on July 10, 2004, 04:01:54 pm
can't test this, as I'm not at my desk at the moment, but you could 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;
and add a switch (if/then) before the echo statement that will make a difference if e.g. the "occupation" filed is being displayed, if yes, add the surounding html code as a wrapper around {$form_data[$element[1]]}.

GauGau
Title: Re: Adding html in the profile pages
Post by: Soong on July 13, 2004, 01:47:41 am
Sorry, I'm not too hot when it comes to html/php to be honest.

You lost me at "add a switch"

:(