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: [Invalid]: Coding to display default album thumbnail  (Read 2713 times)

0 Members and 1 Guest are viewing this topic.

treehstn

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 106
[Invalid]: Coding to display default album thumbnail
« on: November 20, 2008, 07:20:07 pm »

Hi,

My site is built using Mambo.  I'm not a programmer at all.  Just know enough to be dangerous.  I have a page that was built for me by a contractor.  It searches and then displays records in my database.  Those records have CM albums attached to them.  When the search page displays the results it shows a thumbnail of one of the images in the CM album.  That thumbnail is a link to the CM album itself. 

At this point the thumbnail and the album are entered by hand into each record.  I can't get around hand entering the album AID for each record which is ok for my work flow.  But what I would like to figure out is how to have the page automatically look up the default thumbnail for the album instead of it being an entry in the database.

I don't know if this is an easy question to answer or if it's too involved for the forum.  Here is the code that I think determines how the information is queried and displayed.  What I'm wondering is if there might not be another line or two of code that would accomplish this??

Code: [Select]
function displayEAPGItem($found_item)
{
echo "<h2>EAPG Details Page</h2>";

$sql = "SELECT e.Id,
e.patternName,
e.pattern1,
e.pattern2,
e.pattern3,
e.pattern4,
e.thumb_location,
e.album_location,
m.title,
e.notes,
CONCAT(b.title, ' ', eb.pages)
FROM eapg AS e LEFT JOIN eapg_makers AS em ON em.itemid = e.id
LEFT JOIN makers AS m ON em.makerid = m.id
LEFT JOIN eapg_books AS eb ON eb.itemid = e.id
LEFT JOIN books AS b ON eb.bookid = b.id
WHERE e.Id = ".$found_item;
« Last Edit: November 20, 2008, 09:45:37 pm by Joachim Müller »
Logged

Nibbler

  • Guest
Re: Coding to display default album thumbnail
« Reply #1 on: November 20, 2008, 08:18:49 pm »

That code is nothing to do with Coppermine.
Logged

treehstn

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 106
Re: Coding to display default album thumbnail
« Reply #2 on: November 20, 2008, 08:31:47 pm »

I know it doesn't.  What I'm trying to do is replace the code that calls the thumbnail (e.thumb_location) with code that displays the default thumbnail for the corresponding album.
Logged

Fabricio Ferrero

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 1996
  • From San Juan, Argentina, to the World!
    • http://fabricioferrero.com/
Re: Coding to display default album thumbnail
« Reply #3 on: November 20, 2008, 09:06:03 pm »

Quote
I know it doesn't.
So? Post in Mambo's forum for supporting. This forum deals only with coppermine.
Logged
Read Docs and Search the Forum before posting. - Soporte en espaņol
--*--
Fabricio Ferrero's Website

Catching up! :)

treehstn

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 106
Re: [Invalid]: Coding to display default album thumbnail
« Reply #4 on: November 20, 2008, 10:17:58 pm »

Let me rephrase.  If I want to automatically display the default thumbnail image that is assigned to a specific CM album how might I do that?  I can see in the "albums" table of CM there is a field called thumb.  It appears that the value of that field is 0 if the album's thumb is set as the default which is the last image loaded into the album.  But if I select a specific image in the album to be the default album image it appears that a numeric value is in that field in the table.  How is CM determining the value?  And is it one that changes when other images are added to the album?
Logged

Nibbler

  • Guest
Re: [Invalid]: Coding to display default album thumbnail
« Reply #5 on: November 20, 2008, 10:44:27 pm »

That number corresponds to the 'pid' of the picture in the pictures table. It will only change if you specify a different thumbnail.
Logged

treehstn

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 106
Re: [Invalid]: Coding to display default album thumbnail
« Reply #6 on: November 20, 2008, 11:15:41 pm »

Thank you!!  That was exactly what I needed to know.  It means that I can modify the album thumbnail without having do make any other changes.  Now I just need to figure out the part about getting it to display where I want it to in the first place.  I think that part of my question will need to be focused on the php code itself instead of CM.  I appreciate your time Nibbler.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.