(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-21-24 09:17 AM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Shitty PM system New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6303 days
Last view: 6301 days
Posted on 03-18-06 04:53 PM Link | Quote
Unless I'm mistaken, the PM system in v1.A2 sucks... If both members delete the same PM on both sides, the PM is STILL kept in the database, am I wrong ?

I'd like to make it so the PM is totally wiped from the database if both users have deleted it from their box... Anyone can help ?
I'm kind of confused about how things work at the moment.


if ($msg[userto]==$loguserid || $msg[userfrom]==$loguserid) {
if ($msg[userto]==$loguserid) {
$tofrom = "to";
} else {
$tofrom = "from";
}
mysql_query("UPDATE pmsgs SET folder$tofrom=".PM_DELETED." WHERE id=$id");
/* mysql_query("DELETE FROM pmsgs WHERE id=$id");
mysql_query("DELETE FROM pmsgs_text WHERE pid=$id");*/

It seems like the code that actually deletes PM for real got commented out... But that way, it would look like the PM would get deleted even if only one of the two users deletes it, which is also wrong.
I don't get the "PM_DELETE" part really, dunno how that works...

Anyone can help ? Thanks.

PS: Looks like there's a board bug here... I had to add <z> tags to prevent winking smilies to appear in my quote above, while they shouldn't even have appeared since it's not even their code... Try to quote me and remove the <z> if you wanna know what I mean...
Xeon
The master of the universe...


 





Since: 03-09-06
From: Omaha, NE

Last post: 6609 days
Last view: 6609 days
Posted on 03-19-06 06:29 AM Link | Quote
We should make an AcmlmBoard Programming Shit Talk thread, just because of all the negative things that are to be said about AcmlmBoard's programming.
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6303 days
Last view: 6301 days
Posted on 03-19-06 09:00 AM Link | Quote
That wasn't the point at all...
Parasyte +

Red Paragoomba


 





Since: 01-05-06

Last post: 6622 days
Last view: 6622 days
Posted on 03-19-06 09:35 AM Link | Quote
You can try something silly like this:



$tofromsel = array("to", "from");
if ($msg[userto]==$loguserid || $msg[userfrom]==$loguserid) {
if ($msg[userto]==$loguserid) {
$tofrom = 0;
} else {
$tofrom = 1;
}
mysql_query("UPDATE pmsgs SET folder$tofromsel[$tofrom]=".PM_DELETED." WHERE id=$id");
if (@mysql_result(@mysql_query("SELECT COUNT(*) FROM pmsgs WHERE folder$tofromsel[$tofrom]=".PM_DELETED." AND folder".$tofromsel[$tofrom ^ 1]."=".PM_DELETED." AND id=$id"), 0, 0)) {
mysql_query("DELETE FROM pmsgs WHERE id=$id");
mysql_query("DELETE FROM pmsgs_text WHERE pid=$id");
}

// ...



If any of the following code relies on the original $tofrom variable, this will not work. It also will not work if the database structure is any different since the code was commented. There is little I can do or say about that unless I take the time to actually look through the sources.


(edited by Parasyte + on 03-19-06 08:36 AM)
(edited by Parasyte + on 03-19-06 04:46 PM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6303 days
Last view: 6301 days
Posted on 03-19-06 11:24 AM Link | Quote
Yay it works !

Thanks a lot.
Parasyte +

Red Paragoomba


 





Since: 01-05-06

Last post: 6622 days
Last view: 6622 days
Posted on 03-19-06 05:45 PM Link | Quote
Come to think of it, it may be better to dump mysql_num_rows in favour of this:

if (@mysql_result(@mysql_query("SELECT COUNT(*) FROM pmsgs WHERE folder$tofromsel[$tofrom]=".PM_DELETED." AND folder".$tofromsel[$tofrom ^ 1]."=".PM_DELETED." AND id=$id"), 0, 0)) {


(edited by Parasyte + on 03-19-06 04:46 PM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6303 days
Last view: 6301 days
Posted on 03-19-06 08:09 PM Link | Quote
Mysql_num_rows ? Where was that ?

Anyway, I guess you mean I should just replace that 'if' with that new one... Alright. Thanks.

Edit: Actually, now that I'm sober, I notice that the 'if' you just posted is exactly the same one as before... Please enlighten me, I'm confused.
Parasyte +

Red Paragoomba


 





Since: 01-05-06

Last post: 6622 days
Last view: 6622 days
Posted on 03-20-06 04:02 PM Link | Quote
It it the same ... now. After I already updated it. Compare it to the one you are using.
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6303 days
Last view: 6301 days
Posted on 03-20-06 04:10 PM Link | Quote
I thought about that afterward...
Anyway, thanks again !
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - Programming - Shitty PM system |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.010 seconds; used 383.62 kB (max 466.10 kB)