Blodlizrd
I have the same thing I want to do:
I can help you with some of the bits up to an end, but like you, I get stuck at a certain point, and I'm sure someone here (one of the clever blokes) will help us further.
Just to say:
I wanted to add the fields "Event Location" and "Event Date" to my Albums, since I don't really dig the idea as to copy and paste the usual stuff (Event venue and date) in there. I manage to edit the database, the php pages I understand to be changed.
1. I opened my MySQL panel, and went to the coppermine database and added the two line "event_location" and "event_date" to the sql quiry:
Quote:
CREATE TABLE cpg1410_albums (
aid int(11) NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
description text NOT NULL,
event_location text NOT NULL,
event_date text NOT NULL,
event_new enum('YES','NO') NOT NULL default 'YES',
visibility int(11) NOT NULL default '0',
uploads enum('YES','NO') NOT NULL default 'NO',
comments enum('YES','NO') NOT NULL default 'NO',
votes enum('YES','NO') NOT NULL default 'NO',
pos int(11) NOT NULL default '0',
category int(11) NOT NULL default '0',
thumb int(11) NOT NULL default '0',
keyword VARCHAR( 50 ),
alb_password VARCHAR( 32 ),
alb_password_hint TEXT,
PRIMARY KEY (aid),
KEY alb_category (category)
) TYPE=MyISAM COMMENT='Used to store albums';
Un-Quote
2. Find in file db-input.php
line 179:
case 'album_update':
if (!(USER_ADMIN_MODE || GALLERY_ADMIN_MODE)) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
and after: $description = addslashes(trim($_POST['description']));
add: $event_location = addslashes(trim($_POST['event_location'])); //JOHANN ADDED
$event_date = addslashes(trim($_POST['event_date'])); //JOHANN ADDED
I also fixed this line (round about line 204): I added event_location and event_date
if (GALLERY_ADMIN_MODE) {
$query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', event_location='$event_location', event_date='$event_date', event_new='$event_new', category='$category', thumb='$thumb', uploads='$uploads', comments='$comments', votes='$votes', visibility='$visibility', alb_password='$password', alb_password_hint='$password_hint', keyword='$keyword' WHERE aid='$aid' LIMIT 1";
} else {
3. In your language.php file:
Find: // File modifyalb.php
And add:
'event_location' =>'Event Location', //JOHANN
'event_date' =>'Event Date', //JOHANN
4. In modifyalb.php
Find: $captionLabel = $lang_modifyalb_php['alb_desc'];
After: $data = array($lang_modifyalb_php['general_settings'],
Add: array($lang_modifyalb_php['event_location'], 'event_location', 0), //JOHANN ADDED
array($lang_modifyalb_php['event_date'], 'event_date', 0), //JOHANN ADDED
5. In my themes page (theme.php) i locate {ALB_DESC} and add a <br> and then {EVENT_LOCATION} wich is now suppose to reflect the data in the data base.
Also in theme.php page on line 1798 I added the fields like this:
if (is_array($alb_list)) {
foreach($alb_list as $album) {
$count ++;
$params = array('{COL_WIDTH}' => $column_width,
'{ALBUM_TITLE}' => $album['album_title'],
'{THUMB_CELL_WIDTH}' => $thumb_cell_width,
'{ALB_LINK_TGT}' => "thumbnails.php?album={$album['aid']}",
'{ALB_LINK_PIC}' => $album['thumb_pic'],
'{ADMIN_MENU}' => $album['album_adm_menu'],
'{ALB_DESC}' => $album['album_desc'],
'{EVENT_LOCATION}' => $album['event_location'],
'{EVENT_DATE}' => $album['event_date'],
'{ALB_INFOS}' => $album['album_info'],
);
Now, when entering the data in the fields on my Abdate Album Page, it do post the data to the database correctly. When I highlight them and delete them, and I do the "update", it also do the update in the database.
Where I'm stuck now is, the information does not show on the actual index.php page after going to the specific album.
Question now is how and where to fix it that it does reflect ?