<?php
function refresh($link='',$timp=0)
{
global$conn,$de,$is_pc,$page;
$auto_refresh=$conn->query('SELECT`auto_refresh`FROM`membrii`WHERE`id`="'.$de.'"')->fetch_row()[0];
$rrefreshh='';
$alerte_necitite=$conn->query('SELECT COUNT(*)FROM`alerte`WHERE`citit`="0"&&`la`="'.$de.'"')->fetch_row();
if($alerte_necitite[0]>0&&!mb_stristr($_SERVER['REQUEST_URI'],'trimite-i-alerta'))
$rrefreshh='off';
if($link!=''&&$rrefreshh!='off')
{
if($auto_refresh>4||$timp>0)
{
if($timp>0)
$lakate=$timp;
else
$lakate=$auto_refresh;
$nrr=$_GET['nrr']??0;
if($nrr>0)
$nrr++;
else
$nrr=1;
if($nrr>10)
$lynk='/refresh';
else
$lynk=$link.($page>0?(mb_substr_count($link,'?')>0?'&amp;page='.$page.'&amp;':'/pagina/'.$page.'?'):'?').'nrr='.$nrr;
if($is_pc=='1')
return'<onevent type="ontimer"><go href="'.$lynk.'" /></onevent><timer value="'.$lakate.'0" />';
else
return'<meta http-equiv="refresh" content="'.$lakate.'; url='.$lynk.'" />';
}
}
}