Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
southern
Client



Joined: Jan 29, 2004
Posts: 624

PostPosted: Thu Jun 03, 2004 8:41 pm Reply with quote

Any ideas about this??

Code:


Parse error: parse error, unexpected T_VARIABLE in /home/southern/public_html/modules/Recipes/general_functions.php.inc on line 1

Line 1 is: <?php
On the Recipes forum I got the answer:
Quote:

Hello, I encountered a parse error after uploading the files of Recipes 1.5.5. I logged in as admin and activated the Recipes module, then clicked the Recipes link to finish the install, but the first page had this error:

Parse error: parse error, unexpected T_VARIABLE in /home/southernwest/public_html/modules/Recipes/general_functions.php.inc on line 1

I couldn't finish the install. Any ideas?


Make sure the file is uploaded in ascii format.
Some upload programs have different upload settings for each extension, so if you can't figure out the uploaders settings then rename the file (remove the .inc) upload it and rename it there back so it get the extension .inc

My 'uploader' works fine with other .inc files.
The first few lines of this file:
Code:


<?php
/************************************************************************/
/* PHP-NUKE Recipe Module                                               */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2003 by Jens Hauge   http://visayas.dk                 */
/* Support site http://phpnuke.visayas.dk                               */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation.                                        */
/************************************************************************/
$module_name = basename(dirname(__FILE__));

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
 
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Thu Jun 03, 2004 9:22 pm Reply with quote

I'd give the file upload a try it installed ok for me except for some buggie in the sql file.
 
View user's profile Send private message
southern







PostPosted: Thu Jun 03, 2004 9:30 pm Reply with quote

I did, sixone. I renamed it to general_functions.php like the guy said, uploaded that, then renamed it back to general_functions.php.inc, but no go. I even re-unzipped the whole Recipes file and re-uploaded the file but I'll try it again... and I'll make sure Filezilla does it ascii.

Didn't work.
 
sixonetonoffun







PostPosted: Thu Jun 03, 2004 9:48 pm Reply with quote

Yeah that is wierd I'm on Windows its a little more forgiving but a parse error is a parse error. Which version did you download? I grabbed the 1.5.5 one.
 
southern







PostPosted: Thu Jun 03, 2004 10:15 pm Reply with quote

I have the same version, 1.5.5, or should if it would install. Actually I had 1.5.3 but when I tried to upgrade from that to 1.5.4, using the upgrade files from 1.5.5, so I could upgrade to 1.5.5 I got fatal errors, so I manually dropped all Recipe tables in phpmyadmin and re-uploaded everything in the 1.5.5 zip file, went to admin activated the Recipes module clicked the Recipes link to install the tables, and it hung on the parse error. How the hell does a parse error start with the first line <?php ??!
 
sixonetonoffun







PostPosted: Thu Jun 03, 2004 10:28 pm Reply with quote

I used the regular sql file from phpmyadmin. It gave an error then I had to add the rest after the error again but then it worked ok I even added a test recipe fixed the delete category error and left it alone.

Nice module could be great for many uses.
 
sixonetonoffun







PostPosted: Thu Jun 03, 2004 10:34 pm Reply with quote

Might some old file left from the original version being picked up by some reduntent code. It would be worth trying to remove all the files and uploading the new package one more time.
 
southern







PostPosted: Thu Jun 03, 2004 10:50 pm Reply with quote

OK I'll try that. If it works, cool, if not a possible cause is eliminated. Yeh, I like the Recipes module for my home concocted explosives haha Actually I had a lot of gumbo, chili and BBQ recipes in 1.5.3 and nary an error so I wish I'd kept it 'stead of foolin' with an upgrade.
 
southern







PostPosted: Thu Jun 10, 2004 9:16 pm Reply with quote

BumpBump C'mon, sixone, this is important and may have something to do with fixing the other problem I mentioned in a PM. One thing leads to another in an infinite chain. Smile
 
sixonetonoffun







PostPosted: Thu Jun 10, 2004 9:53 pm Reply with quote

Image

I'm fresh out of ideas.

Image
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Jun 10, 2004 10:29 pm Reply with quote

Actually, I always upload everything binary since it is usually win32 to unix. But, if you have tried this and it still is not working, post back.
 
View user's profile Send private message
southern







PostPosted: Thu Jun 10, 2004 10:58 pm Reply with quote

I uploaded general function in binary, the size is different, and ran Recipes again. This time I got only a blank white page, with no parse or other error. Progress, I suppose. Could there be a redundant character? Here is the entire general function from Recipes 1.5.5:
Code:


<?php/************************************************************************/
/* PHP-NUKE Recipe Module                                               */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2003 by Jens Hauge   http://visayas.dk                 */
/* Support site http://phpnuke.visayas.dk                               */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation.                                        */
/************************************************************************/
$module_name = basename(dirname(__FILE__));

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}
function getCategoryName($cat_id){
   GLOBAL $db;
   if ((!(isset($cat_id))) || $cat_id<0){
      return ""._NOTKNOWN;
   } else {
      $sql ="select category from ".$_SESSION["recipeprefix"]."_categories where id=$cat_id";
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      return $row[category];
   }
}

function getCategory($recipeid) {
   GLOBAL $db;
   $sql="select cat_id from ".$_SESSION["recipeprefix"]."_recipes_categories_rl where id=$recipeid";
   $result = $db->sql_query($sql);
   while ($row = $db->sql_fetchrow($result)) {
      $category[] = getCategoryName($row[cat_id]);
   }
   return implode(", ",$category);
}

function requestStatus($status) {
   $status_array = array();
   $status_array[0]=_REQUESTED;
   $status_array[1]=_SUBMITTED;
   $status_array[2]=_REJECTED;
   $status_array[3]=_CLOSED;
   return $status_array[$status];
}
function requestRelationStatus($status) {
   $status_array = array();
   $status_array[0]=_SENT;
   $status_array[1]=_SENT;
   $status_array[2]=_REJECTED;
   $status_array[3]=_APPROVED;
   return $status_array[$status];
}

function getConfig($module_name){
   GLOBAL $db, $prefix, $admin ;
   $sql="select name, value, type from ".$prefix."_modules_config where module='$module_name'";
   $result = $db->sql_query($sql);
   while ($row = $db->sql_fetchrow($result)) {
      switch($row[type]){
         case "CHAR":
            $_SESSION["$row[name]"] = $row[value];
            break;
         case "INT":
            $_SESSION["$row[name]"] = (int)$row[value];
            break;
         case "BOOL":
            $_SESSION["$row[name]"] = (trim($row[value])=="true");
            break;
      }      
   }
   $_SESSION["configmodule"]=$module_name;
   if (!(isset($_SESSION["update_check_time"]))) {$_SESSION["update_check_time"]=0;}
   $curr_time = time();
   if (is_admin($admin) && $_SESSION["update_check_time"]<$curr_time) {
      $onlyupgrade = true;
      include "modules/$module_name/installer/updater.php";
   }
}
?>

And a pic of the diff in size:
Image
 
Raven







PostPosted: Thu Jun 10, 2004 11:09 pm Reply with quote

Change this line
Code:
<?php/************************************************************************/
to
Code:
<?php

/************************************************************************/
Any difference?
 
southern







PostPosted: Fri Jun 11, 2004 12:00 am Reply with quote

Oddly there was no such "warping" of <?php in the file I'd uploaded, just in the post but I added a space after the opening tag and when I went back and clicked the Recipes link what do you know it loaded this time... 'cept some pics didn't show up

http://southernwolf.net/modules.php?name=Recipes

I re-uploaded the images but still some category icons not show up. But this is a vast improvement, maybe worth a case of beer depending on getting the icons to show. Smile
 
Raven







PostPosted: Fri Jun 11, 2004 12:20 am Reply with quote

Make it Pepsi or Scarlet Sangria Wink
 
sixonetonoffun







PostPosted: Fri Jun 11, 2004 8:46 am Reply with quote

There was a post on their forum about how to fix the save categories problem that should take care of that one I think.
 
southern







PostPosted: Fri Jun 11, 2004 9:49 am Reply with quote

OK, I'll go over there and look around for that issue. Thanks guys... what the hey is Scarlet Sangria? Sounds kind of like blood, Lestat. Smile
 
southern







PostPosted: Fri Jun 11, 2004 1:16 pm Reply with quote

sixonetonoffun wrote:
There was a post on their forum about how to fix the save categories problem that should take care of that one I think.


Yup™, there was sort of, but I figured out that since there are more than one icon for some categories you have to manually select which one you want to show, so I did that. Now the Recipes are back on my site or will be once I put back the gumbo™, chili™ and BBQ™ recipes... Thanks, Raven™ and sixonetonoffun™. Smile Uh, I'm not overdoing the ™ stuff, am I? Wink
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©