If you want to insert some code into your post and preserve formatting, indentation, and line breaks, you can use one of the three code tags available in vBulletin.
First, paste or type your code into the post window, then highlight the code that you want to format. Next, click one of the three code tag buttons on the post window toolbar:
For generic code, including Xbasic, click on the button that looks like a # sign:
This will add [CODE]mycode[/CODE] around your code. For example:
[CODE]
FOR i = 1 TO 10
IF i = 1
ui_msg_box("i", "I I, Captain")
END IF
NEXT i
[/CODE]
This will look like:
For HTML code, or even Xbasic code in A5w pages, highlight your code and press the <> button:
This will wrap [HTML][/HTML] around your code and display like this:
For PHP code, there is a special php tag:
This will wrap [PHP][/PHP] around your code and display like this:
First, paste or type your code into the post window, then highlight the code that you want to format. Next, click one of the three code tag buttons on the post window toolbar:
For generic code, including Xbasic, click on the button that looks like a # sign:
This will add [CODE]mycode[/CODE] around your code. For example:
[CODE]
FOR i = 1 TO 10
IF i = 1
ui_msg_box("i", "I I, Captain")
END IF
NEXT i
[/CODE]
This will look like:
Code:
FOR i = 1 TO 10 IF i = 1 ui_msg_box("i", "I I, Captain") END IF NEXT i
This will wrap [HTML][/HTML] around your code and display like this:
HTML Code:
<table cellpadding="0" cellspacing="3" border="0"> <tr> <td>Notification Type:<br /><select name="emailupdate" tabindex="1"> <option value="9999" >Do not subscribe</option> <option value="0" >No email notification</option> <option value="1" selected="selected">Instant email notification</option> <option value="2" >Daily email notification</option> <option value="3" >Weekly email notification</option> </select></td> </tr> </table>
This will wrap [PHP][/PHP] around your code and display like this:
PHP Code:
function display_header_cell($field_name, $sort_col, $sort_dir, $page, $perpage)
{
$sort_img_html = "";
echo "\r\n<th>";
if ( strtolower($sort_col) == strtolower($field_name) )
{
if ( $sort_dir == "asc" )
{
$sort_dir = "desc";
$sort_img = "sort_asc.gif";
}
else
{
$sort_dir = "asc";
$sort_img = "sort_desc.gif";
}
$sort_img_html = "<img src='$sort_img' border='0'>";
}
if ($sort_dir == "")
$sort_dir = "asc";
$target = nav_target($page,$perpage,$field_name,$sort_dir);
echo "<a href='$target'>$field_name</a>$sort_img_html ";
}
Comment