• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Wyswietlanie MOTD w Gesior ACC

Status
Not open for further replies.

Nuklear

New Member
Joined
Mar 8, 2010
Messages
4
Reaction score
0
Jak napisać te funkcje żeby zapisywała MOTD z serwera ?

Próbowałem tak:
PHP:
preg_match('/motd="(\t+)"/', $data, $matches);
$config['status']['serverStatus_motd'] = $matches[1];

i w pliku zapisuje tylko:
serverStatus_motd = ""
 
no w config mam wpisane
motd = "Welcome to server!"
jeśli o to chodzi

jakos dziwnie to dziala w ogole np jak mamy:
PHP:
		preg_match('/players online="(\d+)" max="(\d+)"/', $data, $matches);
		$config['status']['serverStatus_online'] = 1;
		$config['status']['serverStatus_players'] = $matches[1];
		$config['status']['serverStatus_playersMax'] = $matches[2];
wszystko wyswietla jest ok


a zrobie takie cos żeby pokazywało np info o właścicielu:

PHP:
		preg_match('/owner name="(\t+)" email="(\t+)"/', $data, $matches);
		$config['status']['serverStatus_Owner_name'] = $matches[1];
		$config['status']['serverStatus_Owner_emial'] = $matches[2];

to zapisuje tak jak w motd "" ;/

moze te (\t+) jest zle ? ale nie wiem czym to zastapic.
 
@Up: puste miejsce zostaje

// dobra wyciaglem status z nicaw acc tam od razu wyciaga wyszstkie informacje do pliku xml potem tylko sprasować i ok

;/ czytalem manuala i takie cos naskrobalem:

PHP:
		preg_match('/(<motd>\w+)/', $data, $matches);
		$config['status']['serverStatus_motd'] = $matches[1];

efekt:
Code:
serverStatus_motd = "<motd>Welcome"
- ucina mi reszte i dopisalo <motd> /

\/ jakos tak to sie nazywa ;o
 
Last edited:
@Up: puste miejsce zostaje

// dobra wyciaglem status z nicaw acc tam od razu wyciaga wyszstkie informacje do pliku xml potem tylko sprasować i ok :)

Taa, to idz dalej prasowac te pliki XML :peace::ninja:
 
$config['server']['motd'] na bank musi wystarczyć ;p

$main_content .= nl2br($config['server']['motd']);

ew. czemu nie z bazy?

$a = $SQL->query('SELECT * FROM `server_motd`;');
foreach($a->fetchAll() as $b)
...
 
dobra dzięki elf działa źle wpisałem wcześniej ;o
 
Status
Not open for further replies.
Back
Top