Alpha Video Training
Results 1 to 4 of 4

Thread: Forum TOTD: Code Blocks [10/25/2005]

  1. #1
    Alpha Software Employee AaronBBrown's Avatar
    Real Name
    Aaron Brown
    Join Date
    Feb 2001
    Location
    Waltham, MA
    Posts
    2,836

    Default Forum TOTD: Code Blocks [10/25/2005]

    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:
    Attachment 9977

    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
    For HTML code, or even Xbasic code in A5w pages, highlight your code and press the <> button:
    Attachment 9978

    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>
    For PHP code, there is a special php tag:
    Attachment 9979

    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  ";

    Last edited by AaronBBrown; 10-25-2005 at 10:52 AM.
    [FONT=Tahoma][SIZE=1][COLOR=Blue]Aaron Brown
    Alpha Software Development Team[/COLOR][/SIZE][/FONT]

  2. #2
    Alpha Software Employee AaronBBrown's Avatar
    Real Name
    Aaron Brown
    Join Date
    Feb 2001
    Location
    Waltham, MA
    Posts
    2,836

    Default

    Just bumping this thread, as I have seen a lot of people not using code blocks recently.
    [FONT=Tahoma][SIZE=1][COLOR=Blue]Aaron Brown
    Alpha Software Development Team[/COLOR][/SIZE][/FONT]

  3. #3
    "Certified" Alphaholic Marcel Kollenaar's Avatar
    Real Name
    Marcel
    Join Date
    Apr 2003
    Location
    Twente
    Posts
    1,514

    Default Re: Forum TOTD: Code Blocks [10/25/2005]

    Do you have also a colored block for Xbasic code? :D
    Marcel

    I hear and I forget. I see and I remember. I do and I understand.
    ---- Confusius ----

  4. #4
    Alpha Software Employee AaronBBrown's Avatar
    Real Name
    Aaron Brown
    Join Date
    Feb 2001
    Location
    Waltham, MA
    Posts
    2,836

    Default Re: Forum TOTD: Code Blocks [10/25/2005]

    Quote Originally Posted by Marcel Kollenaar View Post
    Do you have also a colored block for Xbasic code? :D
    Unfortunately, no.
    [FONT=Tahoma][SIZE=1][COLOR=Blue]Aaron Brown
    Alpha Software Development Team[/COLOR][/SIZE][/FONT]

Similar Threads

  1. Forum TOTD: Quoting Text [10/24/2005]
    By AaronBBrown in forum Forum Usage
    Replies: 0
    Last Post: 10-24-2005, 03:42 PM
  2. Forum TOTD: Inline Attachments [10/21/2005]
    By AaronBBrown in forum Forum Usage
    Replies: 0
    Last Post: 10-21-2005, 10:42 AM
  3. Commenting out blocks of code
    By burtnco in forum Alpha Five Version 6
    Replies: 2
    Last Post: 09-29-2004, 03:13 PM
  4. Alpha Forum???
    By Mike Konoff in forum Alpha Five Version 4
    Replies: 7
    Last Post: 07-22-2001, 02:00 PM
  5. Have you visited the Code Archive Forum lately ?
    By Jean-P. B├ędard in forum Alpha Five Version 4
    Replies: 0
    Last Post: 05-28-2001, 03:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •