Messed up my private message file... [message #13973] |
Sun, 02 November 2003 18:56 |
dai03
Messages: 7 Registered: November 2003
Karma: 0
|
Junior Member |
|
|
I have my private message file and database all out of sync...
Would it be safe to delete everything from the fud21_pmsg table and set the private file back to 0 length to get it working again? Or will it break something else?
I tried running the consistancy checker and it didn't seem to fix anything and as it is now all private messages show up as having no text even though I see the text in the private file.
Thanks!!
[Updated on: Mon, 03 November 2003 02:03] Report message to a moderator
|
|
|
Re: Messed up my private message file... [message #13974 is a reply to message #13973] |
Sun, 02 November 2003 19:01 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
If you remove all data from the fud_pmsg table that'll allow you to start from scratch as far as private messages are concerned. Do you know what caused the 2 to get out of sync originally?
FUDforum Core Developer
|
|
|
|
Re: Messed up my private message file... [message #13976 is a reply to message #13975] |
Sun, 02 November 2003 19:21 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
When people delete messages the data file is not modified. It is only modified if you run the compactor script. The error you describe could be result of incorrect permissions. I suspect when you moved the server the private file was created in such a way that the webserver could not read/write to it.
FUDforum Core Developer
|
|
|
|
Re: Messed up my private message file... [message #13980 is a reply to message #13978] |
Sun, 02 November 2003 19:33 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Create a new private message, once that is done, go to your MySQL and get the info on the last entry inside the pmsg table. Specifically look @ the offset and length fields.
FUDforum Core Developer
|
|
|
Re: Messed up my private message file... [message #13981 is a reply to message #13980] |
Sun, 02 November 2003 19:38 |
dai03
Messages: 7 Registered: November 2003
Karma: 0
|
Junior Member |
|
|
It's weird, the ofset is correct, but the length is being set as 0!
| 12720 | DAI '03; | 1 | 1 | 0 | 216.98.166.146 | NULL | 1067801700 | 1067801711 | No-Msg.gif | Y | INBOX | Test again | 0 | Y | N | N | 675 | 0 | N | NULL |
BTW:
Even though ther is a No-Msg.gif icon, there was some text entered into the message body!
[Updated on: Sun, 02 November 2003 19:45] Report message to a moderator
|
|
|
Re: Messed up my private message file... [message #13983 is a reply to message #13981] |
Sun, 02 November 2003 19:48 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
That would be the cause of the problem....
I suspect your forum is affected by a bug in the old private message writing code that is triggered on some PHP versions.
If you can paste me the private message writing code from your forum (private.inc.t), I could suggest an alternative.
FUDforum Core Developer
|
|
|
|
|
Re: I'm fixing to have to travel away from the computer for a while... [message #13987 is a reply to message #13985] |
Sun, 02 November 2003 20:24 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
1) In the future please do not paste files into messages, attach them instead it makes my life much easier.
As for the fix try the following, replace this:
<?php unction write_pmsg_body($text) { $fp = fopen($GLOBALS['MSG_STORE_DIR'].'private', 'ab');
if( !($s = ftell($fp)) ) $s = __ffilesize($fp);
fwrite($fp, $text); fflush($fp); $len = (ftell($fp)-$s); fclose($fp);
if( !$s ) chmod($GLOBALS['MSG_STORE_DIR'].'private', 0600);
return array($s,$len); } ?>
with
<?php $fp = fopen($GLOBALS['MSG_STORE_DIR'].'private', 'ab');
fseek($fp, 0, SEEK_END); if (!($s = ftell($fp))) { $s = __ffilesize($fp); }
if (($len = fwrite($fp, $text)) !== strlen($text)) { exit("FATAL ERROR: system has ran out of disk space \n"); } fclose($fp);
return array($s, $len); ?>
However, I'd strongly recommend upgrading your FUDforum version.
FUDforum Core Developer
|
|
|
|
|