jennymac Posted March 21, 2006 Posted March 21, 2006 I tried to make my specials box scroll (perhaps mistake number 1) and somehow, after many hours, ended up screwing up my right hand column. The bestsellers are still there (yipee) but not only has the specials box disappeared so have the reviews, etc. (I commented out the currency box on purpose, so I don't care about that). So..... I'm getting this error at the top of the column: Parse error: parse error, unexpected T_STRING, expecting ')' in /home/jenny6/public_html/includes/boxes/specials.php on line 30 The specials box itself reads: <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ $rp_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc"); if (tep_db_num_rows($rp_query)) { ?> <!-- specials //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SPECIALS); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS)); while ($random_product = tep_db_fetch_array($rp_query)) { $rp .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); $rp .= "</SPAN><BR />n---------n"; } $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover='this.stop()' onmouseout='this.start()'>'.$rp.'</span></MARQUEE>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- specials_eof //--> <?php } ?> Any help would be greatly appreciated! And, yes, I did go back to a backup with no luck. Thanks....Jennifer
MrMcauber Posted March 21, 2006 Posted March 21, 2006 Hi Jenny, not familiar with what your trying to do, but I think your problem may lie in this line... $info_box_contents[] = array('align' => 'center', 'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover='this.stop()' onmouseout='this.start()'>'.$rp.'</span></MARQUEE>'); I could be wrong but have you got some of your " and ' muddled up? I think (?) the onmouseover and onmouseout arguments should have " round them instead of ' like shown below.... Other wise in your original line the ' after onmouseover= would be the end of the string 'text' your building.... and at that point php would expect a ) hence the expecting ')' in your error message...?? $info_box_contents[] = array('align' => 'center', 'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover="this.stop()" onmouseout="this.start()">'.$rp.'</span></MARQUEE>'); I tried to make my specials box scroll (perhaps mistake number 1) and somehow, after many hours, ended up screwing up my right hand column. The bestsellers are still there (yipee) but not only has the specials box disappeared so have the reviews, etc. (I commented out the currency box on purpose, so I don't care about that). So..... I'm getting this error at the top of the column: Parse error: parse error, unexpected T_STRING, expecting ')' in /home/jenny6/public_html/includes/boxes/specials.php on line 30 The specials box itself reads: <?php / $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover='this.stop()' onmouseout='this.start()'>'.$rp.'</span></MARQUEE>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- specials_eof //--> <?php } ?> Any help would be greatly appreciated! And, yes, I did go back to a backup with no luck. Thanks....Jennifer
jasonabc Posted March 21, 2006 Posted March 21, 2006 You've removed all the escaping backslashes from the <marquee> part of the code. To get this contribution to work: 1) FTP the specials_scroll.php file that came with the contribution up to your webserver /catalog/includes/boxes (don't edit it - just FTP it!) 2) Open /catalog/includes/column_right.php and change this: include(DIR_WS_BOXES . 'specials.php'); to this: include(DIR_WS_BOXES . 'specials_scroll.php'); Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
jennymac Posted March 21, 2006 Author Posted March 21, 2006 My two heroes - almost! Now I'm getting this error: Fatal error: Call to undefined function: includes() in /home/jenny6/public_html/includes/column_right.php on line 77 I really would just like to go back to the "old" specials box and leave well enough alone. Any help with that? Thanks!
jasonabc Posted March 21, 2006 Posted March 21, 2006 overwrite your column_right.php page with this: <?php /* $Id: column_right.php,v 1.17 2003/06/09 22:06:41 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com 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'); } 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_scroll.php'); } require(DIR_WS_BOXES . 'reviews.php'); if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { include(DIR_WS_BOXES . 'languages.php'); # include(DIR_WS_BOXES . 'currencies.php'); } ?> Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
jennymac Posted March 21, 2006 Author Posted March 21, 2006 Ok, I put in the "basic" specials box code that someone sent me, but now I'm back to the original error: Parse error: parse error, unexpected T_STRING, expecting ')' in /home/jenny6/public_html/includes/boxes/specials.php on line 30 The specials code is now: <?php /* $Id: specials.php,v 1.31 2003/06/09 22:21:03 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) { ?> <!-- specials //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SPECIALS); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS)); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- specials_eof //--> <?php } ?> Do you need my right hand column code? Many thanks, as usual!
jasonabc Posted March 21, 2006 Posted March 21, 2006 there's nothing wrong with the code you posted. Have u FTP'd the file? Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
jennymac Posted March 21, 2006 Author Posted March 21, 2006 Jason, no - which file? The specials? Double rats!
jasonabc Posted March 21, 2006 Posted March 21, 2006 yeah that code you posted (specials.php). Make sure you FTP it up to /catalog/includes/boxes/ Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
jasonabc Posted March 21, 2006 Posted March 21, 2006 you must still have the old scroll code in there because that's where it was erroring before (line 30). Once again (going right back to the start of this thread) the escaping slashes you removed from the MARQUEE code on the specials_scroll.php page is causing the error on line 30: you have this: 'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover='this.stop()' onmouseout='this.start()'>'.$rp.'</span></MARQUEE>'); but it should be this: 'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "right" height="160" scrollamount= "2" scrolldelay= "20" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$rp.'</span></MARQUEE>'); Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
jennymac Posted March 21, 2006 Author Posted March 21, 2006 Jason, once again you came to my rescue! Muchas gracias, mi amigo! Now, is there a way to make it scroll up instead of the sideways contribution I used? Thanks again SO much!
jennymac Posted March 21, 2006 Author Posted March 21, 2006 Well, it was working with the fix, but when I changed "right" to "up" I got the same old line 30 message. Guess I'm going to have to live with the right?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.