PDA

View Full Version : Keep HTML in $foruminfo[description]


mickmel
12-24-2004, 11:44 AM
I have what should be a pretty simple problem. I'm trying to show the forum description at the top of each forum when you're in it. To do that, you add:

$foruminfo[description]

in the FORUMDISPLAY template. However, my forum descriptions have some HTML in them (for linking to other areas of the site), and using this method the HTML gets stripped out. How can I have the forum description show up at the top of the forum without losing the HTML?

Thanks,
Mickey

mickmel
12-24-2004, 05:32 PM
I figured it out! In forums/forumdisplay.php, go to about line 813 and find:

//remove html to stop the breaking of the meta description
$foruminfo['description'] = strip_tags($foruminfo['description']);

Add this line in between those two lines:

$foruminfo['fulldescription'] = $foruminfo['description'];

so it looks like this:

//remove html to stop the breaking of the meta description
$foruminfo['fulldescription'] = $foruminfo['description'];
$foruminfo['description'] = strip_tags($foruminfo['description']);

Now just use $foruminfo['fulldescription'] in your templates and it'll show it all!

SaN-DeeP
03-01-2005, 10:53 AM
bumping back using the same gives an error in admincp when saving the forumsdisplay template:

The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/san/public_html/forums/includes/adminfunctions_template.php(3096) : eval()'d code on line 20

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.