Changeset 1670524
- Timestamp:
- 06/04/2017 04:12:12 PM (9 years ago)
- Location:
- wp-mediatagger/trunk
- Files:
-
- 2 edited
-
mediatagger.php (modified) (11 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-mediatagger/trunk/mediatagger.php
r1670397 r1670524 6 6 Author: www.photos-dauphine.com 7 7 Author URI: http://www.photos-dauphine.com/ 8 Version: 4.1 9 Stable Tag: 4.1 8 Version: 4.1.1 9 Stable Tag: 4.1.1 10 10 */ 11 11 … … 283 283 // 284 284 private function load_options(&$admin_msg){ 285 $force_serialize = 0; 285 286 286 287 // Plugin options : … … 1458 1459 } 1459 1460 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)); 1461 1473 1462 1474 // Define form prefix to avoid 2 same form names when widget displayed on result page … … 1466 1478 1467 1479 // 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 1469 1483 if ($free_search == "") { 1470 1484 $free_search = $search_field_default; … … 1483 1497 $preset_search_mode_tab = self::$opt['search_default_display_mode']; 1484 1498 //self::print_ro($preset_search_mode_tab); 1499 $preset_search_mode = 0; 1485 1500 foreach($preset_search_mode_tab as $i => $mode) // bit : 0: cloud only; 1: cloud & form; 2: form only 1486 1501 $preset_search_mode += 1<<($mode-1); 1487 1502 //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)))); 1490 1505 //self::print_ro('Search mode : ' . $search_mode); 1491 1506 … … 1502 1517 $search_tags_excluded = self::$opt['search_tags_excluded']; 1503 1518 $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){ 1506 1523 // 0: nothing ; 1: toggle cloud ; 2: toggle form ; toggle field 1507 1524 case 11: self::toggle_search_mode("cloud", $search_mode); break; … … 1511 1528 case 21: 1512 1529 case 22: 1513 case 23: $result_mode = $ _POST['link_triggered']- 20; break;1530 case 23: $result_mode = $p_link_triggered - 20; break; 1514 1531 // 30:prev page, 31:next page 1515 1532 case 30: $change_page_previous = 1; break; … … 1563 1580 1564 1581 // Select highest ranking tags and shuffle 1565 uasort($tax_tab, array($this, cmp_objects_count));1582 uasort($tax_tab, array($this, 'cmp_objects_count')); 1566 1583 $tax_tab = array_reverse($tax_tab); 1567 1584 if ($num_tags_displayed) … … 1570 1587 // Tags are already sorted by descending ranking 1571 1588 if ($tagcloud_order == 0) 1572 uasort($tax_tab, array($this, cmp_objects_lexicography));1589 uasort($tax_tab, array($this, 'cmp_objects_lexicography')); 1573 1590 if ($tagcloud_order == 2) 1574 1591 shuffle($tax_tab); … … 1610 1627 $num_img_stop = $num_img_start + $num_img_per_page; // excluded 1611 1628 1612 if ($_POST['tagcloud'] > 0) { 1629 $p_tagcloud = isset($_POST['tagcloud']) ? $_POST['tagcloud'] : NULL; 1630 if ($p_tagcloud > 0) { 1613 1631 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"> 1618 1636 '; 1619 1637 $strjs .= '<!-- … … 1688 1706 ($called_from_widget ? '' : ($use_hover_and_search_highlight && $use_dynamic_colors && !in_array($tax->term_taxonomy_id, $checked_tags) ? 1689 1707 ' 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> '; 1691 1709 } // if ($search_mode <= 2) 1692 1710 $strout .= '</p>'; -
wp-mediatagger/trunk/readme.txt
r1670410 r1670524 5 5 Requires at least: 3.0 6 6 Tested up to: 4.7.5 7 Stable tag: 4.1 7 Stable tag: 4.1.1 8 8 9 9 … … 20 20 - Log visitors search and make it visible to the administrator 21 21 - 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 22 27 23 28 = 4.1 =
Note: See TracChangeset
for help on using the changeset viewer.