Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: SoNG klausimai

Parašė Dandžu· 2008 Lie. 6 16:07:28
#21

O tai šitas netinka? :?
if (isset($_REQUEST['logout']) && $_REQUEST['logout'] == "yes") {
   header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'");
   setcookie("fusion_user", "", time() - 7200, "/", "", "0");
   setcookie("fusion_lastvisit", "", time() - 7200, "/", "", "0");
   $result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_ip='".USER_IP."'");
   echo "<b>".$locale['192'].$userdata['user_name']."</b><br><br>\n";
} else {
   if (!isset($error)) $error = "";
   if ($error == 1) {
      echo "<b>".$locale['194']."</b><br><br>\n";
   } elseif ($error == 2) {
      echo "<b>".$locale['195']."</b><br><br>\n";
   } elseif ($error == 3) {
      echo "<b>".$locale['196']."</b><br><br>\n";
   } else {
      if (isset($_COOKIE['fusion_user'])) {
         $cookie_vars = explode(".", $_COOKIE['fusion_user']);
         $user_pass = (preg_match("/^[0-9a-z]{32}$/", $cookie_vars['1']) ? $cookie_vars['1'] : "");
         $user_name = preg_replace(array("/\=/","/\#/","/\sOR\s/"), "", stripinput($user));
         if (!dbcount("(user_id)", "users", "user_name='".$user_name."' AND user_password='".md5($user_pass)."'")) {
            echo "<b>".$locale['196']."</b><br><br>\n";
         } else {
            $result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'");
            echo "<b>".$locale['193'].$user."</b><br><br>\n";
         }
      }
   }
}