Log in

View Full Version : some small help needed...


jamslam
06-07-2003, 02:35 AM
Ok, what my goal is here is to allow the forum administrator to use HTML in posts.. i tracked it down to this code in the admin/functions.php that had to be altered... i THINK


if(!$dohtml) { // kill any rogue html code
// $bbcode=str_replace("&","&",$bbcode);
$bbcode=str_replace("<","<",$bbcode);
$bbcode=str_replace(">",">",$bbcode);
$bbcode=str_replace("<","&lt;",$bbcode);
$bbcode=str_replace(">","&gt;",$bbcode);
}


so i altered that to this...


if(!$dohtml and !($bbuserinfo[usergroupid]==6)) { // kill any rogue html code
// $bbcode=str_replace("&","&amp;",$bbcode);
$bbcode=str_replace("&lt;","&amp;lt;",$bbcode);
$bbcode=str_replace("&gt;","&amp;gt;",$bbcode);
$bbcode=str_replace("<","&lt;",$bbcode);
$bbcode=str_replace(">","&gt;",$bbcode);
}


now i tryed working the syntax of the code i added a little bit, since i am not an expert at PHP yet, and still no luck. Knowing me, i'm probably missing a small detail or something, or i'm completely off track... any help would be greatly appreciated, thanks!

-jamslam

P.S. i thought about putting this in the help me finish forum, but thought that it was short enough to just go here.. however, if it is in fact a longer hack, pardon my ignorance and you may do with it what you will. thanx again.

Boofo
06-07-2003, 02:37 AM
In admin/functions.php

Find:
====================
$post[message]=bbcodeparse($post[pagetext],$forum[forumid],$post[allowsmilie]);

//highlight words for search engine
====================

Replace with

if ($post[usergroupid]==6 OR $post[usergroupid]==5) {
$post[message]=bbcodeparse2($post[pagetext],1,1,1,1);
} else {
$post[message]=bbcodeparse($post[pagetext],$forum[forumid],$post[allowsmilie]);
}

//highlight words for search engine
===================

Just add more OR $post[usergroupid]==X to the IF statement for whatever usergroups you want to allow.

5 is Super Mod and 6 is Admin.

jamslam
06-07-2003, 02:43 AM
wow thanx a lot.. i wonder why that was never released as an official hack...

BTW, if anyone could be so nice, as to explain to me why my method didn't work.. i'm new to the PHP stuff, and would like to obsorb as much as i can.. again, i would appreciate it very much.

and thanx again boofo, that helps!

Boofo
06-07-2003, 02:58 AM
It was released as a hack, but I don't remember who released it. If you have the /me vbcode hack installed (by Firefly), you will need to edit the above code for the me code to work there, too.