The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Syntax Error
Trying to put things together but it is killing me trying to understand why I get this error.
Quote:
PHP Code:
PHP Code:
|
#2
|
|||
|
|||
Just go over the code and rem out one line at the time..
or remove, little blocks.. or if(){} rules... After one of them.. you will NOT get the error anymore.. Put the others back in.. and inspect the line you removed to make it working.. F. |
#3
|
|||
|
|||
Forgot to put the template up:
HTML Code:
{vb:stylevar htmldoctype} <html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html"> <head> <title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title> {vb:raw headinclude} </head> <body> {vb:raw header} {vb:raw navbar} <div id="cfrules_mngrules" style="display:{vb:raw cybfr_display_rules};"> <table class="tborder" cellpadding="{vb:stylevar cellpadding}" cellspacing="{vb:stylevar cellspacing}" border="0" width="100%" align="center"> <tr> <td class="tcat" align="{vb:stylevar left}" colspan="4"><a style="float:{vb:stylevar right}" href="misc.php?do=cfrules_addedit">{vb:rawphrase cybfrules_add}</a><a class="smallfont" style="font-weight:bold;text-decoration:underline;" href="javascript:void(0);" onclick="return Cyb_SwitchCFRMNG('rules');">{vb:rawphrase cybfrules_manage}</a> | <a class="smallfont" href="javascript:void(0);" onclick="return Cyb_SwitchCFRMNG('forums');">{vb:rawphrase cybfrules_manage_forums}</a></td> </tr> <tbody id="collapseobj_cybfr_manage" style="{vb:raw vbcollapse.collapseobj_cybfr_manage}"> <tr> <td class="thead" align="center" width="1%">#</td> <td class="thead" align="{vb:stylevar left}">{vb:rawphrase title}</td> <td class="thead" align="{vb:stylevar left}">{vb:rawphrase cybfrules_rules}</td> <td class="thead" align="center" width="1%">{vb:rawphrase edit}/{vb:rawphrase delete}</td> </tr> {vb:raw cyb_frules_manage} </tbody> </table> </div> <div id="cfrules_mngforums" style="display:{vb:raw cybfr_display_forums};"> <form id="cfrules_setforum" name="cfrules_setforum" action="misc.php?do=cfrules_dosetforum" method="post"> <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" /> <table class="tborder" cellpadding="{vb:stylevar cellpadding}" cellspacing="{vb:stylevar cellspacing}" border="0" width="100%" align="center"> <tr> <td class="tcat" align="{vb:stylevar left}" colspan="3"><span class="smallfont" style="float:{vb:stylevar right}">{vb:rawphrase cybfrules_setforum} <select id="rules_id" name="rules_id">{vb:raw cybfrules_list}</select> <input class="button" type="submit" name="cfrules_sendf" value="{vb:rawphrase submit}" /></span><a class="smallfont" href="javascript:void(0);" onclick="return Cyb_SwitchCFRMNG('rules');">{vb:rawphrase cybfrules_manage}</a> | <a class="smallfont" style="font-weight:bold;text-decoration:underline;" href="javascript:void(0);" onclick="return Cyb_SwitchCFRMNG('forums');">{vb:rawphrase cybfrules_manage_forums}</a></td> </tr> <tbody id="collapseobj_cybfr_managef" style="{vb:raw vbcollapse.collapseobj_cybfr_managef}"> <tr> <td class="thead" align="{vb:stylevar left}" width="50%">{vb:rawphrase forum} <span class="smallfont">({vb:rawphrase threads}/{vb:rawphrase posts})</span></td> <td class="thead" align="{vb:stylevar left}" width="50%">{vb:rawphrase cybfrules_rules}</td> <td class="thead" align="center"><input type="checkbox" name="cybfr_check_all" id="cybfr_check_all" value="" onclick="CybChFRAll(this);" /></td> </tr> {vb:raw cyb_frules_forums} </tbody> </table> </form> </div> <script language="Javascript" type="text/javascript"> function CybChFRAll(obj) { var arrInput = document.getElementsByTagName("input"); for (i=0; i<arrInput.length; i++) { if (arrInput[i].type == 'checkbox') { arrInput[i].checked = obj.checked; } } } function Cyb_SwitchCFRMNG(target) { if (target=="rules") { document.getElementById("cfrules_mngrules").style.display = "block"; document.getElementById("cfrules_mngforums").style.display = "none"; } if (target=="forums") { document.getElementById("cfrules_mngrules").style.display = "none"; document.getElementById("cfrules_mngforums").style.display = "block"; } } </script> <br /> {vb:raw footer} </body> </html> HTML Code:
<script language="Javascript" type="text/javascript"> function CybChFRAll(obj) { var arrInput = document.getElementsByTagName("input"); for (i=0; i<arrInput.length; i++) { if (arrInput[i].type == 'checkbox') { arrInput[i].checked = obj.checked; } } } function Cyb_SwitchCFRMNG(target) { if (target=="rules") { document.getElementById("cfrules_mngrules").style.display = "block"; document.getElementById("cfrules_mngforums").style.display = "none"; } if (target=="forums") { document.getElementById("cfrules_mngrules").style.display = "none"; document.getElementById("cfrules_mngforums").style.display = "block"; } } </script> |
#4
|
|||
|
|||
it seems to be related to the javascript bug... in vbulletin..
template parser doesnt like the word var inside curly brackets.. var arrInput inside a curly bracket doesnt work.. 2 solutions: either put the javascript inbetween <vb:litteral> tags or declare the var outside the curly brackets... PS its maybe not that bug.. because usually then you cannot save the template... but its worth a try |
#5
|
|||
|
|||
Ok tried the litteral approach but honestly I have no idea how to mess with javascript outside of templates. Any suggestions?
|
#6
|
||||
|
||||
As suggested, just put <vb:literal> tags around your javascript:
HTML Code:
<vb:literal> <script language="Javascript" type="text/javascript"> function CybChFRAll(obj) { var arrInput = document.getElementsByTagName("input"); for (i=0; i<arrInput.length; i++) { if (arrInput[i].type == 'checkbox') { arrInput[i].checked = obj.checked; } } } function Cyb_SwitchCFRMNG(target) { if (target=="rules") { document.getElementById("cfrules_mngrules").style.display = "block"; document.getElementById("cfrules_mngforums").style.display = "none"; } if (target=="forums") { document.getElementById("cfrules_mngrules").style.display = "none"; document.getElementById("cfrules_mngforums").style.display = "block"; } } </script> </vb:literal> |
#7
|
|||
|
|||
I would do it that way...
either: HTML Code:
{vb:stylevar htmldoctype} <html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html"> <head> <title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title> {vb:raw headinclude} </head> <body> {vb:raw header} {vb:raw navbar} <div id="cfrules_mngrules" style="display:{vb:raw cybfr_display_rules};"> <table class="tborder" cellpadding="{vb:stylevar cellpadding}" cellspacing="{vb:stylevar cellspacing}" border="0" width="100%" align="center"> <tr> <td class="tcat" align="{vb:stylevar left}" colspan="4"><a style="float:{vb:stylevar right}" href="misc.php?do=cfrules_addedit">{vb:rawphrase cybfrules_add}</a><a class="smallfont" style="font-weight:bold;text-decoration:underline;" href="javascript:void(0);" onclick="return Cyb_SwitchCFRMNG('rules');">{vb:rawphrase cybfrules_manage}</a> | <a class="smallfont" href="javascript:void(0);" onclick="return Cyb_SwitchCFRMNG('forums');">{vb:rawphrase cybfrules_manage_forums}</a></td> </tr> <tbody id="collapseobj_cybfr_manage" style="{vb:raw vbcollapse.collapseobj_cybfr_manage}"> <tr> <td class="thead" align="center" width="1%">#</td> <td class="thead" align="{vb:stylevar left}">{vb:rawphrase title}</td> <td class="thead" align="{vb:stylevar left}">{vb:rawphrase cybfrules_rules}</td> <td class="thead" align="center" width="1%">{vb:rawphrase edit}/{vb:rawphrase delete}</td> </tr> {vb:raw cyb_frules_manage} </tbody> </table> </div> <div id="cfrules_mngforums" style="display:{vb:raw cybfr_display_forums};"> <form id="cfrules_setforum" name="cfrules_setforum" action="misc.php?do=cfrules_dosetforum" method="post"> <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" /> <table class="tborder" cellpadding="{vb:stylevar cellpadding}" cellspacing="{vb:stylevar cellspacing}" border="0" width="100%" align="center"> <tr> <td class="tcat" align="{vb:stylevar left}" colspan="3"><span class="smallfont" style="float:{vb:stylevar right}">{vb:rawphrase cybfrules_setforum} <select id="rules_id" name="rules_id">{vb:raw cybfrules_list}</select> <input class="button" type="submit" name="cfrules_sendf" value="{vb:rawphrase submit}" /></span><a class="smallfont" href="javascript:void(0);" onclick="return Cyb_SwitchCFRMNG('rules');">{vb:rawphrase cybfrules_manage}</a> | <a class="smallfont" style="font-weight:bold;text-decoration:underline;" href="javascript:void(0);" onclick="return Cyb_SwitchCFRMNG('forums');">{vb:rawphrase cybfrules_manage_forums}</a></td> </tr> <tbody id="collapseobj_cybfr_managef" style="{vb:raw vbcollapse.collapseobj_cybfr_managef}"> <tr> <td class="thead" align="{vb:stylevar left}" width="50%">{vb:rawphrase forum} <span class="smallfont">({vb:rawphrase threads}/{vb:rawphrase posts})</span></td> <td class="thead" align="{vb:stylevar left}" width="50%">{vb:rawphrase cybfrules_rules}</td> <td class="thead" align="center"><input type="checkbox" name="cybfr_check_all" id="cybfr_check_all" value="" onclick="CybChFRAll(this);" /></td> </tr> {vb:raw cyb_frules_forums} </tbody> </table> </form> </div> <script language="Javascript" type="text/javascript"> <vb:literal> function CybChFRAll(obj) { var arrInput = document.getElementsByTagName("input"); for (i=0; i<arrInput.length; i++) { if (arrInput[i].type == 'checkbox') { arrInput[i].checked = obj.checked; } } } function Cyb_SwitchCFRMNG(target) { if (target=="rules") { document.getElementById("cfrules_mngrules").style.display = "block"; document.getElementById("cfrules_mngforums").style.display = "none"; } if (target=="forums") { document.getElementById("cfrules_mngrules").style.display = "none"; document.getElementById("cfrules_mngforums").style.display = "block"; } } </vb:literal> </script> <br /> {vb:raw footer} </body> </html> HTML Code:
<script language="Javascript" type="text/javascript"> var arrInput; function CybChFRAll(obj) { arrInput = document.getElementsByTagName("input"); for (i=0; i<arrInput.length; i++) { if (arrInput[i].type == 'checkbox') { arrInput[i].checked = obj.checked; } } } function Cyb_SwitchCFRMNG(target) { if (target=="rules") { document.getElementById("cfrules_mngrules").style.display = "block"; document.getElementById("cfrules_mngforums").style.display = "none"; } if (target=="forums") { document.getElementById("cfrules_mngrules").style.display = "none"; document.getElementById("cfrules_mngforums").style.display = "block"; } } </script> if it works.. then you can remove the vb:literal and play around with the var dunno if you put var arrInput; or var arrInput = new array(); or or...Important is outside the curly brackets... ooooooops didnt see lynn posting while i was posting... sorry |
#8
|
||||
|
||||
hehe. Happens all the time.
|
#9
|
|||
|
|||
LOL I spelled it wrong, I am having spelling issues today.
Got it though, now to fix the stupid layout. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|