Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - All Issues
Author Message
rasterman
New Member
New Member


Joined: Oct 28, 2007
Posts: 5
Location: Luton UK

PostPosted: Sun Mar 09, 2008 2:03 pm Reply with quote

I use test website to test everything out before I transfer everything onto my main website, so i did a clean install of 2.20.1 and get this error:

PHP Parse error: syntax error, unexpected T_VARIABLE in /home/gs1623d/public_html/ravenuke/modules/RWS_WhoIsWhere/index.php on line 1

If I click on the RWS_WhoIsWhere link it just goes to a blank page.
I hope someone can help me please Smile
 
View user's profile Send private message Visit poster's website
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Sun Mar 09, 2008 2:56 pm Reply with quote

I can confirm that I'm seeing the same thing in my site. There were some last minute changes in this module before the release of 2.20.01 and one of them may be causing the problem. I would recommend just turning this module and block off for now and someone will get back to you. It's not essential anyway.

I will enter it in our bug tracking system.
 
View user's profile Send private message Visit poster's website
Paul_K
Hangin' Around


Joined: Feb 22, 2004
Posts: 40
Location: Dorset, England

PostPosted: Sun Mar 09, 2008 4:59 pm Reply with quote

I had the same problem when upgrading to the latest version of RavenNuke. In my case the problem was with the uploading of that particular modules index.php. For some reason every time that file was uploaded it would strip out all the formatting so that the file became one long line. In the end I did a copy+paste edit on the server file to make it work. Strange thing, that's the only file I've ever had that happen with! Worth checking on your server?

Cheers, Paul K
 
View user's profile Send private message Yahoo Messenger MSN Messenger ICQ Number
fkelly
PostPosted: Sun Mar 09, 2008 7:34 pm Reply with quote

Good catch, Paul K. I recall that happening during testing ... the file appeared on the server as one long line. That explains the error message with the variable on line 1 also. I think that file had some strange line ending characters perhaps because of an editor it was developed in but we never fully resolved the issue and it didn't happen on most systems. The copy paste approach (copy from the file in the distribution as it appears in your PC text editor and paste it into the server file) should also work. I seem to recall also that opening the file and saving it as txt, then opening that and saving it as PHP will cause the bad line endings to get replaced. To make sure take a look at the file in your CPANEL or whatever other text editor your server provides and make sure it looks like a normal PHP file. I'd just do that if I saw the error.
 
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Sun Mar 09, 2008 9:55 pm Reply with quote

The wiw modules is not intended to be active. The module should be set to INACTIVE. Only the block should be active. Also, all php files should be transfered as binary.
 
View user's profile Send private message
rasterman
PostPosted: Mon Mar 10, 2008 12:12 am Reply with quote

I did what you said guys and it worked perfect thx.
 
nimis
Hangin' Around


Joined: Dec 13, 2007
Posts: 37
Location: New York, Bklyn

PostPosted: Thu Mar 13, 2008 8:17 am Reply with quote

HI all.. I did as suggeested by editding the script but Ive got a Parse error: syntax error, unexpected '*' some where.

Can someone check it out this or post one that is correct... RWS_WhoIsWhere index.php file.

Code:


<?php/************************************************************************//
* PHP-NUKE: Web Portal System                                          *
//* ===========================                                          *
//*                                                                      *
//* Copyright (c) 2002 by Francisco Burzi                                *
//* http://phpnuke.org                                                   *
//*                                                                      *
//* 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; either version 2 of the License.       *
//************************************************************************
//************************************************************************
//* WhoIsWhere Module/Block by Gaylen Fraley (aka Raven)                 *
//* http://Ravenwebhosting.com                                           *
//* http://ravenphpscripts.com                                           *
//* For use with nuke 6.5 and later                                      *
//************************************************************************
//************************************************************************
//* 10/15/2007 Version 1.6 Released                                      *
//*            All known bugs fixed.  Security tightened.                *
//* 01/28/2007 Version 1.5 Released                                      *
//*            Moved the setting $refreshRate out of the block code into *
//*            a configuration file: RWS_WhoIsWhere_config.inc.php.      *
//*            Added "php" short tag to all scripts.                     *
//*            Removed all hard coded language to language folder.       *
//*            All table names are now stored as defines in the lang file*
//* 01/27/2007 Version 1.4 Released                                      *
//*            It appears that v1.3 was never released although I thought*
//*            it had been.  I have added a few more security measures & *
//*            did some code cleanup.                                    *
//* 09/15/2005 Version 1.3 Released                                      *
//*            Removed extraneous "allowtransparency" word in body style *
//*            Added security for $_GET vars                             *
//*            Added language folder/file                                *
//* 08/06/2004 Version 1.2 Released                                      *
//*            Corrected code to use $user_prefix setting in addition to *
//*            $prefix from nuke config.php file. This updates the v1.1  *
//* 07/01/2004 Version 1.1 Released                                      *
//*            Added code to use $user_prefix setting in addition to     *
//*            $prefix from nuke config.php file.                        *
//* 06/28/2004 Version 1.0 Released                                      *
//************************************************************************/
$dirPath=str_replace('\\','/',dirname(__FILE__)).'/';
require_once($dirPath.'RWS_wiw_config.inc.php');
require_once($dirPath.'language/lang-english.php');
$theme ='';
if (!isset($HTTP_GET_VARS['theme'])) $HTTP_GET_VARS['theme'] = '';
$theme = basename(strip_tags($HTTP_GET_VARS['theme']));
if (!eregi("modules",$_SERVER['PHP_SELF']))die(_RWS_WIW_NOACCESS);
define('INDEX_FILE', true);$headTag = '';
$refreshRate = intval($HTTP_GET_VARS['refreshRate']);
$theme = basename(strip_tags($HTTP_GET_VARS['theme']));
if (@file_exists('config.php')) include('config.php');
elseif (@file_exists('../config.php')) include('../config.php');
elseif (@file_exists('../../config.php')) include('../../config.php');
elseif (@file_exists('../../../config.php')) include('../../../config.php');
elseif (@file_exists('../../../../config.php')) include('../../../../config.php');
else die('Unable to locate nuke config file');
$db = mysql_connect($dbhost, $dbuname, $dbpass) or die('<br />'._RWS_WIW_UNABLECONNECTSERVER._RWS_WIW_MYSQLSAID.': '.mysql_error());mysql_select_db($dbname)ordie('<br />'._RWS_WIW_UNABLECONNECTDB._RWS_WIW_MYSQLSAID.':'.mysql_error());
header("Refresh: $refreshRate;");
echo _RWS_WIW_DOCTYPE;
echo'<html><head><title>'._RWS_WIW_TITLE.'</title>';$headTag ='<link rel="StyleSheet" href="../../themes/'.$theme.'/style/style.css" type="text/css">';$headTag .= '<style type="text/css">body
{
background:none;background-color: transparent;                     
}
</style>';echo $headTag;echo '</head>';echo '<body>';$sql = 'Select * from '._RWS_WIW_TABLE_SESSION;$result = mysql_query($sql) or die('<br />'._RWS_WIW_MYSQLSAID.': '.mysql_error());
if ($result && (mysql_num_rows($result) > 0)) {   $registered = array();
$guest= array();
while ($row=mysql_fetch_row($result))
{
if (!$row[3]) $registered[] = $row[0];
else $guest[] = $row[0];
}
}
echo '<b><u>'._RWS_WIW_GUESTSONLINE.'</u></b><br />'.count($guest).' '._RWS_WIW_GUESTS;
echo '<br /><br />';
$reg = '';   $wol = '';
 $regCount = count($registered);
$notHiddenCount = 0;
for ($i=0;$i<$regCount;$i++)
{
if ($i==0)
{
$comma = '';
$lb = '';
}else{
$lb='<br />';
$comma = ',';
}
$result2 = mysql_query('Select user_allow_viewonline hide from '._RWS_WIW_TABLE_USERS.' where username=\''.mysql_real_escape_string($registered[$i]).'\';');
$row2=mysql_fetch_row($result2);
if (!$row2[0]) continue;
$cmd = mysql_query('select mn from '._RWS_WIW_TABLE_HEAP.' where who=\''.mysql_real_escape_string($registered[$i]).'\'');
$data = mysql_fetch_row($cmd);
if (is_null($data[0])) $data[0] =_RWS_WIW_HOME;
$reg .= $lb.'<b>'.$registered[$i].'</b><br />&nbsp;&nbsp;
'.str_replace('_',' ',$data[0]);
$wol .= $comma."'".$registered[$i]."'";
$notHiddenCount++;   }
if (!empty($reg)) {
$delSql = 'delete from '._RWS_WIW_TABLE_HEAP.' where who NOT IN (\''.$wol.'\')';
mysql_query($delSql);
if (substr($reg,0,2)==', ') $reg = substr($reg,2);
$reg = '<b><u>'.$notHiddenCount.' '._RWS_WIW_USERSONLINE.'</u></b><br />'.$reg;
echo $reg;
echo'<br /><br />';
}
echo '<center>('.$refreshRate.' '._RWS_WIW_REFRESH.')</center></body></html>';?>

_________________
˜”°º••º°”˜ Live and Learn˜”°º••º°”˜ 
View user's profile Send private message
Raven
PostPosted: Thu Mar 13, 2008 11:39 am Reply with quote

Your file is corrupted. Your line endings are all messed up. It looks like you used Notepad or Wordpad to edit the files which you should NEVER do. You need to reupload the original file as binary. If it needs editing then use a good editor.
 
nimis
PostPosted: Thu Mar 13, 2008 11:58 am Reply with quote

Used UltraEdit-32.. strange usually works. but will try again.. thx


So now it should be right. thanks R. Very Happy

Code:


<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* 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; either version 2 of the License.       */
/************************************************************************/
/************************************************************************/
/* WhoIsWhere Module/Block by Gaylen Fraley (aka Raven)                 */
/* http://Ravenwebhosting.com                                           */
/* http://ravenphpscripts.com                                           */
/* For use with nuke 6.5 and later                                      */
/************************************************************************/
/************************************************************************/
/* 10/15/2007 Version 1.6 Released                                      */
/*            All known bugs fixed.  Security tightened.                */
/* 01/28/2007 Version 1.5 Released                                      */
/*            Moved the setting $refreshRate out of the block code into */
/*            a configuration file: RWS_WhoIsWhere_config.inc.php.      */
/*            Added "php" short tag to all scripts.                     */
/*            Removed all hard coded language to language folder.       */
/*            All table names are now stored as defines in the lang file*/
/* 01/27/2007 Version 1.4 Released                                      */
/*            It appears that v1.3 was never released although I thought*/
/*            it had been.  I have added a few more security measures & */
/*            did some code cleanup.                                    */
/* 09/15/2005 Version 1.3 Released                                      */
/*            Removed extraneous "allowtransparency" word in body style */
/*            Added security for $_GET vars                             */
/*            Added language folder/file                                */
/* 08/06/2004 Version 1.2 Released                                      */
/*            Corrected code to use $user_prefix setting in addition to */
/*            $prefix from nuke config.php file. This updates the v1.1  */
/* 07/01/2004 Version 1.1 Released                                      */
/*            Added code to use $user_prefix setting in addition to     */
/*            $prefix from nuke config.php file.                        */
/* 06/28/2004 Version 1.0 Released                                      */
/************************************************************************/
$dirPath = str_replace('\\','/',dirname(__FILE__)).'/';
require_once($dirPath.'RWS_wiw_config.inc.php');
require_once($dirPath.'language/lang-english.php');
$theme = '';
if (!isset($HTTP_GET_VARS['theme'])) $HTTP_GET_VARS['theme'] = '';
$theme = basename(strip_tags($HTTP_GET_VARS['theme']));
if (!eregi("modules", $_SERVER['PHP_SELF'])) die(_RWS_WIW_NOACCESS);
define('INDEX_FILE', true);
$headTag = '';
/**
$refreshRate = intval($HTTP_GET_VARS['refreshRate']);
$theme = basename(strip_tags($HTTP_GET_VARS['theme']));
if (@file_exists('config.php')) include('config.php');
elseif (@file_exists('../config.php')) include('../config.php');
elseif (@file_exists('../../config.php')) include('../../config.php');
elseif (@file_exists('../../../config.php')) include('../../../config.php');
elseif (@file_exists('../../../../config.php')) include('../../../../config.php');
else die('Unable to locate nuke config file');
**/
$db = mysql_connect($dbhost, $dbuname, $dbpass) or die('<br />'._RWS_WIW_UNABLECONNECTSERVER._RWS_WIW_MYSQLSAID.': '.mysql_error());
mysql_select_db($dbname) or die('<br />'._RWS_WIW_UNABLECONNECTDB._RWS_WIW_MYSQLSAID.': '.mysql_error());
header("Refresh: $refreshRate;");
echo _RWS_WIW_DOCTYPE;
echo '<html><head><title>'._RWS_WIW_TITLE.'</title>';
$headTag = '<link rel="StyleSheet" href="../../themes/'.$theme.'/style/style.css" type="text/css">';
$headTag .= '<style type="text/css">
               body {background:none;
                     background-color: transparent;
                     }
            </style>';
echo $headTag;
echo '</head>';
echo '<body>';
$sql = 'Select * from '._RWS_WIW_TABLE_SESSION;
$result = mysql_query($sql) or die('<br />'._RWS_WIW_MYSQLSAID.': '.mysql_error());
if ($result && (mysql_num_rows($result) > 0)) {
   $registered = array();
   $guest      = array();
   while ($row=mysql_fetch_row($result)) {
      if (!$row[3]) $registered[] = $row[0];
      else $guest[] = $row[0];
   }
}
   echo '<b><u>'._RWS_WIW_GUESTSONLINE.'</u></b><br />'.count($guest).' '._RWS_WIW_GUESTS;
   echo '<br /><br />';
   $reg = '';
   $wol = '';
   $regCount = count($registered);
   $notHiddenCount = 0;
   for ($i=0;$i<$regCount;$i++) {
      if ($i==0) {
         $comma = '';
         $lb = '';
      }
      else {
         $lb='<br />';
         $comma = ',';
      }
      $result2 = mysql_query('Select user_allow_viewonline hide from '._RWS_WIW_TABLE_USERS.' where username=\''.mysql_real_escape_string($registered[$i]).'\';');
      $row2=mysql_fetch_row($result2);
      if (!$row2[0]) continue;
      $cmd = mysql_query('select mn from '._RWS_WIW_TABLE_HEAP.' where who=\''.mysql_real_escape_string($registered[$i]).'\'');
      $data = mysql_fetch_row($cmd);
      if (is_null($data[0])) $data[0] = _RWS_WIW_HOME;
        $reg .= $lb.'<b>'.$registered[$i].'</b><br />&nbsp;&nbsp;'.str_replace('_',' ',$data[0]);
        $wol .= $comma."'".$registered[$i]."'";
        $notHiddenCount++;
   }
   if (!empty($reg)) {
      $delSql = 'delete from '._RWS_WIW_TABLE_HEAP.' where who NOT IN (\''.$wol.'\')';
      mysql_query($delSql);
      if (substr($reg,0,2)==', ') $reg = substr($reg,2);
      $reg = '<b><u>'.$notHiddenCount.' '._RWS_WIW_USERSONLINE.'</u></b><br />'.$reg;
      echo $reg;
      echo '<br /><br />';
   }
echo '<center>('.$refreshRate.' '._RWS_WIW_REFRESH.')</center></body></html>';
?>
 
Raven
PostPosted: Thu Mar 13, 2008 5:53 pm Reply with quote

Should be Smile
 
pan
Involved
Involved


Joined: Jul 25, 2006
Posts: 354

PostPosted: Fri Oct 03, 2008 2:54 am Reply with quote

Raven wrote:
The wiw modules is not intended to be active. The module should be set to INACTIVE. Only the block should be active. Also, all php files should be transfered as binary.


My file was all on 1 line too

Is there any harm in just replacing it with the original file again?
 
View user's profile Send private message
Raven
PostPosted: Fri Oct 03, 2008 3:09 am Reply with quote

Upload all files in binary and you won't have this problem. Do not edit your files with notepad nor wordpad.
 
pan
PostPosted: Fri Oct 03, 2008 3:11 am Reply with quote

pan wrote:

Is there any harm in just replacing it with the original file again?


the RWS_WhoIsWhere index file i'm talking about.

Replacing it in a binary upload wont ruin anything else on the website, right?

That was my question
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Sat Oct 04, 2008 8:48 am Reply with quote

It will not ruin anything else on your website.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - All Issues

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 ©