Subversion Repositories Applications.papyrus

Rev

Rev 1087 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1087 Rev 1203
Line 24... Line 24...
24
				}
24
				}
25
				if (strlen($item['description']) > 200 && !$all) {
25
				if (strlen($item['description']) > 200 && !$all) {
26
					$item['description'] = substr ($item['description'] , 0, 300).'... <a href="'.$item['link'].'">Lire la suite</a>';
26
					$item['description'] = substr ($item['description'] , 0, 300).'... <a href="'.$item['link'].'">Lire la suite</a>';
27
				}
27
				}
28
				if (!isset($item['pubdate'])) $item['pubdate'] = date('dmY');
28
				if (!isset($item['pubdate'])) $item['pubdate'] = date('dmY');
-
 
29
				
-
 
30
				// Le code ci-apres est pour rattraper les dates du type 01012005 parsees par magpie
-
 
31
				// lorsque les flux donne des dates au format iso
-
 
32
				if (preg_match('/^([0-3][0-9])([0-1][0-9])([0-9][0-9][0-9][0-9])$/', $item['pubdate'], $match)) {
-
 
33
					$item['pubdate'] = $match[3].'-'.$match[2].'-'.$match[1];
-
 
34
					//echo $item['pubdate'];
-
 
35
				}
29
				$res .= str_replace ('{num}', ++$i, 
36
				$res .= str_replace ('{num}', ++$i, 
30
						str_replace ('{item}', '<a href="'.$item['link'].'" target="_top">'.$item['title'].'</a>', 
37
						str_replace ('{item}', '<a href="'.$item['link'].'" target="_top">'.$item['title'].'</a>', 
31
						str_replace ('{date}', strftime('%d.%m.%Y',strtotime($item['pubdate'])),
38
						str_replace ('{date}', strftime('%d.%m.%Y',strtotime($item['pubdate'])),
32
						str_replace ('{description}', $item['description'], $template)))) ;
39
						str_replace ('{description}', $item['description'], $template)))) ;
33
				$res .= "\n";
40
				$res .= "\n";