Add album title to the ecards table Add album title to the ecards table
 

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

Add album title to the ecards table

Started by rob1111, April 14, 2007, 06:34:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rob1111

Does someone know how to set it so that the album title is also added to the
ecards table [along with all the other info] when a user creates an e-card?

I tried figuring this out for myself, believe me -- I installed phpmyadmin on my
server so that I could access the database in the first place, but I don't know
how to code it and not entirely sure which file(s) would need to be modified.

Thanks... :)

Stramm

the query in ecard.php... change it to
$result = cpg_db_query("SELECT *, a.title AS alb_title from {$CONFIG['TABLE_PICTURES']} as p LEFT JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = p.aid WHERE pid='$pid' $ALBUM_SET");

few lines below after
$pic_title = $row['title'];
add
$alb_title = $row['alb_title'];

now you have the album title stored in the var $alb_title
use it wherever you want in the ecard (as you see you may need to add placeholders for the album title in the template and and some code in ecard.php to replace it)

rob1111

Thanks, I added the code, but I don't see an album title column in the
ecards table or the 'Display E-cards' page in the Admin section.

I guess what I'm asking is how to set it up so the album title shows up
in those two places, or just the database really. Or would it be easier to
somehow instruct the ecards table to add an album title column to its
table that pulls the album title from the picture it has.

Thanks again

Stramm

hmm, I misunderstood you... thought you wanted to add the album title to the ecard itself.
But check the changes I posted. Thats the way to get the album title... join the albums table with the pictures table. That way you do not need the 'album title column' again in the ecards table

rob1111