PEAK XOOPS - problem with postcheck line? in englishin japanese

problem with postcheck line?

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/5 23:08
irmtfan  »°Åù·³Áâ   Posts: 96
when i add the line:
include( XOOPS_ROOT_PATH . '/modules/protector/include/postcheck.inc.php' ) ;
in mainfile.php
i have this error in any attempt for posting:

db connection failed.

xoops 2.2.4
mysql 4.0.25
php 4.3.11
Votes:4 Average:5.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/6 3:17
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi irmtfan.
Quote:
when i add the line:
include( XOOPS_ROOT_PATH . '/modules/protector/include/postcheck.inc.php' ) ;
in mainfile.php
i have this error in any attempt for posting:

db connection failed.
Check the position.

	include( XOOPS_ROOT_PATH . '/modules/protector/include/precheck.inc.php' ) ;

	if (!isset($xoopsOption['nocommon'])) {
		include XOOPS_ROOT_PATH."/include/common.php";
	}

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

It is necessary to add lines both postcheck and precheck.

Votes:6 Average:3.33
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/6 5:21
irmtfan  »°Åù·³Áâ   Posts: 96
from my mainfile.php:
define('XOOPS_GROUP_ADMIN', '1');

	define('XOOPS_GROUP_USERS', '2');

	define('XOOPS_GROUP_ANONYMOUS', '3');
  include( XOOPS_ROOT_PATH . '/modules/protector/include/precheck.inc.php' );
  if (!isset($xoopsOption['nocommon'])) {
		include XOOPS_ROOT_PATH."/include/common.php";
        include XOOPS_ROOT_PATH."/include/autologin.php";
	}
  include( XOOPS_ROOT_PATH . '/modules/protector/include/postcheck.inc.php' );
Votes:7 Average:5.71
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/6 6:40
GIJOE  ÀèǤ·³Áâ   Posts: 4110
It looks no problem.

+precheck
+postcheck
you say "DB connection failed"

+precheck
-postcheck
Is it OK?

Anyway try to turn XOOPS_DB_PCONNECT on/off.
define('XOOPS_DB_PCONNECT', 0);
Votes:25 Average:5.20
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/7 0:58
irmtfan  »°Åù·³Áâ   Posts: 96
yes with remove postcheck line thats ok.
Quote:
Anyway try to turn XOOPS_DB_PCONNECT on/off.

define('XOOPS_DB_PCONNECT', 0);

where is this constant?
set it to ON or OFF?
Votes:13 Average:3.08
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/7 4:34
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi irmtfan.
Quote:
yes with remove postcheck line thats ok.
It sounds odd again
Try this hack.

modules/protector/include/postcheck.inc.php
function protector_postcommon()
{
	global $xoopsUser , $xoopsDB , $xoopsModule ;

	// Protector class
	require_once( XOOPS_ROOT_PATH . '/modules/protector/class/protector.php' ) ;
	$db =& Database::getInstance() ;
	$protector =& Protector::getInstance( $db->conn ) ;
	$protector =& Protector::getInstance( $xoopsDB->conn ) ;
	$conf = $protector->getConf() ;


Quote:
Quote:
Anyway try to turn XOOPS_DB_PCONNECT on/off.

define('XOOPS_DB_PCONNECT', 0);
where is this constant?
set it to ON or OFF?
0 or 1.
If you run it with 0, try to change it into 1.
Votes:20 Average:6.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/7 23:51
irmtfan  »°Åù·³Áâ   Posts: 96
WOW... excellent hack... GIjoe you are rock...works fine now.
do you want to impeliment this hack for the next versions?
and i still cant find the constant:
define('XOOPS_DB_PCONNECT', 0);
where is this?
also a question:
how can i change/translate the "db connection failed" note?
it seems this text shows when the mysql server down.
Votes:2 Average:0.00

question Re: problem with postcheck line?

msg# 1.1.1.1.1.1.1.1
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/8 4:55
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi irmtfan.
Quote:
works fine now.
It sounds good!
Perhaps, your $GLOBALS['xoopsDB'] is broken by some reasons.

Quote:
do you want to impeliment this hack for the next versions?
I've already modified my repository of Protector SVN.

Quote:
and i still cant find the constant:
define('XOOPS_DB_PCONNECT', 0);
where is this?
in mainfile.php.

Quote:
also a question:
how can i change/translate the "db connection failed" note?
it seems this text shows when the mysql server down.
Certainly, the messages should be modified into language constants.
I'll fix it.

If you want to modify by yourself, edit class/protector.php
Votes:0 Average:0.00

question Re: problem with postcheck line?

msg# 1.1.1.1.1.1.1.1.1
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/8 20:10
irmtfan  »°Åù·³Áâ   Posts: 96
>>Perhaps, your $GLOBALS['xoopsDB'] is broken by some reasons.

what this meant? what is your guess about the reason and is this dangerous?

another question:
i see the metioned line in my mainfile.php:
define('XOOPS_DB_PCONNECT', 0);
now that my problem solved by useing the hack, is this necessary to change it to "1" or not?
Votes:0 Average:0.00

question Re: problem with postcheck line?

msg# 1.1.1.1.1.1.1.1.1.1
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/9 5:56
GIJOE  ÀèǤ·³Áâ   Posts: 4110
Quote:
irmtfan wrote:
>>Perhaps, your $GLOBALS['xoopsDB'] is broken by some reasons.

what this meant? what is your guess about the reason and is this dangerous?
I can't judge at all.
There are too many reasons - modules, core versions, hacks... -
Perhaps it is troublesome instead of dangerous.

Quote:
another question:
i see the metioned line in my mainfile.php:
define('XOOPS_DB_PCONNECT', 0);
now that my problem solved by useing the hack, is this necessary to change it to "1" or not?
You need not.
This is just a method for finding the causes.
Votes:6 Average:0.00

question Re: problem with postcheck line?

msg# 1.1.1.1.1.1.1.1.1.1.1
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/9 9:14
irmtfan  »°Åù·³Áâ   Posts: 96
thanks a lot
also i found "db connection failed" in include/precheck.inc.php
then you want to add a main.php file in lang folder?
Votes:6 Average:0.00

question Re: problem with postcheck line?

msg# 1.1.1.1.1.1.1.1.1.1.1.1
Previous post - Next post | Parent - No child | Posted on 2006/5/10 14:42
GIJOE  ÀèǤ·³Áâ   Posts: 4110
The reason why I have to write the parameter of die() in english is "the codes is placed before common.php".

Protector can't know $xoopsConfig['language'] .

If you look the message of 'db connection failed.' frequently, you'd better change the hosting service .

Votes:7 Average:0.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!