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: Add album title to the ecards table  (Read 5833 times)

0 Members and 1 Guest are viewing this topic.

rob1111

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Add album title to the ecards table
« on: April 14, 2007, 06:34:14 am »

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... :)
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Add album title to the ecards table
« Reply #1 on: April 14, 2007, 09:27:44 am »

the query in ecard.php... change it to
Code: [Select]
$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
Code: [Select]
$pic_title = $row['title'];add
Code: [Select]
$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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Add album title to the ecards table
« Reply #2 on: April 14, 2007, 07:45:24 pm »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Add album title to the ecards table
« Reply #3 on: April 14, 2007, 08:08:48 pm »

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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Add album title to the ecards table
« Reply #4 on: April 15, 2007, 12:50:29 am »

How do you do that?
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 19 queries.