1
tonyo
Parse error when installing Protector
  • 2007/12/19 22:04

  • tonyo

  • Just popping in

  • Posts: 14

  • Since: 2007/12/19


Hi, I'm a newbie who's starting a site for people who have a heart condition and I thought that XOOPS would work really well for us.

I've just installed XOOPS and I've been following Skenow's "Starting a new XOOPS site" tutorial in the Newbies forum, which is very good by the way.

Everything was going fine till I started installing Protector. I got to the bit where I needed to edit mainfile.php.

When, as instructed, I replace:

define('XOOPS_GROUP_ADMIN', '1');
define('XOOPS_GROUP_USERS', '2');
define('XOOPS_GROUP_ANONYMOUS', '3');


...with...

define('XOOPS_GROUP_ADMIN', '1');
define('XOOPS_GROUP_USERS', '2');
define('XOOPS_GROUP_ANONYMOUS', '3');

include( XOOPS_TRUST_PATH . '/modules/protector/include/precheck.inc.php' ) ;
if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '' ) {
include XOOPS_ROOT_PATH."/include/common.php";
}
include( XOOPS_TRUST_PATH . '/modules/protector/include/postcheck.inc.php' ) ;


...the site stops working and I get this message:

Parse error: syntax error, unexpected '<' in /var/home/prinzmetal/prinzmetal.org/www/mainfile.php on line 99

I also notice that different instructions on the Protector download page say...

After XOOPS Protector is installed, edit your mainfile.php like this:

include XOOPS_TRUST_PATH.'/modules/protector/include/precheck.inc.php' ;
if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '' ) {
include XOOPS_ROOT_PATH."/include/common.php";
}
include XOOPS_TRUST_PATH.'/modules/protector/include/precheck.inc.php' ;
if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '' ) {
include XOOPS_ROOT_PATH."/include/common.php";
}
include XOOPS_TRUST_PATH.'/modules/protector/include/postcheck.inc.php' ;

This doesn't seem to work for me either and I'm starting to get hopelessly confused.

Any ideas?

Many thanks,

Tony

2
stefan88
Re: Parse error when installing Protector
  • 2007/12/19 22:45

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,

use:
include( XOOPS_TRUST_PATH '/modules/protector/include/precheck.inc.php' ) ;
if (!isset(
$xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '' ) { 
include 
XOOPS_ROOT_PATH."/include/common.php"

include( 
XOOPS_TRUST_PATH '/modules/protector/include/postcheck.inc.php' ) ;


No .....
..

3
tonyo
Re: Parse error when installing Protector
  • 2007/12/20 0:10

  • tonyo

  • Just popping in

  • Posts: 14

  • Since: 2007/12/19


Thanks for that Stefan. However, when I pasted the code just below...

define('XOOPS_GROUP_ADMIN', '1');
define('XOOPS_GROUP_USERS', '2');
define('XOOPS_GROUP_ANONYMOUS', '3');

...none of my pages would appear at all. I didn't even get an error message - just a blank page.

Any other ideas?

Many thanks,

Tony

4
tonyo
Re: Parse error when installing Protector
  • 2007/12/27 15:13

  • tonyo

  • Just popping in

  • Posts: 14

  • Since: 2007/12/19


Bump! Hope you're all enjoying the holidays. If anyone can give me some idea why this doesn't work or what I may have done wrong I'd be most grateful.

Did I insert Stefan's code in the wrong place in the file or does that matter? Or have I made some other silly mistake?

Thanks,

Tony

5
kurak_bu
Re: Parse error when installing Protector
  • 2007/12/27 15:38

  • kurak_bu

  • Quite a regular

  • Posts: 342

  • Since: 2005/9/5 1



6
mboyden
Re: Parse error when installing Protector
  • 2007/12/27 15:50

  • mboyden

  • Moderator

  • Posts: 484

  • Since: 2005/3/9 1


In short, yes, you aren't getting the instructions correct for this module. If you follow the protector instructions carefully, you'll get it. There are 3 basic aspects to the installation:
1. Module
2. Trusted Root
3. Mainfile

I'm assuming you got the files properly installed in 1 and 2. 3 is where you're having problems (editing the mainfile). There are two main aspects to this:
A. Define Trusted Path
B. Add Protector Calls

A. Near the top, where you have XOOPS Root Path/URL Defined, you need to add the Trusted Path define statement. Note that this can go just about anywhere in the mainfile.php as long as it comes before B.
B. This is actually a "code replacement" or a wrapping of existing code.
Find:
if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
include 
XOOPS_ROOT_PATH."/include/common.php";
}

Replace with:
include( XOOPS_TRUST_PATH '/modules/protector/include/precheck.inc.php' );
if (!isset(
$xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
include 
XOOPS_ROOT_PATH."/include/common.php";
}
include(
XOOPS_TRUST_PATH '/modules/protector/include/postcheck.inc.php');


So, realistically, it's just 3 lines of code and then the install of the module files per the instructions. Clear as mud?
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development

7
tonyo
Re: Parse error when installing Protector
  • 2007/12/29 20:39

  • tonyo

  • Just popping in

  • Posts: 14

  • Since: 2007/12/19


Thanks chaps, that did the trick! I'm not sure quite what I did wrong before. Anyway, it seems to be working now.

Many thanks,

Tony

Login

Who's Online

306 user(s) are online (245 user(s) are browsing Support Forums)


Members: 0


Guests: 306


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits