Quote from: davidm at Feb 18, 2008, 03:05 PM
I am wondering something... could I use the filesize table you help me add here and "inject" the result of the filesize into the filesize custom MG field ?
I hope I make sense here...
You can add the size_readable function in to maxigallery class in maxigallery.class.inc.php and then find this:
if($modx->getLoginUserID()!="" && $modx->getLoginUserType()=='web'){ //if web user is posting picture, put owner id
$rs1=$modx->db->query("INSERT INTO " . $this->pics_tbl . "(id, gal_id, filename, title, date, own_id) VALUES(NULL,'" . $this->pageinfo['id'] . "','" . $name . "',''," . $pic_date . ",'".$modx->getLoginUserID()."')");
}else{
$rs1=$modx->db->query("INSERT INTO " . $this->pics_tbl . "(id, gal_id, filename, title, date) VALUES(NULL,'" . $this->pageinfo['id'] . "','" . $name . "',''," . $pic_date . ")");
}
and replace it with:
if($modx->getLoginUserID()!="" && $modx->getLoginUserType()=='web'){ //if web user is posting picture, put owner id
$rs1=$modx->db->query("INSERT INTO " . $this->pics_tbl . "(id, gal_id, filename, title, date, own_id, filesize) VALUES(NULL,'" . $this->pageinfo['id'] . "','" . $name . "',''," . $pic_date . ",'".$modx->getLoginUserID()."','". $this->size_readable(filesize($this->path_to_gal."big_".$name)) . "')");
}else{
$rs1=$modx->db->query("INSERT INTO " . $this->pics_tbl . "(id, gal_id, filename, title, date, filesize) VALUES(NULL,'" . $this->pageinfo['id'] . "','" . $name . "',''," . $pic_date . ",'". $this->size_readable(filesize($this->path_to_gal."big_".$name)) . "')");
}