config['url_tmp'].$value["name"]); $value=true; } else { $value=false; } break; default : $value=htmlspecialchars($value,ENT_QUOTES, 'UTF-8'); break; } return $value; } function get_nom($text){ $nom=trim($text); $sSearch = array ('/-/','/à|á|â|ä|ã|å/', '/À|Á|Â|Ä|Ã|Å/', '/è|é|ê|ë/', '/È|É|Ê|Ë/', '/ì|í|î|ï/', '/Ì|Í|Î|Ï/', '/ò|ó|ô|ö|ø/', '/Ò|Ó|Ô|Ö|Ø/', '/ù|ú|û|ü/', '/Ù|Ú|Û|Ü/', '/ÿ/', '/Ÿ/', '/ñ/', '/Ñ/', '/ç/', '/Ç/', '/[^a-z0-9]/i'); $sReplace = array ('_', 'a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U', 'y', 'Y', 'n', 'N', 'c', 'C', '_'); $nom=preg_replace ($sSearch, $sReplace, $nom); $tab=array('"','"',"\\","&","{","(","[","-","|","`","@",")","]","=","}","+",":","/",";",",","?","!","<",">","%"," ","*",'$','-'); $nom=str_replace($tab,"_",$nom); $nom=str_replace("___","_",$nom); $nom=str_replace("__","_",$nom); $nom=strtolower($nom); return $nom; } function get_nom2($text){ $nom=trim($text); $sSearch = array ('/-/','/à|á|â|ä|ã|å/', '/À|Á|Â|Ä|Ã|Å/', '/è|é|ê|ë/', '/È|É|Ê|Ë/', '/ì|í|î|ï/', '/Ì|Í|Î|Ï/', '/ò|ó|ô|ö|ø/', '/Ò|Ó|Ô|Ö|Ø/', '/ù|ú|û|ü/', '/Ù|Ú|Û|Ü/', '/ÿ/', '/Ÿ/', '/ñ/', '/Ñ/', '/ç/', '/Ç/', '/[^a-z0-9]/i'); $sReplace = array ('_', 'a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U', 'y', 'Y', 'n', 'N', 'c', 'C', '_'); $nom=preg_replace ($sSearch, $sReplace, $nom); $tab=array('"',"'","\\", "&", "&","{","(","[","-","|","`","@",")","]","=","}","+",":","/",";",",","?","!","<",">","%"," ","*",'$','-','_'); $nom=str_replace($tab,"-",$nom); $nom=str_replace("---","-",$nom); $nom=str_replace("--","-",$nom); $nom=strtolower($nom); return $nom; } function clean_str_soft($str){ $accents = array('à' => 'a', 'ä' => 'a', 'â' => 'a', 'é' => 'e', 'è' => 'e', 'ê' => 'e', 'ë' => 'e', 'ï' => 'i', 'î' => 'i', 'ö' => 'o', 'ô' => 'o', 'ü' => 'u', 'ç' => 'c'); $str = rtrim($str); $str = str_replace(array_keys($accents), array_values($accents), $str); $str = preg_replace('#[^a-zA-Z0-9\.]#si', '_', $str); return ($str); } function verif_rep($dir_name){ $size = strlen($dir_name); if ($dir_name{$size-1}=="/") { $dir_name = substr($dir_name,0,$size-1); } if (!is_dir($dir_name)) mkdir($dir_name,0775); } function hash_rep($rep,$nom_fichier) { $dir=''; for($i=0 ; $i<3 ; $i++) { $dir.= $nom_fichier{$i}."/"; verif_rep($rep.$dir); } return $dir; } function create_config_id_client() { global $core; if(isset($_SESSION['key_session'])) { //Initialisation de la fonction de cryptage $init_crypt=initialize_crypt(); //Récupération des données en session $key_sess=decode_crypt($_SESSION['key_session'],$init_crypt); if($key_sess!=false) { $core->config['id_client']=$key_sess[0]; $connected="yes"; //$core->page['infos_client']=evalTemplate("tpl_infos_client.php","commun"); } else { $connected=""; //$err=-4; } } else { $connected=""; // $err=-4; } return $connected; } ?>config->http_accepted = array( 'VND.WAP.WML' ); $this->config->agent_denied = array( 'OfficeLiveConnector', 'Swapper', ); $this->config->agent_accepted = array( 'airness', 'alcatel', 'amoi', 'android', //'asus', 'benq', //'bird', 'blackberry', 'cdm-', 'docomo', 'ericsson', //'eten', 'gigabyte', 'Google Wireless Transcoder', //'haier', 'Huawei', 'htc_', 'htc-', 'i-mate', 'i-mobile', 'ipaq', 'iphone', 'j-phone', 'kwc-', 'kddi', 'lenovo-', //'lg', 'lg-', 'lg/', 'lge-', 'midp', 'mitsu/', 'mot-', //'motor', 'motorola', 'nokia', //'nec', 'palm', 'panasonic', 'pantech', 'philips', //'ppc', 'pg-', 'portalmmm', 'qtek', 'sagem', 'samsung', 'sanyo', 'sch-', 'sec-', 'sendo', 'sgh-', 'sharp', 'sie-', 'siemens', 'sonyericsson', 'sph-', 'symbianos', 'treo', 'telit', 'toshiba', //'tsm', 'vk-', 'vodafone', 'wap2', //'wap', 'windows ce', 'wnd', 'wonu', 'zte-', ); $this->config->regex['http_accepted'] = '/(' . str_replace(',', '|', preg_quote(implode(',', $this->config->http_accepted), '/')) . ')/i'; $this->config->regex['agent_denied'] = '/(' . str_replace(',', '|', preg_quote(implode(',', $this->config->agent_denied), '/')) . ')/i'; $this->config->regex['agent_accepted'] = '/(' . str_replace(',', '|', preg_quote(implode(',', $this->config->agent_accepted), '/')) . ')/i'; } function check_http_accept($value = NULL) { return preg_match($this->config->regex['http_accepted'], $value); } function check_http_user_agent($value = NULL) { $status = false; if (!preg_match($this->config->regex['agent_denied'], $value)) { $status = preg_match($this->config->regex['agent_accepted'], $value); } return $status; } function redirect () { if ($this->check_http_accept($_SERVER['HTTP_ACCEPT'])) { return true; } if ($this->check_http_user_agent($_SERVER['HTTP_USER_AGENT'])) { return true; } return false; } } ?>host=$core->config['host']; $this->user=$core->config['user']; $this->pass=$core->config['password']; $this->base=$base; } // PRIVATE : connection à la DB function connect() { global $core; $host=$core->config['host']; $user=$core->config['user']; $pass=$core->config['password']; //=$core->config['dbname']; $this->connect_id = mysql_connect($host, $user, $pass); if ($this->connect_id) { if(mysql_select_db($this->base, $this->connect_id)){ mysql_query("SET NAMES UTF8"); return $this->connect_id; } else return FALSE; } else return FALSE; } // PRIVATE : connection à la DB function query($query) { if ( !$this->connect_id ) $this->connect($this->host,$this->user,$this->pass,$this->base); if ( $this->result_id = mysql_query($query, $this->connect_id) ) { $this->query = trim($query); return $this->result_id; } else { // echo $query.$this->error= mysql_error(); return FALSE; } } // PUBLIC : Dernier id inserer function last_insert_id() { return @mysql_insert_id(); } // PUBLIC : renvoi le nombre d'enregistrement affecté function num_rows(){ if ( isset($this->result_id) ) { if ( preg_match('`^select`i',$this->query) ) { $i = mysql_num_rows($this->result_id); return $i; } if ( preg_match('`^(insert|update|delete)`i',$this->query) ) return mysql_affected_rows($this->result_id); } else { return count($this->records); } } function get_object($id="") { if ($id=="") $id=$this->result_id; return @mysql_fetch_object($id); } function get_array($query, $mode='ASSOC') { switch($mode) { case 'NUMERIC' : return @mysql_fetch_array($query, MYSQL_NUM); break; case 'BOTH' : return @mysql_fetch_array($query, MYSQL_BOTH); break; case 'ASSOC' : default : return @mysql_fetch_assoc($query); break; } } // PUBLIC : renvoi le msg d'erreur mysql function return_error() { return @mysql_error(); } // PUBLIC : ferme la connection; function close() { return @mysql_close($this->connect_id); } // PUBLIC : vide les resultat des requete function free_result() { return @mysql_free_result($this->connect_id); } } /* ***** Script pour se connecter : $maBD = new bd("base"); base est le nom de la base de donnée // executer une requete : $result = $maBD->query(SELECT * FROM ....); $row = $maBD->get_object($result); */ ?>config['sexe']; if(($sexe=="")&&($sexe_page!="")) {$sexe=$sexe_page;} elseif (($sexe=="")&& ($sexe_page=="")) {$sexe="nc";} if($size=="") {$size="468x60";} if ($random=="random") { $add_random="ORDER BY rand() LIMIT 1"; } $pub=recup_donnee(PUBS, "position",$size, "code"," (sexe LIKE '".$sexe."' OR sexe LIKE 'tous') AND visible='1' $add_random"); if ($pub=="") { $pub=recup_donnee(PUBS, "position",$size, "code"," (sexe LIKE 'couple' OR sexe LIKE 'tous') AND visible='1' $add_random"); } if ($pub=="") { $pub=recup_donnee(PUBS, "position",$size, "code"," (sexe LIKE 'nc' OR sexe LIKE 'tous') AND visible='1' $add_random"); } $pub=str_replace("allowtransparency='true'", "", $pub); //$pub=str_replace("&", "&", $pub); return $pub; } ?>config['secret_no_sess']); $init_crypt['iv'] = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); return $init_crypt; } function decode_crypt($key,$init_crypt) { $data=base64url_decode($key); $result = mcrypt_decrypt(MCRYPT_RIJNDAEL_256,$init_crypt['secret'],$data,MCRYPT_MODE_ECB,$init_crypt['iv']); if(strpos($result, '##')) { $tab = explode('##',$result); } else { $tab=false; } return $tab; } function encode_crypt($data,$init_crypt) { $key = base64url_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256,$init_crypt['secret'],$data,MCRYPT_MODE_ECB,$init_crypt['iv'])); return $key; } ?>clear($div, "innerHTML"); $objResponse->assign($div,"innerHTML",$text); if($objResponsescript!="") {$objResponse->script($objResponsescript);} return $objResponse; } /* AFFICHAGE DES MESSAGES D'ERREUR */ function affiche_msg_err($type,$err){ global $core; $db = new db($core->config['db_name']); $result=$db->query("SELECT text FROM ".TEXTES_INFO." WHERE num='$err' AND type='$type' AND lang='".$core->config['lang']."'"); if($db->num_rows($result)!=0) { $r = $db->get_object($result); $erreur = $r->text; } return $erreur; } function msg_err($err){ global $core; //Affichage des erreurs if(($err!='')&&($err!=0)) { $core->systeme['erreur']=affiche_msg_err('err',$err); if($err<0) {$core->page['err'].=evalTemplate("tpl_erreur.php","commun");} elseif($err>0) {$core->page['err'].=evalTemplate("tpl_message.php","commun");} } } // Pour appeler une page dans templates/ function evalTemplate($template,$add_path="") { global $core; if(($add_path!="")&&(substr($add_path,-1)!="/")) {$add_path=$add_path."/";} if ($add_path=="") { $add_path="templates/".$core->config['squelette_defaut']."/"; } $return = file_get_contents($add_path."templates/".$template); $return = str_replace('"','\"',$return); /* $return = str_replace('{$','".$',$return); $return = str_replace('}','."',$return);*/ // $return = preg_replace("/{".'$'."(.*)}/", '/".\$$1."/', $return); $return = preg_replace('/\{'.'\$'.'(.*)\}/smiU','".'.'\$'.'$1."',$return); eval( "\$return = \"$return\";" ); // on va chercher toutes les images et on va vérifier qu'elles existent bien avec la langue actuelle, sinon, on affiche les images correspondantes à la langue par défaut //modif_image($return); return $return; } // Pour appeler une page html dans html/ function evalPageHtml($pageHtml) { global $core; $return = @file_get_contents("html/".$pageHtml); // si le fichier html n'existe pas dans la langue actuelle if(!$return) { // on ouvre le fichier html correspondant à la langue par défaut $tab_namefile = explode('_',$pageHtml); // reconstitution du nom du fichier avec l'extension correspondant au language par défaut for($i=0;$i<(sizeof($tab_namefile)-1);$i++) {$fichierHtml.=$tab_namefile[$i]."_";} $fichierHtml.=$core->config['lang_default'].".html"; $return = file_get_contents("html/".$fichierHtml); } $return = str_replace('"','\"',$return); $return = preg_replace('/\{'.'\$'.'(.*)\}/smiU','".'.'\$'.'$1."',$return); eval( "\$return = \"$return\";" ); modif_image($return); return $return; } // Pour traduire les JS/ function evalTemplateJS($template) { global $core; $return = file_get_contents("js/".$template); $return = str_replace('"','\"',$return); $return = str_replace('$','#dollar#',$return); $return = preg_replace('/\{'.'#dollar#'.'(.*)\}/smiU','".'.'\$'.'$1."',$return); eval( "\$return = \"$return\";" ); $return = str_replace('#dollar#','$',$return); return $return; } function set_text_site(){ global $core; $db = new db($core->config['db_name']); $req1="SELECT nom,text FROM ".TEXTES_SITE." WHERE lang='".$core->config['lang_default']."' ORDER BY nom"; $result1 = $db->query($req1); $nb1 = $db->num_rows($result1); if($nb1>0) { while($row1=$db->get_object($result1)) { $req="SELECT nom,text FROM ".TEXTES_SITE." WHERE lang='".$core->config['lang']."' AND nom LIKE '".$row1->nom."' LIMIT 1"; $result = $db->query($req); $nb = $db->num_rows($result); if($nb>0) { $row=$db->get_object($result); $core->text[$row->nom]=htmlspecialchars($row->text, ENT_QUOTES); } // si aucun texte de la langue en cours , on remplace par le texte de la langue par defaut else { $core->text[$row1->nom]=htmlspecialchars($row1->text, ENT_QUOTES); } } } } function set_text_page($page){ global $core; $db = new db($core->config['db_name']); $req1="SELECT nom,text FROM ".TEXTES_PAGE." WHERE lang LIKE'".$core->config['lang_default']."' AND page LIKE '$page' ORDER BY nom"; $result1 = $db->query($req1); $nb1 = $db->num_rows($result1); if($nb1>0) { while($row1=$db->get_object($result1)) { $req="SELECT nom,page,text FROM ".TEXTES_PAGE." WHERE lang LIKE'".$core->config['lang']."' AND page LIKE '$page' AND nom LIKE '".$row1->nom."' LIMIT 1"; $result = $db->query($req); $nb = $db->num_rows($result); if($nb>0) { $row=$db->get_object($result); $core->page[$row->page][$row->nom]=htmlspecialchars($row->text, ENT_QUOTES); } // si aucun texte de la langue en cours , on remplace par le texte de la langue par defaut else { $core->page[$row->page][$row1->nom]=htmlspecialchars($row1->text, ENT_QUOTES); } } } } function set_text_menu($zone,$style=''){ global $core; $db = new db($core->config['db_name']); $req="SELECT nom,text,url, rubrique FROM ".TEXTES_MENU." WHERE lang LIKE '".$core->config['lang']."' AND zone LIKE '$zone' ORDER BY ordre"; $result = $db->query($req); $nb = $db->num_rows($result); if($nb>0) { $i=0; $core->page['menu']=''; $core->page['menu'].="
"; } // si aucun texte de la langue en cours , on remplace par le texte de la langue par defaut else { $req="SELECT nom,text,url, rubrique FROM ".TEXTES_MENU." WHERE lang LIKE '".$core->config['lang_default']."' AND zone LIKE '$zone' ORDER BY ordre"; $result = $db->query($req); $core->page['menu']=''; $core->page['menu'].="
"; } } function set_text_sous_menu($zone,$rubrique,$style=''){ global $core; $db = new db($core->config['db_name']); $req="SELECT nom,text,url FROM ".TEXTES_SOUS_MENU." WHERE lang LIKE '".$core->config['lang']."' AND zone LIKE '$zone' AND rubrique LIKE '$rubrique' ORDER BY ordre"; $result = $db->query($req); $nb = $db->num_rows($result); if($nb>0) { $i=0; $core->page['sous_menu']=''; $core->page['sous_menu'].="
"; } // si aucun texte de la langue en cours , on remplace par le texte de la langue par defaut else { $req="SELECT nom,text,url FROM ".TEXTES_SOUS_MENU." WHERE lang LIKE '".$core->config['lang_default']."' AND zone LIKE '$zone' AND rubrique LIKE '$rubrique' ORDER BY ordre"; $result = $db->query($req); $core->page['sous_menu']=''; $core->page['sous_menu'].="
"; } } function create_selectbox($obj,$nom,$select,$class='',$js='') { global $core; $text='"; return $text; } function create_selbox_sql($name_sbox, $table, $champ_id, $champ_nom, $id_selected=0, $class_css="", $text_label="", $opt_suppl="", $js="", $where="", $order_by="", $limit="") { $req = "SELECT $champ_id, $champ_nom FROM $table ".$where." ".$order_by." ".$limit; $res = mysql_query($req); $nb_line = mysql_numrows($res); if ($nb_line > 0) { $label = (empty($text_label)) ? "" : ''; $sbox = ''; return $label.$sbox; } return false; } //voir plus haut pour le détail des champs //création de selectbox pour site avec template function create_selbox_sql_tpl($name_sbox, $table, $champ_id, $champ_nom, $id_selected=0, $class_css="", $text_label="", $opt_suppl="", $js="", $where="", $order_by="", $limit="") { global $core; $db = new db($core->config['db_name']); $req = "SELECT $champ_id, $champ_nom FROM $table ".$where." ".$order_by." ".$limit; $res = $db->query($req); $nb_line = $db->num_rows($res); if ($nb_line > 0) { $label = (empty($text_label)) ? "" : ""; $sbox = ''; return $label." ".$sbox; } return false; } function add_reload_div($fonction_php,$type,$div,$interval,$params='0',$add_js=''){ global $core; switch ($type) { case 'change': $js=" onchange=\"xajax_reload_div('$fonction_php','$div','$params');".$add_js."\" "; break; case 'click': $js=" onclick=\"xajax_reload_div('$fonction_php','$div','$params');".$add_js."\" "; break; case 'js': $js="xajax_reload_div('$fonction_php','$div','$params');"; break; case 'div': $js=""; break; } return $js; } /* CONTRUCTION DE TABLEAUX */ function create_tableau($page,$id,$contenu_tableau,$css="",$js="",$add_url=""){ global $core; $constuction_tableau.=""; $db = new db($core->config['db_name']); $req="SELECT nom,text,page,tri,largeur,align FROM ".TEXTES_TABLEAU." WHERE lang='".$core->config['lang']."' AND page='$page' ORDER BY ordre"; $result = $db->query($req); $nb = $db->num_rows($result); if($nb>0) { $i=0; $constuction_tableau.=""; while($row=$db->get_object($result)) { $text=$row->text; // Ce qui va s'afficher $nom=$row->nom; // Pour la recherche sur les flèches $page=$row->page; // Pour la recherche sur les flèches $tri=$row->tri; // Pour la recherche sur les flèches $largeur=$row->largeur; $align=$row->align; // Ajout des flèches hautes et basses if ($tri=='1') { $url_tri=$core->config['page_en_cours']."?tri=$tri&col=$nom"; $constuction_tableau.=""; } else { $constuction_tableau.=""; } $i++; } $constuction_tableau.=""; } // si aucun texte de la langue en cours , on remplace par le texte de la langue par defaut else { $constuction_tableau.=""; $req="SELECT nom,text,page,tri,largeur,align FROM ".TEXTES_TABLEAU." WHERE lang='".$core->config['lang_default']."' AND page='$page' ORDER BY ordre"; $result = $db->query($req); while($row=$db->get_object($result)) { $text=$row->text; // Ce qui va s'afficher $nom=$row->nom; // Pour la recherche sur les flèches $page=$row->page; // Pour la recherche sur les flèches $tri=$row->tri; // Pour la recherche sur les flèches $largeur=$row->largeur; $align=$row->align; // Ajout des flèches hautes et basses if ($tri=='1') { $url_tri=$core->config['page_en_cours']."?tri=$tri&col=$nom"; $constuction_tableau.=""; } else { $constuction_tableau.=""; } $i++; } $constuction_tableau.=""; } $constuction_tableau.="$contenu_tableau"; $constuction_tableau.="
$text$text
$text$text
"; return $constuction_tableau; } function create_pagination($nb_pages,$page=1,$params='',$url="", $rewrite="", $input_hidden="") { global $core; if ($nb_pages!="1") { if ($core->config['page_en_cours']=="/boutique-sexy.php") {$core->config['page_en_cours']="/boutique-sexy.html";} if (($input_hidden!="")&&($rewrite!='rewrite')) { $open_form="
config['page_en_cours']."\" method=\"post\"> ".$input_hidden.""; $close_form="
"; } if ($rewrite=="rewrite") { $url=str_replace(".html","",$url); $tab_rewrite=explode("?", $url); $url=$tab_rewrite[0]; if ($tab_rewrite[1]!="") {$add_url="?".$tab_rewrite[1];} } if($params!='') { for($i=0;$i0) { if($nb_pages<=10) { $fin_aff=$nb_pages+1; $i=1; } else { if(($page>($nb_pages-9))&&($page>10)) { $i=$nb_pages-9; $fin_aff=$nb_pages+1; } else { if($page>5) { $i=$page-5; $fin_aff=$page+5; } else { $i=1; $fin_aff=10; } } } $page_suivante=$page+1; $page_precendente=$page-1; if ($page_precendente<=1) {$page_precendente=1;} if ($page_suivante>=$nb_pages) {$page_suivante=$nb_pages;} if($fin_aff>$nb_pages) {$fin_aff=$nb_pages;} if ($page!=1) { if ($rewrite=="rewrite") { $construct_pagination.= "text['page_premiere']."\"><< "; if ($page_precendente=="1") { $construct_pagination.= "  text['page_precendente']."\"><  "; } else { $construct_pagination.= "  text['page_precendente']."\"><  "; } } elseif (($input_hidden!="")&&($rewrite!='rewrite')) { $construct_pagination.= $open_form."".$close_form; $construct_pagination.= $open_form."    ".$close_form; } else { $construct_pagination.= "config['page_en_cours']."?page=1&key=$key".$url."\" title=\"".$core->text['page_premiere']."\"><< "; $construct_pagination.= " config['page_en_cours']."?page=$page_precendente&key=$key".$url."\" title=\"".$core->text['page_precendente']."\"><  "; } } while($i <= $fin_aff) { if ($rewrite=="rewrite") { if ($i=="1") { $construct_pagination.= " "; } else { $construct_pagination.= " "; } } elseif (($input_hidden!="")&&($rewrite!='rewrite')) { $construct_pagination.= $open_form; } else { $construct_pagination.= " config['page_en_cours']."?page=$i&key=$key".$url."\">"; } if($i==$page) { if (($input_hidden!="")&&($rewrite!='rewrite')) { $construct_pagination.="".$close_form; } else { $construct_pagination.=" ".$i." "; } } else { if (($input_hidden!="")&&($rewrite!='rewrite')) { $construct_pagination.="".$close_form; } else { $construct_pagination.=" $i "; } } $i++; } if ($page!=$nb_pages) { if ($rewrite=="rewrite") { $construct_pagination.= "  text['page_suivante']."\">> "; $construct_pagination.= " text['page_derniere']."\">>>"; } elseif (($input_hidden!="")&&($rewrite!='rewrite')) { $construct_pagination.= $open_form."   ".$close_form; $construct_pagination.= $open_form."".$close_form; } else { $construct_pagination.= "  config['page_en_cours']."?page=$page_suivante&key=$key".$url."\" title=\"".$core->text['page_suivante']."\">> "; $construct_pagination.= " config['page_en_cours']."?page=$nb_pages&key=$key".$url."\" title=\"".$core->text['page_derniere']."\">>>"; } } } } $construct_pagination="
$construct_pagination
"; return $construct_pagination; } // _____________ PAGINATION AJAX _______________ function create_pagination_ajax($nb_pages,$page=1,$params='', $fonction_js, $div) { global $core; if ($params=="") {$params="tous";} if($nb_pages>1) { if($nb_pages<=10) { $fin_aff=$nb_pages+1; $i=1; } else { if(($page>($nb_pages-9))&&($page>10)) { $i=$nb_pages-9; $fin_aff=$nb_pages+1; } else { if($page>5) { $i=$page-5; $fin_aff=$page+5; } else { $i=1; $fin_aff=10; } } } $page_suivante=$page+1; $page_precendente=$page-1; if ($page_precendente<=1) {$page_precendente=1;} if ($page_suivante>=$nb_pages) {$page_suivante=$nb_pages;} if($fin_aff>$nb_pages) {$fin_aff=$nb_pages;} if ($page!=1) { $construct_pagination.= "text['page_premiere']."\"><< "; $construct_pagination.= "  text['page_precendente']."\"><  "; } while($i <= $fin_aff) { $construct_pagination.= " "; if($i==$page) { $construct_pagination.=" ".$i." "; } else { $construct_pagination.=" $i "; } $i++; } if ($page!=$nb_pages) { $construct_pagination.= "  text['page_suivante']."\">> "; $construct_pagination.= " text['page_derniere']."\">>>"; } } $construct_pagination="
$construct_pagination
"; return $construct_pagination; } function recup_text_long($nom,$page) { global $core; $db = new db($core->config['db_name']); $result = $db->query("SELECT text FROM ".TEXTES_LONG." WHERE lang LIKE '".$core->config['lang']."' AND nom = '$nom' AND page='$page'"); $nb = $db->num_rows($result); if($nb>0) { while ($row=$db->get_object($result)) { $text=$row->text; } } else { $result = $db->query("SELECT text FROM ".TEXTES_LONG." WHERE lang LIKE '".$core->config['lang_default']."' AND nom = '$nom' AND page='$page'"); while ($row=$db->get_object($result)) { $text=$row->text; } } return $text; } // fonction permettant d'afficher les images dans la langue par défaut si aucune image dans la langue actuelle function modif_image(&$return) { global $core; // premiere partie de remplacement de l'attribut src preg_match_all('/src=["\']\/images\/trad\/([-._\/:a-zA-Z0-9]*)["\']/', $return, $matches, PREG_SET_ORDER); foreach ($matches as $val) { if(!file_exists("$val[1]")) { $tab_nameImg = explode('_',$val[1]); // reconstitution du nom du fichier avec l'extension correspondant au language par dꧡut //images multilangues if(sizeof($tab_nameImg) > 1) { for($i=0;$i<(sizeof($tab_nameImg)-1);$i++) {$img=$tab_nameImg[$i]."_";} // récupération de l'extension de l'image $tabExt = explode('.' , $val[1]); $format = $tabExt[1]; $img.=$core->config['lang_default'].".$format"; // permet le remplacement de l'url pour les attributs onMouseOver et onMouseOut $img_hover = str_replace("OFF", "ON",$val[1] ); $img_blur = str_replace("ON", "OFF", $val[1] ); $img_modif_hover = str_replace("OFF", "ON",$img ); $img_modif_blur = str_replace("ON", "OFF", $img ); // remplacement de l'image $return = str_replace($val[1],$img,$return); $return = str_replace($img_hover,$img_modif_hover,$return); $return = str_replace($img_blur,$img_modif_blur,$return); } } } } function affichage_err($erreur) { global $core; //Affichage des erreurs if(sizeof($erreur)!=0) { for($i=0;$isysteme['erreur']=affiche_msg_err('err',$erreur[$i]); if($erreur[$i]<0) {$core->page['err'].=evalTemplate("tpl_erreur.php");} elseif($erreur[$i]>0) {$core->page['err'].=evalTemplate("tpl_message.php");} } } } function recup_jour() { global $core; $db = new db($core->config['db_name']); $i=0; $result = $db->query("SELECT text FROM ".PARAMETRES_STATIC." WHERE lang LIKE '".$core->config['lang']."' AND type LIKE 'jours' ORDER BY CAST(nom AS signed integer) ASC"); while ($row=$db->get_object($result)) { $NomDuJour[$i] = $row->text; $i++; } $i=1; $result = $db->query("SELECT text FROM ".PARAMETRES_STATIC." WHERE lang LIKE '".$core->config['lang']."' AND type LIKE 'mois' ORDER BY CAST(nom AS signed integer) ASC"); while ($row=$db->get_object($result)) { $NomDuMois[$i] = $row->text; $i++; } $lejour = date("d"); $lemois = date("m"); $annee = date("Y"); //$requete = $db->query("SELECT fetedujour FROM holydays WHERE lejour='$lejour' AND lemois='$lemois'"); //if($requete){ // $row=$db->get_object($requete); $retour="
"; $retour.=$NomDuJour[ date("w") ]; if($lejour==01){ $retour.=" 1er "; } else if($lejour<10){ $retour.=" $lejour[1] "; } else { $retour.=date (" d "); } $retour.=$NomDuMois[ date(intval($lemois)) ]; $retour.=date (" Y"); // $retour.=" \"".$core-text['saint_du_jour']."\" title=\"".$core->text['saint_du_jour']."\" Style=\"cursor:pointer;cursor:hand;\" >"; // $retour.=$row->fetedujour; $retour.="
"; // } return $retour; } // Traduction complète des pages function affichage_texte_page($page_site,$language_site, $partie="box1") { global $core; $db = new db($core->config['db_name']); $result = $db->query("SELECT ".$partie." FROM ".TRADUCTION_PAGES." WHERE page_site='".$page_site."' AND lang='".$language_site."' LIMIT 1"); while ($row=$db->get_object($result)) { $texte_page=stripslashes($row->$partie); $affichage_texte_page="
$texte_page
"; } return $affichage_texte_page; } function reload_sess() { session_start(); } //______ RECUPERER UN CHAMPS DANS UNE TABLE___________ function recup_donnee ($table,$champs,$id,$champs_a_recup, $ajout="", $debug="") { global $core; $db = new db($core->config['db_name']); if ($ajout!="") { $add_where="AND $ajout"; } if ($champs!="") { $add_champs="WHERE $champs='$id' $add_where"; } $sql="SELECT $champs_a_recup as valeur_a_recup FROM $table $add_champs"; if ($debug=="debug") {echo "DEBUG : $sql
";} $result=$db->query($sql); while ($row=$db->get_object($result)) { $value=$row->valeur_a_recup; } return $value; } //______ RECUPERER UN CHAMPS DANS UNE TABLE DU BLOG___________ function recup_donnee_blog ($table,$champs,$id,$champs_a_recup, $ajout="") { global $core; $db = new db($core->config['db_blog']); if ($ajout!="") { $add_where="AND $ajout"; } if ($champs!="") { $add_champs="WHERE $champs='$id' $add_where"; } $sql="SELECT $champs_a_recup as valeur_a_recup FROM $table $add_champs"; $result=$db->query($sql); while ($row=$db->get_object($result)) { $value=$row->valeur_a_recup; } return $value; } function generate_chaine($car) { $string = ""; $chaine = "abcdefghijklmnpqrstuvwxy0123456789"; srand((double)microtime()*1000000); for($i=0; $i<$car; $i++) { $string .= $chaine[rand()%strlen($chaine)]; } return $string; } function checkEncoding ( $string, $string_encoding ) { $fs = $string_encoding == 'UTF-8' ? 'UTF-32' : $string_encoding; $ts = $string_encoding == 'UTF-32' ? 'UTF-8' : $string_encoding; return $string === mb_convert_encoding ( mb_convert_encoding ( $string, $fs, $ts ), $ts, $fs ); } function nettoyage_br($chaine_de_caractere) { $chaine_de_caractere=urlencode($chaine_de_caractere); //$chaine_de_caractere=clean_str($chaine_de_caractere); $chaine_de_caractere=trim($chaine_de_caractere); $chaine_de_caractere=str_replace("\r\n", "", $chaine_de_caractere); $chaine_de_caractere=str_replace("\n", "", $chaine_de_caractere); $chaine_de_caractere=str_replace("\r", "", $chaine_de_caractere); $chaine_de_caractere=str_replace("
", "", $chaine_de_caractere); $chaine_de_caractere=str_replace("
", "", $chaine_de_caractere); $chaine_de_caractere=urldecode($chaine_de_caractere); $chaine_de_caractere=str_replace("n2Fa", "n/a", $chaine_de_caractere); return $chaine_de_caractere; } ?>config['db_name']); $liste_type_club=""; if ($region!="") { $core->data['region']=recup_donnee(PARAMETRES, "nom", $region, "text", "lang LIKE '".$core->config['lang']."'"); // Récupération des types de clubs $result = $db->query("SELECT nom,text FROM ".PARAMETRES." WHERE type LIKE 'type_club' ORDER BY position ASC"); while ($row=$db->get_object($result)) { $nom=$row->nom; $text=$row->text; if ($type=="$nom") {$class="class=\"selected\"";}else{$class="";} $liste_type_club.="
  • text['en']." ".$core->data['region']."\">".$text."
  • "; } if ($liste_type_club!="") {$liste_type_club="

    ".$core->text['affiner_en']." ".$core->data['region']."

    ";} $retour_carte="

    » ".$core->text['retour_a_la_carte']."


    "; } else { $retour_carte=""; } $box_moteur_recherche="

    ".$core->text['recherche']."

    ".$liste_type_club." ".$retour_carte."

    "; return $box_moteur_recherche; } //___________ AJOUTER CLUB __________________ function box_ajouter_club($position,$couleur, $region="") { global $core; if ($region!="") { $add_region="?region=$region"; } $box_ajout_club="

    ".$core->text['ajouter_club']."

    Vous connaissez un club échangiste qui n'est pas dans la liste ? Un lieu public coquin ? Un bar libertin ?

    "; return $box_ajout_club; } //___________ DERNIERS CLUBS __________________ function box_derniers_clubs($position,$couleur, $nb="5", $region="", $type="") { global $core; $db = new db($core->config['db_name']); if ($region!="") { $add_region="AND region LIKE '$region'"; } if ($type!="") { $add_type="AND type_club LIKE '$type'"; } // Derniers clubs $result = $db->query("SELECT id_club, nom, type_club, region, date FROM ".CLUBS." WHERE visible='1' $add_region $add_type ORDER BY date DESC LIMIT $nb"); $nb_resultats=$db->num_rows($result); if ($nb_resultats=="0") { if ($type!="") { return box_derniers_clubs($position,$couleur, $nb, $region, ""); } elseif ($region!="") { return box_derniers_clubs($position,$couleur, $nb, "", ""); } else { $derniers_clubs="".$core->text['aucun_club'].""; } } else { while ($row=$db->get_object($result)) { $id_club=$row->id_club; $type_club2=$row->type_club; $region2=$row->region; $core->data['nom']=stripslashes($row->nom); $core->data['date']=aff_date($row->date, "1"); $core->data['region']=recup_donnee(PARAMETRES, "nom", $region2, "text", "lang LIKE '".$core->config['lang']."'"); if ($region2=="provence-alpes-cote-d-azur") {$core->data['region']="PACA";} $core->data['type_club']=recup_donnee(PARAMETRES, "nom", $type_club2, "text", "type LIKE 'type_club'"); $core->data['url_club']=url_club($id_club); $derniers_clubs.="

    data['url_club']."\" title=\"".$core->data['nom']."\">".$core->data['nom']."

    ".$core->data['type_club']." ".$core->text['en']." ".$core->data['region']."

    ".$core->text['ajoute_le']." ".$core->data['date']."

    "; } } if (($region!="france") &&($region!="")) { if ($region=="provence-alpes-cote-d-azur") {$titre_region=" - PACA";} else {$titre_region=" - $region";} } $box_dernier_clubs=" "; return $box_dernier_clubs; } //___________ DERNIERS AVIS __________________ function box_derniers_avis($position,$couleur, $nb="5", $region="", $type="") { global $core; $db = new db($core->config['db_name']); if ($region!="") { $add_region="AND region LIKE '$region'"; } if ($type!="") { $add_type="AND type_club LIKE '$type'"; } // Derniers clubs avis $result = $db->query("SELECT ".CLUBS.".id_club, ".CLUBS.".nom, ".CLUBS.".type_club, ".CLUBS.".region, ".CLUBS_AVIS.".date, ".CLUBS_AVIS.".id_client FROM ".CLUBS." LEFT JOIN ".CLUBS_AVIS." ON ".CLUBS_AVIS.".id_club=".CLUBS.".id_club WHERE ".CLUBS_AVIS.".visible='1' AND ".CLUBS.".visible $add_region $add_type ORDER BY ".CLUBS_AVIS.".date DESC LIMIT $nb"); $nb_resultats=$db->num_rows($result); if ($nb_resultats=="0") { if ($type!="") { return box_derniers_avis($position,$couleur, $nb, $region, ""); } elseif ($region!="") { return box_derniers_avis($position,$couleur, $nb, "", ""); } else { $derniers_avis="".$core->text['aucun_avis'].""; } $derniers_avis="".$core->text['aucun_avis'].""; } else { while ($row=$db->get_object($result)) { $id_club=$row->id_club; $type_club2=$row->type_club; $region2=$row->region; $id_client=$row->id_client; $core->data['pseudo']=recup_pseudo($id_client); $core->data['nom']=stripslashes($row->nom); $core->data['date']=aff_date($row->date, "1"); $core->data['region']=recup_donnee(PARAMETRES, "nom", $region2, "text", "lang LIKE '".$core->config['lang']."'"); if ($core->data['region']=="provence-alpes-cote-d-azur") {$core->data['region']="PACA";} $core->data['type_club']=recup_donnee(PARAMETRES, "nom", $type_club2, "text", "type LIKE 'type_club'"); $core->data['url_club']=url_club($id_club); $derniers_avis.="

    data['url_club']."\" title=\"".$core->data['nom']."\">".$core->data['nom']."

    ".$core->data['type_club']." ".$core->text['en']." ".$core->data['region']."

    ".$core->text['ajoute_le']." ".$core->data['date']." ".$core->text['par']." ".$core->data['pseudo']."

    "; } } if (($region!="france") &&($region!="")) { if ($region=="provence-alpes-cote-d-azur") {$titre_region=" - PACA";} else {$titre_region=" - $region";} } $box_dernier_avis="

    ".$core->text['derniers_avis'].$titre_region."

    ".$derniers_avis."
    "; return $box_dernier_avis; } //___________ DERNIERS CLUBS __________________ function box_clubs_aleatoires($position,$couleur, $nb="5", $region="", $type="") { global $core; $db = new db($core->config['db_name']); if ($region!="") { $add_region="AND region LIKE '$region'"; } if ($type!="") { $add_type="AND type_club LIKE '$type'"; } if ($region!="") { $region_titre=recup_donnee(PARAMETRES, "nom", $region, "text", "lang LIKE '".$core->config['lang']."'"); if ($region=="provence-alpes-cote-d-azur") {$region_titre="PACA";} if ($region=="france") {$add_region="";} if ($region=="centre") {$prefixe="dans le";} elseif ($region=="autres_pays") {$prefixe="dans les";} else {$prefixe="en";} $titre="

    text['les_clubs_libertins']." ".$prefixe." ".$region_titre."\">Clubs ".$prefixe." ".$region_titre."

    "; } else { $titre="

    text['les_clubs_libertins']."\">Les Clubs libertins

    "; } // Derniers clubs $result = $db->query("SELECT id_club, nom, type_club, region, date, ville, cp FROM ".CLUBS." WHERE visible='1' $add_region $add_type ORDER BY rand() DESC LIMIT $nb"); $nb_resultats=$db->num_rows($result); if ($nb_resultats=="0") { if ($type!="") { return box_clubs_aleatoires($position,$couleur, $nb, $region, ""); } elseif ($region!="") { return box_clubs_aleatoires($position,$couleur, $nb, "", ""); } else { $liste_clubs="".$core->text['aucun_club'].""; } } else { while ($row=$db->get_object($result)) { $id_club=$row->id_club; $type_club=$row->type_club; $region=$row->region; $ville=stripslashes($row->ville); $cp=substr($row->cp, 0,2); $core->data['nom']=stripslashes($row->nom); //$core->data['date']=aff_date($row->date, "1"); $core->data['region']=recup_donnee(PARAMETRES, "nom", $region, "text", "lang LIKE '".$core->config['lang']."'"); $core->data['type_club']=recup_donnee(PARAMETRES, "nom", $type_club, "text", "type LIKE 'type_club'"); if ($cp!="") {$add_cp="($cp)";} if ($ville!="") {$add_ville="à $ville $add_cp
    ";} $core->data['url_club']=url_club($id_club); $liste_clubs.="

    data['url_club']."\" title=\"".$core->data['nom']."\">".$core->data['nom']."

    ".$core->data['type_club']." ".$add_ville." ".$core->text['en']." ".$core->data['region']."

    "; //

    ".$core->text['ajoute_le']." ".$core->data['date']."

    } } $box_clubs_aleatoires="
    ".$titre."
    ".$liste_clubs."
    "; return $box_clubs_aleatoires; } ?> left - 1 colonne (margin-left:0px; margin-right:Xpx;) bloc_box_2col_left -> left - 2 colonnes bloc_box_3col_left -> left - 3 colonnes bloc_box_1col_right -> right - 1 colonne (margin-right:0px - margin-left:0px;) bloc_box_2col_right -> right - 2 colonnes (margin-right:0px - margin-left:0px;) *************************************************************************************/ function box_affiche_pub_soiree($position,$couleur) { $box.="

    Soirée HFlibres du 28/09

    Attention changement de lieu!!
    "; $box.=''; $box.="
    "; return $box; } function box_affiche_annonce($position) { $box.="
    "; $box.="
    "; return $box; } /* BOX NETTOYAGE */ function box_clear($position) { global $core; $box.="
     
    "; return $box; } /* BOX AFFICHE PUB */ function box_affiche_pub($position,$taille) { global $core; $box.="
    "; $box.=aff_pub($taille); $box.="
    "; return $box; } /* BOX RECHERCHE RAPIDE */ function box_recherche_rapide($position,$couleur) { global $core; $affiche_recherche_rapide="

    Recherche rapide

    ".checkbox_param("sexe","search_sexe","", 'sexe_accueil')."

    ".menu_deroulant_param("region","search_region","","","","")."

    {$core->text['min']}     {$core->text['max']}

    {$core->text['min']}     {$core->text['max']}


    {$core->text['faire_recherche_detaillee']}
    "; return $affiche_recherche_rapide; } /* BOX ANNONCES */ function box_inscrits_inscription($nb=8) { global $core; $db = new db($core->config['dbname']); $text="

    Derniers libertins inscrits

    "; $result = $db->query("SELECT ".CLIENTS.".id_client, ".CLIENTS.".login,".CLIENTS.".sexe, ".CLIENTS_ANNONCES.".avatar FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE ".CLIENTS.".visible='1' AND ".CLIENTS_ANNONCES.".description NOT LIKE '' AND avatar NOT LIKE '' GROUP BY ".CLIENTS.".id_client ORDER BY date_inscription DESC LIMIT $nb"); while ($row=mysql_fetch_object($result)) { $id_client = $row->id_client; $login = ucfirst(strtolower(tronque($row->login, 12, 0))); $avatar = $row->avatar; $photo=url_photo($avatar, $id_client, "tiny"); $url_profil=url_profil($id_client); $title_profil="$login"; $text.=""; } $text.="
    "; return $text; } function box_annonces_accueil($position,$couleur) { global $core; $box.="
    "; return $box; // Appel la box_annonces_accueil_reload } function box_annonces_accueil_reload() { global $core; $db = new db($core->config['db_name']); $text.="

    config['squelette_rep']."/images/pictos/picto_reload.png\" alt=\"reload\" />
    Les Annonces libertines

    "; $result = $db->query("SELECT ".CLIENTS.".id_client, ".CLIENTS.".login,".CLIENTS.".sexe, ".CLIENTS_ANNONCES.".avatar, ".CLIENTS_ANNONCES.".region FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE ".CLIENTS.".visible='1' AND heure_connexion>=SUBDATE(NOW(), INTERVAL 4 MONTH) AND ".CLIENTS.".sexe NOT LIKE 'homme' AND ".CLIENTS.".sexe NOT LIKE '' AND ".CLIENTS_ANNONCES.".description NOT LIKE '' AND avatar NOT LIKE '' GROUP BY ".CLIENTS.".id_client ORDER BY rand() LIMIT 8"); $nb_annonces=$db->num_rows($result); while ($row=mysql_fetch_object($result)) { //$tab_annonce=recup_donnees_annonce($id_user); $id_client = $row->id_client; $sexe = $row->sexe; //$description= TronqueHtml(strip_tags($row->description), 100); $type_personne=aff_type_personne($id_client); $age=aff_age($id_client); $login = ucfirst(strtolower(tronque($row->login, 12, 0))); $avatar = $row->avatar; $photo=url_photo($avatar, $id_client, "tiny"); $region = $row->region; $region_nom=recup_donnee(PARAMETRES, "nom", $region, "text"); $url_profil=url_profil($id_client); $title_profil="Voir le profil de $login $type_personne"; $text.="

    ".$login."

    ".$type_personne."
    ".$age."
    "; //

    ".$description." } $text.="
    "; return $text; } function box_news_home($position,$couleur) { global $core; $box.="
    "; $box.="

    Nouveautés du site

    "; $box.="
    "; $box.=affichage_texte_page("index_news",$core->config['lang']); $box.="
    "; return $box; } function box_contact($position,$couleur) { global $core; $box.="
    "; $box.="

    Nous contacter

    "; $box.="
    "; $box.=affichage_texte_page("box_contact",$core->config['lang']); $box.="
    "; return $box; } function box_tags($position,$couleur) { global $core; $box.="
    "; $box.=affichage_texte_page("box_tags",$core->config['lang']); $box.="
    "; /* ?>

    TAGS

    melangisme gratuit, echangisme gratuit, definition melangisme, annonces echangiste, annonces melangiste, rencontre echangiste, rencontre melangiste, melangisme, melangiste, echangisme, echangiste, libertinage, annonces, annonce, chat, conseil, definition, photo, video, porno, amateur, rencontre, couple, femme, bi, bisexuelle, bisexuel, libertin, charme, gratuit, club libertin, coquin, jeux, coquine, hflibres, hommes libres, femmes libres, lilyrose'
    ";*/ return $box; } // ____ INFORMATIONS__________ function box_nouveautes($position,$couleur) { global $core; $box.="
    "; $box.="

    Nouveautés du site

    "; $box.="
    "; $db = new db("hflibrescom"); /*$result = $db->query("SELECT texte,titre FROM infos"); if($db->num_rows($result)>0) { while($row=$db->get_object($result)) { $box.="

    $row->titre


    ".$row->texte."

    "; } }*/ $box.="
    "; return $box; } // ____ JEUX__________ function box_jeu($position,$couleur) { global $core; $box.="
    "; $box.="

    Faire un jeu coquin ?

    "; $box.="
    "; $db = new db("hflibrescom"); $result = $db->query("SELECT id_jeu,nom, visuel, categorie FROM jeux_ligne WHERE visible='1' AND visuel NOT LIKE '' ORDER BY RAND() LIMIT 1"); if($db->num_rows($result)>0) { while($row=$db->get_object($result)) { $nom_jeu=$row->nom; $text_url=get_nom2($nom_jeu); $id_jeu_cat=$row->id_jeu; $categorie=$row->categorie; $visuel=$row->visuel; $categorie_nom=recup_donnee(PARAMETRES, "nom", $categorie, "text", "type LIKE 'jeux_coquins'"); $core->data['visuel']="\"".$categorie_nom."data['text']."\" />"; $core->data['url']="/jeux-coquins/".$categorie."/".$id_jeu_cat."/".$text_url.".html"; $box.="

    data['url']."\" title=\"Jouer au ".$categorie_nom." ".$nom_jeu."\">$categorie_nom » $nom_jeu

    ".$core->data['visuel']."

    data['url']."\" style=\"width:150px;margin-left:auto;margin-right:auto;\">Je veux jouer !

    "; } } $box.="
    "; return $box; } // ____ NEWSLETTER__________ function box_newsletter($position) { global $core, $err; $box.="
    "; $box.="
    "; $db = new db("hflibrescom"); $action= verif_get_post('char',$_POST['action']); if ($action=="inscription_newsletter") { //Affichage des erreurs affichage_err($err); $erreur=$core->page['err']; $core->page['err']=""; unset($GLOBALS['err']); } $box.="

    Newsletter HFlibres

    "; $box.="

    Pour rester informé des nouveautés

    "; $box.=$erreur; $box.="
    config['page_en_cours']."\" method=\"post\"> text['entrez_votre_email']."\" onclick=\"this.value=''\" />
    "; $box.="
    "; return $box; } // ____ INFORMATIONS ABONNE__________ function box_info_abonne($position,$couleur) { global $core; global $id_user_sess; $box.="
    "; $box.="

    Mon profil

    "; $box.="
    "; //nombre de nouveaux messages $nb_messages=recup_donnee(MESSAGES, "id_client_dest", $core->config['id_client'], "count(1)", "lu='0' AND supp_client_dest='0'" ); if ($nb_messages>0) {$add_blink="style=\"text-decoration:blink\"";}else {$add_blink="";} //nombre de visiste $nb_visites=recup_donnee(CLIENTS_VISITEURS, "id_client", $core->config['id_client'], "count(1)", "vu='0'" ); //nombre de visiste $nb_temoignages=recup_donnee(CLIENTS_TEMOIGNAGES, "id_client", $core->config['id_client'], "count(1)", "visible='0'" ); $avatar=recup_donnee(CLIENTS_ANNONCES, "id_client", $core->config['id_client'], "avatar"); $aff_avatar=url_photo($avatar, $core->config['id_client'], "mini"); $box.="

    config['sexe']."\" >Bonjour ".$core->config['login']."


    "; $box.=""; $box.="
    "; $box.="
    "; return $box; } // ____ INSCRIPTION__________ function box_inscription($position,$couleur) { global $core; $box.="
    "; $box.="

    Inscription

    "; $box.="
    "; //style=\"height:150px;\" $box.=affichage_texte_page("box_inscription",$core->config['lang']); $box.="
    "; return $box; } // ____ Guide du libertinage __________ function box_guide_libertinage($position,$couleur) { global $core; $box.="
    "; $box.="

    \"Guide

    "; $box.="
    "; return $box; } function box_mini($position,$couleur,$type) { global $core; switch($type) { case "clubs": $contenu_box="

    \"Annuaire

    "; break; case "guide-libertinage": default: $contenu_box="

    \"Guide

    "; break; } $box.="
    "; $box.="$contenu_box"; $box.="
    "; return $box; } function box_compte($position,$couleur) { global $core; if ($core->config['id_client']!="") { $box=box_info_abonne($position,$couleur); } else { $box=box_inscription($position,$couleur); } return $box; } // ____ LOGIN__________ function box_login($position,$couleur) { global $core; $box.="
    "; $box.="

    ".$core->text['identification']."

    "; $box.="
    "; $box.="
    config['page_en_cours']."\" method=\"post\"> ".$core->text['entrez_votre_email']." :
    data['email']."\" />

    ".$core->text['mot_de_passe']." :




    "; $box.="
    "; return $box; } // ____ LOGIN__________ function box_login_chat() { global $core, $err; $verif_login= verif_get_post('char',$_POST['verif_login']); if ($verif_login=="yes") { //Affichage des erreurs affichage_err($err); $erreur=$core->page['err']; $core->page['err']=""; unset($GLOBALS['err']); } $box.=""; return $box; } // ____ CHAT - ABO EXPIRE __________ function box_chat_abo_expire($position,$couleur) { global $core; $box.="
    "; $box.="L'accès au chat est réservé aux membres ayant un abonnement en cours de validité.

    "; $box.="
    Je m'abonne !
    "; $box.="
    "; return $box; } // ____ MDP PERDU__________ function box_mdp_perdu($position,$couleur) { global $core; $box.="
    "; $box.="

    ".$core->text['mdp_perdu']."

    "; $box.="
    "; $box.="
    config['page_en_cours']."\" method=\"post\"> ".affichage_texte_page("box_mdp_perdu",$core->config['lang'])." ".$core->text['entrez_votre_email']." :
    data['email']."\" />

    "; $box.="
    "; return $box; } // ____ PROCHAINE SOIREE __________ function box_prochaine_soiree($position,$couleur) { global $core; $box.="
    "; $box.="

    Prochaine soirée

    "; $box.="
    "; // On recherche la prochaine soirée /*$db = new db("hflibrescom"); $result = $db->query("SELECT soirees.nom_soiree,clubs.nom,soirees.id_club,soirees.details FROM soirees JOIN clubs ON soirees.id_club=clubs.id_club WHERE soirees.date='".$date."'"); if($db->num_rows($result)>0) { while($row=$db->get_object($result)) { $box.=aff_soiree_detail($row->id_soiree); } } else { // Annoncez votre soirée $box.="Annoncez votre soirée"; }*/ $box.="
    "; return $box; } // ____ PROCHAINE SOIREE __________ function box_boutique($position,$couleur) { global $core; $db = new db($core->config['dbname']); /*function url_produit($id_produit) { global $core; $nom_produit=recup_donnee("sexe_shop_produits", "id_produit", $id_produit, "nom"); $id_rubrique=recup_donnee("sexe_shop_produits", "id_produit", $id_produit, "id_rubrique"); $nom_rubrique=recup_donnee("sexe_shop_rubriques", "id_rubrique", $id_rubrique, "nom_rubrique"); $id_rubrique_top=recup_donnee("sexe_shop_rubriques", "id_rubrique", $id_rubrique, "id_rubrique_top"); $nom_rubrique_top=recup_donnee("sexe_shop_rubriques_top", "id_rubrique_top", $id_rubrique_top, "nom_rubrique_top"); if ($id_rubrique!="") { $url_produit=$core->config['url_boutique']."/boutique-sexy/".$id_rubrique_top."-".get_nom2($nom_rubrique_top)."/".$id_rubrique."-".get_nom2($nom_rubrique)."/".$id_produit."-".get_nom2($nom_produit).".html"; } else { $url_produit=$core->config['url_boutique']."/boutique-sexy/".$id_rubrique_top."-".get_nom2($nom_rubrique_top)."/".$id_produit."-".get_nom2($nom_produit).".html"; } return $url_produit; } */ $box.="
    "; $box.="

    La Boutique Sexy

    "; $box.="
    "; $result = $db->query("SELECT id_produit,nom,url_image,url, prix,descriptif FROM boutique_produits WHERE visible='1' ORDER BY RAND() LIMIT 1"); if($db->num_rows($result)>0) { while($row=$db->get_object($result)) { $id_produit=$row->id_produit; $nom_produit=$row->nom; $url_image=$row->url_image; $prix=$row->prix; $url_produit=$row->url; $descriptif=tronque($row->descriptif, 120); /*$box.="
    \"".$nom_produit."\"/

    ".$nom_produit."

    Prix : ".$row->prix." €

    ".$descriptif."

    » Voir le produit


    */ $box.="

    \"".$nom_produit."\"/

    ".$nom_produit."

    Prix : ".$row->prix." €

    ".$descriptif."

    » Voir le produit

    "; } } $box.="
    "; return $box; } // ____ INFO CONSEIL __________ function box_mag($position,$couleur, $nb="1") { global $core; $db_blog = new db($core->config['db_blog']); if ($nb=="3") {$add_style="style=\"min-height:260px;\"";} $box.="
    "; $box.="

    Le Magazine HFlibres

    "; $box.="
    "; /* $posts = get_posts('numberposts=1&orderby=post_date'); foreach ($posts as $post) : start_wp(); $box.= "".the_date()."

    ".the_title()."

    ".the_excerpt(); endforeach;*/ $result = $db_blog->query("SELECT ID, post_date, post_content, post_title, guid FROM wp_posts WHERE post_status LIKE 'publish' AND post_type LIKE 'post' AND ID NOT IN (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id='679') ORDER BY post_date DESC LIMIT $nb"); if($db_blog->num_rows($result)>0) { while($row=$db_blog->get_object($result)) { $ID=$row->ID; $post_date=aff_date($row->post_date, "1"); $post_excerpt=$row->post_content; $post_title=$row->post_title; $post_title_court=tronque($post_title, 40); $permalink=get_permalink($ID); $text = get_the_content(); $post_excerpt = tronque(strip_tags(preg_replace(" (\[.*?\])",'',$post_excerpt)), 120); $src = trim(get_post_meta($ID, 'wct_thumb',true)); $hasThumb = ('' != $src && 'none' != $src); if($hasThumb) {$miniature=''.$alt.'';} $box.="

    ".$post_title_court."

    "; //$box.="

    Ajouté le ".$post_date."

    "; $box.="$miniature"; $box.="

    ".$post_excerpt." » suite

    "; $box.="

    "; } } $box.="
    "; return $box; } // ____ INFO CONSEIL __________ function box_slider_mag($position,$couleur, $nb="1") { global $core; $db_blog = new db($core->config['db_blog']); if ($nb=="3") {$add_style="style=\"min-height:260px;\"";} $box.="
    "; //$box.="

    Le Magazine HFlibres

    "; $box.="
    "; /* $posts = get_posts('numberposts=1&orderby=post_date'); foreach ($posts as $post) : start_wp(); $box.= "".the_date()."

    ".the_title()."

    ".the_excerpt(); endforeach;*/ $result = $db_blog->query("SELECT ID, post_date, post_content, post_title, guid FROM wp_posts WHERE post_status LIKE 'publish' AND post_type LIKE 'post' AND ID NOT IN (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id='679') ORDER BY post_date DESC LIMIT $nb"); if($db_blog->num_rows($result)>0) { $box.="
      "; while($row=$db_blog->get_object($result)) { $ID=$row->ID; $post_date=aff_date($row->post_date, "1"); $post_excerpt=$row->post_content; $post_title=$row->post_title; $post_title_court=tronque($post_title, 40); $permalink=get_permalink($ID); $text = get_the_content(); $post_excerpt = tronque(strip_tags(preg_replace(" (\[.*?\])",'',$post_excerpt)), 120); $id_attachement = trim(get_post_meta($ID, '_thumbnail_id',true)); if ($id_attachement=="") {$id_attachement=recup_donnee_blog("wp_posts", "post_parent", $ID, "ID", "post_type LIKE 'attachment' ORDER BY post_modified_gmt ASC");} $attachement=get_permalink($id_attachement); echo "ID : ".$ID."
      "; echo "id_attachement : ".$id_attachement."
      "; echo "attachement : ".$attachement."
      "; if($attachement=="") { $hasThumb = ('' != $src && 'none' != $src); if($hasThumb) {$attachement="src=";} } $box.="
    • ".$post_title_court."

      ".$post_excerpt."

    • "; //$box.="
    • $miniature

      ".$post_title_court."

      ".$post_excerpt."

    • "; /*$box.="

      ".$post_title_court."

      "; //$box.="

      Ajouté le ".$post_date."

      "; $box.="$miniature"; $box.="

      ".$post_excerpt." » suite

      "; $box.="

      ";*/ } $box.="
    "; } $box.="
    "; return $box; } // ____ INFO CONSEIL __________ function box_image_du_jour($position,$couleur, $nb="1") { global $core; $db_blog = new db($core->config['db_blog']); if ($nb=="3") {$add_style="style=\"min-height:260px;\"";} $box.="
    "; $box.="

    L'image du jour

    "; $box.="
    "; $result = $db_blog->query("SELECT ID, post_date, post_content, post_title, guid FROM wp_posts WHERE post_status LIKE 'publish' AND post_type LIKE 'post' AND ID IN (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id='679') ORDER BY post_date DESC LIMIT $nb"); if($db_blog->num_rows($result)>0) { while($row=$db_blog->get_object($result)) { $ID=$row->ID; $post_date=aff_date($row->post_date, "1"); $post_excerpt=$row->post_content; $post_title=$row->post_title; $post_title_court=tronque($post_title, 40); $permalink=get_permalink($ID); $text = get_the_content(); $post_excerpt = tronque(strip_tags(preg_replace(" (\[.*?\])",'',$post_excerpt)), 120); $image_du_jour=recup_donnee_blog("wp_posts", "post_parent", $ID, "guid", "post_type LIKE 'attachment'"); $box.=""; $box.="

    Agrandir\"$post_title\"

    "; $box.="
    "; /* $src = trim(get_post_meta($ID, 'wct_thumb',true)); $hasThumb = ('' != $src && 'none' != $src); if($hasThumb) {$miniature=''.$alt.'';} $box.="

    ".$post_title_court."

    "; //$box.="

    Ajouté le ".$post_date."

    "; $box.="$miniature"; $box.="

    ".$post_excerpt." » suite

    "; $box.="

    ";*/ } } $box.="
    "; return $box; } //____________ BOX FACEBOOK ________________ function box_facebook($position,$couleur) { $box.="
    "; $box.="

    Suivez-nous sur Facebook

    "; $box.="
    "; $box.="
    "; $box.="
    "; return $box; } /* AFFICHAGE DU MOTEUR DE RECHERCHE DES ANNONCES */ function box_affiche_recherche($position,$couleur) { global $core; /* $affiche_recherche="

    Recherche avancée

    ".checkbox_type_sexe()."

    ".liste_deroulante_region()."

    ".input_age_min_max("elle")."

    ".input_age_min_max("lui")."


    ".checkbox_type_orientation("f")." ".checkbox_type_orientation("h")."

    ".checkbox_type_relation()."


    ";*/ return $affiche_recherche; } // ANNONCES PAR REGION function box_annonces_region($zone) { global $core; $db = new db($core->config['dbname']); $box.="

    Toutes les annonces libertines par région

    "; if ($zone=="footer") { $box.="
      "; } else { $box.="
        "; } $result = $db->query("SELECT nom, text FROM ".PARAMETRES." WHERE type LIKE 'region' AND autre_info='france' ORDER BY text"); $i=1; while ($row=mysql_fetch_object($result)) { $nom= $row->nom; $text=$row->text; if ($nom=="provence-alpes-cote-d-azur") {$title="rencontre échangiste en PACA";} elseif ($nom=="ile-de-france") {$title="rencontre échangiste Paris";} else {$title=$text;} $nb_annonces=recup_donnee("".CLIENTS_ANNONCES." LEFT JOIN ".CLIENTS." ON ".CLIENTS.".id_client=".CLIENTS_ANNONCES.".id_client", "region", "$nom", "count(1)", "".CLIENTS.".visible='1'"); $box.="
      • ".$text." (".$nb_annonces.")
      • "; $i++; if (($zone=="footer")&&($i==10)) { $box.="
        "; $i=1; } } $box.="
      • -----------------
      • "; $i++; if ($zone!="footer") { $box.="
      "; } $result2 = $db->query("SELECT nom, text FROM ".PARAMETRES." WHERE type LIKE 'pays' ORDER BY text"); $k; while ($row=mysql_fetch_object($result2)) { $nom = $row->nom; $text = $row->text; if ($nom=="france") {$title="rencontre échangiste en ".$text;}else {$title=$text;} $nb_annonces=recup_donnee("".CLIENTS_ANNONCES." LEFT JOIN ".CLIENTS." ON ".CLIENTS.".id_client=".CLIENTS_ANNONCES.".id_client", "pays", "$nom", "count(1)", "".CLIENTS.".visible='1'"); $box.="
    • ".$text." (".$nb_annonces.")
    • "; $i++; if (($zone=="footer")&&($i==9)) { $box.="
      "; $i=1; } } if ($i==1) {$box.="
    • ";} $box.="
    "; $box.="
    "; return $box; } ?> query("UPDATE ".CLIENTS." SET connecte='0' WHERE heure_connexion<'".$temps."' AND connecte='1'"); $db->close(); } // _____________________ MAJ CONNEXION _______________________ function maj_heure_connexion($id_client) { $db = new db("hflibrescom"); $text="UPDATE ".CLIENTS." SET heure_connexion='".date('Y-m-d H:i:s',time())."', connecte='1' WHERE id_client='".$core->config['id_client']."'"; $db->close(); return $text; } // _____________________ FERMER UNE DISCUSSION _______________________ function end_chat_page($db,$msg) { if(is_object($db)){$db->close();} echo ""; exit(); } /* // _____________________ AFFICHER LE POP-UP DISCUSSIONS _______________________ function aff_discussion($id_client,$id_client_dest) { global $core; $db = new db($core->config['dbname']); $dialogue="
    "; //$core->config['id_client'] $result = $db->query("SELECT * FROM chat_messages WHERE (id_client='$id_client' AND id_client_dest='$id_client_dest') OR (id_client='$id_client_dest' AND id_client_dest='$id_client') ORDER BY date DESC LIMIT 4"); if($db->num_rows($result)!=0) { while ($row = $db->get_object($result)) { $id_client=$row->id_client; $message=$row->message; $heure=aff_date($row->heure); $pseudo=recup_donnee(CLIENTS, "id_client", $id_client, "login"); $sexe=recup_donnee(CLIENTS, "id_client", $id_client, "sexe"); $dialogue.="
    $heure - $pseudo :
    $message
    "; // Si pas lu et dest=moi -> update lu } } $dialogue.="
    "; $objResponse = new xajaxResponse(); $objResponse->assign("discussion","innerHTML",$dialogue); $db->close(); return $objResponse; } */ //_______________ MAJ STATUT _________________ function statut_chat($param="") { global $core; $db = new db($core->config['dbname']); //print_r($param); $action=verif_get_post('char',$param['action']); if($action=="maj_statut") { $dispo=verif_get_post('num',$param['dispo']); $dispo_we=verif_get_post('num',$param['dispo_we']); $dispo_maintenant=verif_get_post('num',$param['dispo_maintenant']); $db->query("UPDATE ".CLIENTS." SET dispo_we='".$dispo_we."',dispo='".$dispo."',dispo_maintenant='".$dispo_maintenant."' WHERE id_client='".$core->config['id_client']."' LIMIT 1"); } //Recherche du statut $res=$db->query("SELECT statut,dispo,dispo_we,dispo_maintenant FROM ".CLIENTS." WHERE id_client='".$core->config['id_client']."' LIMIT 1"); $row = $db->get_object($res); $statut=$row->statut; $dispo=$row->dispo; $dispo_we=$row->dispo_we; $dispo_maintenant=$row->dispo_maintenant; if ($dispo=="1") {$selected_dispo="checked=\"checked\"";}else {$selected_dispo="";} if ($dispo_we=="1") {$selected_dispo_we="checked=\"checked\"";}else {$selected_dispo_we="";} if ($dispo_maintenant=="1") {$selected_dispo_maintenant="checked=\"checked\"";}else {$selected_dispo_maintenant="";} $text.="
    "; $text.=""; $text.="

    Dispo maintenant

    "; $text.="

    Dispo ce soir

    "; $text.="

    Dispo ce WE

    "; $text.="
    "; /* $text.="
    "; $text.="
    "; $text.=" "; if ($dispo=="1") { $css_dispo="chat_dispo_neutre"; $css_pas_dispo="lien_noir"; $titre_dispo="Votre statut est : dispo ce soir"; $titre_pas_dispo="Passer en statut : pas dispo ce soir"; $selected_dispo="checked=\"checked\""; } else { $css_dispo="chat_dispo_neutre"; $css_pas_dispo="chat_pas_dispo"; $titre_dispo="Passer en statut : dispo ce soir"; $titre_pas_dispo="Votre statut est : pas dispo ce soir"; $selected_dispo=""; }*/ return $text; } //_______________ MAJ CONNECTED USERS _________________ function chat_nouvelle_recherche() { global $core; $db = new db($core->config['dbname']); $init_crypt=initialize_crypt(); $search_chat="1"; include("profil_moteur_recherche.php"); $text.=evalTemplate("tpl_chat_moteur_recherche.php"); return $text; } //_______________ MAJ CONNECTED USERS _________________ function maj_connected_users($param="") { global $core, $objResponse, $objResponsescript; $db = new db($core->config['dbname']); $init_crypt=initialize_crypt(); //maj de l'activité du user //maj_heure_connexion($core->config['id_client']); //fonction de déconnexion des user n'ayant plus d'activité deconnect_user(); if ($param['search']=="recherche") { $search="recherche"; $search_pagination="recherche"; foreach($param as $parametres => $value) { $_POST[$parametres]=$value; } } else { $search=$param[0]; $page=$param[1]; $search_pagination=$search; if ($search=="recherche") { $key_search=$param[1]; $page=$param[2]; if ($key_search=="") { // On va rechercher la dernière recherche $id_search=recup_donnee(CLIENTS_SEARCH, "id_client", $core->config['id_client'], "id_search", "search_chat='1' ORDER BY date_modif DESC LIMIT 1"); $key_search=encode_crypt($id_search.'##',$init_crypt); } $_GET['key_search']=$key_search; $add_key_search_sess=$key_search."##"; } } if (($page=="")OR($page=="0")) {$page=1;} // On enregistre les paramètres du chat sélectionné en session, en cas de réactualisation d'une des pages du site $_SESSION['chat_param']=$search_pagination."##".$add_key_search_sess.$page; $core->config['chat_param']=$_SESSION['chat_param']; //________ ACTIONS AU CLIC SUR LES BOUTONS DE TRI ____________// //________ OU ACTUALISATION DE LA REQUETE ____________// //Vérification du type de tri des utilisateurs //Reherche de la requete de tri des utilisateurs connectés $champs_select="".CLIENTS.".id_client,".CLIENTS.".connecte,".CLIENTS.".login,".CLIENTS.".sexe, ".CLIENTS.".heure_connexion,".CLIENTS.".niveau, ".CLIENTS.".dispo, ".CLIENTS.".dispo_we, ".CLIENTS.".dispo_maintenant , ".CLIENTS_ANNONCES.".avatar, ".CLIENTS_ANNONCES.".departement,".CLIENTS_ANNONCES.".pays"; switch ($search) { // TRI PAR SEXE case "couple" : case "femme" : case "homme" : case "trav_trans" : $req_search1="SELECT ".CLIENTS.".id_client FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='1' AND ".CLIENTS.".visible='1' AND sexe LIKE '".$search."' UNION ( SELECT ".CLIENTS.".id_client FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='0' AND ".CLIENTS.".visible='1' AND sexe LIKE '".$search."' ORDER BY heure_connexion DESC LIMIT 100 ) "; $req_search="SELECT 1 as tri, ".$champs_select." FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='1' AND ".CLIENTS.".visible='1' AND sexe LIKE '".$search."' UNION ( SELECT -1 as tri, ".$champs_select." FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='0' AND ".CLIENTS.".visible='1' AND sexe LIKE '".$search."' ORDER BY heure_connexion DESC LIMIT 100 ) "; $type_connectes=recup_donnee(PARAMETRES, "nom", $search, "text"); if ($search!="trav_trans") {$type_connectes=$type_connectes."s";} //LEFT JOIN ".CLIENTS_ANONCES." ON ".CLIENTS.".id_client=".CLIENTS_ANNONCES.".id_client //AND ".CLIENTS_ANNONCES.".description NOT LIKE '' break; case "amis" : $req_search1="SELECT ".CLIENTS.".id_client FROM ".CLIENTS." LEFT JOIN chat_friend_liste ON chat_friend_liste.id_client=".CLIENTS.".id_client LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='1' AND chat_friend_liste.type LIKE 'friend' AND chat_friend_liste.id_client='".$core->config['id_client']."' UNION ( SELECT ".CLIENTS.".id_client FROM ".CLIENTS." LEFT JOIN chat_friend_liste ON chat_friend_liste.id_client=".CLIENTS.".id_client LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='0' AND ".CLIENTS.".visible='1' AND chat_friend_liste.type LIKE 'friend' AND chat_friend_liste.id_client='".$core->config['id_client']."' ORDER BY heure_connexion DESC LIMIT 100 )"; $req_search="SELECT 1 as tri, ".$champs_select." FROM ".CLIENTS." LEFT JOIN chat_friend_liste ON chat_friend_liste.id_client=".CLIENTS.".id_client LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client AND chat_friend_liste.id_client='".$core->config['id_client']."' WHERE connecte='1' AND ".CLIENTS.".visible='1' AND chat_friend_liste.type LIKE 'friend' UNION ( SELECT -1 as tri, ".$champs_select." FROM ".CLIENTS." LEFT JOIN chat_friend_liste ON chat_friend_liste.id_client=".CLIENTS.".id_client LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='0' AND visible='1' AND chat_friend_liste.type LIKE 'friend' AND chat_friend_liste.id_client='".$core->config['id_client']."' ORDER BY heure_connexion DESC LIMIT 100 ) "; $type_connectes="amis"; break; case "recherche" : $search_chat="1"; include("profil_moteur_recherche.php"); if ($action!="nouvelle_recherche") { $add_bouton_recherche=""; } if ($key_search=="") { $objResponse->script("xajax_reload_div('chat_nouvelle_recherche', 'chat_liste', '');"); } else { $add_titre_recherche="

    Résultats de votre recherche

    "; } $add_key_pagination="##$key_search"; $req_search1="SELECT ".CLIENTS.".id_client FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client ".$add_join_param." WHERE connecte='1' AND ".CLIENTS.".visible='1' AND ".CLIENTS.".sexe NOT LIKE '' AND ".CLIENTS_ANNONCES.".description NOT LIKE '' ".$add_sexe." ".$add_recherche." ".$add_age." ".$add_pays." ".$add_region." ".$add_departement." ".$add_orientation." ".$add_type_relation." GROUP BY ".CLIENTS.".id_client UNION ( SELECT ".CLIENTS.".id_client FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client ".$add_join_param." WHERE connecte='0' AND ".CLIENTS.".visible='1' AND ".CLIENTS.".sexe NOT LIKE '' ".$add_sexe." ".$add_recherche." ".$add_age." ".$add_pays." ".$add_region." ".$add_departement." ".$add_orientation." ".$add_type_relation." GROUP BY ".CLIENTS.".id_client ORDER BY heure_connexion DESC LIMIT 100 ) "; $req_search="SELECT 1 as tri, ".$champs_select." FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client ".$add_join_param." WHERE connecte='1' AND ".CLIENTS.".visible='1' AND ".CLIENTS.".sexe NOT LIKE '' ".$add_sexe." ".$add_recherche." ".$add_age." ".$add_pays." ".$add_region." ".$add_departement." ".$add_orientation." ".$add_type_relation." GROUP BY ".CLIENTS.".id_client UNION ( SELECT -1 as tri, ".$champs_select." FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client ".$add_join_param." WHERE connecte='0' AND ".CLIENTS.".visible='1' AND ".CLIENTS.".sexe NOT LIKE '' ".$add_sexe." ".$add_recherche." ".$add_age." ".$add_pays." ".$add_region." ".$add_departement." ".$add_orientation." ".$add_type_relation." GROUP BY ".CLIENTS.".id_client ORDER BY heure_connexion DESC LIMIT 100 ) "; //$type_connectes="connectés selon vos critères"; $type_connectes="résultats"; break; case "tous" : default: $req_search1="SELECT ".CLIENTS.".id_client FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='1' UNION ( SELECT ".CLIENTS.".id_client FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='0' AND ".CLIENTS.".visible='1' ORDER BY heure_connexion DESC LIMIT 100 )"; $req_search="SELECT 1 as tri, ".$champs_select." FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='1' AND ".CLIENTS.".visible='1' UNION ( SELECT -1 as tri, ".$champs_select." FROM ".CLIENTS." LEFT JOIN ".CLIENTS_ANNONCES." ON ".CLIENTS_ANNONCES.".id_client=".CLIENTS.".id_client WHERE connecte='0' AND ".CLIENTS.".visible='1' ORDER BY heure_connexion DESC LIMIT 100 )"; $type_connectes="résultats"; break; } //echo "req_search : $req_search
    "; $limite_affiche=50; //$limite_affiche=10; $nb_deja_affiche=($page*$limite_affiche)-$limite_affiche; //$req_search=$req_search. " ORDER BY connecte DESC, ".CLIENTS."heure_connexion DESC, login ASC"; //$req_search=$req_search. " ORDER BY tri, tri*".CLIENTS_ANNONCES.".heure_connexion"; $req_search=$req_search. " ORDER BY connecte DESC, niveau DESC, heure_connexion DESC, login ASC"; $result_search=$db->query($req_search1); $nb_search=$db->num_rows($result_search); $req_search2=$req_search." LIMIT $nb_deja_affiche, $limite_affiche"; $result_search2=$db->query($req_search2); $nb_search2=$db->num_rows($result_search2); $nb_deja_affiche=($nb_search2*$page); $text.="
    ".$nb_deja_affiche." / ".$nb_search." ".$type_connectes."
    ".$add_bouton_recherche; $i=0; $first_non_connecte=0; $text.=$add_titre_recherche; $text.=""; //$text.=create_pagination(ceil($nb_search/$limite_affiche),$page,"",$url_pagination, $rewrite); $text.=create_pagination_ajax(ceil($nb_search/$limite_affiche),$page,$search_pagination.$add_key_pagination,"maj_connected_users", "chat_liste"); $objResponsescript="clearTimeout(t_maj_connect);t_maj_connect=setTimeout('xajax_reload_div(\"maj_connected_users\",\"chat_liste\", \"".$core->config['chat_param']."\")',30000);"; //$objResponsescript="alert('ok');"; return $text; } //_______________ MAJ MESSAGE _________________ function maj_msg() { global $core, $objResponse, $objResponsescript; $db = new db($core->config['dbname']); // //Recherche de la présence de réponse $result=$db->query("SELECT id_client,bip,id_chat_message FROM chat_messages WHERE id_client_dest='".$core->config['id_client']."' AND lu='0' ORDER BY bip ASC LIMIT 1"); $nb_nouveau=$db->num_rows($result); if($nb_nouveau!=0) { $row = $db->get_object($result); $id_client=$row->id_client; $id_chat_message=$row->id_chat_message; $bip=$row->bip; $init_crypt=initialize_crypt(); $key_chat=encode_crypt($id_client."##",$init_crypt); $text="Nouveau messageNouveau message"; //$text.=""; if ($bip=="0") { $objResponse->script("son_nouveau_message.play();document.title='(".$nb_nouveau.") ".$core->page['meta_title']."';"); $result=$db->query("UPDATE chat_messages SET bip='1' WHERE id_client_dest='".$core->config['id_client']."' AND id_chat_message='$id_chat_message'"); } else { $objResponse->script("document.title='(".$nb_nouveau.") ".$core->page['meta_title']."';"); } } else { //$text=""; $text="Aucun message ".$core->page[Aucun message"; $objResponse->script("document.title='".$core->page['meta_title']."';"); } // on vérifie si le client a bien mis une description à son annonce if ($core->config['id_client']=="") { $text.="
    Vous avez été déconnecté. Merci de réactualiser la page ou de vous reconnecter."; if ((isset($_COOKIE['hflibres']))) { $init_crypt_no_sess=initialize_crypt_no_sess(); $client = decode_crypt($_COOKIE['hflibres'], $init_crypt_no_sess); if ($client) { $core->config['id_client'] = $client[0]; $result2 = $db->query("UPDATE ".CLIENTS." SET connecte='1',heure_connexion=NOW() WHERE id_client='".$core->config['id_client']."'"); $objResponsescript.="clearTimeout(t_maj_discussion_en_cours);t_maj_discussion_en_cours=setTimeout('xajax_reload_div(\"aff_discussion\",\"discussion_en_cours\", \"".$id_client."\")',30000);"; } } else { $text.="
    Vous avez été déconnecté. Merci de réactualiser la page ou de vous reconnecter."; $objResponse->script("document.title='Déconnecté - HFlibres';"); } } return $text; } // _____________ CREATION DISCUSSION ___________________ function creation_discussion($param, $type="") { global $core; $db = new db($core->config['dbname']); if (is_array($param)) {$id_client=$param[0];} else {$id_client=$param;} // On vérifie si la discussion est créée de notre côté $verif_discussion=recup_donnee("chat_discussion", "id_client", $core->config['id_client'], "id_client_dest"); if ($verif_discussion==$id_client) { $result=$db->query("UPDATE chat_discussion SET date=NOW() WHERE id_client='".$core->config['id_client']."' AND id_client_dest='".$id_client."'"); } else { $result=$db->query("INSERT INTO chat_discussion SET id_client='".$core->config['id_client']."', id_client_dest='".$id_client."', date=NOW()"); } // A l'envoi d'un message, on vérifie que la discussion est créée de l'autre côté if ($type=="envoyer") { $verif_discussion=recup_donnee("chat_discussion", "id_client_dest", $core->config['id_client'], "id_client"); if ($verif_discussion==$id_client) { $result=$db->query("UPDATE chat_discussion SET date=NOW() WHERE id_client_dest='".$core->config['id_client']."' AND id_client='".$id_client."'"); } else { $result=$db->query("INSERT INTO chat_discussion SET id_client_dest='".$core->config['id_client']."', id_client='".$id_client."', date=NOW()"); } } } //_______________ DISCUSSION - TERMINER ___________________ function terminer_discussion($param) { global $core, $objResponse, $objResponsescript; $db = new db($core->config['dbname']); $init_crypt=initialize_crypt(); if (is_array($param)) {$key_chat=$param[0];} else {$key_chat=$param;} $tab_key = decode_crypt($key_chat, $init_crypt); $id_client=$tab_key[0]; if(isset($_GET['key'])){$key_chat_en_cours=verif_get_post('char',$_GET['key']);} $tab_key_en_cours = decode_crypt($key_chat_en_cours, $init_crypt); $id_client_en_cours=$tab_key_en_cours[0]; if ($id_client!="") { $result=$db->query("DELETE FROM chat_discussion WHERE id_client='".$core->config['id_client']."' AND id_client_dest='".$id_client."'"); $result=$db->query("UPDATE chat_messages SET lu='1' WHERE id_client_dest='".$core->config['id_client']."' AND id_client='".$id_client."'"); // Si je ferme le client en cours, je recharge le pop-up sur la prochaine discussion if ($id_client_en_cours==$id_client) { // On va chercher le dernier message non lu $id_nouveau=recup_donnee("chat_discussion", "id_client", $core->config['id_client'], 'id_client_dest', "1 ORDER BY date ASC LIMIT 1"); if ($id_nouveau=="") { $objResponse->script("window.close();"); } else { $key_chat_nouveau=encode_crypt($id_nouveau."##",$init_crypt); $objResponse->script("window.location='/chat_discussion.php?key=".$key_chat_nouveau."';"); } } else { $objResponse->script("xajax_reload_div('aff_discussion_attente','discussion_en_attente', '');"); } } return $texte; } //_______________ DISCUSSION - MAJ discu en attente ___________________ function aff_discussion_attente() { global $core, $objResponse, $objResponsescript; $db = new db($core->config['dbname']); $init_crypt=initialize_crypt(); //Recherche de la présence de réponse $result=$db->query("SELECT distinct(id_client_dest) FROM chat_discussion LEFT JOIN ".CLIENTS." ON ".CLIENTS.".id_client=chat_discussion.id_client_dest WHERE chat_discussion.id_client='".$core->config['id_client']."' AND ".CLIENTS.".visible='1' ORDER BY id_chat_discussion ASC"); $nb_messages=$db->num_rows($result); if ($nb_messages=="0") { $texte="Aucun message"; } else { if(isset($_GET['key'])){$key_chat_en_cours=verif_get_post('char',$_GET['key']);} $texte.="
      "; while($row = $db->get_object($result)) { $id_client_dest=$row->id_client_dest; $sexe=recup_donnee(CLIENTS, "id_client", $id_client_dest, "sexe"); $pseudo=recup_donnee(CLIENTS, "id_client", $id_client_dest, "login"); $key_chat=encode_crypt($id_client_dest."##",$init_crypt); if ($key_chat==$key_chat_en_cours){$css_chat_en_cours="class=\"bg_chat_".$sexe."2\"";}else {$css_chat_en_cours="";} // On vérifie si nouveau message non lu $verif_nouveau=recup_donnee("chat_messages", "id_client_dest", $core->config['id_client'], 'id_client', "id_client='$id_client_dest' AND lu='0' ORDER BY date DESC LIMIT 1"); if (($verif_nouveau!="")) { $css_chat_nouveau="\"nouveau\"config['squelette_rep']."/images/gabarit/chat/comment.png\" />"; } else {$css_chat_nouveau="";} $texte.="
    • ".$css_chat_nouveau."$pseudo  config['squelette_rep']."/images/pictos/picto_fermer_chat.png\" alt=\"Fermer la discussion\" class=\"picto\" style=\"vertical-align:middle\" />
    • "; } $texte.="
    "; } $objResponsescript="clearTimeout(t_maj_discussion_en_attente);t_maj_discussion_en_attente=setTimeout('xajax_reload_div(\"aff_discussion_attente\",\"discussion_en_attente\", \"".$core->data['id_client']."\")',30000);"; return $texte; } //_______________ DISCUSSION - MAJ discu en cours ___________________ function aff_discussion($param) { global $core, $objResponse, $objResponsescript; $init_crypt=initialize_crypt(); $db = new db($core->config['dbname']); $id_client=$param[0]; $connecte=recup_donnee(CLIENTS, "id_client", $id_client, "connecte"); $key_dest=encode_crypt('message##'.$id_client.'##',$init_crypt); //Recherche de la présence de réponse $result=$db->query("SELECT * FROM chat_messages WHERE (id_client_dest='".$core->config['id_client']."' AND id_client='".$id_client."') OR (id_client='".$core->config['id_client']."' AND id_client_dest='".$id_client."') ORDER BY date DESC LIMIT 8"); $nb_messages=$db->num_rows($result); if ($nb_messages=="0") { $texte="Aucun message"; } else { $liste=""; while($row = $db->get_object($result)) { $id_chat_message=$row->id_chat_message; $date=aff_date($row->date); $id_client_emett=$row->id_client; $id_client_dest=$row->id_client_dest; $sexe=recup_donnee(CLIENTS, "id_client", $id_client_emett, "sexe"); $pseudo=recup_donnee(CLIENTS, "id_client", $id_client_emett, "login"); $message=stripslashes(nl2br($row->message)); $lu=$row->lu; $termine=$row->termine; $blackliste=recup_donnee("chat_friend_liste", "id_client", $id_client, "id_client_friend", "id_client_friend='".$core->config['id_client']."' AND type LIKE 'blackliste'"); if ($blackliste==$core->config['id_client']) { $add_blackliste="

    Vous avez été blacklisté par cet utilisateur, vous ne pouvez plus lui envoyer de message

    "; } $blackliste2=recup_donnee("chat_friend_liste", "id_client",$core->config['id_client'], "id_client_friend", "id_client_friend='$id_client' AND type LIKE 'blackliste'"); if ($blackliste2==$id_client) { $add_blackliste="

    Vous avez blacklisté cet utilisateur.

    Pour lui envoyer un message, vous devez le retirer de votre blackliste.

    "; } if ($connecte=="0") { $add_deconnexion="

    Cet utilisateur n'est plus en ligne

    Vous pouvez lui envoyer un message.

    "; } // On update le statut lu if (($id_client_dest==$core->config['id_client'])) { $result2=$db->query("UPDATE chat_messages SET lu='1' WHERE id_client_dest='".$core->config['id_client']."' AND id_client='".$id_client."' "); $objResponse->script("xajax_reload_div('aff_discussion_attente','discussion_en_attente', '');"); } /*// Discussion terminée if (($termine=="1")&&($id_client_dest=="$id_client")) { $add_termine="

    Votre interlocuteur a fermé la fenêtre

    "; }*/ // On affiche la discussion $liste="

    $pseudo le $date :

    $message

    ".$liste; } $texte.=$liste2.$liste.$add_blackliste.$add_termine.$add_deconnexion; $texte.="

    "; $objResponsescript.="document.getElementById('discussion_en_cours').scrollTop = document.getElementById('discussion_en_cours').scrollHeight;"; $objResponsescript.="clearTimeout(t_maj_discussion_en_cours);t_maj_discussion_en_cours=setTimeout('xajax_reload_div(\"aff_discussion\",\"discussion_en_cours\", \"".$id_client."\")',30000);"; } return $texte; } //_______________ DISCUSSION - ENVOYER UN MESSAGE ___________________ function envoyer_message($param) { global $core; $db = new db($core->config['dbname']); $init_crypt=initialize_crypt(); $key_chat=$param['key']; $message=verif_get_post('char_base',$param['message']); $ne_pas_donner_suite=$param['ne_pas_donner_suite']; if ($ne_pas_donner_suite!="") { $message=$message."

    Cet utilisateur ne souhaite pas donner suite à la conversation

    "; $add_termine=",termine='1'"; } $tab_key = decode_crypt($key_chat, $init_crypt); $id_client=$tab_key[0]; if ($id_client!="") { $blackliste=recup_donnee("chat_friend_liste", "id_client", $id_client, "id_client_friend", "id_client_friend='".$core->config['id_client']."' AND type LIKE 'blackliste'"); $blackliste2=recup_donnee("chat_friend_liste", "id_client",$core->config['id_client'], "id_client_friend", "id_client_friend='$id_client' AND type LIKE 'blackliste'"); $erreur_flood=verif_flood($id_client, $message); if ($blackliste==$core->config['id_client']) { $erreur.="

    Vous avez été blacklisté par cet utilisateur, vous ne pouvez pas lui envoyer de message

    "; // Vous avez été blacklisté } elseif ($blackliste2==$id_client) { $erreur.="

    Vous avez blacklistécet utilisateur, vous ne pouvez pas lui envoyer de message

    "; } elseif ($erreur_flood!="") { $erreur.=$erreur_flood; } else { $result=$db->query("INSERT INTO chat_messages SET id_client='".$core->config['id_client']."', id_client_dest='".$id_client."', message='$message', date=NOW() $add_termine"); creation_discussion($tab_key, "envoyer"); $texte.=aff_discussion($tab_key); if ($ne_pas_donner_suite!="") { terminer_discussion($key_chat); } } } if ($erreur!="") { $texte.=aff_discussion($tab_key); $texte.=$erreur; } return $texte; } // ________________________ VERIF FLOOD ______________________ function verif_flood($id_client, $message) { global $core; $db = new db($core->config['dbname']); $erreur=""; // On vérifie si plus de 10 messages à la même personne sans réponse $result=$db->query("SELECT distinct(id_client) FROM chat_messages WHERE ((id_client='".$core->config['id_client']."' AND id_client_dest='".$id_client."') OR (id_client_dest='".$core->config['id_client']."' AND id_client='".$id_client."')) AND (SELECT count(1) FROM chat_messages WHERE ((id_client='".$core->config['id_client']."' AND id_client_dest='".$id_client."') OR (id_client_dest='".$core->config['id_client']."' AND id_client='".$id_client."')) AND date > SUBDATE(now(), INTERVAL 30 SECOND))>10 ORDER BY date DESC LIMIT 10"); $nb_messages=$db->num_rows($result); if ($nb_messages==1) { $erreur="

    Tentative de flood. Vous ne pouvez plus envoyer de message à cette personne

    "; $erreur.=maj_flood($id_client, $message); return $erreur; } // On vérifie s'il a envoyé 3 messages ou + à différentes personnes en moins de 10 secondes $result=$db->query("SELECT distinct(id_client_dest) FROM chat_messages WHERE id_client='".$core->config['id_client']."' AND date > SUBDATE(now(), INTERVAL 10 SECOND) AND termine!='1' ORDER BY date DESC LIMIT 10"); $nb_messages=$db->num_rows($result); if ($nb_messages>=3) { $erreur="

    Tentative de flood. Vous ne pouvez plus envoyer de message pour le moment.

    "; $erreur.=maj_flood($id_client, $message); return $erreur; } $message2=trim($message); $message2=str_replace("\n", "%",$message2); $message2=str_replace("\r", "%",$message2); $message2=str_replace("
    ", "%",nl2br($message2)); $message2=str_replace(" ", "%",$message2); // On vérifie s'il a envoyé 3 messages ou + identiques en moins de 30 secondes. $result2=$db->query("SELECT 1 FROM chat_messages WHERE id_client='".$core->config['id_client']."' AND message LIKE '$message2' AND date > SUBDATE(now(), INTERVAL 30 SECOND) AND termine!='1' ORDER BY date DESC LIMIT 10"); $nb_messages2=$db->num_rows($result2); if ($nb_messages2>=3) { $erreur="

    Tentative de flood. Vous ne pouvez plus envoyer de message pour le moment.

    "; $erreur.=maj_flood($id_client, $message); return $erreur; } } function maj_flood($id_client, $message) { global $core; $db = new db($core->config['dbname']); $result=$db->query("INSERT INTO chat_flood SET id_client='".$core->config['id_client']."', id_client_dest='$id_client', message='$message', date=NOW()"); // On vérifie le nombre de flood en 5 minutes // On vérifie s'il a envoyé 3 messages ou + à différentes personnes en moins de 10 secondes $result=$db->query("SELECT 1 FROM chat_flood WHERE id_client='".$core->config['id_client']."' AND date > SUBDATE(now(), INTERVAL 5 MINUTE) ORDER BY date DESC LIMIT 10"); $nb_messages=$db->num_rows($result); if ($nb_messages>=3) { $erreur="

    Trop de flood ! Vous avez été déconnecté.

    "; // Déconnexion du chat $result2 = $db->query("UPDATE ".CLIENTS." SET connecte='0' WHERE id_client='".$core->config['id_client']."'"); session_unset(); setcookie("hflibres", ""); wp_clearcookie(); return $erreur; } } ?> query("SELECT nom,url_image FROM chat_smiley ORDER BY nbr"); if($db->num_rows($result)!=0) { while($row = $db->get_object($result)) { $text=ereg_replace("//$row->nom","url_image\" width=\"14\" height=\"14\" alt=\"$row->nom\"/>",$text); } } return $text; } function insert_smiley() { $db = new db("hflibrescom"); $result = $db->query("SELECT nom,url_image FROM chat_smiley ORDER BY nbr"); if($db->num_rows($result)!=0) { while($row = $db->get_object($result)) { echo "nom','chat_new_msg','text')\">url_image\" width=\"14\" height=\"14\" alt=\"$row->nom\"/>"; } } } /* */ ?>