[Solved]: custom fields html. I know you answered this but... [Solved]: custom fields html. I know you answered this but...
 

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]

Main Menu

[Solved]: custom fields html. I know you answered this but...

Started by nyltak, May 15, 2004, 04:56:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nyltak

I am looking to make one of my custom fields default to a hyperlink. I don't want my visitors to have to type in

<a href="http://www.link.com">link</a>  

just

http://www.link.com  

where the link text  is constant and the url is user input.

If someone could tell me where the code is that prints the table below the picture I would be grateful.


I have done this

QuotePosted: Thu Jul 10, 2003 4:52 pm    Post subject:    

--------------------------------------------------------------------------------

For me bb_decode do not work.
I wantet true HTML in a custom field and find that a Code:
<i>
were translatet to Code:
& lt;i&test&/i& gt;


So I repaced:
Code:
$info[$CONFIG['user_field'.$i.'_name']] = make_clickable($CURRENT_PIC_DATA['user'.$i]);


Code:
$info[$CONFIG['user_field'.$i.'_name']] = $CURRENT_PIC_DATA['user'.$i];
$info[$CONFIG['user_field'.$i.'_name']] = str_replace("& lt;", '<', $info[$CONFIG['user_field'.$i.'_name']]);
$info[$CONFIG['user_field'.$i.'_name']] = str_replace("& gt;", '>', $info[$CONFIG['user_field'.$i.'_name']]);
$info[$CONFIG['user_field'.$i.'_name']] = str_replace("& quot;", '"', $info[$CONFIG['user_field'.$i.'_name']]);



Note: the spaces betwen & and gt (& and lt) (& and quot) are only because this code isnĀ“t shown right without them, remove them.

Now I can add pictures of awards in a custom field

nyltak

Alright, I figured it out.  but I must say   arrays are a pain in the ass.

for ($i = 1; $i <= 4; $i++) {
        if ($CONFIG['user_field' . $i . '_name']) {
            if ($CURRENT_PIC_DATA['user' . $i] != "") {
$info[$CONFIG['user_field'.$i.'_name']] = '<a href=' .$CURRENT_PIC_DATA['user'.$i].' >'.$CURRENT_PIC_DATA['title'].'</a>';  
$info[$CONFIG['user_field'.$i.'_name']] = str_replace("&lt;", '<', $info[$CONFIG['user_field'.$i.'_name']]);
$info[$CONFIG['user_field'.$i.'_name']] = str_replace("&gt;", '>', $info[$CONFIG['user_field'.$i.'_name']]);
$info[$CONFIG['user_field'.$i.'_name']] = str_replace("&quot;", '"', $info[$CONFIG['user_field'.$i.'_name']]);