Exemple #1
0
	static function send($destinataire) {
		$expediteur = CBdd::select_one("SELECT email FROM user WHERE type = 2", "email");
		$id_texte	= CConfiguration::get_valeur('WELCOME_TEXT_ID');
		
		$sql_texte_select = "SELECT * FROM texte WHERE id = " . $id_texte;
		$texte = CBdd::select_row($sql_texte_select);
		
		$sql_user = "******" . $destinataire . "'";
		$user = CBdd::select_row($sql_user);
		
		$message = str_replace('$NOM', $user['nom'], $texte['text']);
		$message = str_replace('$PRENOM', $user['prenom'], $message);
		
		//echo $message;
		
		$sujet = $texte['nom'];
		
		$sql_unicite_message = "SELECT id FROM email WHERE destinataire = '" . addslashes($destinataire) . "' AND nom = '" . addslashes($sujet) . "'";
		// echo $sql_unicite_message;
		if(CBdd::select_one($sql_unicite_message, 'id')) {
			return 1;
		}
		
		$sql_email_insert = "INSERT INTO email(expediteur, destinataire, nom, text, etat) VALUES ('" . addslashes($expediteur) . "', '" . addslashes($destinataire) . "', '" . addslashes($sujet) . "', '" . addslashes($message) . "', '2')";
		
		
		CBdd::insert($sql_email_insert);
		
		return CMail::send_mail($destinataire, CFonction::force_stripslashes($sujet), CFonction::force_stripslashes($message), $expediteur, array(), 'Bcc: ' . $expediteur);
	}
Exemple #2
0
function get_href($zone, $id, $cle = '') {
	$zone = $zone[0];
	$url = "index.php?cle=" . CFonction::formate_chaine($cle)."&" . $zone . "=" . $id;
	if(CConfiguration::get_valeur('REWRITE_ENGINE') == 'on') {
		$url = preg_replace('/^(.*)(cle=)(.*)(&)(p|s|m)(=)([0-9]*)$/', '$3_$5$7.html', $url);
	}
	
	return $url;
}
else if ( $_SERVER['REQUEST_METHOD'] == "POST" ) {	
	$a = @$_POST["a"];
	if(!empty($_POST['order'])) $order = $_POST['order']; else $order = @$_SESSION['order'];
}


// SESSION VARIABLE
if (isset($_GET['alphaA']))	$_SESSION['alphaA']	= $_GET['alphaA'];


// RECUPERATION VALEUR
$zSortField      = 'id' ;
$zSortDirection  = CFunctions::getUserParam('zSortDirection', 'ASC') ;
$pagecourant     = CFunctions::getUserParam('zSortField', '0') ;
$iCurrentPage    = CFunctions::getUserParam('iPage', '1') ;
$iMaxPerPage     = CConfiguration::get_valeur('MAX_ITEM_PER_PAGE', 10) ;
$iStart          = $iCurrentPage - 1  ;


//COMPTEUR D'ENREGISTREMENT
$i = CTableGroupeUtilitaire::get_iNbrContact($_SESSION['groupe']);
$iMaxPerPage1 = $i-1;
// FIN COMPTEUR
$iNbPage    = ceil(($iMaxPerPage1/$iMaxPerPage)) ;

$zListeGetParam  = '' ;


/*--------------------------------------------------------------------
		TRAITEMENTS
----------------------------------------------------------------------*/
Exemple #4
0
	function load_img($imgname, $mwidth, $mheight) {

	// Longueur maximum prédéfinis en configuration
		 if($largeur_max=='') {
				$max_width = CConfiguration::get_valeur('IMG_MAX_WIDTH');
		}			
	// Hauteur maximum prédéfinis en configuration
		 if($hauteur_max=='') {
				$max_height = CConfiguration::get_valeur('IMG_MAX_HEIGHT');
		}			

		$im  = imagecreatetruecolor($mwidth, $mheight); /* Création d'une image blanche */
		$bgc = imagecolorallocate($im, 51, 51, 51);
		imagefilledrectangle($im, 0, 0, $mwidth, $mheight, $bgc);
		$source = imagecreatefromjpeg($imgname);
		// Calcul des nouvelles dimensions
		list($width, $height) 	= getimagesize($imgname);
		$tab = self::width_height_img_formate($imgname, $mwidth, $mheight);
		$nwidth = $tab['width']; $nheight = $tab['height'];
		imagecopyresized($im, $source, 0, 0, 0, 0, $nwidth, $nheight, $width, $height);
		return $im;
	}
Exemple #5
0
	static function getHeadLink()
	{
		echo '<link rel="alternate" type="application/rss+xml"  href="'.URL_RACINE.'/feed.php" title="'.CConfiguration::get_valeur('RSS_TITLE').'">';
	}
Exemple #6
0
<?php

	@include('inc/init.php');
	
	$feed = new CFeed; 

	$feed->channelTitle = CConfiguration::get_valeur('RSS_TITLE'); 
	$feed->channelLink = URL_RACINE; 
	$feed->channelDesc = CConfiguration::get_valeur('RSS_DESC'); 
	
	$feed->imageTitle = CConfiguration::get_valeur('RSS_TITLE'); 
	$feed->imageLink = URL_RACINE.'/userfiles/image/rss/'.CConfiguration::get_valeur('RSS_IMG'); 
	$feed->imageURL = URL_RACINE.'/userfiles/image/rss/'; 
	
	// Get the RSS data 
	$rss = $feed->GetRSS(); 
	
	// Output the generated RSS XML 
	if(strstr($_SERVER['HTTP_USER_AGENT'], 'Mozilla')) {
		header('Content-type: text/xml'); 
	}
	else {
		header('Content-type: application/rss+xml');
	}	
	
	echo $rss; 

	
?>
Exemple #7
0
----------------------------------------------------------------------*/

require_once '../../../../../obj/CCaptcha.php';
session_start();

if (!CCaptcha::testCode($code)) {
	echo 'NOT_SECURE';
	exit(0);
}
  
/*---------------------------------------------------------------------
		ENVOI
----------------------------------------------------------------------*/

$reception_form = CConfiguration::get_valeur('RECEPT_FORM_AUTO', 'non');
$reception_mail = CConfiguration::get_valeur('RECEPT_MAIL_AUTO', 'non');

if($reception_mail == 'oui') {
	if(!CMail::send_mail($destinataire, $sujet, CNmail::build_html_body('p { margin: 15px;}', $message), $expediteur)) {
		$msginfo = $msgerreur;
	} else {
		$msginfo = $msgconfirm;
	}
}
if($reception_form == 'oui'){
	$sql = "INSERT INTO email(id, nom, text, exp_nom, exp_prenom, expediteur, destinataire, date, imap) VALUES ";
	$sql.= "(null, '". CFunction::force_encode(addslashes($sujet)) . "', '" . CNmail::build_html_body('p { margin: 15px;}',addslashes($message)) . "', '". CFunction::force_encode(addslashes($nom)) . "', '". CFunction::force_encode(addslashes($prenom)) . "', '". $expediteur . "', '". $destinataire . "', '". date('Y-m-d H:i:s') . "', '')";
	
	//echo $sql;
	
	if(CBdd::insert($sql)) {
	$_SESSION['idgal'] = $idgal;
	
	if ($idgal < 1) {
		$error_type = 1;
		$error_signe['galerie'] = "*";
	}
	
	if ($error_type > 0) {
		//erreur de type champ non valide
		$msginfo = "Champ non valide";
		$a = 4;
		break;
	}

	$my_imgW = CConfiguration::get_valeur('IMG_MAX_WIDTH');
  $my_imgH = CConfiguration::get_valeur('IMG_MAX_HEIGHT');

	$tgal  = new CTableGalerie(array('id'=>$_SESSION['idgal']));
	$gal   = $tgal->select_row();
	
	$url_dest = '../../userfiles/image/galeries/'.$gal['dossier'];
	
	if(empty($_POST['creer'])) {
		$a = 4;
		break;
	}
	
	$file = CFile::upload_file($_FILES['file'], $url_dest, $unzip);

	if(!$file) {		
		$msginfo = "Fichier non ajout&eacute; (d&eacute;ja &eacute;xistant ou de format non support&eacute;)";