Fetched based on pWidth Fetched based on pWidth
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Fetched based on pWidth

Started by Tin0, March 30, 2008, 09:18:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tin0

Hi,

This is driveing me carzy, Cant find it out.


Is there a way to fetch
$objCpm->cpm_viewRandomMedia(3,2, $aOption);

Based on the images pWidth size?

Tin0

On my own, I got this, now... but Im not happy with it. It works, but its a sluppy way to do it.

function getLastAddedMediaFrom ($source, $count = 1) {
$resultset = array();
if (is_numeric($count)) {

$sourceSql = $this->makeSourceSql($source);

if ($sourceSql != "") $sourceSql = " AND " . $sourceSql;

$sqlcode = "SELECT {$this->sqlPostSelect} " . $this->sqlSelect . " FROM "
. $this->sqlTableSelect
. " WHERE 1 "
. $this->sqlUserDataLink
. $this->filetypefilter
. " AND p.approved='YES' AND p.pwidth='1024'  "


I added:
AND p.pwidth='1024'
to this code
" AND p.approved='YES' "
But was not sure where to do it, so I did what everyone with a brain would do..... Change all of them... It works, but is it possible to do this with a override function?

Best Regards,
Tin0