Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Fetched based on pWidth  (Read 4023 times)

0 Members and 1 Guest are viewing this topic.

Tin0

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Fetched based on pWidth
« on: March 30, 2008, 09:18:30 pm »

Hi,

This is driveing me carzy, Cant find it out.


Is there a way to fetch
Code: [Select]
$objCpm->cpm_viewRandomMedia(3,2, $aOption);
Based on the images pWidth size?
Logged

Tin0

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Fetched based on pWidth
« Reply #1 on: March 30, 2008, 09:55:06 pm »

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

Code: [Select]
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
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 15 queries.