(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
06-26-24 01:02 PM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Shitty PM system
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
Stifu
Posts: 203/647
I thought about that afterward...
Anyway, thanks again !
Parasyte +
Posts: 47/53
It it the same ... now. After I already updated it. Compare it to the one you are using.
Stifu
Posts: 202/647
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 +
Posts: 45/53
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)) {
Stifu
Posts: 199/647
Yay it works !

Thanks a lot.
Parasyte +
Posts: 43/53
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.
Stifu
Posts: 197/647
That wasn't the point at all...
Xeon
Posts: 26/70
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
Posts: 196/647
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...
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.011 seconds; used 351.55 kB (max 393.20 kB)