Results 1 to 7 of 7
  1. #1
    Administrator HigH_HawK's Avatar
    Join Date
    UK / GER

    Code Documentation "short version"

    Here a short documentation, to make you more comfortable with some functions.


    Variables are containers, which can store data. This data can be used at any time during the whole script. Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, digits, or underscores. A variable must not start with a number!!!

    • Number: var=21;
    • Text: var="Hello World";
    • Hex-Colourcode: var="000000"; this will change the colour of the text to "black"

    If you are using the command (e.g. "text()";), the variable must not have a number on the end!

    With these variables you define standard settings (Textcolor, Font, etc.) for the graphic.
    The following variables ar available:
    • defaults.color"Textcolour"
    • defaults.font "Font"
    • defaults.bgcolor "Background colour"
    • defaults.align "Alignment (left, center, right)"
    • defaults.size "Font size in Pixel"
    • defaults.angle "Angle (45 corresponds to 45°, rotation goes counter-clockwise)"


    "+" for Addition
    "-" for Subtraktion
    "*" for Multiplication
    "/" for Division
    "<" for Less than
    ">" for Greater than
    "<=" for Less than or equal to
    ">=" for Greater than or equal to
    "&&" for And
    "||" for Or


    This command creates a rectangle. The following parameters are available:
    • x: Distance on the x-axis
    • y: Distance on the y-axis
    • w: Width
    • h: Height
    • fill: Background colour
    • color: Border colour

    You can either use "fill" or "color". (Both options are unable to work together)
    Example: rectangle(x:20, y:50, w:100, h:40, fill:"ffffff");

    This command is printing a text. The following commands are available:
    • x: Distance on the x-axis
    • y: Distance on the y-axis
    • color: Text colour
    • size: Font size (in Pixel)
    • font: Font
    • align: Alignment (left, center, right)
    • angle: Angle (45 corresponds to 45°, rotation goes counter-clockwise)
    • text: This will be the text you want to print on your graphic

    Example: text(x:80, y: 25, color:"000000", size:"12", font:"Vera", align:"center", angle:45, text:"Here you have the example");

    This command is showing an image. The following commands are available:

    You can choose a specific part of your image to use this part as the background. ("sx", "sy", "sw" and "sh").
    • x: Distance on the x-axis
    • y: Distance on the y-axis
    • w: Width
    • h: Height
    • sx: Distance on the x-axis on the graphic
    • sy: Distance on the y-axis on the graphic
    • sw: Width of the graphic
    • sh: Height of the graphic
    • ownerid: ID of the registered user - This ID must be entered
    • file: Filename of the uploaded graphic
    • noresample Anti-Aliasing (1=on)

    Example: image(file:"image_file.png", x:"0", y:"0", w:"468", h:"100", sx:"468", sy:"0", sw:"468", sh:"100", ownerid:"3", noresample:"1");

    This command is necessary to show a progress bar in your signature. The following commands are available:
    • type: Type (rank)
    • curr: Current Score (e.g. "p.score")
    • start: Initial Value
    • next: Final Value
    • w: Total width in Pixel

    The parameters"start" and "next" are optional and should only be used when you have not defined "type".
    Example: progress(type:"rank", curr:"p.score", w:"100");

    This command displays a transparent background. The following parameters are available:
    • color: Background-Colour

    The colour must be entered with the Alphachannel (0=100% to 127=0%).

    transbg(); makes a transparent background
    transbg(color:"000000-63"); displays a black background which is half (50%) transparent


    This function is connecting different elements.
    Example: concat(4,"%"); displays: 4%

    Format a number with grouped thousands (e.g. 120 000). Additionally you can show the decimals.
    Example: nf(0.245632, 2); displays: 0.25

    To prevent any errors, you should not do any calculations with formated numbers.

    nf(0.245632*100, 2); True - displays: 24.56
    nf(0.245632, 2)*100; False

    see concat()

    Rounds a float.
    round(1.2759, 2); displays: 1.28
    round(1254328, -3); displays: 1254000

    This function returns the time from a UNIX timestamp.
    Example: time(26494); display: 07h 21m 34s

    With this function you can do the same as with time(), however you can specify the output. You can use d(days), h(hours), i(minutes), s(seconds)
    Example: thetime(26494, "h:i"); displays: 07:21

    This function displays the rank image.
    Example: image(file:img_rank(p.rank), x:60, y:20, w:60, h:60); - the owner ID is not necessary

    This function displays the tiny rank image.
    Example: image(file:img_rank_tiny(p.rank), x:60, y:20, w:16, h:16); - the owner ID is not necessary

    Allowed PHP functions:
    intval, floatval, mask_num, mask_text, sprintf, strpos, str_replace, chr, ord, md5, number_format, str_ireplace, str_pad, str_rot13, str_shuffle, str_word_count, strcasecmp, strchr, strcmp, strcoll, strcspn, stripos, stristr, strlen, strnatcasecmp, strnatcmp, strncasecmp, strncmp, strpbrk, strpos, strrchr, strrev, strripos, strrpos, strspn, strstr, strtok, strtolower, strtoupper, strtr, substr_compare, substr_count, substr_replace, substr, trim, ucfirst, ucwords, wordwrap, bin2hex, chunk_split, count_chars, crc32, crypt, hebrev, hebrevc, lcfirst, levenshtein, ltrim, metaphone, abs, acos, acosh, asin, asinh, atan2, atanh, base_convert, bindec, ceil, cos, cosh, decbin, dechex, decoct, deg2rad, exp, expm1, floor, fmod, getrandmax, hexdec, hypot, is_finite, is_infinite, is_nan, lcg_value, log10, log1p, log, max, min, mt_getrandmax, mt_rand, mt_srand, octdec, pi, pow, rad2deg, rand, round, sin, sinh, sqrt, srand, tan, tanh, isset, empty, thetime, array_push, array_pop, array_rand, array_shift, array_unshift, array_reverse, array_sum, array_splice, array_slice, array_search, in_array, array_merge, ksort, asort, arsort, krsort, array, array_unique, shuffle, count
    Last edited by HigH_HawK; 2015-01-27 at 08:20.

  2. #2
    Answerer RSAsterix's Avatar
    Join Date
    The Netherlands
    BFBC2 PC
    BF3 PC
    Gamer IDs

    Steam ID: RSAsterix

    Re: Code Documentation "short version"

    You can also make ANY color you want in paint, and the readings for "red", "green" and "blue" will make up the ###### number.
    The color number uses a hexadecimal system, which works kinda like this:

    numbers 0 till 15:
    00, 01, 02, 03, ... 09, 0A (10), 0B (11), 0C (12), 0D (13), 0E (14), 0F (15)
    numbers from 16:
    10 (16: the 1 stands for 1x16, the 0 for... well 0), 11 (1x16 + 1x1 = 17), 12 (1x16 + 2x1 = 18) and so on till 1F (1x16 + 15x1 = 31)
    and then:
    20 (2x16 + 0x1 = 32) and so on.

    Now you understand the hexadecimal system for a bit, you can enter any red,green,blue value into the color code using this format:
    Yellow, for example, has red=255, green=255, blue=0, so as a color code that would be:

    Now you can make any of the 16777216 colors you want! Enjoy!

  3. #3

    Re: Code Documentation "short version"

    Merry Christmas !
    help me guys, how can i have in my graphic nemesis dogtags?
    its very important

    thank you

  4. #4
    Administrator 1ApRiL's Avatar
    Join Date
    Waiblingen, Germany
    BFBC2 PC
    NFS World
    BF3 PC

    Re: Code Documentation "short version"

    Quote Originally Posted by nino:nino View Post
    Merry Christmas !
    help me guys, how can i have in my graphic nemesis dogtags?
    its very important

    thank you
    Sorry, but that is not possible.
    Admin of / / | Twitter

  5. #5

    Re: Code Documentation "short version"

    do i have to be a noob and insert a text ?

    Merry Christmas !
    and thx

  6. #6
    New User
    Join Date

    Re: Code Documentation "short version"

    Is there a Code Documentation "long version"?

  7. #7
    Administrator HigH_HawK's Avatar
    Join Date
    UK / GER

    Re: Code Documentation "short version"

    Hi togger,

    unfortunately there is no long version as nobody had the time to create one. We only covered the main stuff in the documentation, to keep it simple. Just keep in mind, that the code behind all these signatures is JavaScript, so nearly anything is possible

    If you've got a problem just give us a shout and we'll try to help you.


Posting Permissions

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