vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Dice Roller Hack [BBCode] (https://vborg.vbsupport.ru/showthread.php?t=113972)

Rukbat 04-25-2006 12:40 PM

Now that I'm not so tired I thought of another question regarding my error message above. What MySQL d/b changes were made? Which table needs new fields and what would the names be to look for to be sure they are there?

EDIT 9:07 CDT

Okay, I went into phpMyAdmin and checked my forum tables '******_thread' and '******_post' and neither table has a 'dice' field.
so do I edit the xml file and change
Code:

<codes>
                <code version="1.0">
                        <installcode>ALTER TABLE `thread` ADD `dice` MEDIUMTEXT NOT NULL ;
ALTER TABLE '******_' ADD 'dice' MEDIUMTEXT NOT NULL ;</installcode>
                        <uninstallcode />
                </code>
        </codes>

to
Code:

        <codes>
                <code version="1.0">
                        <installcode>ALTER TABLE `******_thread` ADD `dice` MEDIUMTEXT NOT NULL ;
ALTER TABLE '******_post' ADD dice mediumtext not null;</installcode>
                        <uninstallcode />
                </code>
        </codes>

with the asterisks being the prefix for all tables in the d/b?

EDIT: 9:46am CDT
That didn't work, BUT, once i went in to phpMyAdmin and added the fields to the two tables it works GREAT! :D
so I guess there's something in the code in the xml file that didn't actually ALTER my tables.... or was there something else in the xml file that i didn't find where I should have typed in the name of the d/b? I assumed since it was imported/installed using the vB AdminCP that it would 'know' that was the d/b to alter the tables in......

Rukbat 04-25-2006 03:14 PM

I'm working on making some new images for the die, playing with colors
examples below

Ziki 04-25-2006 06:08 PM

I got this error


Quote:

Database error in vBulletin 3.5.4:

Invalid SQL:
INSERT INTO forumziki_thread
(postusername, postuserid, title, iconid, visible, forumid, threadprefix, dice, dateline, open, attach, lastpost, lastposter, replycount, hiddencount)
VALUES
('Ziki', 1, 'Dices', 1, 1, 9, 'Site related', 'a:1:{i:0;a:3:{s:5:\"dices\";s:1:\"1\";s:5:\"faces \";s:1:\"6\";s:4:\"data\";a:1:{i:0;i:4;}}}', 1145991674, 1, 0, 1145991674, 'Ziki', 0, 0);

MySQL Error : Unknown column 'dice' in 'field list'
Error Number : 1054
Date : Tuesday, April 25th 2006 @ 03:01:14 PM
Script : http://www.xxxxx.com/forums/newthread.php
Referrer : http://www.xxxxx.com/forums/newthrea...=newthread&f=9
IP Address : XXXXXXXX
Username : XXX
Classname : vb_database

Rukbat 04-25-2006 07:19 PM

Ziki-set,
I was having the same problem. For some reason the installer isn't altering your forum database tables (_thread & _post). You need to go into your database and physically add the 'dice' field (mediumtext not null) to those two tables.
That fixed the problem for me.

Also, before installing I corrected some wording in the xml file to correct 'dices' to 'die' because it 'bugged' me:
FIND
Code:

<td><smallfont><b>Dice roll with $dicesno dices of $dicesfaces faces: $dicepoints points</b></smallfont></td>
CHANGE TO
Code:

<td><smallfont><b>Dice roll with $dicesno die of $dicesfaces faces: $dicepoints points</b></smallfont></td>
Also increased the number of 'faces' for dice to 100 since that is what my members needed.
FIND
Code:

if ($faces[$i] >= 2 && $faces[$i] <= 30)
CHANGED TO
Code:

if ($faces[$i] >= 2 && $faces[$i] <= 100)
Of course I had to 'make' die images for 31-100, and upload them to the ../images/dice folder but that didn't take too long.

Hope this helps :D

EDIT: 3:30pm CDT
hmmmm, that works up to '99' faces but can't get it to work for '100'..... *wanders off to ponder a bit*

EDIT: 3:47pm CDT
got it to work
FIND:
Code:

preg_match_all("/\[dice=([1-5])\]([0-9]?[0-9])\[\/dice\]/",$post['message'],$diceresult);
CHANGE TO:
Code:

preg_match_all("/\[dice=([1-5])\]([0-9]?[0-9]?[0-9])\[\/dice\]/",$post['message'],$diceresult);
see attached screenshot

Eikinskjaldi 04-25-2006 10:34 PM

Ya, the install code seems to be errored, I'll work on it and upload the right installer, Thanks rukbat for posting the little mods for others. I might have messed that part up as well.

EDIT:
Upload XML fixed with the correct queries. Sorry about that.

Ziki 04-26-2006 11:33 AM

Now it doesn't show the dices.I imported it and it doesn't show the dices but only the [dice=2]5[/dice]

Rukbat 04-26-2006 11:40 AM

Did you FTP the dice images into a 'dice' folder in images at your site?
Also, go into your PlugIn Manager in your vB admincp, look to be sure all the plug-ins for 'Dice Roller' are checked as 'active'.
Did you 'unistall' via product manager before installing again?

Rukbat 04-26-2006 11:51 AM

oops also, you can't create a thread with a post that includes a dice roll
only replies can include the dice roll
easy solution:
create a new thread i.e.
title: dice roller test
text in post: this thread is to test the dice roller
submit the new thread
then post a reply/quick reply to it, including the dice roll bbcode

Eikinskjaldi 04-26-2006 06:24 PM

Yes, I need to find the right place to inser the code for the first post, I looked in my quick porting of the hack but didn't find it. It's as simple a fix as inserting the code before the first post is output.

username12 04-27-2006 02:50 AM

Don't know how high you would be able to go, but here's one vote for more than 5 dice.


All times are GMT. The time now is 03:38 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01301 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete