Autor Zpráva
Kouba
Profil
Dobrý den, mam takový problém,vždy když se chci přihlásit na stránce tak mi skočí chybová hláška "Fatal error: Call to a member function get() on a non-object in /home/a6548202/public_html/classes/class.login.php on line 88"

$hammer_stops_daily=$fmmemcache->get("{$SETTINGS['iden']}_hammer_stops_daily_{$check_login['id']}");
            if ($hammer_stops_daily === FALSE) $hammer_stops_daily=$check_login['hammer_stops_daily'];

            if ($hammer_stops_daily == '5000'){
                $message="You are hammering the site a bit much. This is a warning too slow down a little. You will get one more warning then a 24 hour freeze.";
                $forceUpdate=1;
                add_event($message, 'unknown', $check_login['id']);
                $curenttime = time();
                $this->mysql->query( "insert into hammer_log  set user_id =$check_login[id],hammer_stops = '5000', time='$curenttime' ");
            }
        
            else if ($hammer_stops_daily == '7500'){
                $message="This is your second warning. You are hammering the site a bit much. This is a warning to slow down a little. You will be frozen for 24 hours if you keep going as you are.";
                $forceUpdate=1;
                add_event($message, 'unknown', $check_login['id']);
                $curenttime = time();
                $this->mysql->query( "insert into hammer_log  set user_id =$check_login[id],hammer_stops = '7500', time='$curenttime' ");
            }


Za radu budu rád.Děkuji

Moderátor Chamurappi: Titulek „Fatal error“ nevystihuje podstatu dotazu. Příště zkus prosím vymyslet lepší.
Alphard
Profil
Před tím vaším kódem by mělo být nějaké
$fmmemcache = new XXX;
Co tam máte?
Kouba
Profil
$pages_to_skip = array("gpanel","train","point_shop","slot_machine","higher_lower");
			$actions_to_skip = array("use");

			$forceUpdate=0;
			$hammer_stops_daily=$fmmemcache->get("{$SETTINGS['iden']}_hammer_stops_daily_{$check_login['id']}");
			if ($hammer_stops_daily === FALSE) $hammer_stops_daily=$check_login['hammer_stops_daily'];
Kouba
Profil
Jestli vám to pomuže tak jsem ten kod mužu dát celej
Alphard
Profil
Dejte sem všechny řádky, kde se vyskytuje proměnná $fmmemcache.
Kouba
Profil
	function login($simple=0){
		global $mysql, $SETTINGS, $usememcache, $fmmemcache, $fmmemcachetime;;
		if (empty($cachetime)) $cachetime=$fmmemcachetime;
		$this->mysql=$mysql;
		


}

		if ($this->isfrozenbanned($check_login, 1)) return false;

		if ($usememcache){
		    $last_active=$fmmemcache->get("{$SETTINGS['iden']}_last_active_{$check_login['id']}");
		    if (!empty($last_active)){
				$check_login['last_active']=$last_active;
		    }

  if (!isset($_SESSION['showinactive']) && !isset($_REQUEST['inactive'])){
				if (!$simple){
					$fmmemcache->set("{$SETTINGS['iden']}_last_active_{$check_login['id']}", time(), false, 15*60); 


$forceUpdate=0;
			$hammer_stops_daily=$fmmemcache->get("{$SETTINGS['iden']}_hammer_stops_daily_{$check_login['id']}");
			if ($hammer_stops_daily === FALSE) $hammer_stops_daily=$check_login['hammer_stops_daily'];


if ( $forceUpdate == 1 ){
				if ($usememcache){
					$fmmemcache->set("{$SETTINGS['iden']}_hammer_stops_daily_{$check_login['id']}", ++$hammer_stops_daily, false, 15*60);  


}else{
				// lets update DB every 5 min..
				$last_db_update=$fmmemcache->get("{$SETTINGS['iden']}_last_active_db_{$check_login['id']}");
				if (intval($last_db_update) < strtotime('1 minute ago')){
					$fmmemcache->set("{$SETTINGS['iden']}_last_active_db_{$check_login['id']}", time(), false, 15*60); 


function logout(){
		global $SETTINGS,$fmmemcache,$usememcache;

		if ($usememcache){
		    $fmmemcache->delete("{$SETTINGS['iden']}_last_active_{$this->user['id']}");
		}
Alphard
Profil
$fmmemcache používá se nastavuje jako globální a používá se jako objekt. Ale nikde se ten objekt nevytváří.
Kouba
Profil
a jak se ten problém dá řešit?Jestli vůbec jde
Alphard
Profil
Psal to už v [#2].
$fmmemcache = new NazevTridy;
Já nemůžu vědět, jak se ta třída jmenuje.

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0