Log in

View Full Version : some template help needed


AN-net
07-15-2004, 05:57 PM
well here is my error:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/anima22/public_html/testvb/journal.php(309) : eval()'d code on line 81


here is the template its using

$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="empty($avatarurl)"><else /><img src="$avatarurl" 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: $journal[startdate]
</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" value="" 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="thead">Recent Comments</td>
</tr>
$reccombits
</table>
<br />
<center>
<if condition="$bbuserinfo[userid]==$journalinfo[journalist_id]">:<a href="journal.php?do=addentry&j=$_REQUEST[j]">Add Entry</a>:-</if>:<a href="#adcom">Add Comment</a>:</center>
<br />
$footer
</body>
</html>


anyone know why?

Andreas
07-15-2004, 06:22 PM
Hmm, I don't get eval errors.

AN-net
07-15-2004, 06:30 PM
could it be templates going into that template such as templates i fetched in while statements?

AN-net
07-16-2004, 03:11 PM
anyone? i really need to find the problem with this template or if there is a problem with something else>_>

Dark_Wizard
07-16-2004, 03:22 PM
anyone? i really need to find the problem with this template or if there is a problem with something else>_>

I see nothing wrong with the template so can you post some code from the script (journal.php) from line 300 to 309?

AN-net
07-16-2004, 03:36 PM
ok:)

i had added more code so the error is now on line 383, here is the line and surrounding code:

375: while($reccom= $DB_site->fetch_array($recent_comments))
376: {
377: $commentdate= vbdate($vboptions['dateformat'], $reccom['comment_date'], 1);
378: $commenttime= vbdate($vboptions['timeformat'], $reccom['comment_date']);
379: eval('$reccombits .= "' . fetch_template('journal_recent_comments') . '";');
380: }
381: }
382: eval('$navbar = "' . fetch_template('navbar') . '";');
383: eval('print_output("' . fetch_template('journal_journalpage') . '");');
384: }
385: }


thanks for the help

Andreas
07-16-2004, 03:51 PM
Small typo, big problem ;)
(At least I think so)


<if conditon="empty($avatarurl)"><else /><img src="$avatarurl" border="0" /></if>


should be actually


<if condition="empty($avatarurl)"><else /><img src="$avatarurl" border="0" /></if>


There are also a couple more minor things to change, so I attached the complete template.

AN-net
07-16-2004, 03:57 PM
wow it worked thanks :D