Znote / ZnoteAAC

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

Guild Invite Character #469

Closed kungen32 closed 3 years ago

kungen32 commented 3 years ago

Hello,

I have downloaded 1 Week ago the znote account, when i try to ' invite character ' on a guild, the page load, load load infinity, without inviting a character, i am using a custom webpage, i didnt know if we need add any sql line on the database about this, is same as when anyone report a bug ' Add Shop Points' , page load , load , load without giving points to the character.

Ps: I have downloaded again the znote, reemplaced guild.php and is same, is not searching for a player, i try differents names, i am using TFS 1.3 OtservBR , sql + sql znote has been imported

There is a video: https://imgur.com/iNeRnvg

There is my script: https://pastebin.com/ESdu8Ea3

Znote commented 3 years ago

Could it be an issue with the layout? Have you tried this using the default layout?

kungen32 commented 3 years ago

Hello znote,

Yes i have tried CLEAN installation of Znote, got an error in SQL , the chance, is now i see the error ( before no )

String(72)"Insert Into guild_invites(player_id,guild_id)VALUES("26","3")" (query - SQL Error) Type: voidQuery (voidQuery is used for update, insert or delete from database= Fiel 'date' doesn't have a default value Here is the video: https://imgur.com/ISk8Pui

kungen32 commented 3 years ago

Appear with last TFS 1.3 Otservbr 12.64 this error, Is Date column giving an error ?

Znote commented 3 years ago

Take a backup of your database, then run this command:

CREATE TRIGGER guild_invites_date BEFORE INSERT ON guild_invites FOR EACH ROW SET new.date = UNIX_TIMESTAMP(NOW());

Or replace this function: https://github.com/Znote/ZnoteAAC/blob/855c889568e9f07f5413837cf4ee4ad8f8df3e01/engine/function/users.php#L406-L411

With this:

// Invite character to guild
function guild_invite_player($cid, $gid) {
    $cid = (int)$cid;
    $gid = (int)$gid;
    mysql_insert("INSERT INTO `guild_invites` (`player_id`, `guild_id`, `date`) VALUES ('$cid', '$gid', UNIX_TIMESTAMP(NOW()))");
}
Znote commented 3 years ago

@kungen32 I would love your feedback on this. Was it a success? Which method did you use?

kungen32 commented 3 years ago

Hello @znote , i dont do any changes and now i can invite.

I test a clean database but i didnt understand all, in accounts using znote default we got like 4-6 columns, 3 month before i installed thi database and i got like 15 columns.. date etc, this one not appears using normal znote, well.

Is working for now also, like someone mencioned maybe change layout, i have finished to converted the most beautiful layout for znote today, and it's very... beautiful. Maybe i will share it on otland.

I keep in mind this code if happens again, thanks for your help

https://imgur.com/ldwJPpd

Ps: Znote is the best web of all.

Znote commented 3 years ago

Hello @Znote , i dont do any changes and now i can invite.

I test a clean database but i didnt understand all, in accounts using znote default we got like 4-6 columns, 3 month before i installed thi database and i got like 15 columns.. date etc, this one not appears using normal znote, well.

Some database schema imports clutter database with custom gesior based columns etc, Znote AAC is clean and doesn't touch original tables, only adds separate znote_ extension tables. When database gets cluttered with columns from other aacs, they also break some Znote AAC functionality. Since Znote AAC expects clean tables when importing data.

Is working for now also, like someone mencioned maybe change layout, i have finished to converted the most beautiful layout for znote today, and it's very... beautiful. Maybe i will share it on otland.

I keep in mind this code if happens again, thanks for your help

https://imgur.com/ldwJPpd

Ps: Znote is the best web of all.

Nice, thanks. :)