How to display CODE properly in your post

Status
Not open for further replies.

Red

Cyntara Admin
Staff member
Global Moderator
Premium User
Joined
Aug 9, 2008
Messages
4,362
Reaction score
760
Location
United States
This thread is to inform users about how they should tag their codes in their threads.

[code=html] HTML CODE HERE [/code]
HTML:
<html>
    <head>
        <title>Hello!</title>
    </head>
    <body>
        <div id="Container">
            <h1>Hello World!</h1>
            <p>This is coded in HTML!</p>
        </div>
    </body>
</html>
[code=XML] XML CODE HERE [/code]
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Alice" script="bless.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="139" head="20" body="39" legs="45" feet="7" addons="0"/>
</npc>
[code=php] PHP CODE HERE [/code]
PHP:
<?php
function helloUser($username) {
    $username = strip_tags($username);
    return 'Hello, ' . $username . '!';
}

if (!empty($_POST['username'])) echo helloUser($_POST['username']);
else echo 'Hello, humble visitor!';
?>
[code=lua] LUA CODE HERE [/code]
Lua:
function onLogin(cid)
    local name = getCreatureName(cid)
    local str = ("Welcome " .. name .. "!")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    return true
end
[code=sql] SQL CODE HERE [/code]
SQL:
SELECT
    `player_id`,
    (SELECT `name` FROM `players` WHERE `id` = `player_id`)
        AS `name`,
    COUNT(`player_id`) AS `Deaths`
FROM `player_deaths`
    GROUP BY `player_id`
    ORDER BY COUNT(`player_id`)
    DESC LIMIT 0, 10
;
[code=cpp] C/C++ CODE HERE [/code]
C++:
#include <iostream>
using namespace std;
void main()
{
  cout << "Hello World!" << endl;   cout << "Welcome to C++ Programming" << endl;
}
[code] OTHER CODE HERE [/code]
Code:
 code (used for anything that doesn't fit other categories)
Have fun using your new tagging skills! :p
Red
 
Last edited by a moderator:
Status
Not open for further replies.
Top