<?php
require'f_stiri.php';
require'f_conectare.php';
conectare('stire '.$pnume,'stire/id/'.$pid.'-'.seo($pinfo[3]));
$head[1]='citeste stirea '.$pnume.', '.htmlspecialchars(mb_substr($pinfo[3],0,150)).'...';
$titlu='Știre '.$pnume;
if($de==0)
$head[3]='<link rel="canonical" href="'.$adresasite[0].'/stire/id/'.$pid.'-'.seo($pinfo[3]).'" />';
require'f_sus.php';
if($de>0)
require'f_nou.php';
echo$div[4].img('stiri.png',2).'Știre '.$pnume.$div[5];
if($de!=$pinfo[1])
$conn->query('UPDATE`stiri`SET`vizualizari`=vizualizari+1 WHERE`id`="'.$pid.'"');
require'f_profil.php';
require'f_data.php';
require'f_filtru.php';
require'f_sms.php';
echo$div[1].'Scrisa de: '.profil($pinfo[1]).$div[0].$div[1].'Vizualizări: <strong>'.$pinfo[5].'</strong>'.$div[0].$div[1].'<small>Scrisa: '.data($pinfo[6]).'</small>'.$div[0].$div[1].'<small>BBCode: <strong>[url=/stire/id/'.$pid.'-'.seo($pinfo[3]).']'.$pnume.'[/url]</strong></small>'.$div[0].$div[13].filtru($pinfo[4]).$div[0].$div[1].sms($pinfo[4]).$div[0].$div[1];
$notare=$conn->query('SELECT COUNT(*)FROM`stiri_note`WHERE`pid`="'.$pid.'"')->fetch_row()[0];
if($notare==0)
echo'Nu a fost notată încă!';
else
{
$rinfo=$conn->query('SELECT COUNT(*),SUM(`valoare`)FROM`stiri_note`WHERE`pid`="'.$pid.'"')->fetch_row();
require'f_nota.php';
echo'Nota: <strong>'.nota(mb_substr(($rinfo[1]/$rinfo[0]),0,4)).'</strong>'.$div[0].$div[1].'Puncte: <strong>'.$rinfo[1].'</strong>'.$div[0].$div[1].'<a href="/note-stire/id/'.$pid.'-'.seo($pinfo[3]).'">Voturi</a> <strong>'.number_format($notare).'</strong>';
}
echo$div[0];
if($conn->query('SELECT COUNT(*)FROM`stiri_note`WHERE`de`="'.$de.'"&&`pid`="'.$pid.'"')->fetch_row()[0]==0)
{
if($pinfo[8]>0)
echo$div[1].'Daca notezi aceasta stire, '.nume($pinfo[1]).' îți oferă suma de <strong>'.$pinfo[8].'</strong> lei!'.$div[0];
$form[0]='/noteaza-stire/id/'.$pid.'-'.seo($pinfo[3]).'" method="post';
$form[1]=0;
require'f_scris3.php';
$form[2]=$div[1].'Noteaza aceasta stire:<br />'.scris3('pmtext','1::2::3::4::5::6::7::8::9::10','10').$div[0];
$form[3]='pmtext';
$form[4]='Noteaza';
require'f_form.php';
}
else
{
$rinfo=$conn->query('SELECT`valoare`,`data`FROM`stiri_note`WHERE`de`="'.$de.'"&&`pid`="'.$pid.'"')->fetch_row();
echo$div[1].'Tu i-ai acordat nota: <strong>'.$rinfo[0].'</strong><br /><small>Data: '.data($rinfo[1]).'</small>'.$div[0];
}
echo$div[1];
if($conn->query('SELECT COUNT(*)FROM`stiri_aprecieri`WHERE`pid`="'.$pid.'"')->fetch_row()[0]==0)
echo'Nu a primit aprecieri încă!';
else
{
$aprecieri=$conn->query('SELECT COUNT(*)FROM`stiri_aprecieri`WHERE`pid`="'.$pid.'"&&`valoare`="1"')->fetch_row();
$dezaprecieri=$conn->query('SELECT COUNT(*)FROM`stiri_aprecieri`WHERE`pid`="'.$pid.'"&&`valoare`="2"')->fetch_row();
if($aprecieri[0]>0)
echo'<a href="/aprecieri-stire/id/'.$pid.'-'.seo($pinfo[3]).'/tip/aprecieri"><strong>'.$aprecieri[0].'</strong> aprecieri</a>';
if($aprecieri[0]>0&&$dezaprecieri[0]>0)
echo'<strong> - </strong>';
if($dezaprecieri[0]>0)
echo'<a href="/aprecieri-stire/id/'.$pid.'-'.seo($pinfo[3]).'/tip/dezaprecieri"><strong>'.$dezaprecieri[0].'</strong> dezaprecieri</a>';
}
echo$div[0].$div[1];
if($conn->query('SELECT COUNT(*)FROM`stiri_aprecieri`WHERE`de`="'.$de.'"&&`pid`="'.$pid.'"')->fetch_row()[0]==0)
echo'<a href="/apreciaza-stire/id/'.$pid.'-'.seo($pinfo[3]).'/tip/apreciaza"><img src="'.$domenii_statice[1].'apreciaza.png" alt="" width="16" height="16" />Apreciază</a><strong> - </strong><a href="/apreciaza-stire/id/'.$pid.'-'.seo($pinfo[3]).'/tip/dezapreciaza"><img src="'.$domenii_statice[2].'dezapreciaza.png" alt="" width="16" height="16" />dezapreciază</a>';
else
{
$apreciere=$conn->query('SELECT`valoare`,`data`FROM`stiri_aprecieri`WHERE`de`="'.$de.'"&&`pid`="'.$pid.'"')->fetch_row();
echo'Tu ai '.($apreciere[0]==1?'a':'deza').'preciat aceasta stire<small> - '.data($apreciere[1]).'</small>';
}
echo$div[0].$div[1];
$comentarii=$conn->query('SELECT COUNT(*)FROM`stiri_comentarii`WHERE`pid`="'.$pid.'"')->fetch_row();
if($comentarii[0]==0)
echo'Nu a fost comentată încă!';
else
echo'<a href="/comentarii-stire/id/'.$pid.'-'.seo($pinfo[3]).'">'.img('stiri.png',2).'Comentarii</a> <strong>'.number_format($comentarii[0]).'</strong>';
echo$div[0];
if($pinfo[7]>0)
echo$div[1].'Daca comentezi aceasta stire, '.nume($pinfo[1]).' îți oferă suma de <strong>'.$pinfo[7].'</strong> lei!'.$div[0];
$form[0]='/comenteaza-stire/id/'.$pid.'-'.seo($pinfo[3]).'" method="post';
$form[1]=0;
require'f_textarea.php';
$form[2]=$div[1].'Scrie comentariu:<br />'.textarea('pmtext').$div[0];
$form[3]='pmtext';
$form[4]='Adauga';
require'f_form.php';
require'f_like.php';
echo$div[1].distribuie('stire/id/'.$pid.'-'.seo($pinfo[3]),$titlu).$div[0];
if($de==$pinfo[1]||$perm>0)
echo$div[1].'<a href="/editeaza-stire/id/'.$pid.'-'.seo($pinfo[3]).'">'.img('administrare.png',1).'Editeaza aceasta stire</a>'.$div[0];
require'f_jos.php';