<?php
@session_start();
@date_default_timezone_set('Europe/Bucharest');
require'config.php';
$conn=@new mysqli($db[0],$db[1],$db[2],$db[3]);
if(mysqli_connect_errno())
{
http_response_code(501);
@error_reporting(0);
@ini_set('display_errors',0);
header('Content-Type: text/html; charset=utf-8');
header('Cache-Control: no-store,no-cache,must-revalidate,max-age=0,post-check=0,pre-check=0');
header('Expires: -1');
echo'<!DOCTYPE html><html lang="ro-RO"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>Eroare!</title><link rel="stylesheet" type="text/css" href="'.$domenii_statice[1].'css_js/stil.css" /></head><body><p style="text-align:center">Nu se poate conecta la baza de date...<br />Reîncercați mai târziu!</p></body></html>';
exit;
}
else
{
$conn->set_charset('utf8');
$conn->query('SET NAMES"utf8"');
function clean($q)
{
global$conn;
if(is_array($q))
{
foreach($q AS$k=>$v)
{
$q[$k]=clean($v);
}
}
elseif(is_string($q))
$q=$conn->real_escape_string(trim($q));
return$q;
}
$_SERVER=(isset($_SERVER)?clean($_SERVER):'');
$_GET=(isset($_GET)?clean($_GET):'');
$_POST=(isset($_POST)?clean($_POST):'');
$_COOKIE=(isset($_COOKIE)?clean($_COOKIE):'');
$_FILES=(isset($_FILES)?clean($_FILES):'');
$_SESSION=(isset($_SESSION)?clean($_SESSION):'');
}
$cid=(isset($_GET['cid'])?explode('-',$_GET['cid'])[0]:'');
$fid=(isset($_GET['fid'])?explode('-',$_GET['fid'])[0]:'');
$go=$_GET['go']??'';
$page=(isset($_GET['page'])?(int)$_GET['page']:'');
$pid=(isset($_GET['pid'])?explode('-',$_GET['pid'])[0]:'');
$pmtext=$_POST['pmtext']??'';
$tid=(isset($_GET['tid'])?explode('-',$_GET['tid'])[0]:'');
if(isset($_POST['la']))
{
$laa=(!is_numeric($_POST['la'])?$conn->query('SELECT`id`FROM`membrii`WHERE`nume`="'.$_POST['la'].'"')->fetch_row()[0]:$_POST['la']);
$la=($laa<1?0:$laa);
unset($laa);
}
else
$la=(isset($_GET['la'])?explode('-',$_GET['la'])[0]:'');
$de=$_SESSION['identitate']??0;
if(isset($_GET['id']))
{
$invitatde=$conn->query('SELECT`id`FROM`membrii`WHERE`id`="'.$_GET['id'].'"')->fetch_row()[0];
if($invitatde>0)
setcookie('invitatde',$invitatde,($_SERVER['REQUEST_TIME']+30*86400),$detalii_cookie[0],$detalii_cookie[1],$detalii_cookie[2],$detalii_cookie[3]);
unset($invitatde);
}
$is_pc=($_GET['versiune_actuala']??$_SESSION['versiune_actuala']??0);
if($is_pc==0)
{
if(isset($_SERVER['HTTP_ACCEPT']))
{
if(mb_stristr($_SERVER['HTTP_ACCEPT'],'application/vnd.wap.xhtml+xml'))
$is_pc=2;
elseif(mb_stristr($_SERVER['HTTP_ACCEPT'],'application/xhtml+xml'))
$is_pc=3;
elseif(mb_stristr($_SERVER['HTTP_ACCEPT'],'text/vnd.wap.wml'))
$is_pc=1;
else
$is_pc=3;
}
else
$is_pc=3;
$_SESSION['versiune_actuala']=$is_pc;
}
$head[0]='';
$div=($is_pc!='1'?['</div>','<div class="s p">','<div class="sc p">','','<h1 class="h"><strong>','</strong></h1>','<div class="ok">','<div class="eroare">','<div class="i2">','<div class="verset">','<div class="reclamealbastra">','<div class="inapoi">','<div class="text">','<div class="textstang">','class="d16" ']:['<br />','','</small></p><p style="text-align:center"><small>','','<strong>','</strong><br />','','','','','','','','','width="16" height="16" ']);
if($is_pc!='1')
{
[$css[0],$css[1]]=explode('_',($_COOKIE['tema']??'albastru_small'));
if($css[0]=='albastru')
{
$css[2]='#000000';
$css[3]='#d8edfe';
$css[4]='#0956a6';
$css[5]='#87cbfc';
$css[6]='#fef8ca';
$css[7]='#666666';
$css[8]='#fef8ca';
$css[9]='#f18d05';
$css[10]='#45ab45';
}
elseif($css[0]=='verde')
{
$css[2]='#000000';
$css[3]='#e3fdd9';
$css[4]='#37aa09';
$css[5]='#79f448';
$css[6]='#fef8ca';
$css[7]='#078223';
$css[8]='#9bf777';
$css[9]='#43d50b';
$css[10]='#247406';
}
elseif($css[0]=='roz')
{
$css[2]='#000000';
$css[3]='#ff99aa';
$css[4]='#fed6dd';
$css[5]='#ff143d';
$css[6]='#ff6580';
$css[7]='#ed57e0';
$css[8]='#ff7089';
$css[9]='#ff1e45';
$css[10]='#fef8ca';
}
elseif($css[0]=='negru')
{
$css[2]='#ffffff';
$css[3]='#9d9c9c';
$css[4]='#ffffff';
$css[5]='#3c3c3c';
$css[6]='#cdcdcd';
$css[7]='#e5e5e5';
$css[8]='#cdcdcd';
$css[9]='#939393';
$css[10]='#6b6b6b';
}
elseif($css[0]=='negru2')
{
$css[2]='#A52A2A';
$css[3]='#000000';
$css[4]='#8B008B';
$css[5]='#8FBC8F';
$css[6]='#00BFFF';
$css[7]='#FF00FF';
$css[8]='#00CED1';
$css[9]='#FF0000';
$css[10]='#FF00FF';
}
elseif($css[0]=='violet')
{
$css[2]='#000000';
$css[3]='#eda5dd';
$css[4]='#d029ab';
$css[5]='#df61c3';
$css[6]='#b62488';
$css[7]='#e78ccb';
$css[8]='#f3c7ea';
$css[9]='#a5217c';
$css[10]='#e683c7';
}
elseif($css[0]=='orange')
{
$css[2]='#000000';
$css[3]='#dc8c50';
$css[4]='#94501d';
$css[5]='#9d551f';
$css[6]='#fef8ca';
$css[7]='#9d551f';
$css[8]='#fef8ca';
$css[9]='#f18d05';
$css[10]='#45ab45';
}
elseif($css[0]=='mustar')
{
$css[2]='#000000';
$css[3]='#d6d537';
$css[4]='#83821a';
$css[5]='#94931d';
$css[6]='#e1e06a';
$css[7]='#f2f1bf';
$css[8]='#e1e06a';
$css[9]='#b6b524';
$css[10]='#7b7a18';
}
elseif($css[0]=='verzui')
{
$css[2]='#397249';
$css[3]='#628b61';
$css[4]='#9cb770';
$css[5]='#c7e1ba';
$css[6]='#f3d5bd';
$css[7]='#666666';
$css[8]='#f6e4cc';
$css[9]='#f18d05';
$css[10]='#45ab45';
}
elseif($css[0]=='galbui')
{
$css[2]='#ec633f';
$css[3]='#e44d2e';
$css[4]='#d6a354';
$css[5]='#f9d654';
$css[6]='#f3d8bd';
$css[7]='#017890';
$css[8]='#f9e5cc';
$css[9]='#017890';
$css[10]='#017890';
}
elseif($css[0]=='caramiziu')
{
$css[2]='#ff6633';
$css[3]='#ff9966';
$css[4]='#ff3300';
$css[5]='#cc6633';
$css[6]='#993300';
$css[7]='#33cc99';
$css[8]='#00cc66';
$css[9]='#339966';
$css[10]='#006633';
}
elseif($css[0]=='mov')
{
$css[2]='#412E3D';
$css[3]='#C65FFF';
$css[4]='#cc0099';
$css[5]='#660066';
$css[6]='#990099';
$css[7]='#CD08FF';
$css[8]='#ccff00';
$css[9]='#99cc33';
$css[10]='#999900';
}
elseif($css[0]=='rosu')
{
$css[2]='#ff0000';
$css[3]='#ff3333';
$css[4]='#ff6666';
$css[5]='#cc3333';
$css[6]='#ff3366';
$css[7]='#990000';
$css[8]='#990033';
$css[9]='#339933';
$css[10]='#009900';
}
elseif($css[0]=='alb')
{
$css[2]='#8A2BE2';
$css[3]='#FFFFFF';
$css[4]='#800080';
$css[5]='#8FBC8F';
$css[6]='#00BFFF';
$css[7]='#FF00FF';
$css[8]='#00CED1';
$css[9]='#FF0000';
$css[10]='#FF00FF';
}
elseif($css[0]=='ioon')
{
$css[2]='#EEA701';
$css[3]='#F9CF5A';
$css[4]='#F1FA57';
$css[5]='#A19D95';
$css[6]='#79777E';
$css[7]='#E0EEFE';
$css[8]='#A9D936';
$css[9]='#DBAF83';
$css[10]='#F3EBE0';
}
else
{
$css[2]='#000000';
$css[3]='#d8edfe';
$css[4]='#0956a6';
$css[5]='#87cbfc';
$css[6]='#fef8ca';
$css[7]='#666666';
$css[8]='#fef8ca';
$css[9]='#f18d05';
$css[10]='#45ab45';
}
}
$head[4]='';
$perm=$conn->query('SELECT`perm`FROM`membrii`WHERE`id`="'.$de.'"')->fetch_row()[0];
$iconite=$_COOKIE['iconite']??0;
function img($valoare,$domeniu_static=1)
{
global$iconite,$domenii_statice;
if($iconite==false)
return'<img src="'.$domenii_statice[$domeniu_static].$valoare.'" alt="" width="16" height="16" />';
else
{
if($iconite==1)
return;
elseif(mb_strlen($iconite)>1&&mb_strlen($iconite)<10)
return$iconite;
else
return'<img src="/'.$iconite.'" alt="" />';
}
}
$conn->query('DELETE FROM`anagrame_conectati`WHERE`data`<'.($_SERVER['REQUEST_TIME']-300));
$conn->query('DELETE FROM`anagrame_raspunsuri`WHERE`data`<'.($_SERVER['REQUEST_TIME']-300));
$conn->query('DELETE FROM`chat_mesaje`WHERE`data`<'.($_SERVER['REQUEST_TIME']-300));
$conn->query('DELETE FROM`chat_conectati`WHERE`data`<'.($_SERVER['REQUEST_TIME']-180));
$conn->query('DELETE FROM`membrii_conectati`WHERE`data`<'.($_SERVER['REQUEST_TIME']-$conn->query('SELECT`valoare`FROM`setari`WHERE`nume`="expirare_sesiune"')->fetch_row()[0]));
$conn->query('DELETE FROM`membrii_pedepsiti`WHERE`data`<'.$_SERVER['REQUEST_TIME']);
$conn->query('DELETE FROM`forum_conectati`WHERE`data`<'.($_SERVER['REQUEST_TIME']-300));
if($meniu['biblia']==1)
{
$conn->query('DELETE FROM`spune_cartea_conectati`WHERE`data`<'.($_SERVER['REQUEST_TIME']-300));
$conn->query('DELETE FROM`spune_cartea_raspunsuri`WHERE`data`<'.($_SERVER['REQUEST_TIME']-300));
}
$conn->query('DELETE FROM`t2_conectati`WHERE`data`<'.($_SERVER['REQUEST_TIME']-300));
$conn->query('DELETE FROM`trivia_conectati`WHERE`data`<'.($_SERVER['REQUEST_TIME']-300));
$conn->query('DELETE FROM`trivia_raspunsuri`WHERE`data`<'.($_SERVER['REQUEST_TIME']-300));
if($de>0)
{
$membru=$conn->query('SELECT`browser`,`ip`,`activitate`FROM`membrii`WHERE`id`="'.$de.'"')->fetch_row();
if($membru[0]!=$_SERVER['HTTP_USER_AGENT']||mb_substr($membru[1],0,6)!=mb_substr($_SERVER['REMOTE_ADDR'],0,6))
require'f_delogare.php';
$atime=$_SERVER['REQUEST_TIME']-$membru[2];
if($atime<1800)
$conn->query('UPDATE`membrii`SET`otime`=otime+'.$atime.' WHERE`id`="'.$de.'"');
unset($membru,$atime);
if(isset($_GET['alerta']))
$conn->query('UPDATE`alerte`SET`citit`="'.$_SERVER['REQUEST_TIME'].'"WHERE`id`="'.$_GET['alerta'].'"&&`la`="'.$de.'"&&`citit`="0"');
if(isset($_GET['dar']))
$conn->query('UPDATE`daruri_oferite`SET`citit`="'.$_SERVER['REQUEST_TIME'].'"WHERE`id`="'.$_GET['dar'].'"&&`la`="'.$de.'"&&`citit`="0"');
}
function nume($la,$valoare='')
{
global$conn,$de,$perm;
$unume=$conn->query('SELECT`nume`,`culoare_nume`,`valid`FROM`membrii`WHERE`id`="'.$la.'"')->fetch_row();
if($unume[2]<1&&$perm<1&&$de!=$la)
return'Cont ne validat';
if($conn->query('SELECT COUNT(*)FROM`membrii_pedepsiti`WHERE`de`="'.$la.'"&&`penalty`="0"')->fetch_row()[0]>0&&$valoare=='')
return'<s>'.$unume[0].'</s>';
elseif($unume[1]!=''&&$valoare=='')
return'<span style="color:'.$unume[1].'">'.$unume[0].'</span>';
else
return$unume[0];
}
function seo($str)
{
$str=mb_strtolower(html_entity_decode($str));
$str=preg_replace(['/[^a-z0-9-]+/','/-+/'],['-','-'],$str);
return mb_substr(trim($str,'-'),0,70);
}