summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/admin/views/giglog_admin_page.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index 637820f..7970cf3 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -110,6 +110,24 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
return $select;
}
+
+ //function to calculate if the concert has been added in the past 10 days or before that and show a green NEW for the newest rows
+ static function getpublishstatus($concert_id)
+ {
+ global $wpdb;
+ $date1 = new DateTime("now");
+ $dsql = "select wpgcl_createddate from wpg_concertlogs where wpgcl_concertid=".$concert_id;
+ $results = $wpdb->get_results($dsql);
+ foreach ( $results AS $row )
+ { //$x = strtotime($row -> filedate);
+ $x= date('Y-m-d H:i:s', strtotime($row -> wpgcl_createddate));
+ $date2 = new DateTime($x, new DateTimeZone('Europe/London'));
+ $dd = $date2 -> diff($date1) ->format("%a");
+ }
+
+ if ($dd <= 10) return ('<span style="color:green">NEW</span>');
+ }
+
static function get_concerts()
{
@@ -172,7 +190,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
//$content .= DATE_FORMAT($fdate,'%d.%b.%Y');
$content .= '<td>' .$newformat. '</td>';
- $content .= '<td></td>'; //.giglogadmin_getpublishstatus($row->id ).'</td>';
+ $content .= '<td>'.GiglogAdmin_AdminPage::getpublishstatus($row->id ).'</td>';
$content .= '<td>'.GiglogAdmin_AdminPage::returnuser('photo1', $row->id ).'</td>';
$content .= '<td>'.GiglogAdmin_AdminPage::returnuser('photo2', $row->id ).'</td>';
$content .= '<td>'.GiglogAdmin_AdminPage::returnuser('rev1', $row->id ).'</td>';