define('IN_PHPBB', true);
$phpbb_root_path = './';
require($phpbb_root_path . 'extension.inc');
require($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, 666);
init_userprefs($userdata);
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
function menage($texte)
{
$non = array("&","<",">","%","\\"," ","$","\"");
$texte = str_replace($non," ",$texte);
return $texte;
}
//
// Setup forum wide options, if this fails
// then we output a CRITICAL_ERROR since
// basic forum information is not available
//
$board_config = array();
$sql = "SELECT * FROM phpbb_config";
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$board_config[$row['config_name']] = $row['config_value'];
}
$info[1]=$userdata['user_id'];
if ($_GET[taf]!="") $taf=menage($_GET[taf]);
if ($_POST[taf]!="") $taf=menage($_POST[taf]);
if ($_GET[pp]!="") $pp=menage($_GET[pp]);
if ($_POST[pp]!="") $pp=menage($_POST[pp]);
$log=menage($_GET[log]);
$message=menage($_POST[message]);
$add_avis=menage($_POST[add_avis]);
$up_photo=menage($_POST[up_photo]);
$look=menage($_POST[look]);
$rcomp=menage($_POST[rcomp]);
$add_collec=menage($_POST[add_collec]);
$rep=menage($_POST[rep]);
$rep_id=menage($_POST[rep_id]);
$suppimg=menage($_GET[suppimg]);
$extsup=menage($_GET[extsup]);
$suppimgp=menage($_GET[suppimgp]);
if (isset($_POST[log]) && !isset($_GET[log])) $log=menage($_POST[log]);
if (isset($_GET[log]) && !isset($_POST[log])) $log=menage($_GET[log]);
$mod1=menage($_POST[mod1]);
$mod=menage($_GET[mod]);
$supavis=menage($_GET[supavis]);
$sel_on = menage($_GET[sel_on]);
$sel_off = menage($_GET[sel_off]);
$up_comp = menage($_POST[up_comp]);
$comp = menage($_POST['comp']);
$url="collec.php";
$date_rec=date("U");
//***********************************************************************************************************************************************
if ($taf=="sup")
{
$list_img=mysql_query("SELECT * FROM collec_img WHERE id_collec='$log' AND id_auteur='$info[1]' AND pp='$pp' ");
while ($li=mysql_fetch_array($list_img))
{
unlink ("collec/".$li[id].".".$li[ext]."");
}
mysql_query("DELETE FROM collec_img WHERE id_collec='$log' AND id_auteur='$info[1]' AND pp='$pp' ");
mysql_query("DELETE FROM collec WHERE id='$log' AND id_auteur='$info[1]' AND pp='$pp' ");
}
if ($suppimg!="")
{
mysql_query("DELETE FROM collec_img WHERE id='$suppimg' AND id_auteur='$info[1]' AND pp='$pp' LIMIT 1");
unlink ("collec/".$suppimg.".".$extsup."");
}
if ($suppimgp!="")
{
if (file_exists("collec/m".$info[1].".png")) unlink("collec/m".$info[1].".png");
if (file_exists("collec/m".$info[1].".gif")) unlink("collec/m".$info[1].".gif");
if (file_exists("collec/m".$info[1].".jpg")) unlink("collec/m".$info[1].".jpg");
}
$interdit = array("\"","java","script","www",".com",".net","&","<",">","%","\\"," ","$");
if ($info[1]!="-1" && $info[1]!="" && !ereg("www",$message) && !ereg("http",$message) && !ereg("href",$message) && !ereg("script",$message) && !ereg("",$message);
$message=$message;
$ok_add_avis=mysql_query("INSERT INTO collec_avis (id_auteur,date,texte,id_collec) VALUES ('$info[1]','$date_rec',\"$message\",'$log')");
if ($ok_add_avis==1)
{
$mp_a_qui=mysql_fetch_array(mysql_query("SELECT id_auteur FROM collec WHERE id='$log'"));
mysql_query("INSERT INTO phpbb_privmsgs (privmsgs_type,privmsgs_subject,privmsgs_from_userid,privmsgs_to_userid,privmsgs_date) VALUES ('1','Un avis a été ajouté à votre presentation perso','2','$mp_a_qui[id_auteur]','$date_rec')");
$mp_bot_id=mysql_insert_id();
$message_mp = "Un avis a ete ajoute a votre présentation perso\n\nMerci de ne pas répondre à cette notification\n\nCliquez ici : http://www.flipjuke.fr/collec.php?taf=visit&log=$log";
mysql_query("INSERT INTO phpbb_privmsgs_text (privmsgs_text_id,privmsgs_text) VALUES ('$mp_bot_id',\"$message_mp\") ");
}
}
if ($info[1]!="-1" && $info[1]!="" && $mod1!="" && !ereg("script",$message) && !ereg("
",$message);
$message=$message;
mysql_query("UPDATE collec_avis SET texte=\"$message\" WHERE id='$mod1' ");
}
if ($info[1]!="-1" && $info[1]!="" && $rep_id!="" && !ereg("script",$rep) && !ereg("
",$message);
$deja=mysql_query("SELECT id FROM collec WHERE id_auteur='$info[1]' AND pp='$pp' ");
$dejan=mysql_num_rows($deja);
if ($dejan!=0)
{
$id=mysql_fetch_row($deja);
$id=$id[0];
$modif=mysql_query("UPDATE collec SET texte=\"$messag\",date='$date_rec' WHERE id='$id' AND id_auteur='$info[1]' AND pp='$pp'");
}
else
{
$modif=mysql_query("INSERT INTO collec(texte,date,id_auteur,pp) VALUES (\"$messag\",'$date_rec','$info[1]','$pp')");
$id=mysql_insert_id();
}
if ($modif==1) $message_info="Vos données ont bien été prise en compte";
$taf="visit";$log=$id;
}
if ($info[1]!="-1" && $info[1]!="" && $up_photo==1 && $_FILES[image][tmp_name]!="")
{
$image_name=$_FILES[image][name];
$image=$_FILES[image][tmp_name];
$imagep_name=$_FILES[imagep][name];
$imagep=$_FILES[imagep][tmp_name];
$deja=mysql_query("SELECT id FROM collec WHERE id_auteur='$info[1]' AND pp='$pp' ");
$dejan=mysql_num_rows($deja);
if ($dejan!=0)
{
$id=mysql_fetch_row($deja);
$id=$id[0];
}
if($image_name!="")
{
list($img_width, $img_height, $img_type, $img_attr) = getimagesize($image);
if (($img_type==1 || $img_type==2 || $img_type==3) && filesize($image)<250000)
{
if ($img_type==1) $ext="gif";
if ($img_type==2) $ext="jpg";
if ($img_type==3) $ext="png";
mysql_query("INSERT INTO collec_img (id_collec,id_auteur,ext,pp) VALUES ('$id','$info[1]','$ext','$pp')");
$id_img=mysql_insert_id();
if ($ext!="") copy($image,"collec/".$id_img.".".$ext);
}
unlink($image);
}
}
if ($taf=="add" || $taf=="visit" || $taf=="mod")
{
?>
}
$contenu=mysql_query("SELECT id FROM collec ");
$nbcol=mysql_num_rows($contenu);
echo "
Présentez vos compétences
| \n";
$contenu=mysql_query("SELECT * FROM collec_img WHERE bestof='1' ORDER BY rand() LIMIT 0,50" );
while ($ligne=mysql_fetch_array($contenu))
{
echo " |
| ||||||
| Membre | "; if ($pp!="1") echo "Nb Photo & Com. | "; echo "Compétences / Services | ||||
"; if ($qui[user_from]!="") echo ucfirst(strtolower($qui[user_from]))." ".$qui[user_from_dept]; else echo "???? (voir votre profil)"; echo " | ";
if ($pp!="1")
{
echo "";
if ($nb_image>1) $pluriel="s";else $pluriel="";
echo "$nb_image photo$pluriel";
if (($ligne[date]+(3600*24*2))>date("U")) echo "![]() "; else echo " "; echo " Maj : ".date("d/m/y",$ligne[date]); $nb_avis=mysql_num_rows(mysql_query("SELECT t1.id FROM collec_avis as t1 WHERE t1.id_collec='$ligne[id]' ")); if ($nb_image==0) echo " ? ";
echo " $nb_avis commentaires | \n";
$contenu_pp=mysql_query("SELECT * FROM collec WHERE id_auteur='$ligne[id_auteur]' AND pp='1' " );
if ($ligne_pp=mysql_fetch_array($contenu_pp))
{
$texte_pp=substr(eregi_replace('$texte_pp | \n"; } else { $suite= "...[lire la suite]"; $detail_comp="||||
";
$img_ok=" ";
if (ereg("meca",$ligne[comp])) $detail_comp.= "$img_ok Redemarrage / réglage flipper mécanique \n"; if (ereg("elec",$ligne[comp])) $detail_comp.= "$img_ok Redemarrage (hors cartes) flipper électronique \n"; if (ereg("cpu",$ligne[comp])) $detail_comp.= "$img_ok Réparation cartes électroniques \n"; if (ereg("retouche",$ligne[comp])) $detail_comp.= "$img_ok Retouche plateau \n"; if (ereg("vitrif",$ligne[comp])) $detail_comp.= "$img_ok Vitrification plateau \n"; if (ereg("caisse",$ligne[comp])) $detail_comp.= "$img_ok Retouche et peinture caisse/fronton \n"; if (ereg("mas",$ligne[comp])) $detail_comp.= "$img_ok Redemarrage / réglage machine à sous \n"; if (ereg("video",$ligne[comp])) $detail_comp.= "$img_ok Réglage écran video \n"; if (ereg("dot",$ligne[comp])) $detail_comp.= "$img_ok Réparation afficheur DOT \n"; if (ereg("prog",$ligne[comp])) $detail_comp.= "$img_ok Prog PROM, EPROM \n"; $detail_comp.=" | ".substr($ligne[texte],0,450)." $suite |
\n";
if (file_exists("collec/m".$ligne[id_auteur].".jpg")) echo " ";
if (file_exists("collec/m".$ligne[id_auteur].".gif")) echo " ";
if (file_exists("collec/m".$ligne[id_auteur].".png")) echo " ";
$qui=mysql_fetch_array(mysql_query("SELECT username,user_from,user_from_dept,user_from_country FROM phpbb_users WHERE user_id='$ligne[id_auteur]' "));
echo "Membre du site : ".$qui[username]."Localité : $qui[user_from] ($qui[user_from_dept] $qui[user_from_country]) | ";
if ($ligne[id_auteur]==$info[1]) echo "Modifier votre présentation "; if ($pp=='0') { $liste_avis=mysql_query("SELECT t1.id FROM collec_avis as t1 WHERE t1.id_collec='$log' "); $nb_avis=mysql_num_rows($liste_avis); echo "$nb_avis Avis déposés"; } echo " | ";
if ($info[1]==$ligne[id_auteur]) echo "Supprimer votre présentation | "; echo "|||
\n";
//traitement de texte
$in_quote="
| ", $thetxt);
$thetxt = str_replace("[/tr]", "|||||
";
$img_ok=" ";
if (ereg("meca",$ligne[comp])) $detail_comp.= "$img_ok Redemarrage / réglage flipper mécanique \n"; if (ereg("elec",$ligne[comp])) $detail_comp.= "$img_ok Redemarrage (hors cartes) flipper électronique \n"; if (ereg("cpu",$ligne[comp])) $detail_comp.= "$img_ok Réparation cartes électroniques \n"; if (ereg("retouche",$ligne[comp])) $detail_comp.= "$img_ok Retouche plateau \n"; if (ereg("vitrif",$ligne[comp])) $detail_comp.= "$img_ok Vitrification plateau \n"; if (ereg("caisse",$ligne[comp])) $detail_comp.= "$img_ok Retouche et peinture caisse/fronton \n"; if (ereg("mas",$ligne[comp])) $detail_comp.= "$img_ok Redemarrage / réglage machine à sous \n"; if (ereg("video",$ligne[comp])) $detail_comp.= "$img_ok Réglage écran video \n"; if (ereg("dot",$ligne[comp])) $detail_comp.= "$img_ok Réparation afficheur DOT \n"; if (ereg("prog",$ligne[comp])) $detail_comp.= "$img_ok Prog PROM, EPROM \n"; $detail_comp.=" | $thetxt; |
| $blabla |
| "; $out_quote=" |
",$thetxt);
$thetxt=str_replace(":,):","
",$thetxt);
$thetxt=str_replace(":D:","
",$thetxt);
$thetxt=str_replace("::)):","
",$thetxt);
$thetxt=str_replace(":|(:","
",$thetxt);
$thetxt=str_replace("::|:","
",$thetxt);
$thetxt=str_replace("::o:","
",$thetxt);
$thetxt=str_replace("::,(:","
",$thetxt);
$thetxt=str_replace("::,((:","
",$thetxt);
$thetxt=str_replace(":<:):","
" ,$thetxt);
$thetxt=str_replace(":8):","
",$thetxt);
$thetxt=str_replace(":9):","
",$thetxt);
$thetxt=str_replace(":?):","
",$thetxt);
$thetxt=str_replace(":z):","
",$thetxt);
$thetxt=str_replace(":#):","
",$thetxt);
$thetxt=str_replace(":>:(:","
",$thetxt);
$thetxt=str_replace(":))=:","
" ,$thetxt);
$thetxt=str_replace(":|(:","
",$thetxt);
$thetxt=str_replace(":s1:","
",$thetxt);
$thetxt=str_replace(":s2:","
",$thetxt);
$thetxt=str_replace("::x:","
",$thetxt);
$thetxt=str_replace(":-%:","
",$thetxt);
$thetxt=str_replace("[color=#444444]","",$thetxt);
$thetxt=str_replace("[color=darkred]","",$thetxt);
$thetxt=str_replace("[color=red]","",$thetxt);
$thetxt=str_replace("[color=orange]","",$thetxt);
$thetxt=str_replace("[color=brown]","",$thetxt);
$thetxt=str_replace("[color=yellow]","",$thetxt);
$thetxt=str_replace("[color=green]","",$thetxt);
$thetxt=str_replace("[color=olive]","",$thetxt);
$thetxt=str_replace("[color=cyan]","",$thetxt);
$thetxt=str_replace("[color=blue]","",$thetxt);
$thetxt=str_replace("[color=darkblue]","",$thetxt);
$thetxt=str_replace("[color=indigo]","",$thetxt);
$thetxt=str_replace("[color=violet]","",$thetxt);
$thetxt=str_replace("[color=white]","",$thetxt);
$thetxt=str_replace("[color=black]","",$thetxt);
$thetxt=str_replace("[/color]","",$thetxt);
$thetxt=str_replace("[size=7]","",$thetxt);
$thetxt=str_replace("[size=9]","",$thetxt);
$thetxt=str_replace("[size=12]","",$thetxt);
$thetxt=str_replace("[size=14]","",$thetxt);
$thetxt=str_replace("[size=18]","",$thetxt);
$thetxt=str_replace("[/size]","",$thetxt);
$blabla="$thetxt