FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » DB storage problems
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: DB storage problems [message #30246 is a reply to message #30234] Sun, 12 February 2006 23:46 Go to previous messageGo to previous message
willy is currently offline  willy   Hungary
Messages: 24
Registered: March 2005
Karma:
Junior Member
Thanks for your reply, and the patch.

Two other problem still not solved..

First:

pmsg.inc and pmsg_view.inc data query problem:

in read_pmsg_body():
        
        if ($GLOBALS['FUD_OPT_3'] & 32768 && $offset != -1) {
                        return q_singleval('SELECT data FROM fud_msg_store WHERE id='.$length);
        }


but offset is always -1 if $GLOBALS['FUD_OPT_3'] & 32768 because:
in fud_pmsg->add

                if ($GLOBALS['FUD_OPT_3'] & 32768) {
                      $this->foff = $this->length = -1;
                } else {


the first ($GLOBALS['FUD_OPT_3'] & 32768 && $offset != -1) condition never true.

cosmetic patch: change != to == in pmsg.inc and pmsg_view.inc read_pmsg_body, and pmsg body correctly retrieved from db.

Another:
The pmsg connectivity pmsg table length field multiple usage

first: contains length of message if stored on disk
(write_pmsg_body())


second: contains relations to msg_store table if pmsg data stored ind db

inc class fud_pmsg

method add

  if ($GLOBALS['FUD_OPT_3'] & 32768 && $this->body) {
    $fid = db_qid('INSERT INTO fud_msg_store(data) VALUES('._esc($this->body).')');
    q('UPDATE fud_pmsg SET length='.$fid.' WHERE id='.$id);
  }


and the storage query problem:
in pmsg.inc

   
 $disk_usage = q_singleval('SELECT SUM(length) FROM fud_pmsg WHERE duser_id='._uid);
 $percent_full = ceil($disk_usage / $MAX_PMSG_FLDR_SIZE * 100);


if msg is stored in db length field contains msg_store table id-s and
summary is false.

patching this maybe rewrite pmsg data handling similar to msg handling, but
i have not enought experience with your software.

Thanks for help
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: "Warning : you are not logged in" message
Next Topic: Hidden forum
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 20:31:57 GMT 2024

Total time taken to generate the page: 0.05329 seconds