Rheannon Dawn Posted October 10, 2006 Posted October 10, 2006 This is the last parse error I have, I think (I hope) ;) And I would dearly love to fix it, but I'm shite with code, I'll freely admit, sooo, if anyone wants to have a crack at it, here it is, and thank you so very much in advance. :) Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/pagan4/public_html/forum.php on line 367 <?php /* $Id:CMS ZNEAK v.02 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $breadcrumb->add(Forum, tep_href_link('forum.php', '', 'NONSSL')); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <?php // Header Tag Controller v1.0 // Replaced by header_tags.php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE ?></title> <?php } // EOF: Header Tag Controller v1.0 ?> <META NAME="Author" CONTENT="www.lxfx.com"> <meta name="robots" content="index, follow"> <meta name="revisit-after" content="7 days"> <base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <?php print($test); ?> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"> <table width="100%" cellspacing="0" cellpadding="2"> <tr> <td valign="top"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td height="14" class="infoBoxHeading" width="100%"> Forum</td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox"> <tr> <td align="center"> <table border="0" width="100%" cellspacing="0" cellpadding="4" class="infoBoxContents"> <tr> <td> </td> <td><br><br> <?php include("forum_config.php"); include("forum_lib.php"); ?> <center> <table border="0" cellpadding="0" cellspacing="0" width="<?php echo $tablewidth; ?>"> <tr><td align="center"> <font face="<?php echo $default_font ?>" size="5" color="<?php echo $headlines ?>"><b><?php echo $forum_title; ?></b></font><br> <br><br> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <table width="150" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000"> <tr> <td> <table width="100%" border="0" cellspacing="0" bgcolor="<?php echo $buttons ?>" cellpadding="3"> <tr> <td align="center"> <b><font face="<?php echo $default_font ?>" size="2"> <a href="forum_newtopic.php"> <font color="#999999" style="text-decoration:none;">New Topic</font> </a></font></b></td> </tr> </table> </td> </tr> </table> <?php $hasil = mysql_query("SELECT * FROM forum_post"); $total_post = mysql_num_rows($hasil) or die("No posting records found!"); $hasil_topic = mysql_query("SELECT * FROM forum_topic"); $total_topic = mysql_num_rows($hasil_topic) or die("No topic records found!"); ?> </td> <td align="right"><font face="<?php echo $default_font ?>" size="1"><b> <font color="<?php echo $headlines ?>">Topic : </font><?php echo $total_topic; ?> -- <font color="<?php echo $headlines ?>">Posting : </font><?php echo $total_post; ?> -- <font color="<?php echo $headlines ?>"> <?php $query = mysql_query("SELECT * FROM forum_topic ORDER BY topic_last_post_id ASC"); $all_record = mysql_num_rows($query) or die("No topic records found!"); if ($page == "") $page = 1; // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($all_record <= $itemperpage) {$pagenumber = 1;} else { if (($all_record % $itemperpage) == 0) {$pagenumber = intval($all_record/$itemperpage);} else {$pagenumber = intval($all_record/$itemperpage) + 1;} } if ($pagenumber == 1) { $start = 1; $end = $all_record; $looping = $all_record; } else { if (($all_record % $itemperpage) == 0) { $sisa = $itemperpage; } else { $sisa = $all_record % $itemperpage; } if ($page == $pagenumber) { $start = 1; $end = $sisa; $looping = $sisa; } else { $end = (($pagenumber - $page) * $itemperpage) + $sisa; $start = $end - $itemperpage + 1; $looping = $itemperpage;} } // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $url = "forum.php?"; navigation($pagenumber, $page, $url); ?> </font></b></font></td> </tr> </table> <img height="4" src="images/space.gif" width=600><br> <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#000000"> <tr> <td width="20%" bgcolor="<?php echo $topbar ?>"><font size="1" face="<?php echo $default_font ?>" color="#999999"><b>Posted</b></font></td> <td width="50%" bgcolor="<?php echo $topbar ?>"><font size="1" face="<?php echo $default_font ?>" color="#999999"><b>Topic</b></font></td> <td width="5%" bgcolor="<?php echo $topbar ?>"><font size="1" face="<?php echo $default_font ?>" color="#999999"><b>Views</b></font></td> <td width="5%" bgcolor="<?php echo $topbar ?>"><font size="1" face="<?php echo $default_font ?>" color="#999999"><b>Replies</b></font></td> <td width="20%" bgcolor="<?php echo $topbar ?>" align="center"><font size="1" face="<?php echo $default_font ?>" color="#999999"><b>Last Reply</b></font></td> </tr> <?php for ($i=1; $i<=$looping; $i++) { $counter = $end - $i; $seekrecord = mysql_data_seek($query, $counter); $data = mysql_fetch_row($query) or die("No records found!"); $nomor = $counter + 1; if ((($i+1) % 2) == 0) $kolor = $color1; else $kolor = $color2; $tgl = substr($data[3],8,2) . "-" . substr($data[3],5,2) . "-" . substr($data[3],0,4); echo "<tr bgcolor="$kolor">"; echo "<td valign="top"><font face="$default_font" size="1">$tgl<br>"; $hasil_user = mysql_query("SELECT * FROM forum_post WHERE topic_id=$data[0] ORDER BY post_time ASC"); $data_user = mysql_fetch_row($hasil_user) or die("No records found!"); $user = $data_user[2]; $user_mail = $data_user[4]; $user_web = $data_user[5]; echo "by <b>$user</b></font><font face="$default_font"><br>"; if (!$user_mail == "") echo "<a href="mailto:$user_mail"><img src="images/sym_email.gif" width="33" height="17" border="0"></a> "; if (!$user_web == "") echo "<a href="$user_web" target="_blank"><img src="images/sym_www.gif" width="34" height="17" border="0"></a>"; echo "</font></td>"; echo "<td><font face="$default_font" size="1"><a href="forum_viewtopic.php?id=$data[0]"><b>$data[1]</b></a><br>"; $hasil_post = mysql_query("SELECT * FROM forum_post WHERE topic_id=$data[0] ORDER BY post_time ASC"); $data_post = mysql_fetch_row($hasil_post) or die("No records found!"); $hasil_text = mysql_query("SELECT * FROM forum_postext WHERE post_id=$data_post[0]"); $data_text = mysql_fetch_row($hasil_text) or die("No records found!"); $hasil_last = mysql_query("SELECT * FROM forum_post WHERE post_id=$data[6]"); $data_last = mysql_fetch_row($hasil_last) or die("No records found!"); $tgl_last = substr($data_last[3],8,2) . "-" . substr($data_last[3],5,2) . "-" . substr($data_last[3],0,4); echo $data_text[1] . "</font></td>"; echo "<td align="center"><b><font size="2" face="$default_font">$data[4]</font></b></td> <td align="center"><b><font size="2" face="$default_font" color="$headlines">$data[5]</font></b></td> <td align="center"><font face="$default_font" size="1">$tgl_last<br>"; $hasil_last_user = mysql_query("SELECT * FROM forum_post WHERE topic_id=$data[0] ORDER BY post_time DESC"); $data_last_user = mysql_fetch_row($hasil_last_user) or die("No records found!"); $last = $data_last_user[2]; echo "by <b>$last</b></font></td></tr>"; } ?> </table> <br> <div align="left"> <table width="150" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000"> <tr> <td> <table width="100%" border="0" cellspacing="0" bgcolor="<?php echo $buttons ?>" cellpadding="3"> <tr> <td align="center"> <b><font face="<?php echo $default_font ?>" size="2"> <a href="forum_admin.php"> <font color="#999999" style="text-decoration:none;">Admin</font> </a></font></b></td> </tr> </table> </td> </tr> </table> </div> </td></tr> </table> <br><br></td> <td> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> <!-- body_text_eof //--> <td valign="top"></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> )o( Blessings..RheannonDawn
Guest Posted October 10, 2006 Posted October 10, 2006 You will probably need to escape the quotation marks. See below for where they should go (bolded). echo "<tr bgcolor=\"$kolor\">"; echo "<td valign="top"><font face=\"$default_font\" size="1">$tgl<br>"; You might want to check any other lines that may be similar. I just looked around the line number that was reporting errors for you. :)
Rheannon Dawn Posted October 10, 2006 Author Posted October 10, 2006 You will probably need to escape the quotation marks. See below for where they should go (bolded). echo "<tr bgcolor=\"$kolor\">"; echo "<td valign="top"><font face=\"$default_font\" size="1">$tgl<br>"; You might want to check any other lines that may be similar. I just looked around the line number that was reporting errors for you. :) Thank you for looking at it, but I've tried that. It simply moves the parse error from line 367 to 369, which I escaped the quotations on at the same time as 367. )o( Blessings..RheannonDawn
Guest Posted October 10, 2006 Posted October 10, 2006 Thank you for looking at it, but I've tried that. It simply moves the parse error from line 367 to 369, which I escaped the quotations on at the same time as 367. Okay, I might not have been entirely correct with the second line (I was a bit busy) ;); you might need to escape ALL the quotations marks within the string. Try the following. If it fails again, don't be afraid to experiment ... as long as you have a backup. ;) echo "<td valign=\"top\"><font face=\"$default_font\" size=\"1\">$tgl<br>";
Rheannon Dawn Posted October 11, 2006 Author Posted October 11, 2006 Okay, I might not have been entirely correct with the second line (I was a bit busy) ;); you might need to escape ALL the quotations marks within the string. Try the following. If it fails again, don't be afraid to experiment ... as long as you have a backup. ;) echo "<td valign=\"top\"><font face=\"$default_font\" size=\"1\">$tgl<br>"; Ok, I've experimented and experimented..escaped all quotations, but it just continues to move the error down a line or two each time. I'll admit, its got me thoroughly stumped. :blink: I do appreciate all your help, though. Many thanks. )o( Blessings..RheannonDawn
Guest Posted October 11, 2006 Posted October 11, 2006 Ok, I've experimented and experimented..escaped all quotations, but it just continues to move the error down a line or two each time. I'll admit, its got me thoroughly stumped. :blink: Can I assume you're getting the SAME parsing error but on different lines? Just having a quick look beyond the original problem area in the code and I can see a number of other lines that have double quotes needing to be escaped. For example, see lines 385, 387 and 390. I'm sure there's going to be others though. Unfortunately, I think it's going to take a little bit of time working your way through the code. You could try a stepped search and replace I guess, being sure to not to escape the first and last double quotes. Good luck. :)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.