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 2 3 [4]   Go Down

Author Topic: Slider in Coppermine  (Read 81688 times)

0 Members and 1 Guest are viewing this topic.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Slider in Coppermine
« Reply #60 on: July 21, 2009, 11:57:40 pm »

"There was an error while processing a database query"
That's a generic error message. There are thousands of threads that explain what needs to be done if you get that error message. However, as you appear to be a person who doesn't heed advice and prefers not to do as supporters suggest, I'll leave it up to you to figure out what needs to be done. Hint: perform a search. Then: stay out of this thread (as I suggested). Supporters are much less reluctant to help if you heed their advice.
Logged

imthegirloverboard

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
    • mkaeuphoria
Re: Slider in Coppermine
« Reply #61 on: February 27, 2010, 05:14:26 pm »

is there any way I can exclude pictures that were uploaded via 'userpics' from the slide?

x
Logged
 *Image Removed*

 *Link Removed*

hobert

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Slider in Coppermine
« Reply #62 on: June 10, 2011, 06:29:18 pm »

Little late answering this question, but you can modify the "query" and take out the albums you *don't* want using something like:

Code: [Select]
$query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} as p WHERE approved = 'YES' AND filename LIKE '%.jpg' AND aid NOT IN (95, 96, 97, 228, 230, 236, 237) $FORBIDDEN_SET ORDER BY RAND() LIMIT $limit";
Not sure what album/category "userpics" are (as I do not use them), but you can code something similar.

Hope this helps anyone chasing this question.
Logged

jenepherre

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 54
  • there's beauty in the breakdown
Re: Slider in Coppermine
« Reply #63 on: June 17, 2011, 11:05:43 am »

Yes. The code hardcodes the name of the albums directory.

Code: [Select]
// path of pic
$file="albums/".$row['filepath']."thumb_".$row['filename'];

It should use the built-in function, like this:

Code: [Select]
// path of pic
$file=get_pic_url($row, 'thumb');

My photos are also outside the albums folder, and I used the info above to correct the display of the thumbnails, but the click-through links still don't work. It looks like it's hardcoded too, but I don't know what to change it to. Can anyone tell me?

Thanks in advance.
Logged
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

hobert

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Slider in Coppermine
« Reply #64 on: June 17, 2011, 04:02:09 pm »

That's interesting, since the code that throws up the link:

Code: [Select]
                 $lien="<a href=\"displayimage.php?pos=-$key\" target=\"_blank\"><img src=\"".$file."\" border=\"0\" height=\"".$max_height."\" alt=\"".$filename." &#10;".$description."K&#10;".$dimensions."\"></a>";...is using the normal CGP gallery URL (displayimage.php).  Or, um, should.  You should search for the "a href" in your code and see what it looks like.

As far as using get_pic_url, this code pretty much just reads the pictures databases, it's not really digging deeper into the config info or cgp functions (like get_pic_url is).  I'm not sure how much rewriting would need to be done.
Logged

jenepherre

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 54
  • there's beauty in the breakdown
Re: Slider in Coppermine
« Reply #65 on: June 19, 2011, 09:32:39 am »

That's interesting, since the code that throws up the link:

Code: [Select]
                 $lien="<a href=\"displayimage.php?pos=-$key\" target=\"_blank\"><img src=\"".$file."\" border=\"0\" height=\"".$max_height."\" alt=\"".$filename." &#10;".$description."K&#10;".$dimensions."\"></a>";...is using the normal CGP gallery URL (displayimage.php).  Or, um, should.  You should search for the "a href" in your code and see what it looks like.

As far as using get_pic_url, this code pretty much just reads the pictures databases, it's not really digging deeper into the config info or cgp functions (like get_pic_url is).  I'm not sure how much rewriting would need to be done.

Um, I have no idea what you just said. I'm using the code from the very first post of this thread and integrated it into my gallery using the anycontent.php method, but since I had originally bulk-uploaded my images, I edited my code per this post in this same thread, which worked perfectly to fix the thumbnails shown in the slider. But no one has mentioned a fix for the click-through link.

I hadn't uploaded too many images yet, so I deleted those and reuploaded through CPG's regular upload interface, but that actually doesn't fix the problem.

I believe this is what needs to be fixed:
Code: [Select]
// link of pic
  $lien="<a href=\"displayimage.php?album=random&cat=0&pos=-$key\"><img src=\"".$file."\" border=0></a>";
but I don't know what to change it to.

My gallery is here: http://www.luxuryalaskahome.com/gallery/index.php
Logged
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

hobert

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Slider in Coppermine
« Reply #66 on: June 20, 2011, 04:37:48 pm »

Ah, that one's easy....

Since your error in CPG is "album/file does not exist", I'd take out the "album=random&".  When I do that manually, I'm taken to the correct page.

Hmm, it may be that "random" as a meta gallery has been removed in a later version since that code has been developed.  Tedchnically, you can probably get rid of the "cat=0&" as well and just leave "displayimage.php?pos=-$key", which is how the latest version of CPG links.  This should put it in the correct category/album that the hosts the original image.
Logged

hobert

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Slider in Coppermine
« Reply #67 on: June 20, 2011, 04:41:24 pm »

Just to be clear, this is changed code you need to use:

Code: [Select]
// link of pic
  $lien="<a href=\"displayimage.php?pos=-$key\"><img src=\"".$file."\" border=0></a>";
Logged

jenepherre

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 54
  • there's beauty in the breakdown
Re: Slider in Coppermine
« Reply #68 on: June 22, 2011, 02:14:48 pm »

Just to be clear, this is changed code you need to use:

Code: [Select]
// link of pic
  $lien="<a href=\"displayimage.php?pos=-$key\"><img src=\"".$file."\" border=0></a>";

Thank you so much for your help, Hobert!
Logged
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.
Pages: 1 2 3 [4]   Go Up
 

Page created in 0.238 seconds with 20 queries.