Code: Difference between revisions From Online Manual

Jump to: navigation, search
(remove <nowiki> from example; categorize basic as per http://docs.simplemachines.org/index.php?topic=57)
(wikified)
Line 1: Line 1:
<tr><td><center><span style="font-size: 12pt;" class="bbc_size"><tt>'''<span id="post_code">code</span>'''</tt></span></center></td><td><center>'''Code'''</center></td><td><center><img src="http://docs.simplemachines.org/Themes/default/images/bbc/code.gif" alt="" class="bbc_img" /></center></td></tr>
{{Wordy bbc
 
|tag=Code
<tr><td><nowiki>[code]if (node.attributes[i].nodeValue != null)
|example=&#91;code&#93;<br/>
str += &#039; &#039; + node.attributes[i].nodeName + &#039;=&quot;&#039; + node.attributes[i].nodeValue + &#039;&quot;&#039;;[/code]</nowiki></td><td>The <tt>code</tt> tag outputs code directly with simple formatting. Any BB Codes, html, php, javascript, c++, or any other text will be outputted exactly the same. The box will scroll for long lines so that the line breaks are preserved at the correct places, which is important in many languages. This is a block level tag.
if (node.attributes&#91;i&#93;.nodeValue != null)<br/>
<code>if (node.attributes[i].nodeValue != null)
str += &#039; &#039; + node.attributes&#91;i&#93;.nodeName + &#039;=&quot;&#039; + node.attributes&#91;i&#93;.nodeValue + &#039;&quot;&#039;;<br/>
str += &#039; &#039; + node.attributes[i].nodeName + &#039;=&quot;&#039; +  node.attributes[i].nodeValue + &#039;&quot;&#039;;</code></td></tr>
&#91;/code&#93;
 
|description=The <tt>code</tt> tag outputs code directly with simple formatting. Any BB Codes, html, php, javascript, c++, or any other text will be outputted exactly the same. The box will scroll for long lines so that the line breaks are preserved at the correct places, which is important in many languages. This is a block level tag. If php code is placed inside, with the initial &lt;?php tag, then it will be color formated according to php syntax.
<tr><td>&#91;code&#93;&lt;?php echo &quot;Hello world!&quot;; ?&gt;</code></td><td>If php code is placed inside, with the initial &lt;?php tag, then it will be color formated according to php syntax.</td><td><div class="codeheader">: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation"></a></div><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"Hello&nbsp;world!"</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span></span></code></td></tr>
<code><span style="color: #000000"><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"Hello&nbsp;world!"</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span></span></code>
 
|result=<code>if (node.attributes&#91;i&#93;.nodeValue != null)<br/>
str += &#039; &#039; + node.attributes&#91;i&#93;.nodeName + &#039;=&quot;&#039; + node.attributes&#91;i&#93;.nodeValue + &#039;&quot;&#039;;<br/></code>
}}
[[Category:Bulletin_Board_Code]]
[[Category:Bulletin_Board_Code]]
{{Cleanup html}}
[[Category:Basic Bulletin Board Code]]
[[Category:Basic Bulletin Board Code]]

Revision as of 21:51, 17 January 2011

description: The code tag outputs code directly with simple formatting. Any BB Codes, html, php, javascript, c++, or any other text will be outputted exactly the same. The box will scroll for long lines so that the line breaks are preserved at the correct places, which is important in many languages. This is a block level tag. If php code is placed inside, with the initial <?php tag, then it will be color formated according to php syntax. <?php echo "Hello world!"?>

example: [code]

if (node.attributes[i].nodeValue != null)
str += ' ' + node.attributes[i].nodeName + '="' + node.attributes[i].nodeValue + '"';

[/code]

result: if (node.attributes[i].nodeValue != null)
str += ' ' + node.attributes[i].nodeName + '="' + node.attributes[i].nodeValue + '"';



Advertisement: