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

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

[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']]);