$nb_aff) {
$nb_aff = (_TRANCHES);
$tranches = afficher_tranches_requete($cpt, 3, $tmp_var, '', $nb_aff);
}
if (!$icone) $icone = "../"._DIR_PLUGIN_ABOMAILMANS."/img_pack/mailman.gif";
if ($cpt) {
if ($titre_table) echo "
";
echo "";
bandeau_titre_boite2($titre_table, $icone, $couleur_claire, "black");
echo "
";
echo $tranches;
$result = spip_query("SELECT $select FROM $from$join$where$group$order LIMIT $deb_aff, $nb_aff");
$num_rows = spip_num_rows($result);
$ifond = 0;
$premier = true;
$compteur_liste = 0;
while ($row = spip_fetch_array($result)) {
$vals = '';
$id_abomailman = $row['id_abomailman'];
$reponses = $row['reponses'];
$titre = $row['titre'];
$tous_id[] = $id_abomailman;
$retour = parametre_url(self(),'duplique_chart','');
$link = generer_url_ecrire('abomailmans_edit',"id_abomailman=$id_abomailman&retour=".urlencode($retour));
if ($reponses) {
$puce = 'puce-verte-breve.gif';
}
else {
$puce = 'puce-orange-breve.gif';
}
$s = " ";
$vals[] = $s;
//$s .= typo($titre);
$s = icone_horizontale(typo($titre), $link,"../"._DIR_PLUGIN_ABOMAILMANS."/img_pack/mailman.gif", "",false);
$vals[] = $s;
$s = "";
$vals[] = $s;
$s = "";
$s = "";
if(abomailmans_abomailman_administrable($id_abomailman)){
$link = parametre_url('','exec=abomailmans_edit&supp_abomailman', $id_abomailman);
$link = parametre_url($link,'id_abomailman', $id_abomailman);
$vals[] = ""._T("abomailmans:supprimer")."";
}
$vals[] = $s;
$table[] = $vals;
}
spip_free_result($result);
$largeurs = array('','','','','');
$styles = array('arial11', 'arial11', 'arial1', 'arial1','arial1');
echo afficher_liste($largeurs, $table, $styles);
echo "
";
echo "
\n";
}
return $tous_id;
}
//* Envoi de mail via Mailman
function abomailman_mail ($from_nom, $from_email, $to_nom, $to_email, $subject="", $body="", $html="", $charset="") {
include_spip ("class/phpmailer/class.phpmailer");
$mail = new PHPMailer();
$mail ->CharSet = $charset;
if ($html==true) $mail->IsHTML(true);
$mail->FromName = $from_nom;
$mail->From = $from_email;
$mail->AddAddress($to_email);
$mail->Subject = $subject;
$mail->Body = $body;
if(!$mail->Send()) {
return false; }
else {
return true;
}
}
// Afficher l'arbo
function abomailman_arbo_rubriques($id_rubrique, $rslt_id_rubrique="") {
global $ran;
$ran ++;
$marge=" |";
for ($g=0;$g<$ran;$g++) {
if (($ran-1)==0) {
$marge="•";
}
else {
$marge .="-";
}
}
$marge .=" ";
$rqt_rubriques = spip_query ("SELECT id_rubrique, id_parent, titre FROM spip_rubriques WHERE id_parent='".$id_rubrique."'");
while ($row = spip_fetch_array($rqt_rubriques)) {
$id_rubrique = $row['id_rubrique'];
$id_parent = $row['id_parent'];
$titre = $row['titre'];
$arbo .="";
$arbo .= abomailman_arbo_rubriques($id_rubrique, $rslt_id_parent);
}
return $arbo;
}
?>