The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Dice Roller Hack [BBCode] Details »» | ||||||||||||||||||||||||||
Dice Roller Hack [BBCode]
RPG Dice is currently a updated version Another updated version Note: Updated package includes only the correct XML. This hack is a port of: Dice Roll for vB3 and permissions was given to port by the following statement. Quote:
The basic bbcode format is: [dice=X]Y[/dice] X - The number of dice to roll, This cannot be larger then 5 currently, this may change later with demand. Y - The number of sides on the dice. so [dice=1]6[/dice] Roll's 1, 6 sided dice. The only limit that I have noticed so far is that dice will not apear correctly when rolled from the create thread editor. I am unsure as to why this is still and am working on this issue. However aside from this it is working as need be. This hack is mainly useful to Game websites that require dice rollers for gambling or roleplaying games. It can add an element of fun to a forum and is adapatable to most dice require situations. If enough demand is displayed I will work on removing the 5 roll limit or making it larger. The current maximum sides one can roll is 30. If you enjoy this hack or have it installed, then please click the install button so that you can remain informed when updates occur. As the original author said, You do not need to ask permission to update or do anything to this hack and can redistribute it if you feel you have made a great contribution to it. If someone does make new dice images and wishes to have them as part of the package then either post here or PM me and I will get them in there with full rights going to the sender for the images. Updates:
This hack was requested from: https://vborg.vbsupport.ru/showthread.php?t=97775 -Eikinskjaldi- Original Screenshots: https://vborg.vbsupport.ru/attachmen...3&d=1078098688 https://vborg.vbsupport.ru/attachmen...4&d=1078098702 Show Your Support
|
Comments |
#182
|
|||
|
|||
If you have access to your MySQL you can go in and add the 'dice' field to the 'thread' table with the properties of MediumText and Not Null
|
#183
|
||||
|
||||
What about fixing the plug-in instead ?
|
#184
|
||||
|
||||
Ok,
Im using the RPG dice roll, but when I choose a dice and replies I just get this Quote:
|
#185
|
||||
|
||||
Well, i've tested my RPG hack on the newest vB version and it works... Try to do it on a new thread.
|
#186
|
||||
|
||||
Awsome hack :O too bad it doesn't work on 3.6.x
I was wondering if anyone could bother to port this to 3.6 I had a look at the xml and lits not too long, I would say that the problem is with the instalation code but I don't know. It would be greatly appreciated if someone could ^^ thx |
#187
|
|||
|
|||
I installed this way back (not the fancy icon clicking one but the write the bbcode one) several upgrades ago. Running 3.6.7PL right now and having no problem with it. Which one are you trying to use? there are several different versions within this thread.
|
#188
|
|||
|
|||
Im running 3.6.7 and have no issues - good hack.
|
#189
|
||||
|
||||
I have installed this on vBulletin 3.7.1 and it works perfectly. I used the latest updated version and not the one with buttons and images. How about posting this in the 3.7 Mods forum?
|
#190
|
|||
|
|||
I have had this installed on my 3.8.1PL1 vB now and it still works perfectly (the one without the buttons, but there ARE dice images)
|
#191
|
|||
|
|||
I have modified the xml and its working on the last version 3.8.4 :
Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <product productid="dice" active="1"> <title>Dice Roller</title> <description>Rolls dice in postbit</description> <version>1.0</version> <codes> <code version="1.0"> <installcode><![CDATA[$vbulletin->db->query_write("ALTER TABLE `vbulletin_thread` ADD `dice` MEDIUMTEXT NOT NULL"); $vbulletin->db->query_write("ALTER TABLE `vbulletin_post` ADD `dice` mediumtext not null");]]></installcode> <uninstallcode><![CDATA[$vbulletin->db->query_write("ALTER TABLE `thread` DROP COLUMN `dice`"); $vbulletin->db->query_write("ALTER TABLE `vbulletin_post` DROP COLUMN `dice` ");]]></uninstallcode> </code> </codes> <templates> <template name="dice" templatetype="template" date="1145915902" username="admin" version="3.5.4"><![CDATA[<img src="images/dice/$point.gif" width="63" height="62" />]]></template> <template name="postbit_dice" templatetype="template" date="1145915990" username="admin" version="3.5.4"><![CDATA[<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"> <tr> <td><smallfont><b>Dice roll with $dicesno dices of $dicesfaces faces: $dicepoints points</b></smallfont></td> </tr> <tr> <td style="BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #000000; BACKGROUND-COLOR: #D7D7D7;"> $dicedata </td> </tr> </table><br/>]]></template> </templates> <plugins> <plugin active="1"> <title>dice_process_data</title> <hookname>newpost_process</hookname> <phpcode><![CDATA[// Hack if (@eregi("\[dice",$post['message'])) { $diceresult = array(); preg_match_all("/\[dice=([1-5])\]([0-9]?[0-9])\[\/dice\]/",$post['message'],$diceresult); $dices = $diceresult[1]; $faces = $diceresult[2]; $dicedetail = array(); $rollcount = count($dices); $validdice = 0; for ($i = 0; $i < $rollcount; $i++) { if ($faces[$i] >= 2 && $faces[$i] <= 30) { $diceresult[0][$i] = str_replace("[","\[",$diceresult[0][$i]); $diceresult[0][$i] = str_replace("]","\]",$diceresult[0][$i]); $diceresult[0][$i] = str_replace("/","\/",$diceresult[0][$i]); $post['message'] = preg_replace("/".$diceresult[0][$i]."/","[dice".($validdice)."]",$post['message'],1); $dicedetail[$validdice]['dices'] = $dices[$i]; $dicedetail[$validdice]['faces'] = $faces[$i]; $dicedetail[$validdice]['data'] = array(); for ($j = 0; $j < $dices[$i]; $j++) { $dicedetail[$validdice]['data'][] = rand(1,$faces[$i]); } $validdice++; } } if (!empty($dicedetail)) { $dataman->set('dice',serialize($dicedetail)); } } // End Hack]]></phpcode> </plugin> <plugin active="1"> <title>dice_postbit_convert</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[// Hack: dice if ($post['dice']) { $dicearray = unserialize($post['dice']); $totalroll = count($dicearray); for ($i = 0; $i < $totalroll; $i++) { $dicedata = ""; $dicepoints = 0; $dicesno = $dicearray[$i]['dices']; $dicesfaces = $dicearray[$i]['faces']; foreach ($dicearray[$i]['data'] as $point) { eval('$dicedata .= "' . fetch_template("dice") . '";'); $dicepoints += $point; } eval('$dice = "' . fetch_template("postbit_dice") . '";'); $post['message'] = preg_replace("/\[dice$i\]/i","$dice",$post['message']); } }]]></phpcode> </plugin> <plugin active="1"> <title>dice_set_valid_fields</title> <hookname>postdata_start</hookname> <phpcode><![CDATA[$this->validfields['dice'] = array(TYPE_STR, REQ_NO);]]></phpcode> </plugin> <plugin active="1"> <title>dice_set_valid_fields_new_thread</title> <hookname>threadfpdata_start</hookname> <phpcode><![CDATA[$this->validfields['dice'] = array(TYPE_STR, REQ_NO);]]></phpcode> </plugin> </plugins> <phrases> </phrases> <options> </options> </product> |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|