DBSelect(SQL_getNewsList($debut, $pas, $statut, $filter, $id_filter)); $datacount = $GLOBALS['sql_object']->DBSelect(SQL_getCountNewsList($statut, $filter, $id_filter)); $bdd_nb_com = $datacount[0]['num_rows']; $bdd_nb_com_display = '
' . $bdd_nb_com . ' ' . $GLOBALS['lang']['news']['name2'] . $suffix . '
' . END_LINE; $content = '' . $news_header . '
' . END_LINE; $content .= '' . END_LINE; $content .= ' ' . $GLOBALS['lang']['statut']['published_on'] . ' ' . $news_posted_on . ' '; $content .= $GLOBALS['lang']['divers']['by'].' ' . $news_posted_by . ''; $content .= '' . END_LINE; $content .= '
' . END_LINE; $content .= '' . $level_name . ' ' . END_LINE; $content .= ' ' . $news_sdtheme . '' . END_LINE; $content .= ' ' . $scale_denomination . '
' . END_LINE; $content .= '' . $GLOBALS['lang']['divers']['nodata'] . '
'; } echo $content; } /** * DisplayOneNews() * Affichage d'une actualté en détail * * @param $news_id * @return $stat Nom du statut + echo content */ function DisplayOneNews($news_id) { $data = $GLOBALS['sql_object']->DBSelect(SQL_getoneCompleteNews($news_id)); $content = ''; if (count($data) != 1) exit; else { $link_theme = array('rub' => $GLOBALS['links']['actualite']['linkvalue'], 'filter' => $GLOBALS['filter']['theme']['linkvalue'], 'id' => $data[0]['theme_sd_theme']); $link_level = array('rub' => $GLOBALS['links']['actualite']['linkvalue'], 'filter' => $GLOBALS['filter']['niveau']['linkvalue'], 'id' => $data[0]['news_level']); $link_scale = array('rub' => $GLOBALS['links']['actualite']['linkvalue'], 'filter' => $GLOBALS['filter']['echelle']['linkvalue'], 'id' => $data[0]['news_scale']); $link_user = array('rub' => $GLOBALS['links']['profil-utilisateur']['linkvalue'], 'id' => $data[0]['news_posted_by']); $news_title = formatText($data[0]['news_title'], '2HTML'); $news_header = linkin_content(formatText($data[0]['news_header'], '2HTML')); $news_body = linkin_content(formatText($data[0]['news_body'], '2HTML')); $news_template = $data[0]['news_template']; $news_photo_uri = $data[0]['news_photo_uri']; $news_sdtheme = formatText($data[0]['sdtheme_name'], '2HTML'); $news_scale_denomination = formatText($data[0]['scale_denomination'], '2HTML'); $news_theme = formatText($data[0]['theme_name'], '2HTML'); $news_level = formatText($data[0]['level_name'], '2HTML'); $news_posted_on = formatText($data[0]['news_published_date_display'], '2HTML'); $news_modify_on = formatText($data[0]['news_last_modify_display'], '2HTML'); $news_posted_by = formatText($data[0]['user_login'], '2HTML'); $news_statut = $data[0]['news_statut']; $contents = TemplateFormat($news_title, $news_header, $news_body, $news_template, $news_photo_uri); $content .= '' . END_LINE; $content .= ' ' . $GLOBALS['lang']['statut']['published_on'] . ' ' . $news_posted_on . ' '; $content .= $GLOBALS['lang']['divers']['by'].' ' . $news_posted_by . ''; if ($news_statut == 'PA') { $content .= ' (' . $GLOBALS['lang']['statut']['archived_on'] . ' ' . $news_modify_on . ')'; } $content .= '' . END_LINE; $content .= '
' . END_LINE; $content .= '' . $GLOBALS['lang']['divers']['level'] . ' : ' . $news_level . ' ' . END_LINE; $content .= '' . $GLOBALS['lang']['divers']['themeref'] . ' : ' . $news_sdtheme . ' ' . $GLOBALS['lang']['divers']['sousthemeref'] . ' :' . $news_theme . END_LINE; $content .= '' . $GLOBALS['lang']['divers']['scale'] . ' : ' . $news_scale_denomination . '' . END_LINE; $content .= '
' . END_LINE; } echo $content; return GetStatutName($news_statut); } /** * GetStatutName() * * @param $statut * @return $stat Nom du statut */ function GetStatutName($statut) { switch ($statut) { case 'P': $stat = 'public'; break; case 'PA': $stat = 'archives_p'; break; case 'AA': $stat = 'archives_a'; break; default: $stat = 'public'; } return $stat; } /** * DisplayLinkNews() * Affiche ou non 1 lien vers les news a venir ou qui précéde. * * @param $current_news * @param $direction * @param $statut * @return echo content */ function DisplayLinkNews($current_news, $direction, $statut) { if ($direction == 'NEXT') { $requete = SQL_getNextNews($current_news, $statut); $class = 'next'; $prefix = '> > '; $suffix = ''; $title = $GLOBALS['lang']['news']['next_news']; } if ($direction == 'PREVIOUS') { $requete = SQL_getPreviousNews($current_news, $statut); $class = 'previous'; $prefix = ''; $suffix = ' < <'; $title = $GLOBALS['lang']['news']['prev_news']; } $data = $GLOBALS['sql_object']->DBSelect($requete); if ($data == false || count($data) != 1) $content = ''; else { $link_news = array('rub' => $GLOBALS['links']['actualite']['linkvalue'], 'id' => $data[0]['news_id']); $news_title = formatText(cutText($data[0]['news_title'], 50), '2HTML'); $content = '' . $header . '
' . END_LINE; $content .= '' . $body . '
' . END_LINE; if ($template == 3) { $style = ' class="tplimgleft"'; $content .= EnlargeImage('../' . $photo2_src, $style, 'visuel ' . $title); $content .= '' . $body2 . '
' . END_LINE; } $content .= '