forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: troystump on July 31, 2010, 05:10:55 am

Title: Using CpmFetch to display thumbnails by using the "sort my pictures" override
Post by: troystump on July 31, 2010, 05:10:55 am
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 (http://www.jeffstump.com) here is the function i have currently edited in the file cmpfetch_dao.php to sort by image pid:

Code: [Select]
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.
Title: Re: Using CpmFetch to display thumbnails by using the "sort my pictures" override
Post by: papukaija on August 02, 2010, 06:40:23 pm
Please post a link to your gallery (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616) as requested by board rules.
Title: Re: Using CpmFetch to display thumbnails by using the "sort my pictures" override
Post by: phill104 on August 02, 2010, 10:08:13 pm
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.

Title: Re: Using CpmFetch to display thumbnails by using the "sort my pictures" override
Post by: troystump on August 03, 2010, 04:43:51 am
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.
Title: Re: Using CpmFetch to display thumbnails by using the "sort my pictures" override
Post by: TeknoSounds on August 03, 2010, 05:25:22 am
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!
Title: Re: Using CpmFetch to display thumbnails by using the "sort my pictures" override
Post by: Αndré on September 03, 2010, 03:10:50 pm
I finally achieved all of my goals
I assume your solution was to change
Code: [Select]
. " ORDER BY p.pid ASC LIMIT $start,$count";to something like
Code: [Select]
. " 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 (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270631.html#msg270631). Thank you.
Title: Re: Using CpmFetch to display thumbnails by using the "sort my pictures" override
Post by: troystump on September 04, 2010, 01:56:21 am
this topic is solved.
Title: Re: Using CpmFetch to display thumbnails by using the "sort my pictures" override
Post by: Jeff Bailey on September 04, 2010, 01:57:49 am
please resolve your threads as lined out here => http://forum.coppermine-gallery.net/index.php/topic,55415.msg270631.html#msg270631