示例#1
0
文件: forum.php 项目: rhertzog/lcs
function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_forum, $i, $retour, $arg,  $script, $argscript) {
	global $spip_lang_right, $spip_display;
	static $voir_logo = array(); // pour ne calculer qu'une fois

	if (is_array($voir_logo)) {
		$voir_logo = (($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non") ? 
		      "position: absolute; $spip_lang_right: 0px; margin: 0px; margin-top: -3px; margin-$spip_lang_right: 0px;" 
		      : '');
	}

	$id_forum=$row['id_forum'];
	$id_parent=$row['id_parent'];
	$id_rubrique=$row['id_rubrique'];
	$id_article=$row['id_article'];
	$id_breve=$row['id_breve'];
	$id_message=$row['id_message'];
	$id_syndic=$row['id_syndic'];
	$id_auteur=$row["id_auteur"];
	$titre=$row['titre'];
	$texte=$row['texte'];
	$nom_site=$row['nom_site'];
	$url_site=$row['url_site'];
	$statut=$row['statut'];
	$ip=$row["ip"];

	$h = (!$id_article ? '' : generer_url_entite($id_article, 'article'))
	  . "#forum$id_forum";

	$titre_boite = "<a href='$h' id='forum$id_forum'>"
	  . typo($titre)
	  . '</a>';

	if ($spip_display == 4) {
		$res = $titre_boite ."<br id='id$id_forum' />";
	} else {
		if ($id_auteur AND $voir_logo) {
			$chercher_logo = charger_fonction('chercher_logo', 'inc');
			if ($logo = $chercher_logo($id_auteur, 'id_auteur', 'on')) {
				list($fid, $dir, $nom, $format) = $logo;
				include_spip('inc/filtres_images_mini');
				$logo = image_reduire("<img src='$fid' alt='' />", 48, 48);
				if ($logo)
					$titre_boite = "\n<div style='$voir_logo'>$logo</div>$titre_boite" ;
			}
		}


		$res = "<tr id='id$id_forum'>"
		. afficher_forum_4($compteur_forum, $nb_forum, $i)
		. "\n<td style='width: 100%' valign='top'>"
		. (($compteur_forum == 1)
		   ? debut_cadre_forum(forum_logo($statut), true, "", $titre_boite)
		   : debut_cadre_thread_forum("", true, "", $titre_boite));
	}

	// Si refuse, cadre rouge
	if ($statut=="off") {
		$style =" style='border: 2px dashed red; padding: 5px;'";
	}
	// Si propose, cadre jaune
	else if ($statut=="prop") {
		$style = " style='border: 1px solid yellow; padding: 5px;'";
	}
	// Si original, cadre vert
	else if ($statut=="original") {
		$style = " style='border: 1px solid green; padding: 5px;'";
	} else $style = '';

	$mots = afficher_forum_mots($id_forum);

	$res .= "<table$style width='100%' cellpadding='5' cellspacing='0'>\n<tr><td>"
	.  afficher_forum_auteur($row)
	. (!$controle_id_article ? '' :
	   boutons_controle_forum($id_forum, $statut, $id_auteur, "id_article=$id_article", $ip,  $script, $argscript))
	. "<div style='font-weight: normal;'>"
	. safehtml(justifier(propre($texte)))
	. "</div>\n"
	. (!$nom_site ? '' :
	      ((strlen($url_site) > 10) ? "\n<div style='text-align: left' class='verdana2'><b><a href='$url_site'>$nom_site</a></b></div>"
	       : "<b>$nom_site</b>"))
	. ($controle_id_article ? '' :
	      repondre_forum($row, $titre, $statut, "$retour?$arg", _T('lien_repondre_message')))
	  . $mots
	  . "</td></tr></table>";

	if ($spip_display == 4) return "\n<li>$res</li>\n";

	if ($compteur_forum == 1) $res .= fin_cadre_forum(true);
	else $res .= fin_cadre_thread_forum(true);
	$res .= "</td></tr>";

	return "<table width='100%' cellpadding='0' cellspacing='0' border='0'>$res</table>\n";
}
示例#2
0
function forum_envoi_formulaire($id, $retour, $statut, $texte, $titre, $nom_site, $url_site)
{

	return (!$retour ? '' : "<div class='entete-formulaire'>".icone(_T('icone_retour'), $retour, forum_logo($statut), '','', false)."</div>")
		. "<div class='formulaire_spip formulaire_editer formulaire_editer_message_forum'>"
		."<ul>"
		."<li class='obligatoire'><label for='titre_message'>"
	  	. _T('info_titre')
	  	."</label>"
	  	. "<input id='titre_message' name='titre_message' type='text' value=\""
	  	. entites_html($titre)
	  	. "\"   class='text' />\n"
		."</li>"
		."<li class='haut'><label for='texte' >"
	  	. _T('info_texte_message')
	  	."</label>"
			."<textarea name='texte' id='texte' rows='13' class='textarea'>\n"
			. $texte
			. "</textarea>"
			."<input type='hidden' name='modif_forum' value='oui' />\n"
	  	."</li>"		
	  . (!($statut != 'perso')
		   ? ''
		   : (
				"<li class='fieldset'><fieldset>"
				."<h3 class='legend'>"._T('info_lien_hypertexte')."</h3>"
				."<p class='explication'>". _T('texte_lien_hypertexte')."</p>\n"
				."<ul>"
				. "<li><label for='nom_site'>"
				. _T('form_prop_nom_site')
				. "</label>"
				. "<input type='text' id='nom_site' name='nom_site' value=\""
					. entites_html($nom_site)
					. "\" class='text' /></li>"
				. "<li><label for='url_site'>"
				. _T('info_url')
				."</label>"
				. "<input type='text' id='url_site' name='url_site' value=\"".entites_html($url_site)
				. "\" class='text' /></li>"
				."</ul></fieldset></li>"
				))
		."</ul></div>";
	  
}