';
$TotalPublications = getTotalPublications();
//Security - Get Variables
if(isset($_GET['next']) ){
if($_GET['next'] == -0) $_GET['next'] = 0;
if( filter_var($_GET['next'], FILTER_VALIDATE_INT)=== 0 || !filter_var($_GET['next'], FILTER_VALIDATE_INT)=== FALSE){
if( $_GET['next'] < 0) $_GET['next'] = 0;
if( $_GET['next'] >= $TotalPublications ) $_GET['next'] = 0;
}else{
$_GET['next'] = 0;
}
}else{
$_GET['next'] = 0;
}
$Publication = getAllPublications();
if( CanAddPublication() == true){
echo'
';
$is_arabic = preg_match('/\p{Arabic}/u', nl2br($Publication[$i]['titre']));
if($is_arabic == true ){
echo'
'.nl2br($Publication[$i]['titre']).'
';
}else{
echo'
'.nl2br($Publication[$i]['titre']).'
';
}
//files
$file = getPublicationsFiles($Publication[$i]['id_publication']);
if(count($file) == 1){
if($file[0]['type'] == "image"){
echo'
';
}elseif($file[0]['type'] == "video"){
}
}elseif(count($file) > 1){
echo'
';
for($y=0 ; $y < count($file) ;$y++){
echo'
';
}
echo'
';
}
echo'
';
$totalEmoj =getTopEmoj($Publication[$i]['id_publication']);
$emojs = count($totalEmoj);
if($emojs != 0){
for($pp=0;$pp < $emojs ; $pp++){
echo'

';
}
}else{
echo'

';
}
echo '
'.getTotal($Publication[$i]['id_publication'],"comment").' commentaires
';
//all Commentaires
$Commentaires = getCommentaires($Publication[$i]['id_publication']);
echo'';
echo'
';
}
//pagination
echo"