%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/nailstv/public_html/
Upload File :
Create Path :
Current File : /home/nailstv/public_html/logout.php

<?php

require_once 'config/config.php';

$p['title'] = 'Műköröm.tv kilépés';
$p['desc'] = 'Kilépés a Műköröm.tv honlapról. Köszönjük látogatását.';
$p['keywords'] = 'kilépés, műköröm.tv, műkörmös';
$p['pagename'] = 'Kilépés';
$p['active'] = 'Kilépés' ;

$page = new Page(Registry::get('site'), false, $p, false);
Registry::set('page', $page);
$page->assign('content', content());
$page->display('page.tpl.html');

////////////////////////////////////////////////////////////////////////////////

function content()
{
    $c = new Content();

    $user = new User(Registry::get('site'));

    $user->logout();

    $c->assign('jobb_banner', Page::banner(2,'jobb'));
    $c->assign('video_legujabb', legujabb());

    if(!empty($_SESSION['last_url'])) {
        Registry::get('page')->assign('redirect', $_SESSION['last_url']);
    }
    else {
        Registry::get('page')->assign('redirect', Registry::get('wwwroot'));
    }

    return $c->fetch('logout.tpl.html');
}
function legujabb()
{
    $db = Registry::get('db');

    $sql = "SELECT v.id, v.cim, v.datum, v.hossz, ka.url, k.file, k.id as kep_id
			FROM video v
			" . $db->joinDefPic('video', 'v') . "
			LEFT JOIN kategoria ka ON ka.id = v.kategoria_id
			WHERE v.storno = 'f'
				AND v.aktiv = 't'
				AND ka.storno ='f'
			GROUP BY v.id
			ORDER BY v.datum DESC
			LIMIT 0,8";

    //print $sql; die;

    $legujabb = $db->GetArray($sql);

    foreach($legujabb as $key=>$val){
        $bind = array($val['id']);
        $sql = "SELECT COUNT(id) as nezettseg
				FROM video_nezettseg
				WHERE video_id = ?";
        $row = $db->GetRow($sql, $bind);

        $legujabb[$key]['nezettseg'] = $row['nezettseg'];

        $sql = "SELECT szazalek as ertekeles
				FROM vt_video_szavazas_full
				WHERE video_id = ?";
        $row = $db->GetRow($sql, $bind);

        $legujabb[$key]['url'] = $val['url'] . '/' . String::fancyurl($val['cim']) . '-' . $val['id'];
        $legujabb[$key]['hossz'] = substr($val['hossz'], 0, 5);
        $legujabb[$key]['ertekeles'] = intval($row['ertekeles']);
    }

    return $legujabb;
}
?>

Zerion Mini Shell 1.0