Plugin Directory

Changeset 3178877


Ignore:
Timestamp:
10/30/2024 02:39:55 PM (16 months ago)
Author:
labelgrid
Message:

v.1.3.59

Location:
label-grid-tools/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • label-grid-tools/trunk/README.txt

    r3101912 r3178877  
    22Contributors: labelgrid
    33Donate link: https://labelgrid.com
    4 Tags: record label, artist, music, musician, releases, songs, tracks, labelgrid, spotify api, free download, pre-save,download gate, free music
     4Tags: record label, artist, music, musician, releases
    55Requires at least: 5.0.0
    6 Tested up to: 6.5
     6Tested up to: 6.7
    77Stable tag: /trunk/
    88Requires PHP: 8.0
     
    8282== Changelog ==
    8383
     84= 1.3.59 =
     85* Fix vulnerabilities in admin for Cross Site Scripting (XSS) (OWASP A3: Injection (2021))
     86
    8487= 1.3.58 =
    8588* Fix issue from LabelGrid content update where the content (release/artist) wasn't correctly updated after being re-imported from LabelGrid Catalog
  • label-grid-tools/trunk/admin/class-gate-entries-table.php

    r2503520 r3178877  
    3535
    3636        $this->table_name = LabelGrid_Tools::lgt_prefixTableName('gate_entries', true);
    37        
    38        
    39        
    40        
    41             add_action( 'init', 'func_export_entries' );
    42        
    43        
     37
     38
     39
     40
     41        add_action('init', 'func_export_entries');
    4442    }
    4543
     
    8280                return $item['created_at'];
    8381            case 'type':
    84                 if($item['type']==0) $type='Gate';
    85                 else $type='Pre-Save';
     82                if ($item['type'] == 0) $type = 'Gate';
     83                else $type = 'Pre-Save';
    8684                return $type;
    8785            default:
     
    147145    function column_cb($item)
    148146    {
    149         return sprintf('<input type="checkbox" name="%1$s[]" value="%2$s" />',
    150             /*$1%s*/ $this->_args['singular'], // Let's simply repurpose the table's singular label ("movie")
    151         /* $2%s */
    152         $item['id'] // The value of the checkbox should be the record's id
     147        return sprintf(
     148            '<input type="checkbox" name="%1$s[]" value="%2$s" />',
     149            /*$1%s*/
     150            $this->_args['singular'], // Let's simply repurpose the table's singular label ("movie")
     151            /* $2%s */
     152            $item['id'] // The value of the checkbox should be the record's id
    153153        );
    154154    }
     
    313313        $query = "SELECT * FROM `" . $wpdb->prefix . $this->table_name . "` WHERE 1=1 ";
    314314
     315        // Sanitize and validate `gate-filter` as an integer ID
    315316        if (isset($_GET['gate-filter'])) {
    316             $query = $query . " AND `gate_id`='" . esc_sql($_GET['gate-filter']) . "'";
    317         }
    318        
     317            $gate_filter = absint($_GET['gate-filter']); // Ensure it's a positive integer
     318            if ($gate_filter > 0) { // Only add to query if it's a valid ID
     319                $query .= " AND `gate_id`='" . esc_sql($gate_filter) . "'";
     320            }
     321        }
     322
     323        // Sanitize and validate `type-filter` as an integer ID
    319324        if (isset($_GET['type-filter'])) {
    320             $query = $query . " AND `type`='" . esc_sql($_GET['type-filter']) . "'";
    321         }
    322 
    323         $query = $query . ' ORDER BY id DESC';
    324 
     325            $type_filter = absint($_GET['type-filter']); // Ensure it's a positive integer
     326            if ($type_filter > 0) { // Only add to query if it's a valid ID
     327                $query .= " AND `type`='" . esc_sql($type_filter) . "'";
     328            }
     329        }
     330
     331        $query .= ' ORDER BY id DESC';
    325332        $sql_results = $wpdb->get_results($query);
    326333
    327         $data = array();
    328         // loop through all requests to build possible array
     334        $data = [];
    329335        foreach ($sql_results as $row) {
    330             // $product_ids[] = $row->product_id;
    331 
    332336            $entry['id'] = $row->id;
    333337            $entry['created_at'] = $row->created_at;
    334             $entry['email'] = $row->email;
    335             $entry['gate_id'] = $row->gate_id;
    336             $entry['session_id'] = $row->session_id;
    337             $entry['type'] = $row->type;
    338             $entry['connected_services'] = $row->connected_services;
     338            $entry['email'] = esc_html($row->email);  // Escape output
     339            $entry['gate_id'] = esc_html($row->gate_id);  // Escape output
     340            $entry['session_id'] = esc_html($row->session_id);  // Escape output
     341            $entry['type'] = esc_html($row->type);  // Escape output
     342            $entry['connected_services'] = esc_html($row->connected_services);  // Escape output
    339343
    340344            $data[] = $entry;
    341345        }
    342 
    343         // var_dump($data);
    344346
    345347        return $data;
     
    502504        }
    503505
    504         return ($order === 'asc') ? $result : - $result; // Send final sort direction to usort
     506        return ($order === 'asc') ? $result : -$result; // Send final sort direction to usort
    505507    }
    506508
     
    510512
    511513        if ($which == "top") {
    512             ?>
    513         <div class="alignleft actions bulkactions">
    514         <?php
    515 
    516             $args = array(
    517                 'post_type' => 'gate_download',
    518                 'posts_per_page' => - 1
    519             );
    520             $loop = new WP_Query($args);
    521             if ($loop->have_posts()) :
    522 
    523             if(isset($_GET['type-filter'])) $log_url = '&type-filter='.$_GET['type-filter'].'&gate-filter=';
    524             else  $log_url = '&gate-filter=';
    525            
     514?>
     515            <div class="alignleft actions bulkactions">
     516                <?php
     517
     518                $args = array(
     519                    'post_type' => 'gate_download',
     520                    'posts_per_page' => -1
     521                );
     522                $loop = new WP_Query($args);
     523                if ($loop->have_posts()) :
     524
     525                    if (isset($_GET['type-filter'])) $log_url = '&type-filter=' . $_GET['type-filter'] . '&gate-filter=';
     526                    else  $log_url = '&gate-filter=';
     527
    526528                ?>
    527         <select name="gate-filter" class="lg-gate-filter">
    528         <option value=""><?php _e('All Gates', LabelGrid_Tools::$plugin_name); ?></option>
    529         <?php
    530 
    531                 while ($loop->have_posts()) :
    532                     $loop->the_post();
    533                     $selected = '';
    534                     if (isset($_GET['gate-filter']) && $_GET['gate-filter'] == get_the_ID()) {
    535                         $selected = ' selected = "selected"';
     529                    <select name="gate-filter" class="lg-gate-filter">
     530                        <option value=""><?php _e('All Gates', LabelGrid_Tools::$plugin_name); ?></option>
     531                        <?php
     532
     533                        while ($loop->have_posts()) :
     534                            $loop->the_post();
     535                            $selected = '';
     536                            if (isset($_GET['gate-filter']) && $_GET['gate-filter'] == get_the_ID()) {
     537                                $selected = ' selected = "selected"';
     538                            }
     539                        ?>
     540                            <option value="<?php echo $log_url . get_the_ID(); ?>" <?php echo $selected; ?>><?php the_title(); ?></option>
     541                        <?php
     542                        endwhile;
     543
     544                        ?>
     545                    </select>
     546                <?php
     547
     548                endif;
     549
     550                wp_reset_postdata();
     551
     552
     553                $type = array(
     554                    0 => 'Gate',
     555                    1 => 'Pre-Save'
     556                );
     557
     558
     559
     560                if (isset($_GET['gate-filter'])) $status_url = '&gate-filter=' . $_GET['gate-filter'] . '&type-filter=';
     561                else  $status_url = '&type-filter=';
     562
     563                ?>
     564                <select name="type-filter" class="lg-type-filter">
     565                    <option value=""><?php _e('All Types', LabelGrid_Tools::$plugin_name); ?></option>
     566                    <?php
     567                    foreach ($type as $id => $name) {
     568                        $selected = '';
     569                        if (isset($_GET['type-filter']) && (int)$_GET['type-filter'] == $id) {
     570                            $selected = ' selected = "selected"';
     571                        }
     572                    ?>
     573                        <option value="<?php echo $status_url . $id; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
     574                    <?php
    536575                    }
    537576                    ?>
    538                     <option value="<?php echo $log_url . get_the_ID(); ?>" <?php echo $selected; ?>><?php the_title(); ?></option>
    539                     <?php
    540                 endwhile
    541                 ;
    542 
    543                 ?>
    544         </select>
    545         <?php
    546        
    547         endif;
    548 
    549             wp_reset_postdata();
    550            
    551            
    552             $type=array(
    553                 0=>'Gate',
    554                 1=>'Pre-Save'
    555             );
    556            
    557      
    558                
    559                 if(isset($_GET['gate-filter'])) $status_url = '&gate-filter='.$_GET['gate-filter'].'&type-filter=';
    560                 else  $status_url = '&type-filter=';
    561                
    562                 ?>
    563                 <select name="type-filter" class="lg-type-filter">
    564                 <option value=""><?php _e('All Types', LabelGrid_Tools::$plugin_name); ?></option>
    565                 <?php
    566                 foreach ($type as $id => $name) {
    567                     $selected = '';
    568                     if (isset($_GET['type-filter']) && (int)$_GET['type-filter'] == $id) {
    569                         $selected = ' selected = "selected"';
    570                     }
    571                     ?>
    572                     <option value="<?php echo $status_url . $id; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
    573                     <?php
    574                 }
    575                 ?>
    576                 </select>
    577        
    578            
    579             <input type="submit" name="export_entries" id="export_entries" class="button button-primary" value="Export to CSV" />
    580              
    581         </div>
     577                </select>
     578
     579
     580                <input type="submit" name="export_entries" id="export_entries" class="button button-primary" value="Export to CSV" />
     581
     582            </div>
    582583<?php
    583584        }
     
    586587        }
    587588    }
    588    
    589    
    590    
    591589}
  • label-grid-tools/trunk/admin/class-system-logs-table.php

    r2503520 r3178877  
    9595    {
    9696        switch ($column_name) {
    97             // case 'rating':
    98             // case 'director':
     97                // case 'rating':
     98                // case 'director':
    9999            case 'id':
    100100            case 'action':
     
    171171    function column_cb($item)
    172172    {
    173         return sprintf('<input type="checkbox" name="%1$s[]" value="%2$s" />',
    174             /*$1%s*/ $this->_args['singular'], // Let's simply repurpose the table's singular label ("movie")
    175         /* $2%s */
    176         $item['id'] // The value of the checkbox should be the record's id
     173        return sprintf(
     174            '<input type="checkbox" name="%1$s[]" value="%2$s" />',
     175            /*$1%s*/
     176            $this->_args['singular'], // Let's simply repurpose the table's singular label ("movie")
     177            /* $2%s */
     178            $item['id'] // The value of the checkbox should be the record's id
    177179        );
    178180    }
     
    198200        $columns = array(
    199201            'cb' => '<input type="checkbox" />', // Render a checkbox instead of text
    200                                                   // 'title' => 'Title',
    201                                                   // 'rating' => 'Rating',
    202                                                   // 'director' => 'Director'
     202            // 'title' => 'Title',
     203            // 'rating' => 'Rating',
     204            // 'director' => 'Director'
    203205            'id' => 'ID',
    204206            'time' => 'Date',
     
    329331        global $wpdb;
    330332        $query = "SELECT * FROM `" . $wpdb->prefix . $this->table_name . "` WHERE 1=1 ";
    331         if (! empty($_GET['log-filter'])) {
    332             $query = $query . " AND `channel`='" . esc_sql($_GET['log-filter']) . "'";
    333         }
    334         if (! empty($_GET['level-filter'])) {
    335             $query = $query . " AND `level`='" . esc_sql($_GET['level-filter']) . "'";
    336         }
    337         $query = $query . ' ORDER BY id DESC';
    338 
     333
     334        // Sanitize `log-filter` as text
     335        if (!empty($_GET['log-filter'])) {
     336            $log_filter = sanitize_text_field($_GET['log-filter']); // Sanitize text input
     337            $query .= " AND `channel`='" . esc_sql($log_filter) . "'";
     338        }
     339
     340        // Sanitize and validate `level-filter` as a number
     341        if (!empty($_GET['level-filter'])) {
     342            $level_filter = absint($_GET['level-filter']); // Ensure it's a positive integer
     343            if ($level_filter >= 0) { // Only add to query if it's a valid level
     344                $query .= " AND `level`='" . esc_sql($level_filter) . "'";
     345            }
     346        }
     347
     348        $query .= ' ORDER BY id DESC';
    339349        $sql_results = $wpdb->get_results($query);
    340350
    341         $data = array();
    342         // loop through all requests to build possible array
     351        $data = [];
    343352        foreach ($sql_results as $row) {
    344             // $product_ids[] = $row->product_id;
    345 
    346             if (isset($_REQUEST['log_action']) && "" != $_REQUEST['log_action'] && $_REQUEST['log_action'] != strtolower(str_replace(' ', '-', $row->action))) {
     353            if (
     354                isset($_REQUEST['log_action']) && $_REQUEST['log_action'] !== "" &&
     355                strtolower(str_replace(' ', '-', $row->action)) !== $_REQUEST['log_action']
     356            ) {
    347357                continue;
    348358            }
    349359
    350360            $entry['id'] = $row->id;
    351             $entry['time'] = $row->time;
    352             // $entry['user'] = $row->user;
    353             // $entry['action'] = $row->action;
    354             // $entry['message'] = $row->message;
    355             // $entry['timestamp'] = $row->unix_timestamp;
    356             $entry['channel'] = $row->channel;
    357             $entry['level'] = $row->level;
    358             $entry['message'] = $row->message;
     361            $entry['time'] = esc_html($row->time);  // Escape output
     362            $entry['channel'] = esc_html($row->channel);  // Escape output
     363            $entry['level'] = esc_html($row->level);  // Escape output
     364            $entry['message'] = esc_html($row->message);  // Escape output
    359365
    360366            $data[] = $entry;
    361367        }
    362368
    363         // var_dump($data);
    364 
    365369        return $data;
    366370    }
     371
    367372
    368373    /**
     
    426431         */
    427432        $this->process_bulk_action();
    428        
     433
    429434        /**
    430435         * Instead of querying a database, we're going to fetch the example data
     
    437442         * be able to use your precisely-queried data immediately.
    438443         */
    439        
     444
    440445        $data = $this->load_data();
    441        
     446
    442447        usort($data, array(
    443448            $this,
    444449            'usort_reorder'
    445450        ));
    446        
     451
    447452        /**
    448453         * *********************************************************************
     
    459464         * ********************************************************************
    460465         */
    461        
     466
    462467        /**
    463468         * REQUIRED for pagination.
     
    467472         */
    468473        $current_page = $this->get_pagenum();
    469        
     474
    470475        /**
    471476         * REQUIRED for pagination.
     
    476481         */
    477482        $total_items = count($data);
    478        
     483
    479484        /**
    480485         * The WP_List_Table class does not handle pagination for us, so we need
     
    484489         */
    485490        $data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
    486        
     491
    487492        /**
    488493         * REQUIRED.
     
    491496         */
    492497        $this->items = $data;
    493        
     498
    494499        /**
    495500         * REQUIRED.
     
    502507        ));
    503508    }
    504    
     509
    505510    /**
    506511     * This checks for sorting input and sorts the data in our array accordingly.
     
    515520        $orderby = (! empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'id'; // If no sort, default to title
    516521        $order = (! empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'desc'; // If no order, default to asc
    517        
     522
    518523        if (is_numeric($a[$orderby]) && is_numeric($b[$orderby])) {
    519524            $result = bccomp($a[$orderby], $b[$orderby]); // Determine sort order
     
    521526            $result = strcmp($a[$orderby], $b[$orderby]); // Determine sort order
    522527        }
    523        
    524         return ($order === 'asc') ? $result : - $result; // Send final sort direction to usort
    525     }
    526    
     528
     529        return ($order === 'asc') ? $result : -$result; // Send final sort direction to usort
     530    }
     531
    527532    function extra_tablenav($which)
    528533    {
    529534        global $wpdb;
    530        
     535
    531536        if ($which == "top") {
    532             ?>
    533 <div class="alignleft actions bulkactions">
    534         <?php
    535             $log_channels = $wpdb->get_results('SELECT DISTINCT channel FROM `' . $wpdb->prefix . $this->table_name . '` order by channel asc', ARRAY_A);
    536             if ($log_channels) {
    537                
    538                 if(!empty($_GET['level-filter'])) $log_url = '&level-filter='.$_GET['level-filter'].'&log-filter=';
    539                 else  $log_url = '&log-filter=';
    540                    
    541                     ?>
    542                 <select name="log-filter" class="lg-log-filter-cat">
    543                 <option value=""><?php _e('All Channels', LabelGrid_Tools::$plugin_name); ?></option>
     537?>
     538            <div class="alignleft actions bulkactions">
    544539                <?php
    545                 foreach ($log_channels as $channel) {
    546                     $selected = '';
    547                     if (isset($_GET['log-filter']) && $_GET['log-filter'] == $channel['channel']) {
    548                         $selected = ' selected = "selected"';
    549                     }
    550                     ?>
    551                     <option value="<?php echo $log_url . $channel['channel']; ?>" <?php echo $selected; ?>><?php echo $channel['channel']; ?></option>
    552                     <?php
     540                $log_channels = $wpdb->get_results('SELECT DISTINCT channel FROM `' . $wpdb->prefix . $this->table_name . '` order by channel asc', ARRAY_A);
     541                if ($log_channels) {
     542
     543                    if (!empty($_GET['level-filter'])) $log_url = '&level-filter=' . $_GET['level-filter'] . '&log-filter=';
     544                    else  $log_url = '&log-filter=';
     545
     546                ?>
     547                    <select name="log-filter" class="lg-log-filter-cat">
     548                        <option value=""><?php _e('All Channels', LabelGrid_Tools::$plugin_name); ?></option>
     549                        <?php
     550                        foreach ($log_channels as $channel) {
     551                            $selected = '';
     552                            if (isset($_GET['log-filter']) && $_GET['log-filter'] == $channel['channel']) {
     553                                $selected = ' selected = "selected"';
     554                            }
     555                        ?>
     556                            <option value="<?php echo $log_url . $channel['channel']; ?>" <?php echo $selected; ?>><?php echo $channel['channel']; ?></option>
     557                        <?php
     558                        }
     559                        ?>
     560                    </select>
     561                <?php
     562                }
     563
     564                $log_status = array(
     565                    100 => 'debug',
     566                    200 => 'info',
     567                    250 => 'notice',
     568                    300 => 'warning',
     569                    400 => 'error',
     570                    500 => 'critical',
     571                    550 => 'alert',
     572                    600 => 'emergency'
     573                );
     574
     575                if ($log_status) {
     576
     577                    if (isset($_GET['log-filter'])) $status_url = '&log-filter=' . $_GET['log-filter'] . '&level-filter=';
     578                    else  $status_url = '&level-filter=';
     579
     580                ?>
     581                    <select name="level-filter" class="lg-level-filter-cat">
     582                        <option value=""><?php _e('All Levels', LabelGrid_Tools::$plugin_name); ?></option>
     583                        <?php
     584                        foreach ($log_status as $id => $name) {
     585                            $selected = '';
     586                            if (!empty($_GET['level-filter']) && $_GET['level-filter'] == $id) {
     587                                $selected = ' selected = "selected"';
     588                            }
     589                        ?>
     590                            <option value="<?php echo $status_url . $id; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
     591                        <?php
     592                        }
     593                        ?>
     594                    </select>
     595                <?php
    553596                }
    554597                ?>
    555                 </select>
    556             <?php
    557             }
    558            
    559             $log_status=array(
    560                     100=>'debug',
    561                     200=>'info',
    562                     250=>'notice',
    563                     300=>'warning',
    564                     400=>'error',
    565                     500=>'critical',
    566                     550=>'alert',
    567                     600=>'emergency'
    568                     );
    569            
    570             if ($log_status) {
    571                
    572                 if(isset($_GET['log-filter'])) $status_url = '&log-filter='.$_GET['log-filter'].'&level-filter=';
    573                 else  $status_url = '&level-filter=';
    574                
    575                 ?>
    576                 <select name="level-filter" class="lg-level-filter-cat">
    577                 <option value=""><?php _e('All Levels', LabelGrid_Tools::$plugin_name); ?></option>
    578                 <?php
    579                 foreach ($log_status as $id => $name) {
    580                     $selected = '';
    581                     if (!empty($_GET['level-filter']) && $_GET['level-filter'] == $id) {
    582                         $selected = ' selected = "selected"';
    583                     }
    584                     ?>
    585                     <option value="<?php echo $status_url . $id; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
    586                     <?php
    587                 }
    588                 ?>
    589                 </select>
    590             <?php
    591             }
    592             ?> 
    593         </div>
     598            </div>
    594599<?php
    595600        }
  • label-grid-tools/trunk/labelgrid-tools.php

    r3101912 r3178877  
    1515 * Plugin Name:       LabelGrid Tools
    1616 * Description:       LabelGrid Tools is an advanced plugin for Record Labels, Artists, and Distributors that allow to showcase music releases with ease providing advanced promotional and pre-release tools.
    17  * Version:           1.3.58
     17 * Version:           1.3.59
    1818 * Author:            LabelGrid
    1919 * Author URI:        https://labelgrid.com
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define('LGT_PLUGIN_VERSION', '1.3.58');
     36define('LGT_PLUGIN_VERSION', '1.3.59');
    3737
    3838/**
  • label-grid-tools/trunk/public/class-labelgrid-tools-public.php

    r3101912 r3178877  
    392392            }
    393393            if (!empty($release_data['show_artist_bandsintown']) && $release_data['show_artist_bandsintown'] != 'no') {
    394                 $html .= '<div id="bandsintown_events_box"><script charset="utf-8" src="https://widget.bandsintown.com/main.min.js"></script><a class="bit-widget-initializer" data-artist-name="' . get_the_title() . '" data-display-local-dates="false" data-display-past-dates="false" data-auto-style="false" data-text-color="#000000" data-link-color="#be1e2d" data-background-color="rgba(0,0,0,0)" data-display-limit="5" data-display-start-time="false" data-link-text-color="#FFFFFF" data-display-lineup="false" data-display-play-my-city="false" data-separator-color="rgba(124,124,124,0.25)"></a></div>';
     394                // Conditionally enqueue the Bandsintown widget script
     395                wp_enqueue_script(
     396                    'bandsintown-widget',
     397                    'https://widget.bandsintown.com/main.min.js',
     398                    [],
     399                    null,
     400                    true // Load in the footer
     401                );
     402
     403                // Output the HTML for the widget
     404                $html .= '<div id="bandsintown_events_box">';
     405                $html .= '<a class="bit-widget-initializer" data-artist-name="' . esc_attr(get_the_title()) . '" data-display-local-dates="false" data-display-past-dates="false" data-auto-style="false" data-text-color="#000000" data-link-color="#be1e2d" data-background-color="rgba(0,0,0,0)" data-display-limit="5" data-display-start-time="false" data-link-text-color="#FFFFFF" data-display-lineup="false" data-display-play-my-city="false" data-separator-color="rgba(124,124,124,0.25)"></a>';
     406                $html .= '</div>';
    395407            }
    396408
  • label-grid-tools/trunk/public/templates/lite_gate.php

    r2544660 r3178877  
    1414$release_wp_id = get_the_ID();
    1515$release_image = get_post_meta($release_wp_id, '_lgt_release_image', true);
    16 if (empty($release_image)) $release_image = get_post_meta($release_wp_id, '_lgt_gate_cover_image', true);
     16if (empty($release_image)) {
     17    $release_image = get_post_meta($release_wp_id, '_lgt_gate_cover_image', true);
     18}
    1719$artwork_medium = wp_get_attachment_image_src($release_image, 'lgt_artwork_medium');
    1820$category = wp_get_object_terms($release_wp_id, 'record_label', array(
     
    2628<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    2729<meta name="viewport" content="width=device-width, initial-scale=1.0">
    28     <?php wp_head(); ?>
     30    <?php wp_head(); ?>
    2931</head>
    3032<body id="lg_lite_page">
    31     <div id="lg_custom_background">
    32 <?php echo '<img src="' . $artwork_medium[0] . '" alt="' . get_the_title() . '" title="' . get_the_title() .'">'; ?>
    33 </div>
    34     <main id="lg_content_release" class="release_detail release_lite">
    35         <div class="release_box_content">
    36             <div class="release_title">
    37                 <h1><?php echo get_the_title();?></h1> <?php if(!empty($category[0])) echo __('Released by ', 'labelgrid-tools').$category[0];?>
    38             </div>
    39             <div class="artwork">
    40                 <?php echo '<img src="' . $artwork_medium[0] . '" alt="' . get_the_title() . '" title="' . get_the_title() .'">'; ?>
    41             </div>
    42             <div class="release_links"><div id="releaselinks">
    43                 <?php echo do_shortcode( '[labelgrid-gate-button gate-id="' . $release_wp_id . '" ]' ); ?>
    44             </div></div>
    45         </div>
    46     </main>
    47 <?php wp_footer(); ?>
     33    <div id="lg_custom_background">
     34        <?php echo '<img src="' . esc_url($artwork_medium[0]) . '" alt="' . esc_attr(get_the_title()) . '" title="' . esc_attr(get_the_title()) . '">'; ?>
     35    </div>
     36    <main id="lg_content_release" class="release_detail release_lite">
     37        <div class="release_box_content">
     38            <div class="release_title">
     39                <h1><?php echo esc_html(get_the_title()); ?></h1>
     40                <?php
     41                if (!empty($category[0])) {
     42                    echo esc_html(__('Released by ', 'labelgrid-tools')) . esc_html($category[0]);
     43                }
     44                ?>
     45            </div>
     46            <div class="artwork">
     47                <?php echo '<img src="' . esc_url($artwork_medium[0]) . '" alt="' . esc_attr(get_the_title()) . '" title="' . esc_attr(get_the_title()) . '">'; ?>
     48            </div>
     49            <div class="release_links">
     50                <div id="releaselinks">
     51                    <?php echo do_shortcode('[labelgrid-gate-button gate-id="' . esc_attr($release_wp_id) . '" ]'); ?>
     52                </div>
     53            </div>
     54        </div>
     55    </main>
     56    <?php wp_footer(); ?>
    4857</body>
    4958</html>
  • label-grid-tools/trunk/public/templates/lite_release.php

    r2544660 r3178877  
    1414$release_wp_id = get_the_ID();
    1515$release_image = get_post_meta($release_wp_id, '_lgt_release_image', true);
    16 if (empty($release_image)) $release_image = get_post_meta($release_wp_id, '_lgt_gate_cover_image', true);
     16if (empty($release_image)) {
     17    $release_image = get_post_meta($release_wp_id, '_lgt_gate_cover_image', true);
     18}
    1719$artwork_medium = wp_get_attachment_image_src($release_image, 'lgt_artwork_medium');
    1820$category = wp_get_object_terms($release_wp_id, 'record_label', array(
     
    2628<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    2729<meta name="viewport" content="width=device-width, initial-scale=1.0">
    28     <?php wp_head(); ?>
     30    <?php wp_head(); ?>
    2931</head>
    3032<body id="lg_lite_page">
    31     <div id="lg_custom_background">
    32 <?php echo '<img src="' . $artwork_medium[0] . '" alt="' . get_the_title() . '" title="' . get_the_title() .'">'; ?>
    33 </div>
    34     <main id="lg_content_release" class="release_detail release_lite">
    35         <div class="release_box_content">
    36             <div class="release_title">
    37                 <h1><?php echo get_the_title();?></h1> <?php if(!empty($category[0])) echo __('Released by ', 'labelgrid-tools').$category[0];?>
    38             </div>
    39             <div class="artwork">
    40                 <?php echo '<img src="' . $artwork_medium[0] . '" alt="' . get_the_title() . '" title="' . get_the_title() .'">'; ?>
    41             </div>
    42             <div class="release_links">
    43                 <?php echo do_shortcode( '[labelgrid-release-links]' ); ?>
    44             </div>
    45         </div>
    46     </main>
    47 <?php wp_footer(); ?>
     33    <div id="lg_custom_background">
     34        <?php echo '<img src="' . esc_url($artwork_medium[0]) . '" alt="' . esc_attr(get_the_title()) . '" title="' . esc_attr(get_the_title()) . '">'; ?>
     35    </div>
     36    <main id="lg_content_release" class="release_detail release_lite">
     37        <div class="release_box_content">
     38            <div class="release_title">
     39                <h1><?php echo esc_html(get_the_title()); ?></h1>
     40                <?php
     41                if (!empty($category[0])) {
     42                    echo esc_html(__('Released by ', 'labelgrid-tools')) . esc_html($category[0]);
     43                }
     44                ?>
     45            </div>
     46            <div class="artwork">
     47                <?php echo '<img src="' . esc_url($artwork_medium[0]) . '" alt="' . esc_attr(get_the_title()) . '" title="' . esc_attr(get_the_title()) . '">'; ?>
     48            </div>
     49            <div class="release_links">
     50                <?php echo do_shortcode('[labelgrid-release-links]'); ?>
     51            </div>
     52        </div>
     53    </main>
     54    <?php wp_footer(); ?>
    4855</body>
    4956</html>
Note: See TracChangeset for help on using the changeset viewer.