Changeset 3148652
- Timestamp:
- 09/09/2024 11:58:28 AM (18 months ago)
- File:
-
- 1 edited
-
hal/trunk/wp-hal.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hal/trunk/wp-hal.php
r2879158 r3148652 178 178 $param 179 179 )); 180 $content = 'Plugin is not configured correctly or shortcode parameters are not valid, please check the <a href="https://doc.archives-ouvertes.fr/afficher-une-liste-de-publications-dans-wordpress/" target="_blank" id="wrong_params">documentation</a>'; 180 181 181 182 /** @var $id : defined by extract … … 203 204 204 205 $json = wphal_do_get_data($url); 206 if(!isset($json->error)){ 205 207 $hal_page = (get_query_var('hal_page')) ? get_query_var('hal_page') : 1; 206 208 … … 921 923 </div> 922 924 </div>'; 923 }else{ 924 $content = 'Plugin is not configured correctly or shortcode parameters are not valid, please check the <a href="https://doc.archives-ouvertes.fr/afficher-une-liste-de-publications-dans-wordpress/" target="_blank" id="wrong_params">documentation</a>'; 925 } 925 }} 926 926 $content .= '<div class="wphal-footer">'; 927 927 $content .= '<p style="color:#B3B2B0">' . __("Documents récupérés de l'archive ouverte HAL", 'wp-hal') . ' <a href="' . wphal_site . '" target="_blank"><img alt="logo" src=" ' . esc_url(plugin_dir_url(__FILE__) . 'img/logo-hal.png').'" style="width:90px;"></a></p>'; … … 1089 1089 foreach($facet_fields->{'affiliated_'.$k} as $r){ 1090 1090 $t = explode(wphal_delimiter_join, $r[0]); 1091 if ( isset($result[$t[1]])){1091 if (!isset($result[$t[1]])){ 1092 1092 $result[$t[1]] = $r[1]; 1093 1093 }else { … … 1208 1208 $json = wphal_do_get_data($url); 1209 1209 1210 $count_results = count($json->response->docs);1211 if ( $count_results > 0) {1210 $count_results = is_array($json->response->docs) ? count($json->response->docs) : 0; 1211 if (isset($json->response->docs) && $count_results > 0) { 1212 1212 $content = '<ul class="widhal-ul">'; 1213 1213 for ($i = 0; $i < $count_results - 1; $i++) {
Note: See TracChangeset
for help on using the changeset viewer.