Hi,
I just want to know if it is possible to fetch last 4 updated albums with details like in the "cpm_showAlbumsUpdatedOverLastDays($numberOfDays,$options="")" (no. of lates files, album name, category name)
thanks
http://redlens.org
hi there,
i just want to update this query.
I want to know how to fetch only 4 updated albums instead of "ALL" updated albums since "date" thanks
http://forum.coppermine-gallery.net/index.php/topic,35221.msg197845.html#msg197845
sorry for that joachim...
i've already made a research but still no luck... i tried to put this code
<style type="text/css">.style {border:1px solid #CCC;}</style>
<?php require_once "./gallery/cpmfetch/cpmfetch.php"; $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php")
;$objCpm->cpm_setfilter($filter = ".jpg");
$options = array("imagewidth"=>"100","imageheight"=>"75","imageStyle"=>"style")
;$objCpm->cpm_showAlbumsUpdatedOverLastDays(7,$options); $albumstoshow = 3;
$objCpm->cpm_close();?>
and replace cpmfetch_dao.php code
function getMediaAddedSince ($timestamp) {
$resultset = array();
if (is_numeric($timestamp)) {
$sqlcode = "SELECT {$this->sqlPostSelect} " . $this->sqlSelect
. ', c.name AS cName, count( p.pid ) AS count '
. ' FROM '
. $this->sqlTableSelect
. " WHERE a.category = c.cid "
. $this->sqlUserDataLink
. " AND p.approved='YES' {$this->privacyfilter} AND p.ctime > " . $timestamp
. ' GROUP BY a.category, a.aid'
. ' ORDER BY c.name, p.mtime';
to this
function getMediaAddedSince ($timestamp) {
$resultset = array();
if (is_numeric($timestamp)) {
$sqlcode = "SELECT {$this->sqlPostSelect} " . $this->sqlSelect
. ', c.name AS cName, count( p.pid ) AS count '
. ' FROM '
. $this->sqlTableSelect
. " WHERE a.category = c.cid "
. $this->sqlUserDataLink
. " AND p.approved='YES' {$this->privacyfilter} AND p.ctime > " . $timestamp
. ' GROUP BY a.category, a.aid'
. ' ORDER BY p.ctime DESC';
but it is still showing "ALL" of the updated album...
thanks
i figured it out.
find in cpmfetch_dao
function getMediaAddedSince ($timestamp) {
$resultset = array();
if (is_numeric($timestamp)) {
$sqlcode = "SELECT {$this->sqlPostSelect} " . $this->sqlSelect
. ', c.name AS cName, count( p.pid ) AS count '
. ' FROM '
. $this->sqlTableSelect
. " WHERE a.category = c.cid "
. $this->sqlUserDataLink
. " AND p.approved='YES' {$this->privacyfilter} AND p.ctime > " . $timestamp
. ' GROUP BY a.category, a.aid'
. ' ORDER BY c.name, p.mtime';
$resultset = $this->dbExecuteSql($sqlcode);
$this->addPathInfo($resultset);
}
change to
function getMediaAddedSince ($timestamp) {
$resultset = array();
if (is_numeric($timestamp)) {
$sqlcode = "SELECT {$this->sqlPostSelect} " . $this->sqlSelect
. ', c.name AS cName, count( p.pid ) AS count '
. ' FROM '
. $this->sqlTableSelect
. " WHERE a.category = c.cid "
. $this->sqlUserDataLink
. " AND p.approved='YES' {$this->privacyfilter} AND p.ctime > " . $timestamp
. ' GROUP BY a.category, a.aid'
. ' ORDER BY p.ctime DESC LIMIT 3 ';
$resultset = $this->dbExecuteSql($sqlcode);
$this->addPathInfo($resultset);
}