#17288 - 05/20/08 01:53 AM
Guild Deny Not Working
|
Dephuze
Grape Nuts
Registered: 05/04/08
Posts: 27
|
Offline
|
|
Mm yeah, when someone applies for the guild, you can't deny him/her.
Any fixes?
|
|
Top
|
|
|
#17289 - 05/20/08 07:45 AM
Re: Guild Deny Not Working
[Re: Dephuze]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
Does this really happen?
|
|
Top
|
|
|
#17291 - 05/20/08 09:38 AM
Re: Guild Deny Not Working
[Re: AnmanIndustries]
|
Dephuze
Grape Nuts
Registered: 05/04/08
Posts: 27
|
Offline
|
|
Yes sir!
Well, my friend just told me it happened. When he tried to deny someone from his guild, it shows the typical MySQL error page: "MySQL query error has occured.." or something like that.
|
|
Top
|
|
|
#17292 - 05/20/08 09:44 PM
Re: Guild Deny Not Working
[Re: Dephuze]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
It helps, if we can SEE this message.
|
|
Top
|
|
|
#17294 - 05/21/08 12:42 AM
Re: Guild Deny Not Working
[Re: Dephuze]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
HAHAHAHAH. Ok. Thats not what I was expecting. I meant the ACTUAL SQL error.
|
|
Top
|
|
|
#17295 - 05/21/08 05:33 PM
Re: Guild Deny Not Working
[Re: AnmanIndustries]
|
Whiz
Cheerios
Registered: 10/28/07
Posts: 129
|
Offline
|
|
The bit of code you are looking for is in guilds.php
// Do stuff. if (isset($_POST["approve"])) { $updatemem = doquery("UPDATE <<users>> SET guild='".$userrow["guild"]."', guildrank='1', guildtag='".$guild["tagline"]."', tagcolor='".$guild["color1"]."', namecolor='".$guild["color2"]."' WHERE id='".$app["charid"]."' LIMIT 1"); $updateguild = doquery("UPDATE <<guilds>> SET members=members+1 WHERE id='".$userrow["guild"]."' LIMIT 1"); $deleteapp = doquery("DELETE FROM <<guildapps>> WHERE guild='".$userrow["guild"]."' AND charid='$charid' LIMIT 1"); $send = doquery("INSERT INTO <<messages>> SET id='', postdate=NOW(), senderid='0', sendername='".$guild["name"]."', recipientid='$charid', recipientname='".$member["charname"]."', status='0', title='Guild Approval', message='The Guild has approved you for membership, and you are now a member of ".$guild["name"].". Congratulations!<br /><br /><b>Do not reply to this message!</b>', gold='0'"); guildupdate(); display("Approve Members", "Thank you for approving this user.<br /><br />You may now return to <a href=\"index.php\">Town</a> or to your <a href=\"index.php?do=guildhome\">Guild Hall</a>."); } else { $deleteapp = doquery("DELETE FROM <<guilds>> WHERE guild='".$userrow["guild"]."' AND charid='$charid' LIMIT 1"); $send = doquery("INSERT INTO <<messages>> SET id='', postdate=NOW(), senderid='0', sendername='".$guild["name"]."', recipientid='$charid', recipientname='".$member["charname"]."', status='0', title='Guild Denial', message='The Guild has denied your application for membership. Sorry.<br /><br /><b>Do not reply to this message!</b>', gold='0'"); display("Approve Members", "Thank you for denying this user.<br /><br />You may now return to <a href=\"index.php\">Town</a> or to your <a href=\"index.php?do=guildhome\">Guild Hall</a>."); }
Specifically: $deleteapp = doquery("DELETE FROM <<guilds>> WHERE guild='".$userrow["guild"]."' AND charid='$charid' LIMIT 1");
needs to be:
$deleteapp = doquery("DELETE FROM <<guildapps>> WHERE guild='".$userrow["guild"]."' AND charid='$charid' LIMIT 1");
Note: I haven't tested this at all, but it appears as if the stock code is trying to delete an entire guild that matches $userrow["guild"] and $charid. A the guild table doesn't have a charid column, so an error is given.
The fix was to simply swap out <<guild>> with <<guildapps>>.
Edited by AnmanIndustries (10/16/08 08:51 PM) Edit Reason: giant php code ruins forum format
|
|
Top
|
|
|
#18505 - 10/16/08 10:35 AM
Re: Guild Deny Not Working
[Re: Whiz]
|
gamefreak888
Rice Krispies
Registered: 09/06/07
Posts: 215
|
Offline
|
|
Open: guilds.php
Find (in the guildleave() function):
$guild = dorow(doquery("SELECT * FROM {{table}} WHERE id='".$userrow["guild"]."' LIMIT 1", "guilds"));
Replace with:
$guild = dorow(doquery("SELECT * FROM <<guilds>> WHERE id='".$userrow["guild"]."' LIMIT 1"));
That'll do it.
|
|
Top
|
|
|
|
|