[ABD] Dicemod

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
alicia86
Registered User
Posts: 75
Joined: Sat Oct 10, 2009 10:10 pm
Name: Alicia
Contact:

Re: [BETA] Dicemod

Post by alicia86 »

Sorry to double post but I'm encountering the following from an update from .8.4a to current. When I click to submit a post with dice I've been getting a 500 server error, which in turn causes prevents the forum from directing you to the "Successful Post" page and the subsequent redirects. This doesn't occur on a plain post without dice.

I've also notice that if you have the forum set to the default mode of 'string' the bbcode in the post doesn't format when posted.
MalkContent
Registered User
Posts: 203
Joined: Mon Aug 18, 2008 10:00 am

Re: [BETA] Dicemod

Post by MalkContent »

lagame wrote:I don't know if it would be possible, but it would be interesting if you had the option of having buttons custom rollover for each dice type, with the option to choose the amount of dices as well.
Please elaborate, I can't picture what you are trying to convey here.
alicia86 wrote:[phpBB Debug] PHP Warning: in file [ROOT]/includes/acp/acp_dicemod.php on line 206: scandir(./../images/mods/dicemod/)
nice find, no idea how i missed that, I'll release a 0.8.8b soon with an updated acp_dicemod.php. there's actually another reference to the old image path just a few lines lower.

I'll try to recreate the 500 server error and fix it. As for the default mode: It does not get injected into the post text. It's just that if there is no mode chosen in the bbcodes post text, the display of the bbcode defaults to string or whatever was chosen as default.
User avatar
alicia86
Registered User
Posts: 75
Joined: Sat Oct 10, 2009 10:10 pm
Name: Alicia
Contact:

Re: [BETA] Dicemod

Post by alicia86 »

I had to revert back to .8.4 as the dice weren't parsing at all.
I even went through the install.xml and made sure I had all the code inputted correctly.
MalkContent
Registered User
Posts: 203
Joined: Mon Aug 18, 2008 10:00 am

Re: [BETA] Dicemod

Post by MalkContent »

holy crap, i recreated it.
in the install instructions i forgot the line that included.. well kinda all of the functions of dicemod.
mybad.

0.8.8 is NOT working at all, I removed it
0.8.8b is up now, everything should work, at least it does on my own forum (updated it from 0.8.4b to find the error)
i also saw that I did not include another small fix in posting.php, nothing gamebraking, just one less complaint about an empty array.

the update instructions are for 0.8.4b to 0.8.8b directly.
if you have 0.8.8 installed, please just run the updateDatabase_0.8.4b_to_0.8.8b.php and manually update the posting.php (the second edit is the one that needs manual find, since the find is not identical anymore. should be rather easy to identify what should be replaced). after those two edits, you are done.

updateDatabase_0.8.4b_to_0.8.8b.php will throw an error if you already ran updateDatabase_0.8.4b_to_0.8.8.php, but it won't do any harm.
User avatar
alicia86
Registered User
Posts: 75
Joined: Sat Oct 10, 2009 10:10 pm
Name: Alicia
Contact:

Re: [BETA] Dicemod

Post by alicia86 »

Working perfectly so far. Thanks
User avatar
alicia86
Registered User
Posts: 75
Joined: Sat Oct 10, 2009 10:10 pm
Name: Alicia
Contact:

Re: [BETA] Dicemod

Post by alicia86 »

MalkContent wrote:
lagame wrote:I don't know if it would be possible, but it would be interesting if you had the option of having buttons custom rollover for each dice type, with the option to choose the amount of dices as well.
Please elaborate, I can't picture what you are trying to convey here.
I think what he's envisioning is like a form field where you can input the amount of dice and the type and then click a button of sorts to have it prefill the text box.
Something like this maybe?
Image (This was pulled off of the Virtual Table Top, OpenRPG/Traipse.)
The first box contains the amount of the dice and the last box any modifiers. The buttons between them are the type of dice that could be "templated". Pressing the dice buttons submits the appropriate formula.
alvbot
Registered User
Posts: 5
Joined: Thu Jun 07, 2012 6:21 am

Re: [BETA] Dicemod

Post by alvbot »

First of all, thanks so much for this mod. I find it so useful as my thoughts are in developing a new RPG forum.

Second of all, sorry for my english, It´s not my mother language, hehe.

Third and last, I tried to install it in a testing forum and I find the same error as other people here, but the solutions were not for my case at this time.

What happens is that I write the [dice]3d6[/dice] (It´s an example, It doesn´t work with any quantity, and any dice faces) and in the post appears the code like it has been put before.

- I tried to check for the forum permissions, and were fine.
- I checked in the language file if it was any other command but 'd'.
- I tried to check if BBCodes were disable.
- I checked about the 'real dice' is enabled or not.
- I installed it twice for the same result, trying to check step by step very slowly, hehe 2 hours last time to ensure I was doing the right thing.

I hope my less experience in phpbb forums is the trouble and not anything else.

Thanks!
MalkContent
Registered User
Posts: 203
Joined: Mon Aug 18, 2008 10:00 am

Re: [BETA] Dicemod

Post by MalkContent »

alicia86 wrote:Image (This was pulled off of the Virtual Table Top, OpenRPG/Traipse.)
The first box contains the amount of the dice and the last box any modifiers. The buttons between them are the type of dice that could be "templated". Pressing the dice buttons submits the appropriate formula.
@lagame If that's what you want, I'm sorry, but I won't do that. I'd have to mod the posting page to cram these buttons and textfields next to the bbcode buttons (because where else to put them) and it require a templateside mod. All in all too much work for little to no comfort (i can type 3d20+20 faster than clicking textfields and typing afterwards). If you desperatly need this feature, just commission someone to code those buttons for you. I'd do it for.. lets say 100 european bucks ^^

@alvbot
Codewise, the initial unparsed dicecode can get ignored in the second part of the mods code in posting.php or in the function encodediceBBCode() in dicemod/dice_functions_posting.php
However I have not even a remote idea why that would happen.
The unparsed bbcode gets completely ignored if you don't have permissions or the forum doesn't allow dice, but u said that you did set them. If you didn't clear the forums cache, this might be the problem, but if you wouldn't have cleared it, the new options shouldn't save anyways and I think you would have seen that.

vipaka had the same problem here:
http://www.phpbb.com/community/viewtopi ... #p13145453
I can not reproduce this error. I made several reinstallations of dicemod on my local testserver and I find it working. All I can say for now: check again, you might have done something wrong. However, I am not entirely sure that it is your fault.
I simply have no clue why the dice bbcode doesn't get parsed for you.
In case of doubt, try a manual install, make perfectly sure that the "find" instructions are unambiguous and you find the right place, don't forget to follow the diy instructions (such as editing the includes/constants.php a second time) and refresh the style templates and clear the cache.
alvbot
Registered User
Posts: 5
Joined: Thu Jun 07, 2012 6:21 am

Re: [BETA] Dicemod

Post by alvbot »

No, This is not my best week...

Thanks for your answer.

I tried to install it again. From the beginning. Re-Installing the phpbb, and from cero, install only the 'dicemod'. I tried to do it following the instructions, step by step. They are very clear, and I don´t find any difficulties to make it in order:

-Add or replace new code lines by hand in the files indicated.
-Upload all the files of the mod.
-Add new code lines in the file of the style prosilver.
-Update the database with the file included in the mod.
-Add the BBCodes and change the numbers in constants.php in /includes/
-Created the tag for the 'dicemod' as indicated
-Clean caché
-Add permissions

And when posting, not parsed.

I have done it manually all the times, as I don´t know how to do it automatically :P

Thanks for your answers!
MalkContent
Registered User
Posts: 203
Joined: Mon Aug 18, 2008 10:00 am

Re: [BETA] Dicemod

Post by MalkContent »

@alvbot

to figure out what's wrong, install the mod and try this:

in posting.php find:

Code: Select all

					if(($row['forum_allow_dice']==2) || $auth->acl_get('f_allow_dice', $data['forum_id']))
					{
after add:

Code: Select all

						var_dump("this works");
when you post a dice bbcode and you get a message reading "this works" in the top left corner after clicking submit, we at least know that the permissions are set and recognized correctly.
alvbot
Registered User
Posts: 5
Joined: Thu Jun 07, 2012 6:21 am

Re: [BETA] Dicemod

Post by alvbot »

Thanks for your rapid reply,

Reading your post, that gave me an idea. I have created 3 forums with the 3 choices of permission (yes, no, never), and tryed to use de bbcode [dice], after adding the line you told me in the posting.php file.

There was no positive result. I got no message telling 'this works'.

I think that tells the problem is not in the permission, it doesn´t parse it.

Thank you!
Last edited by alvbot on Thu Jun 07, 2012 7:49 pm, edited 1 time in total.
alvbot
Registered User
Posts: 5
Joined: Thu Jun 07, 2012 6:21 am

Re: [BETA] Dicemod

Post by alvbot »

sorry double post
MalkContent
Registered User
Posts: 203
Joined: Mon Aug 18, 2008 10:00 am

Re: [BETA] Dicemod

Post by MalkContent »

actually... that DOES tell you that either the permission isn't set OR the forum where you post in does not allow rolling dice...
alvbot
Registered User
Posts: 5
Joined: Thu Jun 07, 2012 6:21 am

Re: [BETA] Dicemod

Post by alvbot »

Thanks for the reply.

As I said on my first post, I hoped the mistake was my unexpierenced hands...I didn´t know the forums have to be set to allow 'always' the dice rolling, at the same time I had to give group or user permissions also. I can be very meticulous with the steps of installation, but loose myself in the ACP...

Anyway, now I changed everything, and tried to post again, with that result:

(the message 'this works')

and:
Fatal error: Call to undefined function encodediceBBCode() in ...root/posting.php(1149) : regexp code on line 1
What I have in the line where error is:
//add new dice codes
$dmessage = preg_replace('#\[dice(=([^\]]*))?:' . $message_parser->bbcode_uid . '\]((.*?))\[/dice:' . $message_parser->bbcode_uid . '\]#ise' , "encodediceBBCode('\$2','\$3',\$data['post_id'], \$data['forum_id'], \$message_parser->bbcode_uid)" , $dmessage);
}
I tried to find any errors like thath, but I couldn't find any but one, wich I haven´t understood how was solved. The user said that:
Darkling2000 wrote:
Darkling2000 wrote:Ok found out my problem was the server was running pre php5.0 so the functions it wanted where not there...

Still got an issue with it just going blank when I try to post a post with a [dice]1d6[/dice] in it... it just dies... White screen, firefox says its done... click back take you back to post. And if you look in forum there is no post at all.

If any of you have any thoughts happy to hear them.
ok that was me being rubbish, put the posting_function for the bbcode inside the final bracket... fixed now and working WOOT...

But reading through the code it reminds me why I didn't want to be a coder :P



Thanks for all! Problems are geting solved step by step :P
MalkContent
Registered User
Posts: 203
Joined: Mon Aug 18, 2008 10:00 am

Re: [BETA] Dicemod

Post by MalkContent »

alvbot wrote:Fatal error: Call to undefined function encodediceBBCode() in ...root/posting.php(1149) : regexp code on line 1
if you have this error you are using version 0.8.8
PLEASE use version 0.8.8b, 0.8.8 is not functional
Locked

Return to “[3.0.x] Abandoned MODs”