Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse Error: Syntax Error, Unexpected '<'


Gimpz

Recommended Posts

I'm getting this code error coming from my column_right.php file

<?php
/*
 $Id: column_right.php,v 1.17 2003/06/09 22:06:41 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 require(DIR_WS_BOXES . 'shopping_cart.php');

 if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');

 if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

 if (isset($HTTP_GET_VARS['products_id'])) {
   if (tep_session_is_registered('customer_id')) {
     $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");
     $check = tep_db_fetch_array($check_query);
     if ($check['count'] > 0) {
       include(DIR_WS_BOXES . 'best_sellers.php');
     } else {
       include(DIR_WS_BOXES . 'product_notifications.php');
     }
   } else {
     include(DIR_WS_BOXES . 'product_notifications.php');
   }
 } else {
   include(DIR_WS_BOXES . 'best_sellers.php');
 }
require(DIR_WS_BOXES . 'information.php');
 if (isset($HTTP_GET_VARS['products_id'])) {
   if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');
 } else {
   include(DIR_WS_BOXES . 'specials.php');
 }
<?php

?>

 if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
   include(DIR_WS_BOXES . 'languages.php');
   include(DIR_WS_BOXES . 'currencies.php');
    }

?>

when I go view a testimonial

 

Please assist:

Link to comment
Share on other sites

look at the bottom of the file

 

 

?>

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

include(DIR_WS_BOXES . 'languages.php');

include(DIR_WS_BOXES . 'currencies.php');

}

?>

 

 

Remove the top ?>

I dont help with templates (thats what the seller is for)

 

th search function will often help, when it dont try this in google.

 

site:http://www.oscommerce.com/forums then your search word

Link to comment
Share on other sites

I did that.

 

Now I get this error:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /usr/www/users/dellad/includes/boxes/categories.php:13) in /usr/www/users/dellad/includes/footer.php on line 26

 

Any clues?

 

BTW: For some reason with this template, I call all my info boxes (guessing caterfories too) from the footer.php file...

 

Error is here:

 

http://dell-direct.co.za/customer_testimon...estimonial_id=1

Link to comment
Share on other sites

I copied your code removed the

 

<?php

?>

 

before the last ?>

 

and copied it in my column right and it worked

 

 

Edit : Are you sure this is your column right?? On your site i see a lot of stuff (online help etc ) which I dont see in the code .

Link to comment
Share on other sites

Ok, i removed the two items as requested from column_right.php.

 

It's giving me this error now:

 

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /usr/www/users/dellad/includes/boxes/categories.php:13) in /usr/www/users/dellad/includes/footer.php on line 26

 

 

As i mentioned above for some reason with this template I have to put all my column infoboxes in the footer.... maby the problems in the footer?

 

See footer code below:

 

<?php
/*
 $Id: footer.php,v 1.26 2003/02/10 22:30:54 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/


?>



    </td>
    <td width=205 valign=top>
     <table cellspacing=0 cellpadding=0>
      <tr><td height=1></td></tr> 
      <tr><td height=29 class=ch8><span class=ch3><i>Browse Products</i></span></td></tr> 
      <tr><td height=13></td></tr>
<?   // ---- CATEGORIES

 function tep_show_category($counter) {
   global $tree, $categories_string, $cPath_array;

  if(!$tree[$counter]['level']){               

   $categories_string .= $categories_string ? '<tr><td height=7></td></tr>' : '';             

   $categories_string .= '<tr><td class=ch8><img src=images/m29.gif width=3 height=5 align=absmiddle>   <a class=ml3 href=';

   if ($tree[$counter]['parent'] == 0) {
     $cPath_new = 'cPath=' . $counter;
   } else {
     $cPath_new = 'cPath=' . $tree[$counter]['path'];
   }
   $categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display categry name
   $categories_string .= $tree[$counter]['name'];
   $categories_string .= '</a></td></tr> ';

  }else{  // SUBCATEGORY

   $categories_string .= '<tr><td class=ch8><img src=images/m29.gif width=3 height=5 align=absmiddle>   ';

   for($i=0;$i<$tree[$counter]['le vel'];$i++)
    $categories_string .= '     ';

   $categories_string .= '     <a class=ml3 style="font-weight:normal;" href=';   
   if ($tree[$counter]['parent'] == 0) {
     $cPath_new = 'cPath=' . $counter;
   } else {
     $cPath_new = 'cPath=' . $tree[$counter]['path'];
   }
   $categories_string .= tep_href_link('index.php', $cPath_new) . '>-';
// display category name
   $categories_string .= $tree[$counter]['name'];
   $categories_string .= '</a></td></tr>';
  }  

   if ($tree[$counter]['next_id'] != false) {
     tep_show_category($tree[$counter]['next_id']);
   }  
 }



 define(TABLE_CATEGORIES, "categories");
 define(TABLE_CATEGORIES_DESCRIPTION, "categories_description");
 $categories_string = '';
 $tree = array();

 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
 while ($categories = tep_db_fetch_array($categories_query))  {
   $tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
                                               'parent' => $categories['parent_id'],
                                               'level' => 0,
                                               'path' => $categories['categories_id'],
                                               'next_id' => false);

   if (isset($parent_id)) {
     $tree[$parent_id]['next_id'] = $categories['categories_id'];
   }

   $parent_id = $categories['categories_id'];

   if (!isset($first_element)) {
     $first_element = $categories['categories_id'];
   }
 }

 //------------------------
 if ($cPath) {
   $new_path = '';
   reset($cPath_array);
   while (list($key, $value) = each($cPath_array)) {
     unset($parent_id);
     unset($first_id);
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
     if (tep_db_num_rows($categories_query)) {
       $new_path .= $value;
       while ($row = tep_db_fetch_array($categories_query)) {
         $tree[$row['categories_id']] = array('name' => $row['categories_name'],
                                              'parent' => $row['parent_id'],
                                              'level' => $key+1,
                                              'path' => $new_path . '_' . $row['categories_id'],
                                              'next_id' => false);

         if (isset($parent_id)) {
           $tree[$parent_id]['next_id'] = $row['categories_id'];
         }

         $parent_id = $row['categories_id'];

         if (!isset($first_id)) {
           $first_id = $row['categories_id'];
         }

         $last_id = $row['categories_id'];
       }
       $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
       $tree[$value]['next_id'] = $first_id;
       $new_path .= '_';
     } else {
       break;
     }
   }
 }
 $categories_string .=  '';
 tep_show_category($first_element); 
 $categories_string .=  '';

 echo $categories_string; 

include(DIR_WS_BOXES . 'live_help.php');
include(DIR_WS_BOXES . 'reviews.php');

require(DIR_WS_BOXES . 'boxad.php');
include(DIR_WS_BOXES . 'best_sellers.php');
include(DIR_WS_BOXES . 'customer_testimonials.php');


?>

<tr><td></td></tr>



      <tr><td height=26></td></tr>
      <tr><td background=images/m17.gif height=1></td></tr>
      <tr><td height=9></td></tr>
      <tr><td><a href=<?=tep_href_link('specials.php')?>><img src=images/m30.gif width=205 height=133 border=0></a><br><a href="http://dell-direct.co.za/create_account.php"><img src=images/mz.gif width=205 height=133 border=0></a></td></tr>
     </table> 
    </td></tr>
   </table>  
  </td></tr>
 <tr><td valing=bottom>
   <table cellspacing=0 cellpadding=0 width=729>
    <tr><td bgcolor=#FFFFFF height=8></td></tr> 
    <tr><td bgcolor=#000000 height=4></td></tr>
    <tr><td bgcolor=#FFFFFF align=center>
     <table cellspacing=0 cellpadding=0 width=703 aling=center>
      <tr><td width=700 style="padding-right: 9px">
       <table cellspacing=0 cellpadding=0 width=700>
        <tr><td></td>
        <td width=700 bgcolor=#FFFFFF>
        <table cellspacing=0 cellpadding=0 style="padding-left: 9px">
         <br><tr>

     <td width="700" valign="top"><p><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#5dafdf">My 
       Account:</font></strong><br>
       <br>
       - <a href="create_account.php?">Login or Create Account</a><br>
       - <a href="password_forgotten.php?">Forgot Password</a><br>
       - <a href="account.php?">My Account</a><br>
       - <a href="account_edit.php?">Edit Account Information</a><br>
       - <a href="account_history.php?">Order History</a><br>
       - <a href="address_book.php?">My Address Book</a><br>
       - <a href="checkout_shipping.php?">Shopping Cart</a><br>
<br>
</font></p>
     </td>
   <td width="700" valign="top"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#006baf">Information:</font></strong><br>

     <br>
     - <a href="conditions.php?">Why Shop Here?</a><br>
     - <a href="shipping.php?">Delivery/Returns & VAT</a><br>
     - <a href="privacy.php?">Privacy Notice</a><br>
     - <a href="about_us.php?">Dell Support</a><br>      
     - <a href="contact_us.php?">Contact Us</a></font></td>
   <td width="700" valign="top"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#202d7c">Extras:</font></strong><br>
     <br>
     - <a href="specials.php?">Specials</a><br>
     - <a href="reviews.php?">Product Reviews</a><br>
     - <a href="products_new.php?">New Products</a><br>
     - <a href="advanced_search.php?">Advanced Search<br></a>
     - <a href="logoff.php?">Log Out<br></a>
           </font> </td>

 </tr>
        </table>  
        </td>
        <td></td></tr> 
       </table>
      </td>
<br>
<a href="http://www.shopmania.co.za" title="Visit Dell-Direct.co.za on ShopMania" onclick="target='_blank'; window.open('http://www.shopmania.co.za/?m=101'); return false;" onkeypress="target='_blank'"><img src="http://www.shopmania.co.za/img/cert/shopmania-store-za.gif" style="border:0" alt="Visit Dell-Direct.co.za on ShopMania"</a></td></tr><a href="http://www.payfast.co.za"><img src=images/logo.png width=146 height=44 style="border:0"></a><a href="http://www.jump.co.za"><img src=images/listedonjump.gif width=120 height=60 style="border:0"></a><a href="http://www.pricecheck.co.za"><img src=images/listed_on_pricecheck.gif width=120 height=36 style="border:0"></a><br>
<a href="http://directory.onlineshopping.co.za/">SA Business Directory</a>


   </table> 

  </td></tr>
 </table>







<?php
 if ($banner = tep_banner_exists('dynamic', 'footerbann')) {
?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
 </tr>
</table>
<br>


<?php
 }
?>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-5581739-2");
pageTracker._trackPageview();
} catch(err) {}</script>

Link to comment
Share on other sites

I dont think you will get much help from the forum but you may try asking the comany who gave the template !!

 

The tempalte may not support testimonials . As you see reviews.php does not have a column.right and a column left but only the right column which actually gets the code from footer . Try copying the structure of reviews.php to the testimonial.php or just forget about testimonials .

 

 

PS BTW searching from the search box gives the error

 

1054 - Unknown column 'p.products_id' in 'on clause'

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...