Welcome to Our Community

Registration on our forums are now open for some days! Feel free to sign up today.

Dice 1.0.2

Throw dice in posts

Tags:
  1. XenForo Rocks
    Compatible XF Versions:
    • 1.2
    • 1.3
    • 1.4
    Additional Requirements:
    BBM addon
    License:
    CC by
    Visible Branding:
    No
    Dice Bb Code

    [​IMG]

    DISCLAIMER
    • This is a demo Bb Code to show how to use the preCache system of the BBM addon. So no need to ask me custom modifications on it, I will not do them. But if you want to modify it, feel free to use the "CC by" licence. The only thing I will add will be a TinyMCE Quattro user interface to help users to throw the dice.

    • If you don't use the Bbm preCache system, each Bb Code will use one database request. It doesn't seem fine, doesn't it? But if you use the preCache system, no matter how many "dice" Bb Codes are in the view, they will only use one database request ; which is far more better.

    • You will find in the first paragraph of the FAQ what has to be done to enable this preCache system. So read it.

    Presentation
    Let's say it again: this Bb Code is a demo to show how to use the preCache system of the BBM addon. But it's functional. You can throw the following dice: D4, D6, D8, D10, D12, D20, D40 & D100.

    Each dice is given a shape that you can configure. Here are the different available shapes: square, circle, triangle, pentagon, hexagon, diamond-square, diamond-shield, burst-8, burst-12. These shapes are done with css (thanks to this website) and don't use any images. You can also customize the background color and the text color of these shapes.

    [​IMG]


    How to use
    The dice can only be thrown in posts. A post can only have one "dice" Bb codes. Well it can have several, but only the first thrown will be saved, so the other will show the results of the first thrown. Which mean, it doesn't matter if the user edits his message, the results of his thrown will remain the same.

    The "dice" Bb Codes can have several dice it it. To use it, it's simple: each dice must be separated with ";". So if you want to throw one D20 and one d8, just write:

    Code:
    [dice]d20; d8[/dice]
    If you want throw several of the same dice, you can write like this:

    Code:
    [dice]3xd20[/dice]
    This will throw three d20. The sign "x" is not important, you can write what you want or simple ignore it.

    Needed addons
    1. BBM addon (version 3.0.3 minimum)
    Install/Update
    • Do like always, just be sure to have the needed addons installed first
    • Import the Bbm Bb Code (available in the extra directory of the archive) using the Bbm Bb Codes Manager
    Support
    None, if you still want to submit bugs, just do it on github, but before be sure to have read the Faq.

    References
    Related Resources:
    BbCodes & Buttons Manager