Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse Error in Event Calendar Contribution


beebee99

Recommended Posts

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 by beebee99
Link to comment
Share on other sites

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 //-->

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...