inherit
222412
0
Jan 29, 2019 16:48:39 GMT -8
tules
76
June 2015
tulululu
|
Post by tules on Aug 10, 2015 13:45:32 GMT -8
I was coding a plugin when it gave me this. is there a way to by pass it or do i have to figure out how to condense my code...
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 10, 2015 14:06:38 GMT -8
Hi, tules. The variable limit is hard-coded to ensure that the server doesn't experience slowdown from having to fetch too much information at once. You'll unfortunately have to figure out a way to condense your HTML to use less variables.
|
|
inherit
222412
0
Jan 29, 2019 16:48:39 GMT -8
tules
76
June 2015
tulululu
|
Post by tules on Aug 10, 2015 14:24:11 GMT -8
so my problem with condensation right now is that i'm not sure how to even begin with it. this is what the variable heavy part of the code looks like: <table> {foreach $[plugin.settings.monster]} {if $[plugin.settings.monster.area] == ash} {if $[plugin.settings.monster.oddeven] == 1}<tr>{/if} <td> <div class="meow" style="min-height: 130px;{if $[plugin.settings.monster.oddeven] == 1}margin-right: 10px;{/if} margin-bottom: 10px;"> <h1 style="font-size: 15px;">$[plugin.settings.monster.monster_name]</h1><br /> <h2><img src="$[plugin.settings.monster.monster_image]" style="height: 75px; width: 75px;"></h2> <table class="beststats"> {if $[plugin.settings.monster.hp]}<tr><td colspan="4">$[plugin.settings.monster.hp] HP</td></tr>{/if} <tr> {if $[plugin.settings.monster.atk]}<td>$[plugin.settings.monster.atk] ATK</td>{/if} {if $[plugin.settings.monster.def]}<td>$[plugin.settings.monster.def] DEF</td>{/if} {if $[plugin.settings.monster.rec]}<td>$[plugin.settings.monster.rec] REC</td>{/if} {if $[plugin.settings.monster.spd]}<td>$[plugin.settings.monster.spd] SPD</td>{/if} </tr> </table> <p>$[plugin.settings.monster.monster_description]</p> </div> </td> {if $[plugin.settings.monster.oddeven] == 1} {if $[plugin.settings.monster.oddeven] == 2}</tr>{/if} {/if} {/if} {/foreach} </table> and it's repeated 12 times because we have 12 subboards (for now...) that this information is relevant to. the only alternative i can think of is to code everything individually, straight into the header footer part of the plugin, but if there is a way to make this work i'd love to have it as it makes filling the information out infinitely easier
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 10, 2015 14:58:28 GMT -8
Which part determines the sub-board that the information displays in?
Also, are you coding it entirely with the Global/Main components? Part of your code might be better off being shown or hidden using Javascript rather than HTML and if statements.
|
|
inherit
222412
0
Jan 29, 2019 16:48:39 GMT -8
tules
76
June 2015
tulululu
|
Post by tules on Aug 10, 2015 15:21:47 GMT -8
I modified a thread link to open a modal window when clicked. The modal window contains a tabbed table that displays information specific for each subboard. here's how the plugin is supposed to workthe part of the code that specifies the subboard is {if $[plugin.settings.monster.area] == ash}. my knowledge of perl and javascript is shabby at best, so i'm at a loss at how to connect it without repeating all the if statements. if it helps, i've attached the plugin and here is the full global header as i had intended it. the plugin is a little messy because it draws from a lot of code in other parts of the forum. Attachments:Bestiary.pbp (2.25 KB)
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 10, 2015 15:40:04 GMT -8
If you look at the source code of your page you'll notice that a lot of the monster information you've added to the plugin is already contained between the <head> and </head> tags of your page in the form of Javascript variables. For this reason what many plugin authors typically do is build empty containers using either Javascript or the HTML components of their plugin. Then they populate that container's data by referencing the Javascript variables whenever the function to open the container is called. If you'd like it done that way to massively cut down on variable use in the HTML component you may want to try posting a thread in the Plugin Development board as that's typically where most plugin authors help each other with development questions.
|
|
inherit
222412
0
Jan 29, 2019 16:48:39 GMT -8
tules
76
June 2015
tulululu
|
Post by tules on Aug 10, 2015 16:21:48 GMT -8
okay i'll try that. thank you for your help ~
|
|