Adding html in the profile pages Adding html in the profile pages
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Adding html in the profile pages

Started by Soong, June 30, 2004, 07:39:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Soong

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.

Casper

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;

'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;
'interests' => bb_decode($user_data['user_interests']),
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Soong

Tried that. It made the profile page not load up at all :( Any ideas?

Casper

Works for me.  Sorry, no other ideas.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

webhostau

Quote from: 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.

What other details are you wanting to add??

Soong

It's html code to see if the person is online with Yahoo! Messenger.


Soong

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.

Joachim Müller

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

Soong

#8
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.


<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>

Joachim Müller

you should get a yahoo account to be able to test this...

GauGau

Soong

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.

Joachim Müller

can't test this, as I'm not at my desk at the moment, but you could 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;
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

Soong

Sorry, I'm not too hot when it comes to html/php to be honest.

You lost me at "add a switch"

:(