beebee99 Posted April 9, 2010 Share Posted April 9, 2010 (edited) Hi forum world! We have installed this contribution well with the exception of one error that is appearing. It is contributions,1061 and we have looked through the 14 pages of the contribution thread and there is no answer for this error: On the page itself the site loads, but we do not see the calendar on the left-hand column. Under the header we see this error: "Parse error: syntax error, unexpected T_VARIABLE in /home1/xxxxxx/public_html/shop/includes/boxes/calendar.php on line 1" Is anyone familiar with this contribution and can help with this problem? One of the items in the thread contribution said to turn the register globals on and we did that. Edited April 9, 2010 by beebee99 Quote Link to comment Share on other sites More sharing options...
MrPhil Posted April 9, 2010 Share Posted April 9, 2010 Please cut and paste the first 10 lines of your calendar.php file here so we can look at what's wrong. Register globals would probably have nothing to do with a parse error. Quote Link to comment Share on other sites More sharing options...
beebee99 Posted April 9, 2010 Author Share Posted April 9, 2010 Thanks so much for the assistance. Here is the entire file (it is short): <?php/* $Id: events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License*/ $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CALENDAR ); ?><!-- events_calendar //--> <tr> <td> <iframe name="calendar" id="calendar" class="calendarBox" align="center" valign="top" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" src="<?php echo FILENAME_EVENTS_CALENDAR_CONTENT .'?_month='. $_month .'&_year='. $_year ?>">Sorry, your browser does not support iframes.</iframe> </td> </tr><!-- events_calendar //--> Quote Link to comment Share on other sites More sharing options...
MrPhil Posted April 10, 2010 Share Posted April 10, 2010 That's no help. Use "code" and "/code" tags around the code so that it doesn't get all run together. Is the following more or less correct? <?php /* $Id: events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License*/ $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CALENDAR ); ?> <!-- events_calendar //--> <tr> <td> <iframe name="calendar" id="calendar" class="calendarBox" align="center" valign="top" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" src="<?php echo FILENAME_EVENTS_CALENDAR_CONTENT .'?_month='. $_month .'&_year='. $_year ?>">Sorry, your browser does not support iframes.</iframe> </td> </tr> <!-- events_calendar //--> I see a <tr> without being in the middle of a <table>, although that shouldn't cause a PHP error. Are $_month and $_year defined somewhere? If not, that might cause a PHP error. If these variables are passed in via register global variables, they will not be defined. You need to find how these two variables are passed in (under what names), and use $_REQUEST['name'] to get the values. Quote Link to comment Share on other sites More sharing options...
beebee99 Posted April 12, 2010 Author Share Posted April 12, 2010 Thanks for looking at this again...your help is so much appreciated!!! You have no idea. This code is exactly what the text looks like when opened in Notepad, it is all run together. Maybe that is part of the problem. Again we are just installing the contribution which we assume has all the coding done correctly in the contribution. We will look through the pages and figure out where it passes these variables. Quote Link to comment Share on other sites More sharing options...
germ Posted April 12, 2010 Share Posted April 12, 2010 Thanks for looking at this again...your help is so much appreciated!!! You have no idea. This code is exactly what the text looks like when opened in Notepad, it is all run together. Maybe that is part of the problem. Again we are just installing the contribution which we assume has all the coding done correctly in the contribution. We will look through the pages and figure out where it passes these variables. Unless you want to install a different text editor, Wordpad works better than Notepad for manipulating text files retrieved from a 'nix server. It has to to with how Windowz and 'nix define text files. In 'nix each line in a text file is terminated with a line-feed. In Windowz/DOS each line in a text file is terminated with a carriage-return/line-feed combination. Notepad chokes on this difference whereas Wordpad doesn't care. When using Wordpad for simple text files just be sure you don't save it as an RTF (rich text format) file. Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
MrPhil Posted April 12, 2010 Share Posted April 12, 2010 Ugh. Don't use Notepad unless you have been careful to download the file in ASCII mode (not binary). As explained, that changes Linux "newline" line ends to "carriage-return/linefeed" favored by Windows. On the trip back up, the process is reversed. ViM is another editor which is happy to edit Linux-style files, and I wouldn't be surprised if Notepad++ can also do it. It's possible that the file got corrupted even before you downloaded it, and is all one line on the server. The table tags outside of a <table> concerns me greatly, but otherwise I can't see what it's complaining about on line 1. If there are multiple calendar.php files, did you get the one from the correct directory? Quote Link to comment Share on other sites More sharing options...
beebee99 Posted April 12, 2010 Author Share Posted April 12, 2010 Yep, we re-checked the install guides and files several times and it is a easy install with multiple files, but still easy to install so this error is upsetting and frustrating for such a relatively easy contribution. We have opened that file in Dreamweaver and Notepad from the live server the lines are all run together, but when opening from our harddrive in Wordpad it has the nice breaks and you can actually make out the code. We are going to try and re-download the source files for the contribution and upload them again to the site. Using Cute FTP pro. Quote Link to comment Share on other sites More sharing options...
MrPhil Posted April 13, 2010 Share Posted April 13, 2010 Don't use Dreamweaver (or any other WYSIWYG page editor) on a PHP-based site. It's more trouble than it's worth. You can use Notepad on small files that have been properly downloaded (ASCII format), but you'd be better off using ViM, Notepad++, or some other real editor that can handle Linux-style lines. I'm not sure exactly what you mean by "from the live server" -- did you download via FTP? If so, you probably used binary mode instead of ASCII. Be careful with word processor editors (e.g., Wordpad) that you don't accidentally save with WP markup codes in your file. It's best to learn to use a real "flat file" text editor and a real FTP client to upload and download. That way you have full control over what's going on, without any "funny business" behind the scenes (file transfer in the wrong mode, code being saved with word processing codes or HTML tags that you don't want, etc.). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.