Changeset 3233519
- Timestamp:
- 02/02/2025 05:54:48 PM (12 months ago)
- Location:
- ngg-smart-image-search
- Files:
-
- 6 edited
- 8 copied
-
tags/3.2.1 (copied) (copied from ngg-smart-image-search/trunk)
-
tags/3.2.1/README.txt (copied) (copied from ngg-smart-image-search/trunk/README.txt)
-
tags/3.2.1/admin/class-ngg-smart-image-search-admin.php (copied) (copied from ngg-smart-image-search/trunk/admin/class-ngg-smart-image-search-admin.php)
-
tags/3.2.1/includes/class-ngg-smart-image-search-activator.php (copied) (copied from ngg-smart-image-search/trunk/includes/class-ngg-smart-image-search-activator.php)
-
tags/3.2.1/ngg-smart-image-search.php (copied) (copied from ngg-smart-image-search/trunk/ngg-smart-image-search.php)
-
tags/3.2.1/public/class-ngg-smart-image-search-public.php (copied) (copied from ngg-smart-image-search/trunk/public/class-ngg-smart-image-search-public.php)
-
tags/3.2.1/public/css/ngg-smart-image-search-public.css (copied) (copied from ngg-smart-image-search/trunk/public/css/ngg-smart-image-search-public.css)
-
tags/3.2.1/public/js/fancyapps-fancybind-v-5-0.js (copied) (copied from ngg-smart-image-search/trunk/public/js/fancyapps-fancybind-v-5-0.js)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-ngg-smart-image-search-admin.php (modified) (2 diffs)
-
trunk/ngg-smart-image-search.php (modified) (1 diff)
-
trunk/public/class-ngg-smart-image-search-public.php (modified) (18 diffs)
-
trunk/public/css/ngg-smart-image-search-public.css (modified) (1 diff)
-
trunk/public/js/fancyapps-fancybind-v-5-0.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ngg-smart-image-search/trunk/README.txt
r3041581 r3233519 1 1 === NGG Smart Image Search === 2 Contributors: wpo-HR 3 Tags: NextGEN Gallery, image search, smart search, customizable gallery displays, Bildersuche 4 Requires at least: 4.5.1 5 Requires PHP: 5.2.4 6 Tested up to: 6.4.3 7 Stable tag: trunk 8 License: GPLv2 or later 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 2 Contributors: wpo-HR 3 Tags: NextGEN Gallery, image search, smart search, gallery displays, frontend search 4 Tested up to: 7.6.1 5 Stable tag: trunk 6 License: GPLv2 or later 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 8 11 9 NGG Smart Image Search provides a smart search and display functionality for images in selectable arbitary collections of NextGEN galleries. … … 142 140 == Changelog == 143 141 142 = 3.3.2 = 143 This is a highly recommended enhancement and security update, uploaded 2025-02-02. 144 145 *NEW: new url-parameter ?sngg=<search-parameter> provided to initialize searches via url-links 146 *NEW: special search variable a:<album-id> provided to dynamically limit image search to images in specified album <album-id> 147 *NEW: special search variable u:<user-id> provided to dynamically limit image search to images uploaded by specified user <user-id> 148 *Changed: Fancybox 5.0 is now locally included and no longer linked via cdn 149 *Fixed: security issue with unsanatized shortcode parameter attribute: a registered user with edit and publish capabilities could inject malicious code in the browser of a site visitor 144 150 145 151 = 3.2.1 = -
ngg-smart-image-search/trunk/admin/class-ngg-smart-image-search-admin.php
r3041581 r3233519 122 122 } 123 123 124 wp_register_script( 'hr-hide-nextgen-header-js', plugin_dir_url( __FILE__ ) . 'js/hide-nextgen-header.js', array(), $this->version, true ); 125 wp_enqueue_script( 'hr-hide-nextgen-header-js' ); 126 124 127 } 125 128 … … 1094 1097 add_action( 'wp_footer', 'def_svg_icon' ); 1095 1098 1096 1097 /**1098 * Make sure the function does not exist before defining it1099 /1100 if( ! function_exists( 'hr_remove_class_filter' ) ){1101 /**1102 * Remove Class Filter Without Access to Class Object1103 *1104 * In order to use the core WordPress remove_filter() on a filter added with the callback1105 * to a class, you either have to have access to that class object, or it has to be a call1106 * to a static method. This method allows you to remove filters with a callback to a class1107 * you don't have access to.1108 *1109 * Works with WordPress 1.2+ (4.7+ support added 9-19-2016)1110 * Updated 2-27-2017 to use internal WordPress removal for 4.7+ (to prevent PHP warnings output)1111 *1112 * @param string $tag Filter to remove1113 * @param string $class_name Class name for the filter's callback1114 * @param string $method_name Method name for the filter's callback1115 * @param int $priority Priority of the filter (default 10)1116 *1117 * @return bool Whether the function is removed.1118 *1119 function hr_remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) {1120 global $wp_filter;1121 // Check that filter actually exists first1122 if ( ! isset( $wp_filter[ $tag ] ) ) {1123 return FALSE;1124 }1125 /**1126 * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer1127 * a simple array, rather it is an object that implements the ArrayAccess interface.1128 *1129 * To be backwards compatible, we set $callbacks equal to the correct array as a reference (so $wp_filter is updated)1130 *1131 * @see https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/1132 /1133 if ( is_object( $wp_filter[ $tag ] ) && isset( $wp_filter[ $tag ]->callbacks ) ) {1134 // Create $fob object from filter tag, to use below1135 $fob = $wp_filter[ $tag ];1136 $callbacks = &$wp_filter[ $tag ]->callbacks;1137 } else {1138 $callbacks = &$wp_filter[ $tag ];1139 }1140 // Exit if there aren't any callbacks for specified priority1141 if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) {1142 return FALSE;1143 }1144 // Loop through each filter for the specified priority, looking for our class & method1145 foreach ( (array) $callbacks[ $priority ] as $filter_id => $filter ) {1146 // Filter should always be an array - array( $this, 'method' ), if not goto next1147 if ( ! isset( $filter['function'] ) || ! is_array( $filter['function'] ) ) {1148 continue;1149 }1150 // If first value in array is not an object, it can't be a class1151 if ( ! is_object( $filter['function'][0] ) ) {1152 continue;1153 }1154 // Method doesn't match the one we're looking for, goto next1155 if ( $filter['function'][1] !== $method_name ) {1156 continue;1157 }1158 // Method matched, now let's check the Class1159 if ( get_class( $filter['function'][0] ) === $class_name ) {1160 // WordPress 4.7+ use core remove_filter() since we found the class object1161 if ( isset( $fob ) ) {1162 // Handles removing filter, reseting callback priority keys mid-iteration, etc.1163 $fob->remove_filter( $tag, $filter['function'], $priority );1164 } else {1165 // Use legacy removal process (pre 4.7)1166 unset( $callbacks[ $priority ][ $filter_id ] );1167 // and if it was the only filter in that priority, unset that priority1168 if ( empty( $callbacks[ $priority ] ) ) {1169 unset( $callbacks[ $priority ] );1170 }1171 // and if the only filter for that tag, set the tag to an empty array1172 if ( empty( $callbacks ) ) {1173 $callbacks = array();1174 }1175 // Remove this filter from merged_filters, which specifies if filters have been sorted1176 unset( $GLOBALS['merged_filters'][ $tag ] );1177 }1178 return TRUE;1179 }1180 }1181 return FALSE;1182 }1183 }1184 /**1185 * Make sure the function does not exist before defining it1186 ***1187 if( ! function_exists( 'hr_remove_class_action9') ){1188 /**1189 * Remove Class Action Without Access to Class Object1190 *1191 * In order to use the core WordPress remove_action() on an action added with the callback1192 * to a class, you either have to have access to that class object, or it has to be a call1193 * to a static method. This method allows you to remove actions with a callback to a class1194 * you don't have access to.1195 *1196 * Works with WordPress 1.2+ (4.7+ support added 9-19-2016)1197 *1198 * @param string $tag Action to remove1199 * @param string $class_name Class name for the action's callback1200 * @param string $method_name Method name for the action's callback1201 * @param int $priority Priority of the action (default 10)1202 *1203 * @return bool Whether the function is removed.1204 *1205 function hr_remove_class_action9( $tag = 'in_admin_header', $class_name = 'M_Marketing', $method_name = 'admin_header', $priority = 10 ) {1206 remove_filter( $tag, $class_name, $method_name, $priority=10 );1207 }1208 }1209 if( ! function_exists( 'hr_remove_class_action10') ){1210 function hr_remove_class_action10( $tag = 'in_admin_header', $class_name = 'M_Marketing', $method_name = 'admin_header', $priority = 10 ) {1211 remove_filter( $tag, $class_name, $method_name, $priority=10 );1212 }1213 }1214 if( ! function_exists( 'hr_remove_class_action11') ){1215 function hr_remove_class_action11( $tag = 'in_admin_header', $class_name = 'M_Marketing', $method_name = 'admin_header', $priority = 10 ) {1216 remove_filter( $tag, $class_name, $method_name, $priority=10 );1217 }1218 }1219 add_action( 'init', 'hr_remove_class_action9', 9 ) ;1220 add_action( 'init', 'hr_remove_class_action10', 10 ) ;1221 add_action( 'init', 'hr_remove_class_action11', 11 ) ;1222 1223 remove_action( 'in_admin_header', [ 'M_Marketing', 'admin_header' ], 10 );1224 remove_action( 'in_admin_footer', [ 'M_Marketing', 'footer_template' ], 10 );1225 */ -
ngg-smart-image-search/trunk/ngg-smart-image-search.php
r3041581 r3233519 9 9 * that starts the plugin. 10 10 * 11 * @link https://r-fotos.de/wordpress-plugins12 * @since 1.0.013 * @package NGG_Smart_Image_Search11 * @link https://r-fotos.de/wordpress-plugins 12 * @since 1.0.0 13 * @package NGG_Smart_Image_Search 14 14 * 15 15 * @wordpress-plugin 16 * Plugin Name: NGG Smart Image Search17 * Plugin URI: https://r-fotos.de/wordpress-plugins/ngg-smart-image-search18 * Description: This plugin provides a customizable smart image search and display function for images in NextGEN galleries.19 * Version: 3.2.120 * Requires at least: 5.5.421 * Requires PHP: 7.022 * Author: Harald Röh23 * Author URI: https://r-fotos.de24 * License: GPL-2.0+25 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt26 * Text Domain: ngg-smart-image-search27 * Domain Path: /languages16 * Plugin Name: NGG Smart Image Search 17 * Plugin URI: https://r-fotos.de/wordpress-plugins/ngg-smart-image-search 18 * Description: This plugin provides a customizable smart image search and display function for images in NextGEN galleries. 19 * Version: 3.3.2 20 * Requires at least: 5.5.4 21 * Requires PHP: 7.0 22 * Author: Harald Röh 23 * Author URI: https://r-fotos.de 24 * License: GPL-2.0+ 25 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 26 * Text Domain: ngg-smart-image-search 27 * Domain Path: /languages 28 28 */ 29 29 -
ngg-smart-image-search/trunk/public/class-ngg-smart-image-search-public.php
r3040703 r3233519 81 81 wp_enqueue_style( $this->plugin_name . '-genericons', plugins_url( 'fonts/genericons/genericons.css', dirname(__FILE__) ), array(), $this->version, 'all' ); 82 82 83 //wp_register_style( 'hr-fancybox-css', plugin_dir_url( __FILE__ ) . 'js/fancyapps-fancybox-v-5-0.css', array(), $this->version, 'all' );84 wp_register_style( 'hr-fancybox-css', 'https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox/fancybox.css', array(), $this->version, 'all' );83 wp_register_style( 'hr-fancybox-css', plugin_dir_url( __FILE__ ) . 'css/fancyapps_5-0_fancybox.css', array(), $this->version, 'all' ); 84 //wp_register_style( 'hr-fancybox-css', 'https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox/fancybox.css', array(), $this->version, 'all' ); 85 85 wp_enqueue_style( 'hr-fancybox-css' ); 86 86 … … 108 108 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/ngg-smart-image-search-public.js', array( 'jquery' ), $this->version, false ); 109 109 110 //wp_register_script( 'hr-fancybox-js', plugin_dir_url( __FILE__ ) . 'js/fancyapps-fancybox-v-5-0.js', array(), $this->version, true );111 wp_register_script( 'hr-fancybox-js', 'https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox/fancybox.umd.js', array(), $this->version, true );110 wp_register_script( 'hr-fancybox-js', plugin_dir_url( __FILE__ ) . 'js/fancyapps_5-0_fancybox.uml.js', array(), $this->version, true ); 111 //wp_register_script( 'hr-fancybox-js', 'https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox/fancybox.umd.js', array(), $this->version, true ); 112 112 wp_enqueue_script( 'hr-fancybox-js' ); 113 113 … … 239 239 240 240 default: 241 $hr_SIS_output_box .= __("Warning: unknown shortcode parameter:", "ngg-smart-image-search") . " " . $hr_SIS_index . '="' . $hr_SIS_value. '"<br><br>' ;241 $hr_SIS_output_box .= __("Warning: unknown shortcode parameter:", "ngg-smart-image-search") . " " . $hr_SIS_index . '="' . esc_attr($hr_SIS_value) . '"<br><br>' ; 242 242 } 243 243 } … … 281 281 $hr_SIS_output_box .= '<form ' ; 282 282 } else { 283 $hr_SIS_output_box .= '<form id="' . $hr_SIS_form_id. '" ' ;283 $hr_SIS_output_box .= '<form id="' . esc_attr($hr_SIS_form_id) . '" ' ; 284 284 } 285 285 $hr_SIS_output_box .= 'action="' . esc_url($hr_SIS_form_target) . '" method="post" class="' . $hr_SIS_search_form . '" > ' . … … 358 358 if ($hr_SIS_debug1 == 1 ) { 359 359 echo "<br>===========> Aufruf image list handler<br>"; 360 var_dump( "_GET:", $_GET ); echo "<br>"; 360 361 var_dump( "_POST:", $_POST ); echo "<br>"; 361 362 var_dump( "_REQUEST:", $_REQUEST ); echo "<br>"; 362 363 var_dump( "Parameter _atts: ", $atts ); echo "<br>"; 363 var_dump( "url:", $_SERVER['DOCUMENT_ROOT'] ); echo "<br><hr><br>"; 364 //var_dump( "home_url: ", home_url('/suche-ngg-bilder/') ); echo "<br>"; 365 //var_dump( "url:", $_SERVER['DOCUMENT_ROOT'] ); echo "<br><hr><br>"; 364 366 } 365 367 … … 377 379 } 378 380 379 // check if static streachstring is provided as current shortcode parameter 380 if ( ( ! $atts == '' ) && (isset($atts['static_search'])) ) { 381 // check if searchstring is provided per static_search parameter or per url searchstring 382 if ( ( ( ! $atts == '' ) && (isset($atts['static_search'])) ) or 383 ( ( ! $_REQUEST == '' ) && (isset($_REQUEST['sngg'])) ) ) { 384 385 // sngg search is internally marked as static search too 381 386 $hr_SIS_search_type = "static" ; 382 $hr_SIS_search_text = $atts['static_search'] ; 383 // echo "static_search=<", $hr_SIS_search_text, "><br><br>" ; 387 388 // but sngg search cannot overwrite static_search 389 if ( ( ! $atts == '' ) && (isset($atts['static_search'])) ) { 390 $hr_SIS_search_text = $atts['static_search'] ; 391 } else { 392 $hr_SIS_search_text = $_REQUEST['sngg'] ; 393 } 384 394 // prepare for differentiation between public and logged in users 385 395 $hr_user_ID = get_current_user_id(); … … 401 411 // include all default values, if values are not yet set 402 412 $hr_SIS_array = hr_SIS_check_defaults( $hr_SIS_array ) ; 413 // var_dump("update defaults ", $hr_SIS_array); echo "<br><hr>"; 403 414 // override search limit 404 415 $hr_SIS_limit = $hr_SIS_array['limit'] ; … … 502 513 if ( $hr_SIS_search_type == "static" ) { 503 514 // check for additional search parameters as in shortcode searchbox 515 // echo "direct shortcode parameter " . $hr_SIS_index . " = " . $hr_SIS_value . "<br>" ; 504 516 // check if shortcode parameter is only set for public or logged in user 505 517 $hr_SIS_shortcode_parameter = preg_match('/^(?P<scope>(pu|lo))\_(?P<scpara>.*)$/', $hr_SIS_index, $hr_SIS_match); 506 // var_dumP( $hr_SIS_index, $hr_SIS_shortcode_parameter ) ; echo "<br>"; 507 if ( $hr_SIS_shortcode_parameter ) { 508 $hr_SIS_scope = $hr_SIS_match['scope'] ; 509 $hr_SIS_scpara = $hr_SIS_match['scpara'] ; 518 // var_dump( "preg_match ", $hr_SIS_match ) ; echo "<br>" ; 519 // var_dumP( 'static parameter '.$hr_SIS_index, $hr_SIS_shortcode_parameter ) ; echo "<br>"; 520 if ( $hr_SIS_shortcode_parameter ) { // match was found 521 $hr_SIS_scope = $hr_SIS_match['scope'] ; // specifies lo or up 522 $hr_SIS_scpara = $hr_SIS_match['scpara'] ; // specifies correct parameter without lo_/pu_ 510 523 } else { 511 $hr_SIS_scope = "" ; 524 $hr_SIS_scope = "" ; // no match lo_/pu_ found 512 525 $hr_SIS_scpara = $hr_SIS_index ; 513 526 } … … 519 532 ( ( ( $hr_user_ID == 0 ) && ( $hr_SIS_scope == "pu" ) ) or // either public 520 533 ( ( $hr_user_ID > 0 ) && ( $hr_SIS_scope == "lo" ) ) ) ) { // or logged in 534 // echo "overwrite parameter " . $hr_SIS_scpara . " old value=" . $hr_SIS_array[$hr_SIS_scpara] . " with " . $hr_SIS_value . " <br>" ; 521 535 $hr_SIS_array[$hr_SIS_scpara] = $hr_SIS_value ; 536 if ($hr_SIS_scpara == "limit" ) { $hr_SIS_limit = $hr_SIS_value ; } 522 537 } 523 538 } else { … … 629 644 // init variables for extended search mode 630 645 $hr_SIS_search_gallery_id = 0 ; // init special search gallery marker 646 $hr_SIS_search_album_id = 0 ; // init special search album marker 647 $hr_SIS_search_uploader_id = 0 ; // init special search qualifier for uploader search 631 648 $hr_SIS_search_limit_type = "" ; // init special search recent/last marker 632 649 if ( $hr_SIS_search_mode == "basic" ) { … … 712 729 for ( $hr_index0 = 0; $hr_index0 <= $hr_search_index ; $hr_index0 ++ ) { 713 730 $hr_SIS_search_qmode[$hr_index0] = 'text' ; // default is text search 714 $hr_SIS_search_pattern = preg_match('/^(?P<code>(g|r|l )):(?P<digit>\d+)$/', trim($hr_SIS_search_array[$hr_index0]), $hr_SIS_match);731 $hr_SIS_search_pattern = preg_match('/^(?P<code>(g|r|l|u|a)):(?P<digit>\d+)$/', trim($hr_SIS_search_array[$hr_index0]), $hr_SIS_match); 715 732 if ( $hr_SIS_search_pattern ) { 716 733 switch ( $hr_SIS_match['code'] ) { … … 798 815 $hr_sort_direction = "DESC"; 799 816 break; 817 818 case "u": // special qualifier to select images of a special uploader 819 if ( is_user_logged_in() ) { // exept only for logged in users 820 if ( ( $hr_SIS_search_uploader_id == 0 ) or ( $hr_SIS_search_uploader_id == $hr_SIS_match['digit'] ) ) { 821 $hr_SIS_search_uploader_id = $hr_SIS_match['digit'] ; 822 } else { 823 // conflict: cannot filter for two different uploaders 824 $hr_SIS_output = sprintf( __("ERROR: you cannot search for two different uploaders in searchstring %s.", "ngg-smart-image-search"), 825 "<b><em>" . esc_tml($hr_SIS_search_text) . "</em></b>" ) . "<br>" ; 826 return $hr_SIS_output; 827 } 828 829 if ( $hr_SIS_search_qcode[$hr_index0] <> "&" ) { 830 // conflict: gallery search only possible with qualifier & 831 $hr_SIS_output = sprintf( __("ERROR: you cannot use field qualifier %s for gallery search in searchstring %s.", "ngg-smart-image-search"), 832 $hr_SIS_search_qcode[$hr_index0], "<b><em>" . esc_html($hr_SIS_search_text) . "</em></b>" ) . "<br>" ; 833 return $hr_SIS_output; 834 } 835 $hr_SIS_search_qmode[$hr_index0] = "uploader" ; 836 } else { 837 // conflict: uploader search only possible for logged in users & 838 $hr_SIS_output = sprintf( __("WARNING: uploader search in searchstring %s is not authorized by settings for public users.", "ngg-smart-image-search"), 839 "<b><em>" . esc_html($hr_SIS_search_text) . "</em></b>" ) . "<br>" ; 840 return $hr_SIS_output; 841 } 842 break; 843 844 case "a": // special qualifier to select images of a special album 845 if ( is_user_logged_in() ) { // exept only for logged in users 846 if ( ( $hr_SIS_search_album_id == 0 ) or ( $hr_SIS_search_album_id == $hr_SIS_match['digit'] ) ) { 847 $hr_SIS_search_album_id = hr_SIS_get_gallery_list ( $hr_SIS_match['digit'], '' ) ; 848 } else { 849 // conflict: cannot filter for two different album ids 850 $hr_SIS_output = sprintf( __("ERROR: you cannot search for two different album ids in searchstring %s.", "ngg-smart-image-search"), 851 "<b><em>" . esc_tml($hr_SIS_search_text) . "</em></b>" ) . "<br>" ; 852 return $hr_SIS_output; 853 } 854 855 if ( $hr_SIS_search_qcode[$hr_index0] <> "&" ) { 856 // conflict: gallery search only possible with qualifier & 857 $hr_SIS_output = sprintf( __("ERROR: you cannot use field qualifier %s for album search in searchstring %s.", "ngg-smart-image-search"), 858 $hr_SIS_search_qcode[$hr_index0], "<b><em>" . esc_html($hr_SIS_search_text) . "</em></b>" ) . "<br>" ; 859 return $hr_SIS_output; 860 } 861 $hr_SIS_search_qmode[$hr_index0] = "album" ; 862 } else { 863 // conflict: uploader search only possible for logged in users & 864 $hr_SIS_output = sprintf( __("WARNING: album search in searchstring %s is not authorized by settings for public users.", "ngg-smart-image-search"), 865 "<b><em>" . esc_html($hr_SIS_search_text) . "</em></b>" ) . "<br>" ; 866 return $hr_SIS_output; 867 } 868 break; 869 800 870 } 801 871 } … … 873 943 while ( $hr_SIS_loop_index <= $hr_search_index ) : // loop at least once, or more often for number of qualified searches 874 944 875 // echo "loop index ", $hr_SIS_loop_index, " with search qmode ", $hr_SIS_search_qmode[$hr_SIS_loop_index], "<br>";945 //echo "loop index ", $hr_SIS_loop_index, " with search qmode ", $hr_SIS_search_qmode[$hr_SIS_loop_index], "<br>"; 876 946 877 947 switch ( $hr_SIS_search_qmode[$hr_SIS_loop_index] ) { … … 945 1015 case "gallery" : 946 1016 // special case, search for specified gallery id 947 $hr_SIS_searchstring0 = " ( npic.galleryid = " . $hr_SIS_search_gallery_id . " ) ";1017 $hr_SIS_searchstring0 = "npic.galleryid = " . $hr_SIS_search_gallery_id ; 948 1018 // $hr_SIS_search_scope = '' ; 949 1019 // $hr_SIS_exclude_scope = '' ; 950 1020 break; 951 1021 952 case "recent" : 1022 case "uploader" : 1023 // special case, search for specified uploader id 1024 $hr_SIS_searchstring0 = "npic.uploader = " . $hr_SIS_search_uploader_id ; 1025 break; 1026 1027 case "album" : 1028 // special case, search for specified uploader id 1029 $hr_SIS_searchstring0 = "npic.galleryid in ( " . $hr_SIS_search_album_id . " )" ; 1030 break; 1031 1032 case "recent" : 953 1033 case "last" : 954 1034 // define dummy qualifier … … 1008 1088 $hr_SIS_sql_ngg_pictures .= " AND ( npic.exclude <> 1 ) "; // one parenthesis still open 1009 1089 } 1010 1011 // specify search gallery scope, if set1090 1091 // specify search gallery scope, if set 1012 1092 if ( $hr_SIS_search_scope <> '' ) { 1013 1093 $hr_SIS_sql_ngg_pictures .= " AND ( npic.galleryid in (" . $hr_SIS_search_scope . ") ) "; // one parenthesis still open … … 1317 1397 // add leading slash to path, if missing (was on some installations) 1318 1398 if ( substr( $hr_SIS_picture->path, 0 , 1) !== '/' ) { $hr_SIS_pathname = '/' . $hr_SIS_picture->path ; } else { $hr_SIS_pathname = $hr_SIS_picture->path ; } 1319 1399 //var_dump("para-path", $hr_SIS_picture->path); echo "<br>" ; 1320 1400 // check for closing slash to path, if missing 1321 1401 if ( substr($hr_SIS_pathname, -1) !== '/' ) { $hr_SIS_pathname .= '/' ; } 1322 1323 // to address image file correctly we need the local path to the file 1402 //var_dump("clear-path", $hr_SIS_pathname); echo "<br>" ; 1403 // to address image file correctly we need the local path to the file but not from home 1324 1404 $hr_SIS_document_root = get_option("siteurl") ; 1325 $hr_SIS_filename = $hr_SIS_ document_root . $hr_SIS_pathname . $hr_SIS_picture->filename ;1326 $hr_SIS_thumbsfilename = $hr_SIS_ document_root . $hr_SIS_pathname . "thumbs/thumbs_" . $hr_SIS_picture->filename ; // $_SERVER['DOCUMENT_ROOT']1405 $hr_SIS_filename = $hr_SIS_pathname . $hr_SIS_picture->filename ; 1406 $hr_SIS_thumbsfilename = $hr_SIS_pathname . "thumbs/thumbs_" . $hr_SIS_picture->filename ; // alter thumb name 1327 1407 $hr_SIS_thumbsfilename2 = ABSPATH . substr($hr_SIS_pathname,1) . "thumbs/thumbs_" . $hr_SIS_picture->filename ; 1328 1408 1329 if ( !file_exists( $hr_SIS_thumbsfilename2 ) ) { 1330 // NextGEN changed at some time thumbs-filename from thumbs_imagefile to thumbs-imagefile 1409 if ( !file_exists( $hr_SIS_thumbsfilename2 ) ) { //kein alter thumb name mit _ 1410 // NextGEN changed at some time thumbs-filename from thumbs_imagefile to thumbs-imagefile = new thumb name 1331 1411 $hr_SIS_thumbsfilename = $hr_SIS_document_root . $hr_SIS_pathname . "thumbs/thumbs-" . $hr_SIS_picture->filename ; 1332 1412 } … … 1387 1467 // add leading slash to path, if missing (was on some installations) 1388 1468 if ( substr( $hr_SIS_picture->path, 0 , 1) !== '/' ) { $hr_SIS_pathname = '/' . $hr_SIS_picture->path ; } else { $hr_SIS_pathname = $hr_SIS_picture->path ; } 1389 1469 //var_dump("para-path", $hr_SIS_picture->path); echo "<br>" ; 1390 1470 // check for closing slash to path, if missing 1391 1471 if ( substr($hr_SIS_pathname, -1) !== '/' ) { $hr_SIS_pathname .= '/' ; } 1392 1472 // var_dump("clear-path", $hr_SIS_pathname); echo "<br>" ; 1393 1473 // to address image file correctly we need the local path to the file 1394 1474 $hr_SIS_document_root = get_option("siteurl") ; 1395 $hr_SIS_filename = $hr_SIS_ document_root . $hr_SIS_pathname . "/" . $hr_SIS_picture->filename ;1396 $hr_SIS_thumbsfilename = $hr_SIS_ document_root . $hr_SIS_pathname . "/thumbs/thumbs_" . $hr_SIS_picture->filename ;1475 $hr_SIS_filename = $hr_SIS_pathname . "/" . $hr_SIS_picture->filename ; 1476 $hr_SIS_thumbsfilename = $hr_SIS_pathname . "/thumbs/thumbs_" . $hr_SIS_picture->filename ; // alter thumbs name 1397 1477 $hr_SIS_thumbsfilename2 = ABSPATH . substr($hr_SIS_pathname,1) . "thumbs/thumbs_" . $hr_SIS_picture->filename ; 1398 1478 1399 1479 if ( !file_exists ( $hr_SIS_thumbsfilename2 ) ) { 1400 1480 // NextGEN changed at some time thumbs-filename from thumbs_imagefile to thumbs-imagefile 1401 $hr_SIS_thumbsfilename = $hr_SIS_ document_root . $hr_SIS_pathname . "/thumbs/thumbs-" . $hr_SIS_picture->filename ;1481 $hr_SIS_thumbsfilename = $hr_SIS_pathname . "/thumbs/thumbs-" . $hr_SIS_picture->filename ; // neuer thumbs name 1402 1482 } 1403 1483 … … 1961 2041 1962 2042 1963 /** 1964 * mark second paging buttons at top of list as not displayable 1965 * if canvas is not supported document.querySelector("hr-top-paging-buttons").style='display: none;'; 1966 1967 function mark_canvas_inability() { 1968 1969 echo '<script> if (!Modernizr.Canvas) { document.querySelector("hr-top-paging-buttons").removeAttribute("style") ; } </script>'; 1970 1971 } 1972 1973 add_action( 'wp_footer', 'mark_canvas_inability' ); 1974 */ 1975 1976 2043 -
ngg-smart-image-search/trunk/public/css/ngg-smart-image-search-public.css
r3040703 r3233519 263 263 top:32px !important; 264 264 } 265 -
ngg-smart-image-search/trunk/public/js/fancyapps-fancybind-v-5-0.js
r3040721 r3233519 1 Fancybox.bind( '[data-fancybox="gallery"]', {1 Fancybox.bind("[data-fancybox]", { 2 2 // Transition effect when changing gallery items 3 3 Carousel : { … … 24 24 ] // 25 25 }); 26
Note: See TracChangeset
for help on using the changeset viewer.