Advanced search  

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

Pages: [1]   Go Down

Author Topic: [Solved]: custom fields html. I know you answered this but...  (Read 2199 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.017 seconds with 19 queries.