MyBB Community Forums

Full Version: How to post html?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Oh...that sucks...I am trying to run a RP board and posting templates are a nearly always unique thing. I can't really add every style element to my css everytime...well balls...i picked mybb because i thought it allowed this. I take it there is no [dohtml] equivalent that i could add to the bbcodes? *crosses fingers
^ replies here can be helpful (see also replies here)
Thank you for the links, that was quite helpful, i've almost gotten it to work but now its replacing all my style tags with <span style="color: #444444;" class="mycode_color"><span style="font-size: x-small;" class="mycode_size">
if you could point me at the file i need to put a if then around i'd appreciate it Smile

ok that was the mycode enabling doing that. but it still puts extra line breaks at the end of very line which messes up the styling

<br />
.ntitle { width: 512px; background: #000; color: #fff; font-family: raleway; font-weight: 800; font-size: 30px; text-transform: uppercase; padding: 50px 30px 50px 30px; }<br />
.nstuff { height: 345px; width: 330px; overflow: auto; text-align: justify; padding: 0px 5px 0px 0px; font-family: arial; font-size: 10px; line-height: 100%; }<br />
thing { font-family: anaheim; font-size: 8px; text-transform: uppercase; margin-left: -15px; font-weight: normal; letter-spacing: 1px; color: #373737; }<br />
.nstuff2 { height: 345px; overflow: auto; text-align: justify; font-family: arial; font-size: 10px; padding: 5px; }<br />
.nstuffff { margin-left: 15px; }<br />
.head { color: #ccc; font-family: raleway; font-weight: 900; text-transform: uppercase; font-size: 15px; padding: 5px; border-bottom: solid 1px #eee; margin: 5px; text-align: left; }<br />
.ndetails { width: 541px; padding: 15px; raleway; font-weight: 700; background: #000; color: #fff; text-transform: uppercase; font-size: 8px; letter-spacing: 1px; margin-left: 20px; margin-top: -10px; text-align: center; }<br />
.nshipper { background-color: #fafafa; border: 1px solid #eee; width: 550px; height: 400px; padding: 10px 10px 10px 10px; }<br />
.Ncontainer {<br />
height: 400;<br />
width: 550;<br />
}<br />
.Ntabs {<br />

<input type="radio" id="Ntab-1" name="Ntab-group-1" checked><br />
<label for="Ntab-1"> <i class="fa fa-home fa-fw" style="font-size: 10px;margin-top:5px"></i>&nbsp; image</label><br />
<div class="Ncontent">
<img src="http://placehold.it/550x355/eee" width="550" height="355"><br />
</div>
</div>
<br />
<br />
<div class="Ntab">
<input type="radio" id="Ntab-2" name="Ntab-group-1"><br />
<label for="Ntab-2"> <i class="fa fa-heartbeat" style="font-size: 10px;margin-top:5px"></i>&nbsp; in depth</label><br />
<div class="Ncontent">
<table cellpadding="5" cellspacing="0"><tr><td>
<br />
<img src="http://placehold.it/200x345/eee/" width="200" height="345"><br />
<br />
</td><td>
<br />

sorry for the double post, any idea where i can nix that extra 'br' or where to add a wrapper so that it will not format on line breaks? Thank you. (assuming i can add on a mycode type tag ig a poor mans dohtml and set a if then, just need a heads up where i'm looking.) Thank you again!
So i'm gonna post my Solution here: Note this is a SUPER DANGEROUS HACK.

Inc/class_parser.php
Find and comment out these lines:

 $message = preg_replace('#<(/?)(base|meta|script|style)([^>]*)>#i', '&lt;$1$2$3&gt;', $message);
 $message = $this->fix_javascript($message);
 $find = array("<br />\n", "<br>\n");
 $replace = array("\n", "\n");
 $message = str_replace($find, $replace, $message);





Find:
 $message = $plugins->run_hooks("parse_message_end", $message); 
(under)
ADD:

               

 if (strpos($message , "[dohtml]") !== false) {
  $message = str_replace("<br />", "", $message);
    $message = str_replace("[dohtml]", "", $message);
    $message = str_replace("[/dohtml]", "", $message);
}



 (above)
return $message;


 

AFTER the
return $message;

ADD:

function replaceInCode($row){
    $replace = array('<br />' => '','<br />' => '');
    $text= str_replace(array_keys($replace),array_values($replace),$row[1]);
    return  $text; //"<code>$text</code>";
}




FIND: 
 function parse_html($message)


COMMENT EVERYTHING BUT THE 
return $message;


FIND AND COMMENT OUT ALL:
$message = str_replace('$', '$', $message);

$message = str_replace('$', '$', $message);

(2018-04-30, 07:54 PM)fishu Wrote: [ -> ]So i'm gonna post my Solution here: Note this is a SUPER DANGEROUS HACK.

Inc/class_parser.php
Find and comment out these lines:

 $message = preg_replace('#<(/?)(base|meta|script|style)([^>]*)>#i', '&lt;$1$2$3&gt;', $message);
 $message = $this->fix_javascript($message);
 $find = array("<br />\n", "<br>\n");
 $replace = array("\n", "\n");
 $message = str_replace($find, $replace, $message);





Find:
 $message = $plugins->run_hooks("parse_message_end", $message); 
(under)
ADD:

               

 if (strpos($message , "[dohtml]") !== false) {
  $message = str_replace("<br />", "", $message);
    $message = str_replace("[dohtml]", "", $message);
    $message = str_replace("[/dohtml]", "", $message);
}



 (above)
return $message;


 

AFTER the
return $message;

ADD:

function replaceInCode($row){
    $replace = array('<br />' => '','<br />' => '');
    $text= str_replace(array_keys($replace),array_values($replace),$row[1]);
    return  $text; //"<code>$text</code>";
}




FIND: 
 function parse_html($message)


COMMENT EVERYTHING BUT THE 
return $message;


FIND AND COMMENT OUT ALL:
$message = str_replace('$', '$', $message);

That second $  is &#36 ; forum doesnt let it show lol
Pages: 1 2