Plugin Directory

Changeset 2254779


Ignore:
Timestamp:
03/05/2020 02:08:36 AM (6 years ago)
Author:
hahncgdev
Message:

version 4.8.4 - Fixed Parameter must be an object warning on add images page.

Location:
wp-easy-gallery/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wp-easy-gallery/trunk/admin/add-gallery.php

    r2137518 r2254779  
    11<?php
    22if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
    3 /*
    4 $galleryName = '';
    5 $galleryDescription = '';     
    6 $slug = '';
    7 $imagepath = '';
    8 $thumbwidth = '';
    9 $thumbheight = '';
    103
    11 $galleryAdded = false;
    12    
    13     if(isset($_POST['hcg_add_gallery']))
    14     {
    15         if(check_admin_referer('wpeg_add_gallery','wpeg_add_gallery')) {
    16           if($_POST['galleryName'] != "") {
    17             $galleryName = sanitize_text_field($_POST['galleryName']);
    18             $galleryDescription = sanitize_text_field($_POST['galleryDescription']);     
    19             $slug = mb_convert_case(str_replace(" ", "", sanitize_text_field($_POST['galleryName'])), MB_CASE_LOWER, "UTF-8");
    20             $imagepath = sanitize_text_field(str_replace("\\", "", $_POST['upload_image']));
    21             $thumbwidth = sanitize_text_field($_POST['gallerythumbwidth']);
    22             $thumbheight = sanitize_text_field($_POST['gallerythumbheight']);
    23            
    24             global $wpdb;
    25             global $easy_gallery_table;
    26            
    27             $gallery = $wpdb->get_row( "SELECT * FROM $wpdb->easyGalleries WHERE slug = '".$slug."'" );
    28            
    29             if (count($gallery) > 0) {
    30                 $slug = $slug."-".count($gallery); 
    31             }
    32            
    33             $galleryAdded = $wpdb->insert( $wpdb->easyGalleries, array( 'name' => $galleryName, 'slug' => $slug, 'description' => $galleryDescription, 'thumbnail' => $imagepath, 'thumbwidth' => $thumbwidth, 'thumbheight' => $thumbheight ) );
    34            
    35             $galleryNew = $wpdb->get_row( "SELECT * FROM $wpdb->easyGalleries WHERE slug = '".$slug."'" );
    36            
    37             if($galleryAdded) {
    38             ?> 
    39             <div class="updated"><p><strong><?php _e('Gallery Added.' ); ?></strong></p></div> 
    40             <?php
    41             }
    42           }
    43           else {
    44               ?> 
    45             <div class="updated"><p><strong><?php _e('Please enter a gallery name.' ); ?></strong></p></div> 
    46             <?php
    47           }
    48         }
    49     }*/
    504    ob_start();
    515?>
  • wp-easy-gallery/trunk/admin/add-images.php

    r2125007 r2254779  
    33
    44global $wpdb;
    5 $imageResults = null;
     5$imageResults = [];
    66$galleryResults = $wpdb->get_results( "SELECT * FROM $wpdb->easyGalleries" );
    77
     
    1515}
    1616
    17 /*
    18 //Edit/Delete Images
    19 if(isset($_POST['editing_images'])) {
    20     if(check_admin_referer('wpeg_gallery','wpeg_gallery')) {
    21         $_POST = stripslashes_deep( $_POST );
    22        
    23         $editImageIds = array_map('absint', $_POST['edit_imageId']);
    24         $imagePaths = array_map('sanitize_text_field', $_POST['edit_imagePath']);
    25         $imageTitles = array_map('sanitize_text_field', $_POST['edit_imageTitle']);
    26         $imageDescriptions = array_map('sanitize_text_field', $_POST['edit_imageDescription']);
    27         $sortOrders = array_map('absint', $_POST['edit_imageSort']);
    28         $imagesToDelete = isset($_POST['edit_imageDelete']) ? array_map('absint', $_POST['edit_imageDelete']) : array();
    29    
    30         $i = 0;
    31         foreach($editImageIds as $editImageId) {
    32             if(in_array($editImageId, $imagesToDelete)) {
    33                 $wpdb->query( "DELETE FROM $wpdb->easyImages WHERE Id = '".$editImageId."'" );
    34                 echo "Deleted: ".$imageTitles[$i];
    35             }
    36             else {
    37                 $imageEdited = $wpdb->update( $wpdb->easyImages, array( 'imagePath' => $imagePaths[$i], 'title' => $imageTitles[$i], 'description' => $imageDescriptions[$i], 'sortOrder' => $sortOrders[$i] ), array( 'Id' => $editImageId ) );
    38             }       
    39             $i++;
    40         }         
    41       ?> 
    42       <div class="updated"><p><strong><?php _e('Images have been edited.' ); ?></strong></p></div> 
    43       <?php     
    44     }
    45 }
    46 */
    4717if(isset($_POST['editing_gid'])) {
    4818    if(check_admin_referer('wpeg_gallery','wpeg_gallery')) {
  • wp-easy-gallery/trunk/admin/edit-gallery.php

    r2137518 r2254779  
    1212      $gallery = $wpdb->get_row( "SELECT * FROM $wpdb->easyGalleries WHERE Id = $gid" );   
    1313}
    14 /* 
    15 if(isset($_POST['hcg_edit_gallery']))
    16 {
    17     if(check_admin_referer('wpeg_gallery','wpeg_gallery')) {
    18       if($_POST['galleryName'] != "") {
    19         $galleryName = sanitize_text_field($_POST['galleryName']);
    20         $galleryDescription = sanitize_text_field($_POST['galleryDescription']);     
    21         $slug = mb_convert_case(str_replace(" ", "", sanitize_text_field($_POST['galleryName'])), MB_CASE_LOWER, "UTF-8");
    22         $imagepath = sanitize_text_field(str_replace("\\", "", $_POST['upload_image']));
    23         $thumbwidth = sanitize_text_field($_POST['gallerythumbwidth']);
    24         $thumbheight = sanitize_text_field($_POST['gallerythumbheight']);
    25        
    26         if(isset($_POST['hcg_edit_gallery'])) {
    27             $imageEdited = $wpdb->update( $wpdb->easyGalleries, array( 'name' => $galleryName, 'slug' => $slug, 'description' => $galleryDescription, 'thumbnail' => $imagepath, 'thumbwidth' => $thumbwidth, 'thumbheight' => $thumbheight ), array( 'Id' => intval($_POST['hcg_edit_gallery']) ) );
    28                
    29                 ?> 
    30                 <div class="updated"><p><strong><?php _e('Gallery has been edited.' ); ?></strong></p></div> 
    31                 <?php
    32         }
    33       }
    34     }
    35 }
    36 */
     14
    3715if(isset($_POST['hcg_edit_gallery'])) {
    3816    if(check_admin_referer('wpeg_gallery','wpeg_gallery')) {
  • wp-easy-gallery/trunk/admin/overview.php

    r2137518 r2254779  
    55$galleryResults = $wpdb->get_results( "SELECT * FROM $wpdb->easyGalleries" );
    66
    7 /*
    8 if (isset($_POST['defaultSettings'])) {
    9     if(check_admin_referer('wpeg_settings','wpeg_settings')) {
    10       $temp_defaults = get_option('wp_easy_gallery_defaults');
    11       $temp_defaults['hide_social'] = isset($_POST['hide_social']) ? $_POST['hide_social'] : 'false';
    12          
    13       update_option('wp_easy_gallery_defaults', $temp_defaults);
    14      
    15       ?> 
    16       <div class="updated"><p><strong><?php _e('Options saved.', 'wp-easy-gallery'); ?></strong></p></div> 
    17       <?php
    18     }
    19 }
    20 $default_options = get_option('wp_easy_gallery_defaults');
    21 */
    227ob_start();
    238?>
  • wp-easy-gallery/trunk/readme.txt

    r2228213 r2254779  
    66Tested up to: 5.3
    77Requires PHP: 5.6
    8 Stable tag: 4.8.3
     8Stable tag: 4.8.4
    99
    1010WP Easy Gallery is a powerful WordPress gallery plugin that is easy to use. WP Easy Gallery gives you the power to create and manage unlimited image galleries.
     
    152152== Changelog ==
    153153
     154**v4.8.4**
     155
     156* Fixed Parameter must be an object warning on add images page.
     157
    154158**v4.8.3**
    155159
  • wp-easy-gallery/trunk/wp-easy-gallery.php

    r2154519 r2254779  
    77    Text Domain: wp-easy-gallery
    88    Domain Path: /languages
    9     Version: 4.8.3
     9    Version: 4.8.4
    1010    Author URI: https://plugingarden.com/
    1111    */
     
    1717        public function __construct() {
    1818            $this->plugin_name = plugin_basename(__FILE__);
    19             $this->plugin_version = "4.8.3";
     19            $this->plugin_version = "4.8.4";
    2020            $this->db_version = "1.3";
    2121           
Note: See TracChangeset for help on using the changeset viewer.