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: Using CpmFetch to display thumbnails by using the "sort my pictures" override  (Read 4037 times)

0 Members and 1 Guest are viewing this topic.

troystump

  • Coppermine newbie
  • Offline Offline
  • Posts: 13

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:

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.
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333

Please post a link to your gallery as requested by board rules.
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me

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.

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

troystump

  • Coppermine newbie
  • Offline Offline
  • Posts: 13

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.
Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • 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é

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764

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. Thank you.
Logged

troystump

  • Coppermine newbie
  • Offline Offline
  • Posts: 13

this topic is solved.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford
Pages: [1]   Go Up
 

Page created in 0.058 seconds with 19 queries.