/**
  *	Option: Home
  *	Show the account informations
  *
  *	@return	void
  */
 public function Home()
 {
     $GLOBALS['userpanel']['home_informations']['member_id'] = "#" . $this->userData['info']['memb_guid'];
     $GLOBALS['userpanel']['home_informations']['member_login'] = $this->userData['info']['memb___id'];
     $GLOBALS['userpanel']['home_informations']['member_coin'][1] = number_format($this->userData['coin'][COIN_COLUMN_1], 0, false, ".");
     $GLOBALS['userpanel']['home_informations']['member_coin'][2] = number_format($this->userData['coin'][COIN_COLUMN_2], 0, false, ".");
     $GLOBALS['userpanel']['home_informations']['member_coin'][3] = number_format($this->userData['coin'][COIN_COLUMN_3], 0, false, ".");
     $GLOBALS['userpanel']['home_informations']['member_level'] = $this->functions->AccountLevel($this->userData['vip'][VIP_COLUMN]);
     $GLOBALS['userpanel']['home_informations']['member_vip']['begin'] = $this->functions->MakeVIPTime($this->userData['vip'][VIP_BEGIN]);
     $GLOBALS['userpanel']['home_informations']['member_vip']['end'] = $this->functions->MakeVIPTime($this->userData['vip'][VIP_TIME]);
     $GLOBALS['userpanel']['home_informations']['member_birth'] = $this->userData['info']['MemberBirth'];
     $GLOBALS['userpanel']['home_lastconnection']['date'] = date("d/m/Y", $lastConnectionTime = strtotime($this->userData['stat']['ConnectTM']));
     $GLOBALS['userpanel']['home_lastconnection']['hour'] = date("H:i:s", $lastConnectionTime);
     $GLOBALS['userpanel']['home_lastconnection']['server'] = $this->functions->GetServerName($this->userData['stat']['ServerName']);
     $GLOBALS['userpanel']['home_lastconnection']['ip'] = $this->userData['stat']['IP'];
     $GLOBALS['userpanel']['home_lastconnection']['status'] = $this->userData['stat']['ConnectStat'];
     $queryString = "SELECT " . MUGEN_CORE . ".dbo.Character.Name, " . MUGEN_CORE . ".dbo.Character.Class, " . MUGEN_CORE . ".dbo.Character.cLevel";
     $queryString .= ", " . MUGEN_CORE . ".dbo.GuildMember.G_Name FROM " . MUGEN_CORE . ".dbo.Character LEFT JOIN " . MUGEN_CORE . ".dbo.GuildMember";
     $queryString .= " ON (" . MUGEN_CORE . ".dbo.GuildMember.Name = " . MUGEN_CORE . ".dbo.Character.Name) WHERE " . MUGEN_CORE . ".dbo.Character.AccountID = '%s'";
     $this->DB->Arguments(USER_ACCOUNT);
     $this->DB->Query($queryString, $accountChars);
     if ($this->DB->CountRows($accountChars) > 0) {
         $GLOBALS['userpanel']['home_characters'] = array();
         while ($charData = $this->DB->FetchObject($accountChars)) {
             $GLOBALS['userpanel']['home_characters'][] = array("name" => $charData->Name, "class" => $this->functions->ClassInfo($charData->Class), "level" => $charData->cLevel, "guild" => strlen($charData->G_Name) > 0 ? $charData->G_Name : $this->lang->words['Words']['None']);
         }
     }
     if ($this->userData['info']['bloc_code'] == 1 && $this->userData['info']['MemberStatus'] == 0) {
         $this->DB->Arguments(USER_ACCOUNT);
         $accountBlockInfoQ = $this->DB->Select("Responsible,Expiration,Reason", "CTM_AccountsBanneds", "Account = '%s'");
         if ($this->DB->CountRows($accountBlockInfoQ) > 0) {
             $accountBlockInfo = $this->DB->FetchObject($accountBlockInfoQ);
             $GLOBALS['userpanel']['home_block_info']['responsible'] = $accountBlockInfo->Responsible;
             $GLOBALS['userpanel']['home_block_info']['expiration'] = date("d/m/Y - H:i", $accountBlockInfo->Expiration);
             $GLOBALS['userpanel']['home_block_info']['reason'] = CTM_Text::UTF8Text($accountBlockInfo->Reason);
         } else {
             $GLOBALS['userpanel']['home_block_info']['responsible'] = $this->lang->words['Words']['None'];
             $GLOBALS['userpanel']['home_block_info']['expiration'] = $this->lang->words['Words']['Never'];
             $GLOBALS['userpanel']['home_block_info']['reason'] = $this->lang->words['Words']['None'];
         }
     }
     $GLOBALS['userpanel']['home_chars_blocked'] = array();
     $queryString = "SELECT " . MUGEN_CORE . ".dbo.Character.Name, CTM_CharactersBanneds.Expiration FROM " . MUGEN_CORE . ".dbo.Character";
     $queryString .= " LEFT JOIN dbo.CTM_CharactersBanneds ON (CTM_CharactersBanneds.Account = " . MUGEN_CORE . ".dbo.Character.AccountID)";
     $queryString .= " WHERE " . MUGEN_CORE . ".dbo.Character.AccountID = '%s' AND CtlCode = 1";
     $this->DB->Arguments(USER_ACCOUNT);
     $charsBlockedQ = $this->DB->Select("Name", MUGEN_CORE . "@Character", "AccountID = '%s' AND CtlCode = 1");
     if ($this->DB->CountRows($charsBlockedQ) > 0) {
         while ($charsBlocked = $this->DB->FetchArray($charsBlockedQ)) {
             $this->DB->Arguments($charsBlocked['Name']);
             $findExpiration = $this->DB->Select("Expiration", "CTM_CharactersBanneds", "Character = '%s'");
             $findExpiration = $this->DB->CountRows($findExpiration) > 0 ? $this->DB->FetchRow($findExpiration) : array(0);
             $expiration = strlen($findExpiration[0]) != 10 ? $this->lang->words['Words']['Ever'] : date("d/m/Y - H:i", $findExpiration[0]);
             $GLOBALS['userpanel']['home_chars_blocked'][] = sprintf($this->lang->words['UserPanel']['Home']['CharBlocked'], $charsBlocked['Name'], $expiration);
         }
     }
 }
示例#2
0
 /**
  *	Send Mail
  *
  *	@return	boolean
  */
 public function SendMail()
 {
     $this->WriteDebug("Start Mailer");
     if ($this->loadCheckVars() == false) {
         $this->FinishCommand();
         return false;
     }
     if ($this->SendMethod == 1) {
         if ($this->loadSMTPData() == false) {
             $this->FinishCommand();
             return false;
         }
         $this->PHPMailer->IsSMTP();
         $this->PHPMailer->Host = $this->SMTPHost;
         $this->PHPMailer->Port = $this->SMTPPort;
         $this->PHPMailer->Username = $this->SMTPUser;
         $this->PHPMailer->Password = $this->SMTPPass;
         $this->PHPMailer->SMTPKeepAlive = TRUE;
     } else {
         $this->PHPMailer->IsMail();
     }
     $this->PHPMailer->SetFrom($this->FromMail[0], CTM_Text::UTF8Text($this->FromMail[1]));
     $this->WriteDebug("Mailer method: " . ($this->SendMethod == 1 ? "SMTP" : "PHP mail()"));
     $this->WriteDebug("E-Mail subject: " . (!$this->vars['subject'] ? "NULL" : $this->PHPMailer->Subject));
     $this->WriteDebug("E-Mail from: " . ($this->FromMail[1] ? CTM_Text::UTF8Text($this->FromMail[1]) . " <" . $this->FromMail[0] . ">" : $this->FromMail[0]));
     foreach ($this->data['address'] as $value) {
         $this->WriteDebug("Send e-mail to: " . ($value[1] ? $value[1] . " <" . $value[0] . ">" : $value[0]));
     }
     if (!$this->PHPMailer->Send()) {
         $this->WriteDebug($this->PHPMailer->ErrorInfo);
         $this->FinishCommand();
         return false;
     } else {
         $this->WriteDebug("E-Mail(s) sended with success");
         $this->FinishCommand();
         return true;
     }
 }
 /**
  *	Send Global Message
  *	Send a global message by the JoinServer
  *
  *	@param	string	Message
  *	@return	void
  */
 public function SendGlobalMessage($message)
 {
     if ($this->settings['JoinServer'] != "WZ") {
         return false;
     }
     if (!$this->started) {
         if (!$this->init()) {
             return false;
         }
     }
     if (strlen($message) > 34) {
         $message = substr($message, 0, 34);
     }
     $packet = $this->packetsGlobMsg['WZ'] . "0024000000";
     $packet .= str_pad($this->loadConvertASCIIToHexa(CTM_Text::UTF8Text($message)), 68, 0, STR_PAD_RIGHT);
     $packet = $this->loadConvertHexaToASCII($packet . str_repeat("00", 26));
     $this->socket->WritePack($packet);
     $this->socket->CloseSocket();
     $this->started = false;
     return true;
 }
 /**
  *	Get Server Name
  *	Get the real server name
  *
  *	@param	string	GameServer
  *	@return	string
  */
 public function GetServerName($GameServer)
 {
     $GameServer = !is_numeric($GameServer) ? $this->GetServerID($GameServer) : $GameServer;
     if (!array_key_exists($GameServer, $this->settings['SERVERLIST']['ROOM_LIST'])) {
         return $GameServer;
     } else {
         return CTM_Text::UTF8Text($this->settings['SERVERLIST']['ROOM_LIST'][$GameServer][1]);
     }
 }
示例#5
0
 /**
  *	Board Notices Data
  *	Get notice from Board System
  *
  *	@param	array	Settings
  *	@return	array	Result
  */
 private function loadBoardNoticesData($data)
 {
     $this->DB->settings['mysql']['hostname'] = $this->config['MySQL']['HOST'];
     $this->DB->settings['mysql']['hostport'] = $this->config['MySQL']['PORT'];
     $this->DB->settings['mysql']['username'] = $this->config['MySQL']['USER'];
     $this->DB->settings['mysql']['password'] = $this->config['MySQL']['PASS'];
     $this->DB->settings['mysql']['database'] = $this->config['MySQL']['DATA'];
     $this->DB->settings['mysql']['log_folder'] = "MySQL";
     $this->DB->settings['mysql']['debug'] = in_array("mysql", explode(",", CTM_SQL_DEBUG_MODE));
     $this->DB->settings['mysql']['hideErrors'] = TRUE;
     if ($this->DB->Connect("mysql")) {
         $query = "SELECT * FROM " . $this->config['PREFIX'] . $data['TABLE'] . " WHERE ";
         for ($i = 1; $i <= sizeof($this->config['FORUM_ID']); $i++) {
             $this->DB->MySQL()->Arguments($this->config['FORUM_ID'][$i - 1]);
             if ($i < count($this->config['FORUM_ID'])) {
                 $query .= $data['FORUM_COLUMN'] . " = %d OR ";
             } else {
                 $query .= $data['FORUM_COLUMN'] . " = %d ";
             }
         }
         $query .= "ORDER BY " . $data['ID_COLUMN'] . " DESC LIMIT " . $this->config['LIMIT'];
         $this->DB->MySQL()->Arguments($this->config['LIMIT']);
         if ($topics = $this->DB->MySQL()->Query($query)) {
             if ($this->DB->MySQL()->CountRows($topics) > 0) {
                 $notices = array();
                 while ($notice = $this->DB->MySQL()->FetchObject($topics)) {
                     if (isset($data['POST']) && is_array($data['POST'])) {
                         $this->DB->MySQL()->Arguments($data['POST']['TITLE'], $data['POST']['DATE'], $this->config['PREFIX'] . $data['POST']['TABLE']);
                         $this->DB->MySQL()->Arguments($data['POST']['TOPIC_ID'], $notice->{$data['ID_COLUMN']}, $data['POST']['ID']);
                         $query = $this->DB->MySQL()->Query("SELECT %s,%s FROM %s WHERE %s = %d ORDER BY %s ASC");
                         $fetch = $this->DB->MySQL()->FetchObject($query);
                         $title = $fetch->{$data['POST']['TITLE']};
                         $date = $fetch->{$data['POST']['DATE']};
                     } else {
                         $title = $notice->{$data['TITLE']};
                         $date = $notice->{$data['DATE']};
                     }
                     $link = $this->config['LINK'];
                     $link .= substr($this->config['LINK'], strlen($this->config['LINK']) - 1, 1) != "/" ? "/" : NULL;
                     $link .= $data['LINK'] . "=" . $notice->{$data['ID_COLUMN']};
                     $notices[] = array("title" => $this->config['UTF8_DECODE'] == true ? CTM_Text::UTF8Text($title) : $title, "postDate" => date("d/m/Y - h:i a", $date), "topicLink" => $link);
                 }
                 $this->DB->Clear(true, true);
                 return $notices;
             } else {
                 $this->DB->Clear(true, true);
                 return 255;
             }
         }
         $this->DB->Clear(true, true);
         $this->DB->MySQL()->Close();
     }
     return false;
 }