HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Dice Roller Miniblock

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#66225 (In Topic #14154)
Avatar

Community saint

Simple miniblock inspired by ChrisW's tutorial

Greetings,

Inspired by ChrisW's tutorial, I decided to attempt to make a miniblock that could be useful for RPG communities, like mine, and share it with you all.

Please note: This is a very simple miniblock. All I did was searched for a dice roller, found one that had an embed code with it already, pasted taht into kate, and saved it as main_diceroller.php, uploaded and tested with…

Code

[BLOCK]main_diceroller[/BLOCK]
And well, it workstm!

Now, I am not sure if it would work as an add on (so if this is the wrong forum please move). I am also not sure how to make it work with the add block button. I am sure it's probably documented somewhere right?

Anyways, here it is. Just upload to your /sources_custom/miniblocks to use.

Attachment
» Download: main_diceroller.php (604 Bytes, 158 downloads so far)


Source for dice roller code: D&D dice roller Widget --- Widgetbox

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Rating:
#66226
Avatar

Community saint

You could prob add it to the downloads.

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#66227
Avatar

Hi,

I would guess it automatically works with add-block, just it won't be able to work with parameters if you block uses them (one minor disadvantage to miniblocks).
It's super-easy to make it an addon, just fill in the form on ocPortal's addon export screen and it'll get exported to a tar.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#66233
Avatar

Community saint

I think this is a great use-case for a miniblock, and better than my example of a map since a virtual die doesn't need any parameters (except maybe number of sides). I just tried it on my local installation, and it appears to be working (in so much that a box appears and Firefox says it requires Flash, which I don't have :P ). The miniblock doesn't show in the "add block" menu, which I think is due to language strings being missing. I know how to do this for full blocks, since I (eventually) got it working for the Flattr blocks, but miniblocks don't seem to have the same abilities (an 'info' method, in the case of blocks) and I don't know how else to specify such language strings. It works fine when the full comcode tag is written manually though :)
Back to the top
 
Posted
Rating:
#66244
Avatar

Hi,

Miniblocks will now be addable via add-block in v6. You can consider this a bug fix :).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#66250
Avatar

Community saint

Awesome!

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Rating:
#66268
Avatar

Community saint

Greetings,

I added it to the add-ons section, though not sure if it really should count or anything lol.

What i'd love to do is to make a comcode that lets me input a value like 3d100 or whatever and get a random number rolled as if rolling the percentile dice. More research on that though will have to come when I get my site all back up and online. At least for now we'll have a dice roller and I got to contribute it to the community thanks to ChrisW.

ChrisW watch out, points coming your way.

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
There are too many online users to list.
Control functions:
 Add topic 

Quick reply   Contract

Your name:
Your message: