coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: treehstn on November 20, 2008, 07:20:07 PM

Title: [Invalid]: Coding to display default album thumbnail
Post by: treehstn 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??

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;
Title: Re: Coding to display default album thumbnail
Post by: Nibbler on November 20, 2008, 08:18:49 PM
That code is nothing to do with Coppermine.
Title: Re: Coding to display default album thumbnail
Post by: treehstn 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.
Title: Re: Coding to display default album thumbnail
Post by: Fabricio Ferrero on November 20, 2008, 09:06:03 PM
QuoteI know it doesn't.
So? Post in Mambo's forum for supporting. This forum deals only with coppermine.
Title: Re: [Invalid]: Coding to display default album thumbnail
Post by: treehstn 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?
Title: Re: [Invalid]: Coding to display default album thumbnail
Post by: Nibbler 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.
Title: Re: [Invalid]: Coding to display default album thumbnail
Post by: treehstn 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.