Slider in Coppermine - Page 4 Slider in Coppermine - Page 4
 

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]

Main Menu

Slider in Coppermine

Started by pbasmo, February 12, 2007, 05:06:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joachim Müller

Quote from: Alcor on July 21, 2009, 08:59:27 AM
"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.

imthegirloverboard

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

x
 *Image Removed*

*Link Removed*

hobert

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

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

jenepherre

Quote from: Nibbler on January 27, 2008, 02:41:12 PM
Yes. The code hardcodes the name of the albums directory.


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


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


// 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.
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

hobert

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

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

jenepherre

Quote from: hobert on June 17, 2011, 04:02:09 PM
That's interesting, since the code that throws up the link:

                 $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:
// 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
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

hobert

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.

hobert

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

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

jenepherre

Quote from: hobert on June 20, 2011, 04:41:24 PM
Just to be clear, this is changed code you need to use:

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


Thank you so much for your help, Hobert!
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.