• 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!

Problem z zakładaniem konta

Status
Not open for further replies.

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
743
Solutions
5
Reaction score
200
Location
Pr0land
GitHub
Erexo
Witam,
mam taki problem, otóż gdy zakładam konto, w DB account wpisuje w "ID", a na moim DB jest tak, że ID to liczba porządkowa, i jest sporządzona nowa tabela o nazwie "name", w której jest zapisany account number (gdy robię konto, zostawia tą tabele pustą).

I moje pytanie jest takie, umiałby mi ktoś podesłać DB pod tibię 8.40-8.42 gdzie account number wyczytuje z "ID"?

Lub dodać do "createaccount.php", by w polu "name" wpisywało account number jaki wpisaliśmy.

Tutaj jak to jest zrobione:

PHP:
// ----------creates account-------------(save in database)
	if(empty($reg_form_errors))
	{
		//create object 'account' and generate new acc. number
		$reg_account = $ots->createObject('Account');
		if($config['site']['account_number'] == 'custom')
			$number = $reg_account->create($posted_reg_account, $posted_reg_account);
		else
			$number = $reg_account->create();
		// saves account information in database
		$reg_password = password_ency($reg_password);
		$reg_account->setPassword($reg_password);
		$reg_account->setEMail($reg_email);
		$reg_account->unblock();
		$reg_account->save();
		$reg_account->setCustomField("created", time());
		$reg_account->setCustomField("premdays", $config['site']['newaccount_premdays']);
		$reg_account->setCustomField("lastday", time());


Bardzo proszę o pomoc :)

Pozdrawiam,
Erexo.
 
Czy dobrze rozumiem? Chcesz uzywac ID recordu jako account number? Jesli tak, to jaki to ma sens? Jesli nie to wytlumacz jeszcze raz.

@edit
Chyba rozumiem, chcesz aby uzytkownik byl wstanie wpisac swoj wlasny account number tak?
 
@up
nie nie nie...

Player wpisuje acc number własny, lecz to co wpisze (dajmy na to 111111), w DB wpisuje się w tabeli o nazwie "ID",
a mój ots pobiera acc number z tabeli "name" (która jest pusta, bo acc number wpisuje się w "ID").

Dlatego chciałbym aby acc number wpisywał się też w tabeli "name"

Rozumiesz?
 
No to widocznie masz cos zepsute. Probowales po prostu dac w configu account_number na custom?

Jesli nie, to sproboj po prostu dopisac:
PHP:
$reg_account->setCustomField("name", $posted_reg_account);

Teoretycznie powinno smigac, nie wiem, nie pamietam metod POT.
 
Sie zobaczy czy działa, na tym kompie nie mam dostępu do dedyka, w każdym razie + dla Ciebie za chęci :)

Dzięki wielkie

@edit
Działa w 100% tak jak chciałem (trochę to dziwnie wygląda, ale ważne że działa xD)

Dzięki jeszcze raz...
 
Last edited:
Status
Not open for further replies.
Back
Top