Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-07-2011, 09:09 AM
Mv.c9 Mv.c9 is offline
 
Join Date: Aug 2010
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default looking for dice roller BBcode

Hi

a small part of my forum is regarding role-play and they need dice roll, i saw one: https://vborg.vbsupport.ru/showthread.php?t=245192 but it wont work. its disfunctional. it always gives me [roll0].

this is the main php method we use on another site http://requiem.raptorred.com/dice/multiple_d10.php

PHP Code:
<br>Multiple D 10<hr>
      

    
        <form name="form1" method="post" action="">
          
           <font size="2">Amount of Dice : </font><input type="text" name="dice_amount" value="1" size="4" class="input"><br>
        
          <input type="submit" name="roll" id="roll" value="Roll Dice" class="input">
        </form>
<hr>
<?php 

if (isset($_POST['roll'])) { 
$dice_amount $_POST["dice_amount"];
      
      if(
$dice_amount <= 50) {
?>
<table border ="0" width="100%">
<tr>
<td valign="top">
  

<table border ="0" align="right">
<tr>

<?php
      
      
      $counter 
0;
      
$max 5;
      
$row_break 1;
      
$numbers = array("null"0000000000);
      
      while(
$counter $dice_amount) {
       
       
      echo 
"<td>";
      
$i rand(110);
    
      
      
$numbers[$i] = $numbers[$i] + 1;
      
      echo 
"<img src='d10/$i.png'>";
      
      
      echo 
"</td>";
    
       if(
$row_break ==$max) { echo "</tr><tr>"$row_break=1; } else { $row_break $row_break+1;}
         
$counter $counter 1;
      }
    
      
      
?>
      </tr>
</table>

<td width="200">&nbsp;</td>

<td valign="top"  width="200">
<table border="1" width="350">
    <tr>
    

 <td><div align="center">Number</div></td>
      <td><div align="center">Amount</div></td>
    </tr>
    <tr>
      <td><div align="center">1's</div></td>
      <td><div align="center"><?php echo $numbers[1]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">2's</div></td>
      <td><div align="center"><?php echo $numbers[2]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">3's</div></td>
      <td><div align="center"><?php echo $numbers[3]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">4's</div></td>
      <td><div align="center"><?php echo $numbers[4]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">5's</div></td>
      <td><div align="center"><?php echo $numbers[5]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">6's</div></td>
      <td><div align="center"><?php echo $numbers[6]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">7's</div></td>
      <td><div align="center"><?php echo $numbers[7]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">8's</div></td>
      <td><div align="center"><?php echo $numbers[8]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">9's</div></td>
      <td><div align="center"><?php echo $numbers[9]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">10's</div></td>
      <td><div align="center"><?php echo $numbers[10]; ?></div></td>
    </tr>
  </table>
  
  
</td>



 </td>
 </tr>
</table>

   <?php 
 
}  else {  echo "You can only roll up to 50 dice as a time."; }
   }
   
   
?>
was hoping to know if i can shove it into a forum bbcode, or to be able to use that addon correctly for 4.1.3

Thanks alot.
Reply With Quote
  #2  
Old 05-08-2011, 05:49 PM
Mv.c9 Mv.c9 is offline
 
Join Date: Aug 2010
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone ?
Reply With Quote
  #3  
Old 05-08-2011, 07:07 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed the mod you linked to above and it works for me (vb 4.1.3). If you're getting [roll0] could it be you're entering a '0' instead of 'o' in the [rollo] tag?

But if you want to implement your own version maybe you could just change that mod as needed.
Reply With Quote
  #4  
Old 05-10-2011, 05:11 PM
Mv.c9 Mv.c9 is offline
 
Join Date: Aug 2010
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
I installed the mod you linked to above and it works for me (vb 4.1.3). If you're getting [roll0] could it be you're entering a '0' instead of 'o' in the [rollo] tag?

But if you want to implement your own version maybe you could just change that mod as needed.
i dont know why but i still get the [roll0] maybe im not installing correctly, or i dont know. something is off and i cant figure it out.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:22 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07198 seconds
  • Memory Usage 2,216KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete