hellofacteurV1/vues/repertoire_annonce_info.php

82 lines
8.0 KiB
PHP
Raw Normal View History

2021-11-02 11:23:49 +01:00
<?php
if(strlen(strip_tags($post_infos["annonce"]))>400)
$header_robots="index,nofollow";
else
$header_robots="noindex,nofollow";
$header_title=htmlentities(get_chaine_debut($post_infos["ancre"],70," (...)"),ENT_QUOTES);
$body_title=htmlentities(get_chaine_debut($post_infos["ancre"],70," (...)"),ENT_QUOTES);
$ariane_items[0]["txt"]="<li><a href='".PAGE_REPERTOIRE_ACCUEIL."'>Les bonnes adresses du facteur.</a></li>";
$ariane_items[0]["form"]=false;
$ariane_items[0]["actif"]=false;
$i=1;
if(!empty($meres))
{
foreach ($meres as $mere_info)
{
$ariane_items[$i]["txt"]="<li><a href=\"".PAGE_REPERTOIRE_RUBRIQUE_INFO.intval($mere_info["id_rubrique"])."\">".affiche_utf8(htmlentities($mere_info["nom"],ENT_QUOTES),UTF8_OK)."</a></li>";
$ariane_items[$i]["form"]=false;
$ariane_items[$i]["actif"]=false;
$i++;
}
}
$ariane_items[$i]["txt"]="<li><a href='".PAGE_REPERTOIRE_HUB_INFO.intval($post_infos["hub_id"])."'>".affiche_utf8(htmlentities($hub_infos["nom"],ENT_QUOTES))."</a></li>";
$ariane_items[$i]["form"]=false;
$ariane_items[$i]["actif"]=false;
if(!empty($_SESSION["message"]))
{
$msg_infos[0]="<strong>".$_SESSION["message"]."</strong>";
$_SESSION["message"]="";
}
$body_content="";
$body_content.="<h2 class='articles-chapeau'>".affiche_utf8(htmlentities($hub_infos["nom"],ENT_QUOTES))." :: ".htmlentities($post_infos["ancre"],ENT_QUOTES)."</h2>";
$body_content.="<div class='articles-contenu'>";
if($auteur_infos["statut"]!="administrateur")
$body_content.="<p class=\"articles-infos\">Actualité postée par <a href='".PAGE_UTILISATEUR_INFO.intval($post_infos["auteur_id"])."'>".affiche_utf8(htmlentities($auteur_infos["pseudo"],ENT_QUOTES),UTF8_OK)."</a> dans le bureau de poste <a href='".PAGE_REPERTOIRE_HUB_INFO.intval($post_infos["hub_id"])."'>".affiche_utf8(htmlentities($hub_infos["nom"],ENT_QUOTES))."</a>, le <time datetime=\"".date("Y-m-d",$post_infos["time_crea"])."\">".$Jours_semaine[date("w",$post_infos["time_crea"])]." ".date("d/m/Y",$post_infos["time_crea"])."</time> - <a href='".PAGE_UTILISATEUR_CONTACT.intval($post_infos["auteur_id"])."/a".$post->id_post."'>Lui répondre.</a>.</p>";
else
$body_content.="<p class=\"articles-infos\">Actualité postée par <b>Hello facteur</b> dans le bureau de poste <a href='".PAGE_REPERTOIRE_HUB_INFO.intval($post_infos["hub_id"])."'>".affiche_utf8(htmlentities($hub_infos["nom"],ENT_QUOTES))."</a>, le <time datetime=\"".date("Y-m-d",$post_infos["time_crea"])."\">".$Jours_semaine[date("w",$post_infos["time_crea"])]." ".date("d/m/Y",$post_infos["time_crea"])."</time>.</p>";
$img="";
if(!empty($post_infos["illustration"]))
{
$illustration=$post_infos["illustration"];
if(file_exists(POST_ILLUS_REP."/".$illustration[0]."/".$illustration))
$img="<div class='col-md-3'><img src='".SITE_URL."/".POST_ILLUS_REP."/".$illustration[0]."/".$illustration."' alt=\"Illustration de l'annonce ".htmlentities($post_infos["ancre"],ENT_QUOTES)."\" title=\"Illustration de l'annonce ".htmlentities($post_infos["ancre"],ENT_QUOTES)."\" class='img-responsive img-thumbnail'></div>";
}
if((empty($img))&&($auteur_infos["statut"]!="administrateur"))
{
$illustration=$auteur_infos["illustration"];
if((!empty($illustration))&&(file_exists(UTILISATEUR_ILLUS_REP."/".$illustration[0]."/".$illustration)))
$img="<div class='col-md-3'><img src='".SITE_URL."/".UTILISATEUR_ILLUS_REP."/".$illustration[0]."/".$illustration."' alt=\"Photo de ".htmlentities($auteur_infos["pseudo"],ENT_QUOTES)."\" title=\"Photo de ".htmlentities($auteur_infos["pseudo"],ENT_QUOTES)."\" class='img-responsive img-thumbnail'></div>";
}
$body_content.=$img.$post_infos["annonce"];
$body_content.="<div class='call_actions'>";
if(!empty($post_infos["url"]))
$body_content.="<div class='bouton_action'><a href=".$post_infos["url"]." title=\"lien fourni avec l'annonce\" target='_blank' class='btn btn-success'>+ En savoir plus.</a></div>";
if($auteur_infos["statut"]!="administrateur")
$body_content.="<div class='bouton_action'><a href='".PAGE_UTILISATEUR_CONTACT.intval($post_infos["auteur_id"])."/a".$post->id_post."' class='btn btn-success' rel='nofollow'>Répondre à l'annonce.</a></div>
<div class='bouton_action'><a href='".PAGE_UTILISATEUR_INFO.intval($post_infos["auteur_id"])."' class='btn btn-success' rel='nofollow'>Voir le profil de ".affiche_utf8(htmlentities($auteur_infos["pseudo"],ENT_QUOTES),UTF8_OK).".</a></div>";
$body_content.="</div>";
$url_partage_annonce=PAGE_REPERTOIRE_POST_INFO.$post->id_post;
$titre_partage_annonce=urlencode($post_infos["ancre"]);
$body_content.="<div class=\"share-buttons\">
Partagez sur : <a target=\"_blank\" title=\"Twitter\" href=\"https://twitter.com/share?url=$url_partage_annonce&amp;text=$titre_partage_annonce\" rel=\"nofollow\" onclick=\"javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=700');return false;\"><img src=\"".SITE_URL."/images/icones/big/twitter_icon.png\" alt=\"Twitter\"></a>
<a target=\"_blank\" title=\"Facebook\" href=\"https://www.facebook.com/sharer.php?u=$url_partage_annonce&amp;t=$titre_partage_annonce\" rel=\"nofollow\" onclick=\"javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=700');return false;\"><img src=\"".SITE_URL."/images/icones/big/facebook_icon.png\" alt=\"Facebook\"></a>
<a target=\"_blank\" title=\"Google +\" href=\"https://plus.google.com/share?url=$url_partage_annonce&amp;hl=fr\" rel=\"nofollow\" onclick=\"javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=650');return false;\"><img src=\"".SITE_URL."/images/icones/big/gplus_icon.png\" alt=\"Google Plus\"></a>
<a target=\"_blank\" title=\"Linkedin\" href=\"https://www.linkedin.com/shareArticle?mini=true&amp;url=$url_partage_annonce&amp;title=$titre_partage_annonce\" rel=\"nofollow\" onclick=\"javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=650');return false;\"><img src=\"".SITE_URL."/images/icones/big/linkedin_icon.png\" alt=\"Linkedin\"></a>
<a target=\"_blank\" title=\"Pinterest\" href=\"https://pinterest.com/pin/create/button/?url=$url_partage_annonce&amp;description=$titre_partage_annonce\" rel=\"nofollow\" onclick=\"javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=650');return false;\"><img src=\"".SITE_URL."/images/icones/big//pinterest_icon.png\" alt=\"Pinterest\"></a>
<a target=\"_blank\" title=\"Scoop.it!\" href=\"https://www.scoop.it/bookmarklet?url=$url_partage_annonce\" rel=\"nofollow\" onclick=\"javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=650');return false;\"><img src=\"".SITE_URL."/images/icones/big/scoopit_icon.png\" alt=\"Scoop.it!\"></a>
<a target=\"_blank\" title=\"Diaspora\" href=\"http://sharetodiaspora.github.io/?title=$titre_partage_annonce&amp;url=$url_partage_annonce\"><img src=\"".SITE_URL."/images/icones/big/diaspora_icon.png\" alt=\"Diaspora\"></a>
</div>";
$body_content.="<div class='call_actions'><div class='bouton_action'><a href='".PAGE_INSCRIPTION."' class='btn btn-success' title=\"Créez votre compte gratuitement\">+ Recevoir les actualités locales.</a></div><div class='bouton_action'><a href='".PAGE_AJOUT_POST."' class='btn btn-success' title=\"Proposez une actualité\">+ Proposer une actualité locale.</a></div></div></div>";
if($auteur_infos["statut"]!="administrateur")
$body_content.="<p class=\"articles-infos\"><b>Attention :</b> Hello facteur ne peut garantir la validité des informations de cette annonce qui reste sous la responsabilité de la personne l'ayant proposée. Dans le doute ou en cas d'erreur, merci de <a href='".PAGE_UTILISATEUR_CONTACT.intval($post_infos["auteur_id"])."/a".$post->id_post."' rel='nofollow'>contactez son auteur</a>.</p>";
else
$body_content.="<p class=\"articles-infos\"><b>Attention :</b> Hello facteur ne peut garantir la validité des informations de cette annonce. Si vous constatez une erreur, <a href='".PAGE_CONTACT."' rel='nofollow'>n'hésitez pas à nous contacter</a>.</p>";
require(TEMPLATE_REP."/page.php");