Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
146 stars 127 forks source link

Errors and Corrections #19

Closed TheMegafuji closed 10 years ago

TheMegafuji commented 10 years ago

Register.php is giving Username is already registred a lot of times. to fix change user_exist function in engine/functions/users.php to this:

function user_exist($username) { $username = sanitize($username); $data = mysql_select_single("SELECT id FROM accounts WHERE name='$username';"); return ($data !== false) ? true : false; }

This error: string(43) "SELECT name FROM players WHERE id = ;" (query - SQL error) Type: select_single (select single row from database)

Is fixed by: engine/functions/users.php function fetchAllNews(): Change for ($i = 0; $i < count($data); $i++) { to for ($i = 1; $i < count($data); $i++) {

Admin creating a new, when its not created, fixed by: change all mysql_query to mysql_update if its an update query mysql_insert if its an insert query mysql_delete if its an delete query

exura commented 10 years ago

Not sure if you fix on fetchAllNews will work if there actually is one player online? I put it all in an if-clause,

function fetchAllNews() { $data = mysql_select_multi("SELECT * FROM znote_news ORDER BY id DESC;"); if ($data !== False) { for ($i = 0; $i < count($data); $i++) { $cd = user_character_data($data[$i]['pid'], 'name'); $data[$i]['name'] = $cd['name']; unset($data[$i]['pid']); } return $data; } }

Znote commented 10 years ago

All these should be fixed now.