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: [Solved]: custom fields html. I know you answered this but...  (Read 2207 times)

0 Members and 1 Guest are viewing this topic.

nyltak

  • Coppermine newbie
  • Offline Offline
  • Posts: 17

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

Quote
Posted: 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
« Last Edit: May 15, 2004, 09:16:55 am by GauGau »
Logged

nyltak

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: custum fields html. I know you answered this but...
« Reply #1 on: May 15, 2004, 06:38:04 am »

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']]);
« Last Edit: May 15, 2004, 10:41:04 am by nyltak »
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 18 queries.