Plugin Directory

Changeset 1670524


Ignore:
Timestamp:
06/04/2017 04:12:12 PM (9 years ago)
Author:
phd38
Message:

PHP 7.0 notices cleanup

Location:
wp-mediatagger/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-mediatagger/trunk/mediatagger.php

    r1670397 r1670524  
    66Author: www.photos-dauphine.com
    77Author URI: http://www.photos-dauphine.com/
    8 Version: 4.1
    9 Stable Tag: 4.1
     8Version: 4.1.1
     9Stable Tag: 4.1.1
    1010*/
    1111
     
    283283    //
    284284    private function load_options(&$admin_msg){
     285        $force_serialize = 0;
    285286       
    286287        // Plugin options :                             
     
    14581459        }
    14591460       
    1460         $tax_id_list = (isset($tax_id_list) ? $tax_id_list : ($_POST['search'] == "Clear" ? array() : $_POST['mdtg_tags']));
     1461        $p_search = isset($_POST['search']) ? $_POST['search'] : NULL;
     1462        $p_mdtg_tags = isset($_POST['mdtg_tags']) ? $_POST['mdtg_tags'] : NULL;
     1463        $p_free_search = isset($_POST['free_search']) ? $_POST['free_search'] : NULL;
     1464        $p_last_free_search = isset($_POST['last_free_search']) ? $_POST['last_free_search'] : NULL;
     1465        $p_link_triggered = isset($_POST['link_triggered']) ? $_POST['link_triggered'] : NULL;
     1466        $p_search = isset($_POST['search']) ? $_POST['search'] : NULL;
     1467        $p_search_mode = isset($_POST['search_mode']) ? $_POST['search_mode'] : NULL;
     1468        $p_coming_from_widget = isset($_POST['coming_from_widget']) ? $_POST['coming_from_widget'] : NULL;
     1469       
     1470        // $tax_id_list = (isset($tax_id_list) ? $tax_id_list : ($_POST['search'] == "Clear" ? array() : $_POST['mdtg_tags']));
     1471        // changed to line below to avoid NOTICE messages in log file
     1472        $tax_id_list = (isset($tax_id_list) ? $tax_id_list : ($p_search == "Clear" ? array() : $p_mdtg_tags));
    14611473       
    14621474        // Define form prefix to avoid 2 same form names when widget displayed on result page
     
    14661478       
    14671479        // Free field search
    1468         $free_search = (($_POST['search'] == "Clear" || ($_POST['free_search'] == $_POST['last_free_search']) && ($_POST['link_triggered']<21)) ? "" : $_POST['free_search']);
     1480        // $free_search = (($_POST['search'] == "Clear" || ($_POST['free_search'] == $_POST['last_free_search']) && ($_POST['link_triggered']<21)) ? "" : $_POST['free_search']);
     1481        $free_search = (($p_search == "Clear" || ($p_free_search == $p_last_free_search) && ($p_link_triggered<21)) ? "" : $p_free_search);
     1482       
    14691483        if ($free_search == "") {
    14701484            $free_search = $search_field_default;   
     
    14831497        $preset_search_mode_tab = self::$opt['search_default_display_mode'];   
    14841498        //self::print_ro($preset_search_mode_tab);
     1499        $preset_search_mode = 0;
    14851500        foreach($preset_search_mode_tab as $i => $mode) // bit : 0: cloud only; 1: cloud & form; 2: form only
    14861501            $preset_search_mode += 1<<($mode-1);
    14871502        //self::print_ro("Preset search mode : " . $preset_search_mode);
    1488         $search_mode = ($called_from_widget ? 1 : (isset($search_mode) ? $search_mode : ( $_POST['coming_from_widget'] ? $preset_search_mode : (isset($_POST['search_mode']) ? $_POST['search_mode'] :
    1489             $preset_search_mode))));   
     1503        $search_mode = ($called_from_widget ? 1 : (isset($search_mode) ? $search_mode :
     1504            ( $p_coming_from_widget ? $preset_search_mode : ($p_search_mode ? $p_search_mode : $preset_search_mode))));
    14901505        //self::print_ro('Search mode : ' . $search_mode);
    14911506       
     
    15021517        $search_tags_excluded = self::$opt['search_tags_excluded'];
    15031518        $admin_background_color = self::$opt['admin_background_color'];
    1504    
    1505         switch ($_POST['link_triggered']){
     1519        $change_page_previous = 0;
     1520        $change_page_next = 0;
     1521   
     1522        switch ($p_link_triggered){
    15061523            // 0: nothing ; 1: toggle cloud ; 2: toggle form ; toggle field
    15071524            case 11: self::toggle_search_mode("cloud", $search_mode); break;
     
    15111528            case 21:
    15121529            case 22:
    1513             case 23: $result_mode = $_POST['link_triggered'] - 20; break;
     1530            case 23: $result_mode = $p_link_triggered - 20; break;
    15141531            // 30:prev page, 31:next page
    15151532            case 30: $change_page_previous = 1; break; 
     
    15631580                   
    15641581            // Select highest ranking tags and shuffle
    1565             uasort($tax_tab, array($this, cmp_objects_count));
     1582            uasort($tax_tab, array($this, 'cmp_objects_count'));
    15661583            $tax_tab = array_reverse($tax_tab);
    15671584            if ($num_tags_displayed)
     
    15701587            // Tags are already sorted by descending ranking
    15711588            if ($tagcloud_order == 0)
    1572                 uasort($tax_tab, array($this, cmp_objects_lexicography));
     1589                uasort($tax_tab, array($this, 'cmp_objects_lexicography'));
    15731590            if ($tagcloud_order == 2)
    15741591                shuffle($tax_tab);
     
    16101627        $num_img_stop = $num_img_start + $num_img_per_page; // excluded
    16111628       
    1612         if ($_POST['tagcloud'] > 0) {
     1629        $p_tagcloud = isset($_POST['tagcloud']) ? $_POST['tagcloud'] : NULL;
     1630        if ($p_tagcloud > 0) {
    16131631            unset($tax_id_list);
    1614             $tax_id_list[0] = $_POST['tagcloud'];
    1615         }
    1616 
    1617         $strjs .= '<script language="JavaScript" type="text/javascript">
     1632            $tax_id_list[0] = $p_tagcloud;
     1633        }
     1634
     1635        $strjs = '<script language="JavaScript" type="text/javascript">
    16181636';
    16191637        $strjs .= '<!--
     
    16881706                    ($called_from_widget ? '' : ($use_hover_and_search_highlight && $use_dynamic_colors && !in_array($tax->term_taxonomy_id, $checked_tags) ?
    16891707                    ' onmouseover="this.style.color=' . "'#" . $highlight_text_color . "'" . '" onmouseout="this.style.color=' . "'" . self::rgb2html($color_rgb) .
    1690                     "'" . '"' : '')) . ' title="' . $tax->count . ' ' . self::n(occurence, $tax->count) . '">' . $tax->name . '</a> ';
     1708                    "'" . '"' : '')) . ' title="' . $tax->count . ' ' . self::n('occurence', $tax->count) . '">' . $tax->name . '</a> ';
    16911709            }   // if ($search_mode <= 2)
    16921710            $strout .= '</p>';
  • wp-mediatagger/trunk/readme.txt

    r1670410 r1670524  
    55Requires at least: 3.0
    66Tested up to: 4.7.5
    7 Stable tag: 4.1
     7Stable tag: 4.1.1
    88
    99
     
    2020- Log visitors search and make it visible to the administrator
    2121- Plugin internationalization : the `mediatagger.pot` file, required to translate the package to any other language, is provided for volunteers with the plugin files (contact me to make sure the *.pot file part of the package is up-to-date). If you are interested in internationalizing this plugin, I would certainly welcome your help. Simply [let me know](http://www.photos-dauphine.com/ecrire "Any volunteer to push the WP MediaTagger internationalization ?") so that I can push your translation to the repository. If needed I can provide you the methodology, many tools are available to ease this task.
     22
     23= 4.1.1 =
     24
     25- Code cleanup fixing all NOTICE reports in debug log.
     26
    2227
    2328= 4.1 =
Note: See TracChangeset for help on using the changeset viewer.