$bdd_host = "localhost";
$bdd_user = "eosknum";
$bdd_pass = "bigounou";
$bdd_base = "eosknum_vb4";
$db = mysql_connect($bdd_host, $bdd_user, $bdd_pass);
// on sélectionne la base
$db_selected = mysql_select_db($bdd_base,$db);
$content='';
$timestamp=time() - 432000;
$sql = 'SELECT postid, pagetext FROM post LEFT JOIN thread ON thread.threadid = post.threadid WHERE (thread.visible!=2 AND post.visible=1 AND thread.forumid IN(33,34,36,37,38,39,40,41,42,43,44,45,46,67,74,75,76,77,121,122) AND post.parentid=0 AND (pagetext LIKE "%maphoto/%" OR pagetext LIKE "%[photo]%") AND post.dateline > ' . $timestamp . ') ORDER BY post.dateline DESC LIMIT 0, 10';
$res = mysql_query($sql) or die('Erreur SQL !
'.$sql.'
'.mysql_error());
while($row=mysql_fetch_array($res))
{
$text=$row['pagetext'].' - ';
$text = str_replace('[PHOTO]', '[img]https://www.eos-numerique.com/maphoto/', $text);
$text = str_replace('[/PHOTO]', '.jpg[/img]', $text);
$text = str_replace('[photo]', '[img]https://www.eos-numerique.com/maphoto/', $text);
$text = str_replace('[/photo]', '.jpg[/img]', $text);
$text = preg_match_all( "/maphoto(.*).jpg/Us" , $text, $url, PREG_SET_ORDER);
$post=$row['postid'];
$content.= ' ';
$photo_nb++;
if ($photo_nb == 5) {
$content .='
';
}
}
$content.='
Voir toutes les photos';
$content.=" postées pendant les dernières 24 heures (sur le serveur d'eos-numerique.com)";
$content.='';
echo $content;
mysql_close();
?>