Dice Rolls results customisation
Page 1 of 1
Dice Rolls results customisation
Technical Details
Forum version : #phpBB2
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : Yourself
Forum link : ( link is hidden, you must reply to see )
Description of problem
Hello! I have couple questions about dice rolls.1) Following script provided here - https://help.forumotion.com/t141900-quick-reply-display-dice-rolls?highlight=dice - where is the best place to put it in? The scripts page or templates?
2) Is there a way to customise the dice rolls result? Now it says something like:
The member 'Kami-sama' has done the following action : Dice roll
#1 'First' :
#1 Result : 7
I would like to at least translate it (the forum is not in english)
Regards,
Re: Dice Rolls results customisation
The code should be added in the javascript page. About the second problem, the texts can be modified, but I'll need a link to a forum page that display's those texts(I don't use dice rolls on my forum so I don't know how it works).
Guest- Guest
Re: Dice Rolls results customisation
Hello Wolfuryo,
The issue is basically, you select one account in the forum and automatic result is posted as a message bellow the roll itself with that selected account. There are no specific tags in the message (that would mark it as dice roll result, like special IDs or classes). I have an idea how to just translate it (done that before), but would be interesting to modify the layout itself /
The issue is basically, you select one account in the forum and automatic result is posted as a message bellow the roll itself with that selected account. There are no specific tags in the message (that would mark it as dice roll result, like special IDs or classes). I have an idea how to just translate it (done that before), but would be interesting to modify the layout itself /
Re: Dice Rolls results customisation
The only way to modify it would be by using javascript in this case. I don't there are any templates for dice rolls so that's the only way.
Guest- Guest
Re: Dice Rolls results customisation
But I don't think that it will affect it well. As I mention, there are no specific Tags in the dice roll result post.... I wish there were more templates available.
Re: Dice Rolls results customisation
You'll have to do something like this:
with the old text(the default one) and
with the updated text.
- Code:
$(function(){
$(":contains('Text to modify')").text("New text");
})
|
|
Guest- Guest
Re: Dice Rolls results customisation
How to check if for example SPAN element contains another SPAN element AND other text?
Example:
As I tested, it has some issues with <> and " I think.
Example:
- Code:
<span><span>Text</span>Other Text</span>
$("span:contains('<span>Text</span>Other Text')").text("New text");
As I tested, it has some issues with <> and " I think.
Re: Dice Rolls results customisation
This should work:
:contains only works with text nodes, not html elements. If you need to select for example a span that contains another span, you have to use span>span
|
Last edited by Wolfuryo on June 9th 2017, 9:10 pm; edited 1 time in total
Guest- Guest
Re: Dice Rolls results customisation
Oh, then it will apply style or whatever to the first span?
Nice was looking for that for an hour now ;DD
Nice was looking for that for an hour now ;DD
Re: Dice Rolls results customisation
If you want to apply some styles to that, you should add a class via jquery and than style the elem via css:
- Code:
$("span>span:contains('Text')").addClass("class_name")
|
Guest- Guest
Re: Dice Rolls results customisation
I am just concerned, that this will really slow down the page load time....
Re: Dice Rolls results customisation
It should not slow it down too much, no more than half of a millisecond. Make sure to place the script just in a page where it is needed, so that it does not loads on pages where it is no need for it.
Guest- Guest
Similar topics
» Profile Customisation
» Dice rolls statistics
» Limit Number of Dice Rolls
» Dice results problem
» Dice?
» Dice rolls statistics
» Limit Number of Dice Rolls
» Dice results problem
» Dice?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum