Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Adding html in the profile pages  (Read 5302 times)

0 Members and 1 Guest are viewing this topic.

Soong

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Adding html in the profile pages
« 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.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Adding html in the profile pages
« Reply #1 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']),
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Adding html in the profile pages
« Reply #2 on: July 01, 2004, 06:45:45 pm »

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

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Adding html in the profile pages
« Reply #3 on: July 01, 2004, 08:11:16 pm »

Works for me.  Sorry, no other ideas.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Adding html in the profile pages
« Reply #4 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??
Logged

Soong

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Adding html in the profile pages
« Reply #5 on: July 02, 2004, 01:47:06 pm »

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

Logged

Soong

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Adding html in the profile pages
« Reply #6 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Adding html in the profile pages
« Reply #7 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
Logged

Soong

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Adding html in the profile pages
« Reply #8 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>
« Last Edit: July 09, 2004, 05:29:12 pm by Soong »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Adding html in the profile pages
« Reply #9 on: July 09, 2004, 11:08:04 pm »

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

GauGau
Logged

Soong

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Adding html in the profile pages
« Reply #10 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Adding html in the profile pages
« Reply #11 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
Logged

Soong

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Adding html in the profile pages
« Reply #12 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"

:(
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.