1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Dice 1.0.2

Throw dice in posts

  1. cclaerhout

    cclaerhout Well-Known Member

    cclaerhout submitted a new resource:

    Dices - Throw dices in posts

    Read more about this resource...
     
  2. Deriel

    Deriel Well-Known Member

    Sorry, but couldn't find the Dice BB Code in Extra

    o_O
     
  3. cclaerhout

    cclaerhout Well-Known Member

    It's inside the archive (ref).
     
  4. Velli

    Velli Active Member

    Great addon, @cclaerhout !

    One question..
    Can I replace the CSS code for a picture? so I can design my own dice.

    Thanks!
     
  5. Deriel

    Deriel Well-Known Member

    Oh, shame on me! :oops:

    I think I was looking in the wrong folder (from BBM itself)
     
    cclaerhout likes this.
  6. cclaerhout

    cclaerhout Well-Known Member

    If you know to code a little php and format css correctly, yes. Otherwise, no. The code of this Bb Code is only 150 lines, so it's not hard to read it.
     
    Velli likes this.
  7. Chris D

    Chris D XenForo Developer Staff Member

    The correct word is "dice" rather than "dices"
     
    cclaerhout likes this.
  8. Velli

    Velli Active Member

    I'll look. Thank you.
     
  9. cclaerhout

    cclaerhout Well-Known Member

    Damned, changing phrases is not a problem but the Bb Code tag is.
    Thanks to have told me this.
     
    Chris D likes this.
  10. Chris D

    Chris D XenForo Developer Staff Member

    It's ok. Sorry but thought it right to point it out. If it was single it would be "die". Plural is "dice". Stupid English ;)
     
    cclaerhout likes this.
  11. cclaerhout

    cclaerhout Well-Known Member

    Yes, absolutely. Don't hesitate, it's useful.
    That what I read after you mentioned it. Actually, I've never used or heard the singular of this word in English. "Die" is quite surprising. It's rare but this time French is easier: "un dé / des dés".
    Oh and for those who knows a little German, this word in Chinese is quite easy to remember: "shaizi" (sorry for those who would have understood).
     
    Chris D likes this.
  12. Xon

    Xon Well-Known Member

    @cclaerhout I'm hoping to have a pull request for this to add support for rolz.org style dice rolls within the next few weeks. It's got a bunch of different 'style' of dice rolls.

    Additionally I'm planning to add support for grouping titles, and perhaps multiple dice groups in a single post.

    Then I can write a migration script for this addon and migrate to your free one.
     
  13. cclaerhout

    cclaerhout Well-Known Member

    @Xon
    I didn't know there was another addon. Its code architecture looks more advanced than this one, put aside the dice shapes that are only there for cosmetic reasons. Any pull requests are welcome or feel free to release another version, that would be easier for you to manage the new releases. This Bb Code was coded because it was the easiest way to show how can be used the precache function and I can reuse its code for one private addon.
     
  14. derpyhooves

    derpyhooves Active Member

    Quoting a post that has the dice bbcode in it makes the post completely blank and spams the admin cp with server errors.
     
  15. cclaerhout

    cclaerhout Well-Known Member

    Guess what, for debugging these errors are needed ;) I can't reproduce the problem on my local website. If you quote a message with this Bb Code, the dice results won't be from the post quoted but will be linked to the current message. I will see if I can do something about it, but that's not my priority.
     
  16. derpyhooves

    derpyhooves Active Member

    Getting plenty server errors so I can help you out with that.

    Code:
    Error Info
    Zend_Db_Statement_Mysqli_Exception: BB code to string error:Mysqli statement execute error : Duplicate entry '241799' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
    Generated By: ligeration, 9 minutes ago
    Stack Trace
    #0 /home/redligh1/public_html/forums/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
    #1 /home/redligh1/public_html/forums/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
    #2 /home/redligh1/public_html/forums/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `bb...', Array)
    #3 /home/redligh1/public_html/forums/library/XenForo/DataWriter.php(1624): Zend_Db_Adapter_Abstract->insert('bbm_dices', Array)
    #4 /home/redligh1/public_html/forums/library/XenForo/DataWriter.php(1613): XenForo_DataWriter->_insert()
    #5 /home/redligh1/public_html/forums/library/XenForo/DataWriter.php(1405): XenForo_DataWriter->_save()
    #6 /home/redligh1/public_html/forums/library/Sedo/Dices/Listener.php(137): XenForo_DataWriter->save()
    #7 [internal function]: Sedo_Dices_Listener::bbmDices('d20', Array, 'bbm_dices', false, Array, Object(WidgetFramework_XenForo_BbCode_Formatter_Base), 'bbm_dices')
    #8 /home/redligh1/public_html/forums/library/XenForo/CodeEvent.php(73): call_user_func_array(Array, Array)
    #9 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Base.php(604): XenForo_CodeEvent::fire('bbm_callback_te...', Array, 'bbm_dices')
    #10 [internal function]: BBM_BbCode_Formatter_Base->TemplateMethodRenderer(Array, Array, Object(WidgetFramework_XenForo_BbCode_Formatter_Base))
    #11 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(740): call_user_func(Array, Array, Array, Object(WidgetFramework_XenForo_BbCode_Formatter_Base))
    #12 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Base.php(775): XenForo_BbCode_Formatter_Base->renderValidTag(Array, Array, Array)
    #13 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Extensions/PreCacheBase.php(95): BBM_BbCode_Formatter_Base->renderValidTag(Array, Array, Array)
    #14 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(647): BBM_BbCode_Formatter_Extensions_PreCacheBase->renderValidTag(Array, Array, Array)
    #15 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(560): XenForo_BbCode_Formatter_Base->renderTag(Array, Array, 0)
    #16 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(541): XenForo_BbCode_Formatter_Base->renderTreeElement(Array, Array, 0)
    #17 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Base.php(1393): XenForo_BbCode_Formatter_Base->renderSubTree(Array, Array)
    #18 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(521): BBM_BbCode_Formatter_Base->renderSubTree(Array, Array)
    #19 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Extensions/PreCacheBase.php(80): XenForo_BbCode_Formatter_Base->renderTree(Array, Array)
    #20 /home/redligh1/public_html/forums/library/XenForo/BbCode/Parser.php(505): BBM_BbCode_Formatter_Extensions_PreCacheBase->renderTree(Array, Array)
    #21 /home/redligh1/public_html/forums/library/XenForo/BbCode/TextWrapper.php(119): XenForo_BbCode_Parser->render('[dices]d20[/dic...', Array)
    #22 /home/redligh1/public_html/forums/library/XenForo/Template/Abstract.php(265) : eval()'d code(1601): XenForo_BbCode_TextWrapper->__toString()
    #23 /home/redligh1/public_html/forums/library/XenForo/Template/Abstract.php(265): eval()
    #24 /home/redligh1/public_html/forums/library/XenForo/Template/Abstract.php(191): XenForo_Template_Abstract->_renderInternal('$__output = '';...', Array)
    #25 /home/redligh1/public_html/forums/library/XenForo/Template/Public.php(110): XenForo_Template_Abstract->render()
    #26 /home/redligh1/public_html/forums/library/XenForo/ViewRenderer/HtmlPublic.php(123): XenForo_Template_Public->render()
    #27 /home/redligh1/public_html/forums/library/XenForo/FrontController.php(618): XenForo_ViewRenderer_HtmlPublic->renderContainer(Object(XenForo_Template_Public), Array)
    #28 /home/redligh1/public_html/forums/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
    #29 /home/redligh1/public_html/forums/index.php(13): XenForo_FrontController->run()
    #30 {main}
    Request State
    array(3) {
    ["url"] => string(74) "http://www.redlightponyville.com/forums/threads/dice-have-been-added.5459/"
    ["_GET"] => array(0) {
    }
    ["_POST"] => array(0) {
    }
    }
    
    Code:
    Error Info
    XenForo_Exception: BB code to string error:Value is not unserializable - library/XenForo/DataWriter.php:799
    Generated By: derpyhooves, 8 minutes ago
    Stack Trace
    #0 /home/redligh1/public_html/forums/library/XenForo/DataWriter.php(721): XenForo_DataWriter->_castValueToType('serialized', 'no', 'code', Array)
    #1 /home/redligh1/public_html/forums/library/XenForo/DataWriter.php(643): XenForo_DataWriter->_isFieldValueValid('code', Array, 'no', Array)
    #2 /home/redligh1/public_html/forums/library/XenForo/DataWriter.php(995): XenForo_DataWriter->set('code', 'no', '', NULL)
    #3 /home/redligh1/public_html/forums/library/Sedo/Dices/Listener.php(136): XenForo_DataWriter->bulkSet(Array)
    #4 [internal function]: Sedo_Dices_Listener::bbmDices('1xd1000', Array, 'bbm_dices', false, Array, Object(WidgetFramework_XenForo_BbCode_Formatter_Base), 'bbm_dices')
    #5 /home/redligh1/public_html/forums/library/XenForo/CodeEvent.php(73): call_user_func_array(Array, Array)
    #6 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Base.php(604): XenForo_CodeEvent::fire('bbm_callback_te...', Array, 'bbm_dices')
    #7 [internal function]: BBM_BbCode_Formatter_Base->TemplateMethodRenderer(Array, Array, Object(WidgetFramework_XenForo_BbCode_Formatter_Base))
    #8 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(740): call_user_func(Array, Array, Array, Object(WidgetFramework_XenForo_BbCode_Formatter_Base))
    #9 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Base.php(775): XenForo_BbCode_Formatter_Base->renderValidTag(Array, Array, Array)
    #10 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Extensions/PreCacheBase.php(95): BBM_BbCode_Formatter_Base->renderValidTag(Array, Array, Array)
    #11 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(647): BBM_BbCode_Formatter_Extensions_PreCacheBase->renderValidTag(Array, Array, Array)
    #12 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(560): XenForo_BbCode_Formatter_Base->renderTag(Array, Array, 0)
    #13 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(541): XenForo_BbCode_Formatter_Base->renderTreeElement(Array, Array, 0)
    #14 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Base.php(1393): XenForo_BbCode_Formatter_Base->renderSubTree(Array, Array)
    #15 /home/redligh1/public_html/forums/library/XenForo/BbCode/Formatter/Base.php(521): BBM_BbCode_Formatter_Base->renderSubTree(Array, Array)
    #16 /home/redligh1/public_html/forums/library/BBM/BbCode/Formatter/Extensions/PreCacheBase.php(80): XenForo_BbCode_Formatter_Base->renderTree(Array, Array)
    #17 /home/redligh1/public_html/forums/library/XenForo/BbCode/Parser.php(505): BBM_BbCode_Formatter_Extensions_PreCacheBase->renderTree(Array, Array)
    #18 /home/redligh1/public_html/forums/library/XenForo/BbCode/TextWrapper.php(119): XenForo_BbCode_Parser->render('[dices]1xd1000[...', Array)
    #19 /home/redligh1/public_html/forums/library/XenForo/Template/Abstract.php(265) : eval()'d code(1601): XenForo_BbCode_TextWrapper->__toString()
    #20 /home/redligh1/public_html/forums/library/XenForo/Template/Abstract.php(265): eval()
    #21 /home/redligh1/public_html/forums/library/XenForo/Template/Abstract.php(191): XenForo_Template_Abstract->_renderInternal('$__output = '';...', Array)
    #22 /home/redligh1/public_html/forums/library/XenForo/Template/Public.php(110): XenForo_Template_Abstract->render()
    #23 /home/redligh1/public_html/forums/library/XenForo/ViewRenderer/HtmlPublic.php(123): XenForo_Template_Public->render()
    #24 /home/redligh1/public_html/forums/library/XenForo/FrontController.php(618): XenForo_ViewRenderer_HtmlPublic->renderContainer(Object(XenForo_Template_Public), Array)
    #25 /home/redligh1/public_html/forums/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
    #26 /home/redligh1/public_html/forums/index.php(13): XenForo_FrontController->run()
    #27 {main}
    Request State
    array(3) {
      ["url"] => string(70) "http://redlightponyville.com/forums/threads/dice-have-been-added.5459/"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(0) {
      }
    }

    Other weird things have been adding as posts with dice in them being blank for people (even words that were written in the post don't show up) without them being quoted, and dice results moving posts if another person rolls dice in the same thread
    Example:

    What one user sees:
    [​IMG]
    [​IMG]

    What another user sees:
    [​IMG]
     
  17. cclaerhout

    cclaerhout Well-Known Member

    @derpyhooves
    Just to check, what is your php version and your XenForo version?
     
  18. Brandon Sheley

    Brandon Sheley Well-Known Member

    Cool idea!
     
  19. derpyhooves

    derpyhooves Active Member

    @cclaerhout I'm using 5.5.12 as my PHP version, and my XenForo is version 1.3.4
     
  20. cclaerhout

    cclaerhout Well-Known Member

    @derpyhooves,
    I can reproduce the serialize related problem, I will have a look during the next days. It's certainly related to blank dice value. For your other problems, I can't reproduce them yet.
     

Share This Page