Changeset 3663 for extensions/Flash_Gallery/generate-xml.php
- Timestamp:
- Jul 22, 2009, 12:34:42 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Flash_Gallery/generate-xml.php
r3531 r3663 233 233 foreach ($pictures as $row) 234 234 { 235 // echo "prev=".$prev_catid;236 // echo "catid=".$row['CATID'];237 235 // Alimentation des variables pour la constitution du flux xml 238 236 foreach ($module_data['datas'] as $keydata => $valuedata) 239 237 { 240 238 if ($valuedata) // == true 241 $picture[$keydata] = parse($module['datas'][$keydata], $row );239 $picture[$keydata] = parse($module['datas'][$keydata], $row, $module['maxcomment']); 242 240 else 243 241 $picture[$keydata] = ''; … … 274 272 unset_make_full_url(); 275 273 276 function parse($data, $row) 277 { 274 function parse($data, $row, $nb_comment = 0) 275 { 276 // Eviter de charger les commentaires (appels base) si ils ne sont pas affichés 277 if (strpos($data, '%ID') === false) 278 $nb_comment = 0; 279 278 280 include (FLASHGAL_PATH.'include/config_param.inc.php'); 279 281 … … 282 284 foreach ($flashgal_parse as $key => $value) 283 285 { 284 // echo "key=".$key." value=".$value."\n";285 286 array_push($patterns, $key); 286 287 array_push($replacements, $value); … … 288 289 289 290 return str_replace($patterns, $replacements, $data); 290 // echo "output=".$output; 291 // return $output; 291 } 292 293 // Return the last comments of an image id 294 function get_comment($img_id, $nb_comment = 0) 295 { 296 $commentstring = ''; 297 298 if ($nb_comment != 0) 299 { 300 $query = ' 301 SELECT id,author,date,image_id,content 302 FROM '.COMMENTS_TABLE.' 303 WHERE image_id = '.$img_id.' 304 AND validated = \'true\' 305 ORDER BY date ASC 306 LIMIT 0,'.$nb_comment.' 307 ;'; 308 $result = pwg_query( $query ); 309 $first = true; 310 311 while ($row = mysql_fetch_array($result)) 312 { 313 314 // Format : "Commentaire (Utilisateur - Date)" 315 $commentstring .= ($first ? '' : " / \n") 316 .trigger_event('render_comment_content',$row['content']) 317 .' ('. trigger_event('render_comment_author', 318 empty($row['author']) 319 ? l10n('guest') 320 : $row['author']) 321 .' - ' 322 .format_date( $row['date'], false) 323 .")"; 324 325 $first = false; 326 327 } 328 } 329 return $commentstring; 292 330 } 293 331
Note: See TracChangeset
for help on using the changeset viewer.