<?php
session_start();
require_once 'includes/config.php';
$yorum = new HTML_Template_Sigma();
$yorum->setRoot(TEMP_ROOT);
if(CACHE){ $yorum->setCacheRoot(C_ROOT.'/'.SIGMA_C_DIR); }
$yorum->setErrorHandling(PEAR_ERROR_DIE);
$yorum->loadTemplateFile('yorumlar.tpl',true,true);
$yorum->setOption('charset',CHARSET);
static $num = 0; static $res = array();
$u_ip = ipbul();
$sayfa = (int)abs($_GET['s']); $sayfa = $sayfa<1?1:$sayfa;
$min = ($t=$sayfa-1)<1?0:$t*NUM_YORUMLAR;
$yorum->setGlobalVariable(array('SITEURL'=>SITEURL,'T_DIZ IN'=>T_DIZIN,'SELF'=>$_SERVER['PHP_SELF']));
$yorum->setCallBackFunction('ads','reklam');
$yorum->setCallBackFunction('s_num','s_num');
$yorum->setCallBackFunction('c_num','c_num');
$yorum->setCallBackFunction('t_num','t_num');
$yorum->setCallBackFunction('img','img');
$yorum->setCallBackFunction('embed','embed');
$yorum->setCallBackFunction('sef','sef');
$yorum->setCallBackFunction('yvote','yvote');
$v = (string)$fonk['str_clean']($_GET['v']);
$res = $db->getAll('SELECT SQL_CALC_FOUND_ROWS y.yid,x.id, x.baslik, x.sef, x.resim, x.resim_l, x.detay, x.tarih as vtarih, x.hit, x.sure, x.rating_t_puan, x.rating_t_oy, y.yid, y.ad, y.mesaj, y.rapor, y.tarih, y.ip, y.vote, y.iplist FROM video x, yorumlar y WHERE x.sef=? AND x.id=y.vid AND x.status=? AND y.status=? ORDER BY y.tarih DESC LIMIT '.$min.','.NUM_YORUMLAR,array($v,'1','1'),DB_FETCH MODE_ASSOC);
pear_error($res);
if(sizeof($res)==0){error('Sayfa Bulunamadý');}
$top_res = $db->query('SELECT FOUND_ROWS()');
$top_row = $top_res->FetchRow();
$toplam = $top_row[0];
$yorum->setVariable(array('Q_ID'=>$res[0]['id'],'Q_BASLIK'=>$res[0]['baslik'],'Q_IMG'=>$res[0]['resim'],'Q_IMG_L'=>$res[0]['resim_l'],'Q_DETAY'=>$res[0]['detay'],'Q_TARIH'=>date_($res[0]['vtarih']),'Q_HIT'=>$res[0]['hit'],'Q_SURE'=>$res[0]['sure'],'Q_TOY'=>$res[0]['rating_t_oy'],'Q_VOTE'=>vote($res[0]['rating_t_puan'],$res[0]['rating_t_oy']),'Q_LINK'=>video_link($res[0]['id'],$res[0]['sef']),'TOP_YORUM'=>$toplam));
$yorum->setCurrentBlock('YORUM_LIST');
foreach($res as $arr):
$ip_list = is_array($t=unserialize($arr['iplist']))?$t:array();
$yorum->setVariable(array('Y_ID'=>$arr['yid'],'Y_VID'=>$arr['vid'],'V_AD'=>$arr['ad'],'V_MESAJ'=>smiley($arr['mesaj']),'V_TARIH'=>date_($arr['tarih']),'V_VOTE'=>(int)$arr['vote'],'Y_RID'=>$arr['yid'],'VOTE_X'=>strlen(array_search($u_ip,$ip_list))?1: 0,'V_RAPOR'=>(int)$arr['rapor']));
if(YORUM_VOTE==0 || $u_ip==$arr['ip'] || $u_ip==NULL){$yorum->hideBlock('VOTES');}
if(YORUM_RAPOR==0 || $u_ip==$arr['ip'] || $u_ip==NULL){$yorum->hideBlock('REPORT');}
$yorum->parseCurrentBlock();
endforeach;
$sayfalama = new sayfalama($toplam,NUM_YORUMLAR,array('v'),array($v ),'s',$sayfa);
$sayfalama->kontrol();
$sayfalama->sef = yorum_link($res[0]['sef'],NULL);
$yorum->setVariable(array('ONCEKI_SAYFA'=>$sayfalama->t_onceki_sayfa(),'SONRAKI_SAYFA'=>
$sayfalama->t_sonraki_sayfa(),'SAYFALAR'=>$sayfalama->t_sayfalar()));
$meta = new meta();
$meta->m_add = $res[0];
$meta->show();
add_css('yorumlar');
$header->show();
$yorum->show();
$footer->show();
$db->disconnect()
?>