diff options
author | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-04-21 22:39:44 +0200 |
---|---|---|
committer | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-04-21 22:39:44 +0200 |
commit | 21ed6eeee204b27408eb20f2330cba28ec5625ab (patch) | |
tree | 36ad824aa4ac9ed4872257100017a00cad426fd1 | |
parent | f29cb92957df4423396af64fdcce08ca2b630457 (diff) | |
download | gigologadmin-21ed6eeee204b27408eb20f2330cba28ec5625ab.tar.gz gigologadmin-21ed6eeee204b27408eb20f2330cba28ec5625ab.tar.bz2 gigologadmin-21ed6eeee204b27408eb20f2330cba28ec5625ab.zip |
Added column for concert title in database
Modified so that band is no longer in use
-rw-r--r-- | includes/admin/register_db_tables.php | 20 | ||||
-rw-r--r-- | includes/admin/views/giglog_admin_page.php | 100 | ||||
-rw-r--r-- | includes/admin/views/giglog_import_gigs.php | 12 | ||||
-rw-r--r-- | includes/concert.php | 32 | ||||
-rw-r--r-- | includes/public/shortcodes/giglog_bands.php | 11 | ||||
-rw-r--r-- | includes/public/shortcodes/giglog_display_unprocessed.php | 25 | ||||
-rw-r--r-- | includes/public/shortcodes/giglog_photographers.php | 11 |
7 files changed, 73 insertions, 138 deletions
diff --git a/includes/admin/register_db_tables.php b/includes/admin/register_db_tables.php index 3e26a15..90ce473 100644 --- a/includes/admin/register_db_tables.php +++ b/includes/admin/register_db_tables.php @@ -424,7 +424,25 @@ if ( !function_exists( "giglog_register_db_tables") ) $wpdb->query( "INSERT INTO `wpg_countries` (`id`, `wpgc_fullname`, `wpgcountry_name`, `wpgc_iso3`, `wpgc_numcode`) VALUES ('NN', 'UNKNOWN', 'Unknown', 'NNN', '666');"); } - update_option("giglogadmin_db_version", 4); + + if ($db_version == NULL || $db_version < 5) + { + $wpdb->query( + "ALTER TABLE `wpg_concerts` + ADD COLUMN IF NOT EXISTS + `wpgconcert_name` VARCHAR(2000) NOT NULL AFTER `id`;"); + $wpdb->query( + "ALTER TABLE `wpg_concerts` + ADD COLUMN IF NOT EXISTS + `wpgconcert_type` INT NOT NULL DEFAULT '1' COMMENT '1 concert, 2 festival';"); + $wpdb->query( + "ALTER TABLE `wpg_concerts` DROP INDEX `wpgconcert_band`;"); + } + $wpdb->query( + "ALTER TABLE `wpg_concerts` DROP FOREIGN KEY `wpgconcert_band`;"); + ) + + update_option("giglogadmin_db_version", 5); } giglog_register_db_tables(); diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 548694b..92d97dd 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -49,31 +49,6 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { return($select); } - static function get_allbands($inband) - { - $select = '<select name="selectband">'; - $select .= '<option value="">Please Select..</option>'; - foreach ( GiglogAdmin_Band::all_bands() AS $band ) { - if($inband==$band ->id) $select .= '<option value="' . $band -> id. '" selected="selected">'.$band->vname; - else $select .= '<option value="' . $band -> id. '">'.$band->vname; - $select .='</option>'; - } - $select .= '</select>'; - return($select); - } - - static function get_countries($incountry) - { - $select = '<select name="selectcountry">'; - $select .= '<option value="">Please Select..</option>'; - foreach ( GiglogAdmin_Band::all_countries() AS $country ) { - if($incountry==$country ->id) $select .= '<option value="' . $country -> id. '" selected="selected">'.$country->cname; - else $select .= '<option value="' . $country->id. '">'. $country->cname; - $select .='</option>'; - } - $select .= '</select>'; - return($select); - } static function get_user($cid, $ctype) { @@ -99,6 +74,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { return($select); } + static function get_filters() { $cities = array_merge(["ALL"], GiglogAdmin_Venue::all_cities()); @@ -158,9 +134,9 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { else $c = new GiglogAdmin_Concert(); - $content='<form method="POST" action="" class="concedit" > Form to create/edit concerts, bands, venues<br>' + $content='<form method="POST" action="" class="concedit" > Form to create/edit concerts and venues<br>' .'<input type="hidden" name="pid" value="' .$c->id(). '" />' - .'<label for="band">Band:</label>'.GiglogAdmin_AdminPage::get_allbands($c->band()).'<br>' + .'<label for="cname">Concert Name:</label><input type="text" id="cname" name="cname" value="'.$c->cname().'"><br>' .'<label for="venue">Venue:</label>'.GiglogAdmin_AdminPage::get_allvenues($c->venue()).'<br>' .'<label for="cdate">Date:</label><input type="date" id="cdate" name="cdate" value="'.$c->cdate().'"><br>' .'<label for="ticket">Tickets:</label><input type="text" id="ticket" name="ticket" value="'.$c->tickets().'"><br>' @@ -181,32 +157,8 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { $content.='</form>'; - $band = ''; - $bcountry = ''; - $b = GiglogAdmin_Band::get_band($c->band()); - if (is_array($b)) - { - $band = GiglogAdmin_Band::get_band($c->band())[0]; - $bcountry = GiglogAdmin_AdminPage::get_countries(GiglogAdmin_Band::get_band($c->band())[1]); - } - - - $content.='<form method="POST" action="" class="bandedit" ><br>' - .'<input type="hidden" name="bid" value="' .$c->band(). '" />' - .'<label for="bandname">Band Name:</label><input type="text" id="bandname" name="bandname" value="'.$band.'"><br>' - .'<label for="eventurl">Band Country:</label>'.$bcountry.'<br>'; - - if ($editing) { - $content.='<p><input type="submit" name="editband" value="Edit Band"></p>'; - } - else { - $content.='<p><input type="submit" name="newband" value="Create New Band"></p>'; - } - - $content.='</form>'; - - $content.='<form method="POST" action="" class="bandedit" ><br>' - .'<label for="bandname">Venue Name:</label><input type="text" id="venuename" name="venuename"><br>' + $content.='<form method="POST" action="" class="venue" ><br>' + .'<label for="venue">Venue Name:</label><input type="text" id="venuename" name="venuename"><br>' .'<label for="eventurl">Venue City:</label><input type="text" id="venuecity" name="venuecity"><br>' .'<p><input type="submit" name="newvenue" value="Create New Venue"></p>' .'</form>'; @@ -266,7 +218,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { // $content .= '</tr><th>CITY</th><th>ID</th><th>BAND</th><th>VENUE</th><th>DATE</th></tr>'; $content .= '<tr class="assignithrow"> - <th>CITY</th><th>BAND</th><th>VENUE</th><th>DATE</th><th> </th> + <th>CITY</th><th>NAME</th><th>VENUE</th><th>DATE</th><th> </th> <th>PHOTO1</th><th>PHOTO2</th><th>TEXT1</th><th>TEXT2</th> <th>STATUS</th>'; if (current_user_can('administrator')) //($hf_username == 'etadmin') @@ -281,10 +233,9 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { $venue = $venue ? $venue : '0'; - $query = "SELECT wpgc.id, wpgb.wpgband_name as band, wpgv.wpgvenue_name as venue, wpgc.wpgconcert_date, wpgc.wpgconcert_tickets, wpgc.wpgconcert_event, wpgv.wpgvenue_city, wpgv.wpgvenue_webpage, wpgps.wpgs_name - FROM wpg_concerts wpgc, wpg_bands wpgb, wpg_venues wpgv, wpg_pressstatus wpgps, wpg_concertlogs wpgcl - where wpgc.band=wpgb.id - and wpgc.venue = wpgv.id + $query = "SELECT wpgc.id, wpgconcert_name, wpgv.wpgvenue_name as venue, wpgc.wpgconcert_date, wpgc.wpgconcert_tickets, wpgc.wpgconcert_event, wpgv.wpgvenue_city, wpgv.wpgvenue_webpage, wpgps.wpgs_name + FROM wpg_concerts wpgc, wpg_venues wpgv, wpg_pressstatus wpgps, wpg_concertlogs wpgcl + where wpgc.venue = wpgv.id and wpgconcert_date >= CURDATE() and wpgps.id = wpgcl.wpgcl_status and wpgcl.wpgcl_concertid=wpgc.id"; @@ -309,7 +260,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { // Modify these to match the database structure // $content .= '<td>' . $row->id. '</td>'; $content .= '<td></td>'; - $content .= '<td>' . $row->band. '</td>'; + $content .= '<td>' . $row->wpgconcert_name. '</td>'; $content .= '<td>' . $row->venue. '</td>'; $fdate = strtotime($row->wpgconcert_date); $newformat = date('d.M.Y',$fdate); @@ -380,49 +331,28 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { if(isset($_POST['newconcert'])) { - IF (empty($_POST['selectband']) || empty($_POST['selectvenueadmin']) || empty($_POST['cdate']) || empty($_POST['ticket']) || empty($_POST['eventurl'])) + IF (empty($_POST['cname']) || empty($_POST['selectvenueadmin']) || empty($_POST['cdate']) || empty($_POST['ticket']) || empty($_POST['eventurl'])) echo '<script language="javascript">alert("You are missing a value, concert was not created"); </script>'; else { - $ret = GiglogAdmin_Concert::create($_POST['selectband'], $_POST['selectvenueadmin'], $_POST['cdate'], $_POST['ticket'], $_POST['eventurl']); + $ret = GiglogAdmin_Concert::create($_POST['cname'], $_POST['selectvenueadmin'], $_POST['cdate'], $_POST['ticket'], $_POST['eventurl']); if ($ret!='dup') echo '<script language="javascript">alert("Yey, concert created"); </script>'; else echo '<script language="javascript">alert("Nay, concert was duplicated"); </script>'; } } if(isset($_POST['editconcert'])) { - IF (empty($_POST['selectband']) || empty($_POST['selectvenueadmin']) || empty($_POST['cdate']) || empty($_POST['ticket']) || empty($_POST['eventurl'])) + IF (empty($_POST['cname']) || empty($_POST['selectvenueadmin']) || empty($_POST['cdate']) || empty($_POST['ticket']) || empty($_POST['eventurl'])) echo '<script language="javascript">alert("You are missing a value, concert was not updated"); </script>'; else { - GiglogAdmin_Concert::update_concert($_POST['pid'],$_POST['selectband'], $_POST['selectvenueadmin'], $_POST['cdate'], $_POST['ticket'], $_POST['eventurl']); + GiglogAdmin_Concert::update_concert($_POST['pid'],$_POST['cname'], $_POST['selectvenueadmin'], $_POST['cdate'], $_POST['ticket'], $_POST['eventurl']); GiglogAdmin_Concert::update_concertlog($_POST['pid'],$_POST['photo1'], $_POST['photo2'], $_POST['rev1'], $_POST['rev2']); echo '<script language="javascript">alert("Yay, concert updated"); </script>'; } } - if(isset($_POST['newband'])) - { - IF (empty($_POST['bandname'])) //country is not checked as it is set to Norway by default - echo '<script language="javascript">alert("You are missing a value, band was not created"); </script>'; - else - { - GiglogAdmin_Band::create($_POST['bandname'],$_POST['selectcountry']); - echo '<script language="javascript">alert("Yey, band created"); </script>'; - } - } - - if(isset($_POST['editband'])) - { - IF (empty($_POST['bandname'])) //country is not checked as it is set to Norway by default - echo '<script language="javascript">alert("You are missing band name, band was not edited"); </script>'; - else - { - GiglogAdmin_Band::update_band($_POST['bid'],$_POST['bandname'],$_POST['selectcountry']); - echo '<script language="javascript">alert("Yey, band updated"); </script>'; - } - } if(isset($_POST['newvenue'])) { @@ -495,8 +425,10 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { global $wpdb; $hf_user = wp_get_current_user(); $hf_username = $hf_user->user_login; + if (!empty($c)) { + //PHOTO1 if ($p1 == 'photo1') { diff --git a/includes/admin/views/giglog_import_gigs.php b/includes/admin/views/giglog_import_gigs.php index 17b1cbd..053f505 100644 --- a/includes/admin/views/giglog_import_gigs.php +++ b/includes/admin/views/giglog_import_gigs.php @@ -6,7 +6,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { - require_once __DIR__ . '/../../band.php'; + // require_once __DIR__ . '/../../band.php'; require_once __DIR__ . '/../../concert.php'; require_once __DIR__ . '/../../concertlogs.php'; require_once __DIR__ . '/../../venue.php'; @@ -41,7 +41,7 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { * The file must contain the following columns each separated by _one_ * tab character: * - * 1. Bandname + * 1. Concertname * 2. Venuename * 3. Concert date * 4. Ticket link @@ -61,15 +61,15 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { } $resultArray = explode("\t", $line); - $bandname = trim($resultArray[0]); + $cname = trim($resultArray[0]); $venue = trim($resultArray[1]); $condate = date('Y-m-d', strtotime($resultArray[2])); $ticketlink = trim($resultArray[3]); $eventlink = trim($resultArray[4]); - //first item in the row should be band $resultArray[0]; second should be venue $resultArray[1]; third should be concert date $resultArray[2]; + //first item in the row should be concert name $resultArray[0]; second should be venue $resultArray[1]; third should be concert date $resultArray[2]; //fourth item is ticketlink $resultArray[3]; fifth item is eventlink $resultArray[4]; - $band = GiglogAdmin_Band::create($bandname); + if (is_numeric($venue)) $newconcert[1] = $venue; @@ -81,7 +81,7 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { //not sure how to check dates, hopefully manual verification of files will take care of it GiglogAdmin_Concert::create( - $band->id(), + $cname, $newconcert[1], $condate, $ticketlink, diff --git a/includes/concert.php b/includes/concert.php index 462586d..54bdbc4 100644 --- a/includes/concert.php +++ b/includes/concert.php @@ -9,7 +9,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) { class GiglogAdmin_Concert { private $id; - private $band; + private $cname; private $venue; private $cdate; private $tickets; @@ -24,7 +24,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) { public function __construct($attrs = []) { $this->id = isset($attrs->id) ? $attrs->id : NULL; - $this->band = isset($attrs->band) ? $attrs->band : NULL; + $this->cname = isset($attrs->wpgconcert_name) ? $attrs->wpgconcert_name : NULL; $this->venue = isset($attrs->venue) ? $attrs->venue : NULL; $this->cdate = isset($attrs->wpgconcert_date) ? $attrs->wpgconcert_date : NULL; $this->tickets = isset($attrs->wpgconcert_tickets) ? $attrs->wpgconcert_tickets : NULL; @@ -51,24 +51,24 @@ if ( !class_exists('GiglogAdmin_Concert') ) { } } - static function check_duplicate($band, $venue, $cdate, $ticketlink, $eventlink) + static function check_duplicate($cname, $venue, $cdate, $ticketlink, $eventlink) { global $wpdb; - $cresults = GiglogAdmin_Concert::get($band, $venue, $cdate); + $cresults = GiglogAdmin_Concert::get($cname, $venue, $cdate); if ($cresults) return($cresults); else return ('new'); } - public static function create($band, $venue, $cdate, $ticketlink, $eventlink) - { $c = GiglogAdmin_Concert::check_duplicate($band, $venue, $cdate, $ticketlink, $eventlink); + public static function create($cname, $venue, $cdate, $ticketlink, $eventlink) + { $c = GiglogAdmin_Concert::check_duplicate($cname, $venue, $cdate, $ticketlink, $eventlink); if ($c=='new') { $attrs = new stdClass(); $attrs->id = ''; - $attrs->band = $band; + $attrs->wpgconcert_name = $cname; $attrs->venue = $venue; $attrs->wpgconcert_date = $cdate; $attrs->wpgconcert_tickets = $ticketlink; @@ -78,7 +78,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) { error_log( 'NEW CONCERT ADDED: ' . ' ID: ' . $cid -> id() - . ' BAND ID ' . $band + . ' CONCERT NAME ' . $cname . ', VENUE ID ' . $venue . ', CONCERTDATE ' . $cdate . ', Ticket LINK ' . $ticketlink @@ -99,7 +99,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) { else { error_log( 'DUPLICATE ROW detected: ' - . ' BAND ID ' . $band + . ' CONCERT NAME ' . $cname . ', VENUE ID ' . $venue . ', CONCERTDATE ' . $cdate); return('dup'); @@ -107,12 +107,12 @@ if ( !class_exists('GiglogAdmin_Concert') ) { } - public static function update_concert($id, $band, $venue, $cdate, $ticketlink, $eventlink) + public static function update_concert($id, $cname, $venue, $cdate, $ticketlink, $eventlink) { global $wpdb; $res = $wpdb->update('wpg_concerts', array( - 'band' => $band, + 'wpgconcert_name' => $cname, 'venue' => $venue, 'wpgconcert_date' => $cdate, 'wpgconcert_tickets' => $ticketlink, @@ -153,12 +153,12 @@ if ( !class_exists('GiglogAdmin_Concert') ) { } - public static function get($band, $venue, $date) + public static function get($cname, $venue, $date) { global $wpdb; $sql = 'SELECT id from wpg_concerts' - . ' where band = ' . $band + . ' where wpgconcert_name = "' . $cname .'"' . ' and venue = ' . $venue . ' and wpgconcert_date ="' . $date . '"'; @@ -172,7 +172,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) { $wpdb->insert('wpg_concerts', array( 'id' => '', - 'band' => $this->band, + 'wpgconcert_name' => $this->cname, 'venue' => $this->venue, 'wpgconcert_date' => $this->cdate, 'wpgconcert_tickets' => $this->tickets, @@ -187,9 +187,9 @@ if ( !class_exists('GiglogAdmin_Concert') ) { return $this->id; } - public function band() + public function cname() { - return $this->band; + return $this->wpgconcert_name; } public function venue() { diff --git a/includes/public/shortcodes/giglog_bands.php b/includes/public/shortcodes/giglog_bands.php index 5533142..78fd72b 100644 --- a/includes/public/shortcodes/giglog_bands.php +++ b/includes/public/shortcodes/giglog_bands.php @@ -65,7 +65,7 @@ function giglogadmin_getconcerts() // Shortcodes RETURN content, so store in a variable to return $content = '<table class="concertstb">'; // $content .= '</tr><th>CITY</th><th>ID</th><th>BAND</th><th>VENUE</th><th>DATE</th><th>TICKETS</th><th>EVENT</th></tr>'; - $content .= '<tr class="concertshrow"><th>CITY</th><th>BAND</th><th>VENUE</th><th>DATE</th><th>TICKETS</th><th>EVENT</th></tr>'; + $content .= '<tr class="concertshrow"><th>CITY</th><th>TITLE</th><th>VENUE</th><th>DATE</th><th>TICKETS</th><th>EVENT</th></tr>'; // Use the submitted "city" if any. Otherwise, use the default/static value. $cty = filter_input(INPUT_POST, 'selectcity'); $cty = $cty ? $cty : 'ALL'; @@ -75,10 +75,9 @@ function giglogadmin_getconcerts() $venue = $venue ? $venue : '0'; - $query = "SELECT wpgc.id, wpgb.wpgband_name as band ,wpgv.wpgvenue_name as venue ,wpgc.wpgconcert_date, wpgc.wpgconcert_tickets, wpgc.wpgconcert_event, wpgv.wpgvenue_city, wpgv.wpgvenue_webpage - FROM wpg_concerts wpgc, wpg_bands wpgb, wpg_venues wpgv -where wpgc.band=wpgb.id -and wpgc.venue = wpgv.id + $query = "SELECT wpgc.id, wpgc.wpgconcert_name ,wpgv.wpgvenue_name as venue ,wpgc.wpgconcert_date, wpgc.wpgconcert_tickets, wpgc.wpgconcert_event, wpgv.wpgvenue_city, wpgv.wpgvenue_webpage + FROM wpg_concerts wpgc, wpg_venues wpgv +where wpgc.venue = wpgv.id and wpgconcert_date >= CURDATE()"; $query .= ($cty == "ALL") ? "" : " and wpgv.wpgvenue_city='" . $cty . "'"; $query .= ($venue == "0") ? "" : " and wpgv.id='" . $venue . "'"; @@ -101,7 +100,7 @@ and wpgconcert_date >= CURDATE()"; // Modify these to match the database structure // $content .= '<td>' . $row->id. '</td>'; $content .= '<td></td>'; - $content .= '<td>' . $row->band . '</td>'; + $content .= '<td>' . $row->wpgconcert_name . '</td>'; $content .= '<td>' . $row->venue . '</td>'; $fdate = strtotime($row->wpgconcert_date); $newformat = date('d.M.Y', $fdate); diff --git a/includes/public/shortcodes/giglog_display_unprocessed.php b/includes/public/shortcodes/giglog_display_unprocessed.php index 21382fd..aa3596c 100644 --- a/includes/public/shortcodes/giglog_display_unprocessed.php +++ b/includes/public/shortcodes/giglog_display_unprocessed.php @@ -52,7 +52,7 @@ function giglogadmin_insertconcerts() foreach ($cresults AS $row) { $rowfileid = $row->id; $resultArray = explode("\t", $row->rowcontent); - $band = $resultArray[0]; + $cname = $resultArray[0]; $venue = $resultArray[1]; $condate = date('Y-m-d', strtotime($resultArray[2])); $ticketlink = $resultArray[3]; @@ -60,20 +60,7 @@ function giglogadmin_insertconcerts() //first item in the row should be band $resultArray[0]; second should be venue $resultArray[1]; third should be concert date $resultArray[2]; //fourth item is ticketlink $resultArray[3]; fifth item is eventlink $resultArray[4]; - //processing band - $bandsql = 'SELECT id FROM wpg_bands WHERE upper(wpgband_name)="' . $band . '"'; - $results = $wpdb->get_results($bandsql); - if ($results) - $newconcert[0] = $results[0]->id; - else { - $wpdb->insert('wpg_bands', array( - 'id' => '', - 'wpgband_name' => $band - )); - echo ($wpdb->last_error); - $newconcert[0] = $wpdb->insert_id; - } - //done processing band + //processing venue if (is_numeric($venue)) @@ -97,21 +84,21 @@ function giglogadmin_insertconcerts() //not sure how to check dates, hopefully manual verification of files will take care of it //check if concert already exists and return ID if it does. Not checking by date, to be considered - $csql = 'SELECT id from wpg_concerts where band = ' . $newconcert[0] . ' and venue = ' . $newconcert[1] . ' and wpgconcert_date ="' . $condate . '"'; + $csql = 'SELECT id from wpg_concerts where wpgconcert_name = ' . $cname . ' and venue = ' . $newconcert[1] . ' and wpgconcert_date ="' . $condate . '"'; $cresults = $wpdb->get_results($csql); if ($cresults) { $usql = 'UPDATE wpg_files SET processed="D", wpgc_id = ' . $cresults[0]->id . ' WHERE id = ' . $rowfileid; $uresults = $wpdb->get_results($usql); - $concertlist .= 'DUPLICATE ROW detected BAND ' . $band . ' with band ID ' . $newconcert[0]; + $concertlist .= 'DUPLICATE ROW detected Title ' . $cname . ' with band ID ' . $newconcert[0]; $concertlist .= ', VENUE ' . $venue . ' with venue ID ' . $newconcert[1]; $concertlist .= ', CONCERTDATE ' . $condate; $concertlist .= ' <br />'; } else { $wpdb->insert('wpg_concerts', array( 'id' => '', - 'band' => $newconcert[0], + 'wpgconcert_name' => cname, 'venue' => $newconcert[1], 'wpgconcert_date' => $condate, 'wpgconcert_tickets' => $ticketlink, @@ -123,7 +110,7 @@ function giglogadmin_insertconcerts() $usql = 'UPDATE wpg_files SET processed="Y", wpgc_id = ' . $newconcertid . ' WHERE id = ' . $rowfileid; $uresults = $wpdb->get_results($usql); - $concertlist .= 'BAND ' . $band . ' with band ID ' . $newconcert[0]; + $concertlist .= 'name ' . $cname ; $concertlist .= ', VENUE ' . $venue . ' with venue ID ' . $newconcert[1]; $concertlist .= ', CONCERTDATE ' . $condate . ', Ticket LINK ' . $ticketlink . ', event LINK' . $eventlink; $concertlist .= ' <br />'; diff --git a/includes/public/shortcodes/giglog_photographers.php b/includes/public/shortcodes/giglog_photographers.php index cb79375..500445a 100644 --- a/includes/public/shortcodes/giglog_photographers.php +++ b/includes/public/shortcodes/giglog_photographers.php @@ -236,7 +236,7 @@ function giglogadmin_getconcertsphotog ( ) { // $content .= '</tr><th>CITY</th><th>ID</th><th>BAND</th><th>VENUE</th><th>DATE</th></tr>'; $content .= '<tr class="assignithrow"> - <th>CITY</th><th>BAND</th><th>VENUE</th><th>DATE</th><th> </th> + <th>CITY</th><th>TITLE</th><th>VENUE</th><th>DATE</th><th> </th> <th>PHOTO1</th><th>PHOTO2</th><th>TEXT1</th><th>TEXT2</th> <th>STATUS</th>'; if (current_user_can('administrator')) //($hf_username == 'etadmin') @@ -252,10 +252,9 @@ function giglogadmin_getconcertsphotog ( ) { $venue= $venue? $venue: '0'; - $query = "SELECT wpgc.id, wpgb.wpgband_name as band, wpgv.wpgvenue_name as venue, wpgc.wpgconcert_date, wpgc.wpgconcert_tickets, wpgc.wpgconcert_event, wpgv.wpgvenue_city, wpgv.wpgvenue_webpage, wpgps.wpgs_name - FROM wpg_concerts wpgc, wpg_bands wpgb, wpg_venues wpgv, wpg_pressstatus wpgps, wpg_concertlogs wpgcl - where wpgc.band=wpgb.id - and wpgc.venue = wpgv.id + $query = "SELECT wpgc.id, wpgc.wpgconcert_name, wpgv.wpgvenue_name as venue, wpgc.wpgconcert_date, wpgc.wpgconcert_tickets, wpgc.wpgconcert_event, wpgv.wpgvenue_city, wpgv.wpgvenue_webpage, wpgps.wpgs_name + FROM wpg_concerts wpgc, wpg_venues wpgv, wpg_pressstatus wpgps, wpg_concertlogs wpgcl + where wpgc.venue = wpgv.id and wpgconcert_date >= CURDATE() and wpgps.id = wpgcl.wpgcl_status and wpgcl.wpgcl_concertid=wpgc.id"; @@ -281,7 +280,7 @@ function giglogadmin_getconcertsphotog ( ) { // Modify these to match the database structure // $content .= '<td>' . $row->id. '</td>'; $content .= '<td></td>'; - $content .= '<td>' . $row->band. '</td>'; + $content .= '<td>' . $row->wpgconcert_name. '</td>'; $content .= '<td>' . $row->venue. '</td>'; $fdate = strtotime($row->wpgconcert_date); $newformat = date('d.M.Y',$fdate); |