Using CpmFetch to display thumbnails by using the "sort my pictures" override Using CpmFetch to display thumbnails by using the "sort my pictures" override
 

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

Using CpmFetch to display thumbnails by using the "sort my pictures" override

Started by troystump, July 31, 2010, 05:10:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

troystump

Hello there,

I have modified CpmFetch and created a dynamic pagination script that grabs all the images in an album and displays them all in ascending order (by usage of each image's pid) at 20 per "page". Obviously, the "my picture sorting" tool in CPG overrides this image pid sorting and I have read documentation and was wondering if there is any such code i could use to pull that same "my picture sorting" override using a cpmfetch function. I understand this probably isn't possible (nor recommended by CPG), but does anyone have an idea to get this to work? My working cmpfetch gallery script can be seen in action under the "fashion" link at http://www.jeffstump.com here is the function i have currently edited in the file cmpfetch_dao.php to sort by image pid:

function getLastAddedMediaFrom ($source, $start = 0, $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' "
. $sourceSql
. " {$this->privacyfilter} "
//. " ORDER BY p.ctime DESC LIMIT $start,$count";
. " ORDER BY p.pid ASC LIMIT $start,$count";

$resultset = $this->dbExecuteSql($sqlcode);
$this->addPathInfo($resultset);

}
elseif ($this->cfg['cfDebugMode'] == 'true'){
debugPrint("Non numeric count submitted");
}

return ($resultset);
}


I have also noticed that the image id when using the "my picture sorting" tool in CPG is id="enl_autoid#" where number is the new "id" given to that image. This is all I could find that may be of help. Thank you.

papukaija


phill104

What, you mean this link - http://jeffstump.com/photoGallery/login.php

troystump,

Really like your gallery and usage of cpmfetch, well done on that.

Incase you are not aware, Vuud is currently re-writing a whole new version of cpmfetch for CPG1.5.x so it is probably best waiting for that to finish. There is no date as of yet and he is very busy at the moment so you will have to be patient. If you have any suggestions for CPMfetch 1.5.x then Vuud has started a thread on the development. I am sure he would appreciate your input and I am 100% certain he would love to see your current usage.

It is a mistake to think you can solve any major problems just with potatoes.

troystump

papukaija,

If you followed my post all the way through, you would see that my question does not involve the standard photo gallery link, as this question does not pertain to that. I posted my link that cpmfetch uses to connect with my photogallery to draw thumbnails. Before you jump on me for board rules, pay attention to what I'm asking and what's going on. I'm dealing with dynamic content and scripting using cpmfetch. Thank you.

Phill,

Thanks for taking a look at it. I finally achieved all of my goals with cpmfetch and am very happy with how it turned out. I was aware of him working on a new cpmfetch for support within cpg 1.5 but (as a programmer), I was just itchin' to get this going. I'll shoot him a post in his dev thread. Thanks a lot man.

TeknoSounds

Troy, love your gallery :D I'm about to start working on pulling my gallery into the rest of my site, but waiting for the new cpmfetch to come out.  That's some phenomenal work tho sir!

ΑndrĂ©

Quote from: troystump on August 03, 2010, 04:43:51 AM
I finally achieved all of my goals
I assume your solution was to change
. " ORDER BY p.pid ASC LIMIT $start,$count";
to something like
. " ORDER BY p.pos ASC, p.pid ASC LIMIT $start,$count";
right?

In any case it would be nice if you could resolve / mark this thread as solved. Thank you.


Jeff Bailey

Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford