[Invalid]: Coding to display default album thumbnail [Invalid]: Coding to display default album thumbnail
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Invalid]: Coding to display default album thumbnail

Started by treehstn, November 20, 2008, 07:20:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

treehstn

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;

Nibbler

That code is nothing to do with Coppermine.

treehstn

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.

Fabricio Ferrero

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

Catching up! :)

treehstn

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?

Nibbler

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

treehstn

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.