Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-17-2004, 08:03 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default parse errors on my template

anyone know why it keeps saying parse error expecting `']''

HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
	<title>$vboptions[bbtitle] - vB Journal: <if condition="$journalinfo[journalname]">$journalinfo[journalname] Journal<else />$journalinfo[journalist]'s Journal</if></title>
$headinclude
<script type="text/javascript">
function validate()
{
form=document.comment
ctitle=form.title.value
cmessage=form.comment.value
submitOK="true"
if(ctitle.length<3)
{
 alert("The title for your comment must be at least 3 characters.")
 submitOK="false"
}
if(cmessage.length<5)
{
 alert("Your comment must be at least 5 characters.")
 submitOK="false"
}
if(submitOK=="false")
{
 return false
}
}
</script>
</head>
<body>
$header
$navbar
<table align="center" width="100%" border="0">
<tr>
<td>
<table class="tborder" align="center" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0">
<tr>
<td class="tcat" colspan="2">Journal Info</td>
</tr>
<tr>
<td class="alt2"><if conditon="$avatar[avatarpath]"><img src="$avatar[avatarpath]" border="0" /></if><if condition="$avatar[userid]"><img src="image.php?u=$avatar[userid]" border="0" /></if></td><td class="alt1">Journalist:<a href="member.php?userid=$journalinfo[journalist_id]">$journalinfo[journalist]</a><br />
# of Entries: $journalinfo[entries](Private: $journalinfo[priventries])</br>
Start Date:
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center"><if condition="$bbuserinfo['userid']==$journalinfo['journalist_id']">:<a href="journal.php?do=addentry&j=$j">Add Entry</a>:-</if>:<a href="#adcom">Add Comment</a>:</td>
</tr>
<tr>
<td align="center">
$entrybits
</td>
</tr>
</table>
<br />
<a name="adcom">
<form action="journal.php?do=insertcomment&j=$j" method="post" name="comment" onsubmit="return validate()">
<input type="hidden" name="commenter" value="$bbuserinfo[username]" />
<input type="hidden" name="commenterid" value="$bbuserinfo[userid]" />
<input type="hidden" name="j" value="$j" />
<table class="tborder" align="center" cellspacing="$styelvar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0">
<tr>
<td class="tcat">Add Comment to <if condition="$journalinfo[journalname]">$journalinfo[journalname] Journal<else />$journalinfo[journalist]'s Journal</if></td>
</tr>
<tr>
<td class="alt1">Title: <input type="text" name="title" <if condition="!empty($e)">value="Re: $entryinfo[entrytitle]"<else />value=""</if> maxlength="100" size="70" /></td>
</tr>
<tr>
<td class="alt2" align="center"><fieldset><legend>Comment:</legend><table><tr><td><textarea name="comment" cols="60" rows="4"></textarea></td></tr></table></fieldset></td>
</tr>
<tr>
<td class="alt1" align="center"><input type="submit" value="Add Comment!" class="button" /></td>
</tr>
</table>
</form>
</a>
<br />
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%">
<tr>
<td class="tcat">Recent Comments</td>
</tr>
$reccombits
</table>
<br />
<center>
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id]">:<a href="journal.php?do=addentry&j=$j">Add Entry</a>:-</if>:<a href="#adcom">Add Comment</a>:</center>
<br />
$footer
</body>
</html>
Reply With Quote
  #2  
Old 05-18-2004, 01:20 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In every conditional you have, it should contain the single quotes within the brackets of an array.

e.g.

PHP Code:
<if condition="$bbuserinfo['userid']==$journalinfo['journalist_id']"
not:

PHP Code:
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id]"
In PHP this would not generate an error (although is recommended practice), but maybe the template editor handles it differently.
Reply With Quote
  #3  
Old 05-18-2004, 09:18 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i removed them and i still receive the error

here is my updated code:
HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
	<title>$vboptions[bbtitle] - vB Journal: <if condition="$journalinfo[journalname]">$journalinfo[journalname] Journal<else />$journalinfo[journalist]'s Journal</if></title>
$headinclude
<script type="text/javascript">
function validate()
{
form=document.comment
ctitle=form.title.value
cmessage=form.comment.value
submitOK="true"
if(ctitle.length<3)
{
 alert("The title for your comment must be at least 3 characters.")
 submitOK="false"
}
if(cmessage.length<5)
{
 alert("Your comment must be at least 5 characters.")
 submitOK="false"
}
if(submitOK=="false")
{
 return false
}
}
</script>
</head>
<body>
$header
$navbar
<table align="center" width="100%" border="0">
<tr>
<td>
<table class="tborder" align="center" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0">
<tr>
<td class="tcat" colspan="2">Journal Info</td>
</tr>
<tr>
<td class="alt2"><if conditon="$avatar[avatarpath]"><img src="$avatar[avatarpath]" border="0" /></if><if condition="$avatar[userid]"><img src="image.php?u=$avatar[userid]" border="0" /></if></td><td class="alt1">Journalist:<a href="member.php?userid=$journalinfo[journalist_id]">$journalinfo[journalist]</a><br />
# of Entries: $journalinfo[entries](Private: $journalinfo[priventries])</br>
Start Date:
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center"><if condition="$bbuserinfo[userid]==$journalinfo[journalist_id]">:<a href="journal.php?do=addentry&j=$j">Add Entry</a>:-</if>:<a href="#adcom">Add Comment</a>:</td>
</tr>
<tr>
<td align="center">
$entrybits
</td>
</tr>
</table>
<br />
<a name="adcom">
<form action="journal.php?do=insertcomment&j=$j" method="post" name="comment" onsubmit="return validate()">
<input type="hidden" name="commenter" value="$bbuserinfo[username]" />
<input type="hidden" name="commenterid" value="$bbuserinfo[userid]" />
<input type="hidden" name="j" value="$j" />
<table class="tborder" align="center" cellspacing="$styelvar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0">
<tr>
<td class="tcat">Add Comment to <if condition="$journalinfo[journalname]">$journalinfo[journalname] Journal<else />$journalinfo[journalist] 's Journal</if></td>
</tr>
<tr>
<td class="alt1">Title: <input type="text" name="title" <if condition="!empty($e)">value="Re: $entryinfo[entrytitle]"<else />value=""</if> maxlength="100" size="70" /></td>
</tr>
<tr>
<td class="alt2" align="center"><fieldset><legend>Comment:</legend><table><tr><td><textarea name="comment" cols="60" rows="4"></textarea></td></tr></table></fieldset></td>
</tr>
<tr>
<td class="alt1" align="center"><input type="submit" value="Add Comment!" class="button" /></td>
</tr>
</table>
</form>
</a>
<br />
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%">
<tr>
<td class="tcat">Recent Comments</td>
</tr>
$reccombits
</table>
<br />
<center>
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id]">:<a href="journal.php?do=addentry&j=$j">Add Entry</a>:-</if>:<a href="#adcom">Add Comment</a>:</center>
<br />
$footer
</body>
</html>
Reply With Quote
  #4  
Old 05-19-2004, 02:58 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated code? It still looks the same.

It should have the single quotes around array elements, in conditionals.

$avatar['avatarpath'] is good, whereas $avatar[avatarpath] isn't.

Again, I don't know if this is why it's not working, but you must try it.
Reply With Quote
  #5  
Old 05-19-2004, 11:37 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

now i get parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
	<title>$vboptions[bbtitle] - vB Journal: <if condition="$journalinfo['journalname']">$journalinfo[journalname] Journal<else />$journalinfo[journalist]'s Journal</if></title>
$headinclude
<script type="text/javascript">
function validate()
{
form=document.comment
ctitle=form.title.value
cmessage=form.comment.value
submitOK="true"
if(ctitle.length<3)
{
 alert("The title for your comment must be at least 3 characters.")
 submitOK="false"
}
if(cmessage.length<5)
{
 alert("Your comment must be at least 5 characters.")
 submitOK="false"
}
if(submitOK=="false")
{
 return false
}
}
</script>
</head>
<body>
$header
$navbar
<table align="center" width="100%" border="0">
<!--
<tr>
<td>
<table class="tborder" align="center" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0">
<tr>
<td class="tcat" colspan="2">Journal Info</td>
</tr>
<tr>
<td class="alt2"><if conditon="$avatar['avatarpath']"><img src="$avatar[avatarpath]" border="0" /></if><if condition="$avatar['userid']"><img src="image.php?u=$avatar[userid]" border="0" /></if></td><td class="alt1">Journalist:<a href="member.php?userid=$journalinfo[journalist_id]">$journalinfo[journalist]</a><br />
# of Entries: $journalinfo[entries](Private: $journalinfo[priventries])</br>
Start Date:
</td>
</tr>
</table>
</td>
</tr> -->
<tr>
<td align="center"><if condition="$bbuserinfo['userid']==$journalinfo['journalist_id']">:<a href="journal.php?do=addentry&j=$j">Add Entry</a>:-</if>:<a href="#adcom">Add Comment</a>:</td>
</tr>
<tr>
<td align="center">
$entrybits
</td>
</tr>
</table>
<br />
<a name="adcom">
<form action="journal.php?do=insertcomment&j=$j" method="post" name="comment" onsubmit="return validate()">
<input type="hidden" name="commenter" value="$bbuserinfo[username]" />
<input type="hidden" name="commenterid" value="$bbuserinfo[userid]" />
<input type="hidden" name="j" value="$j" />
<table class="tborder" align="center" cellspacing="$styelvar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0">
<tr>
<td class="tcat">Add Comment to <if condition="$journalinfo['journalname']">$journalinfo[journalname] Journal<else />$journalinfo[journalist] 's Journal</if></td>
</tr>
<tr>
<td class="alt1">Title: <input type="text" name="title" <if condition="!empty($e)">value="Re: $entryinfo[entrytitle]"<else />value=""</if> maxlength="100" size="70" /></td>
</tr>
<tr>
<td class="alt2" align="center"><fieldset><legend>Comment:</legend><table><tr><td><textarea name="comment" cols="60" rows="4"></textarea></td></tr></table></fieldset></td>
</tr>
<tr>
<td class="alt1" align="center"><input type="submit" value="Add Comment!" class="button" /></td>
</tr>
</table>
</form>
</a>
<br />
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%">
<tr>
<td class="tcat">Recent Comments</td>
</tr>
$reccombits
</table>
<br />
<center>
<if condition="$bbuserinfo['userid']==$journalinfo['journalist_id']">:<a href="journal.php?do=addentry&j=$j">Add Entry</a>:-</if>:<a href="#adcom">Add Comment</a>:</center>
<br />
$footer
</body>
</html>
Reply With Quote
  #6  
Old 05-20-2004, 01:59 AM
lierduh lierduh is offline
 
Join Date: Jan 2003
Location: Sydney, Australia
Posts: 459
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AN-net
now i get parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
Instead of finding one missing " ' " from the entire code. It might be easier to trim down the code into blocks, and then find out which block contain the miss type.

Otherwise, paste the code into your main script and run it instead of calling eval, then the error message will tell you which line it failed. Naturally get the raw template code from the other field of the template table instead these <if condition=()>...
Reply With Quote
  #7  
Old 05-20-2004, 08:58 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try removing the jscript and then see if it parses.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:31 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03942 seconds
  • Memory Usage 2,289KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_html
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete