#Page title $view->title = $news['name']; #Emoticons if ($news['opt'] & 2) { $news['txt'] = emots($news['txt']); if ($full) { $full = emots($full); } } #Line breaks if ($news['opt'] & 1) { $news['txt'] = nl2br($news['txt']); if ($full) { $full = nl2br($full); } } #Date, author $news['date'] = genDate($news['date'], true); $news['wrote'] = autor($news['author']); #Assign to template $view->add('news', array('news' => &$news, 'full' => &$full, 'path' => catPath($news['cat']), 'edit' => admit($news['cat'], 'CAT') ? url('edit/5/' . $id, 'ref') : false, 'root' => isset($cfg['allCat']) ? $lang['cats'] : $lang['news'], 'cats' => url(isset($cfg['allCat']) ? 'cats' : 'cats/news'))); #Tags if (isset($cfg['tags'])) { include './lib/tags.php'; tags($id, 5); } #Comments if (isset($cfg['ncomm']) && $news['catOpt'] & 2) { require './lib/comm.php'; comments($id, 5); }
#Subcategories if ($cat['opt'] & 8) { $res = $db->query('SELECT ID,name,dsc,nums FROM ' . PRE . 'cats WHERE sc=' . $cat['ID'] . ' AND (access=1 OR access="' . LANG . '") ORDER BY name'); $res->setFetchMode(3); foreach ($res as $c) { $sc[] = array('url' => url($c[0]), 'name' => $c[1], 'desc' => $c[2], 'num' => $c[3]); } } #If empty and have privileges if ($cat['num'] == '0' && empty($sc) && admit($d, 'CAT')) { header('Location: ' . URL . url('edit/' . $cat['type'])); } #Prepare template $data = array('cat' => &$cat, 'edit' => admit('C') ? url('editCat/' . $d, 'ref', 'admin') : null, 'add' => url('edit/' . $cat['type'], 'catid=' . $d), 'list' => url('list/' . $cat['type'] . '/' . $d), 'subcats' => isset($sc) ? $sc : null, 'options' => admit($d, 'CAT')); #Category path if ($cat['opt'] & 1 && isset($cfg['catStr'])) { $view->nav = catPath($d, $cat); $data['path'] = catPath($d, $cat); } else { $view->nav = null; $data['path'] = null; } #Load item list generator - TODO: improve if ($cat['num']) { $view->add('cat', $data); include './mod/cat/' . $cat['type'] . '.php'; } else { $data['type'] = $lang['cats']; $data['cats'] = url('cats'); $view->add('cat', $data); }
if (isset($cfg['arate']) && $art['catOpt'] & 4) { $view->css(SKIN_DIR . 'rate.css'); $rates = 'vote.php?type=1&id=' . $id; } else { $rates = 0; } #Count popularity if (isset($cfg['adisp'])) { register_shutdown_function(array($db, 'exec'), 'UPDATE ' . PRE . 'arts SET views=views+1 WHERE ID=' . $id); ++$art['views']; } else { $art['ent'] = 0; } #Pages if ($art['pages'] > 1) { $pages = pages($page, $art['pages'], 1, url('art/' . $id), 0, '/'); } else { $pages = false; } #Template $view->add('art', array('art' => &$art, 'pages' => &$pages, 'path' => catPath($art['cat']), 'edit' => admit($art['cat'], 'CAT') ? url('edit/1/' . $id, 'ref=' . $page) : false, 'color' => $art['opt'] & 4, 'rates' => $rates, 'root' => isset($cfg['allCat']) ? $lang['cats'] : $lang['arts'], 'cats' => url(isset($cfg['allCat']) ? 'cats' : 'cats/articles'), 'lightbox' => isset($cfg['lightbox']))); #Tags if (isset($cfg['tags'])) { include './lib/tags.php'; tags($id, 1); } #Comments if (isset($cfg['acomm']) && $art['catOpt'] & 2) { require './lib/comm.php'; comments($id, 1); }
$view->info(sprintf($lang['NVAL'], $img['name']), null, 'warning'); } #Dimensions $size = strpos($img['size'], '|') ? explode('|', $img['size']) : null; #Data, autor $img['date'] = genDate($img['date'], true); $img['author'] = autor($img['author']); #Ocena if (isset($cfg['irate']) and $img['opt'] & 4) { $view->css(SKIN_DIR . 'rate.css'); $rates = 'vote.php?type=3&id=' . $id; } else { $rates = 0; } #Tag title and meta description - clean temporary $view->title = $img['name']; $view->desc = $img['dsc'] ? clean(substr($img['dsc'], 0, 150)) : $cfg['metaDesc']; #Description $img['dsc'] = nl2br($img['dsc']); #Template $view->add('img', array('img' => &$img, 'size' => &$size, 'rates' => $rates, 'image' => $img['type'] === '1' ? true : false, 'flash' => $img['type'] === '2' ? true : false, 'audio' => $img['type'] === '3' ? true : false, 'video' => $img['type'] === '4' ? true : false, 'path' => catPath($img['cat']), 'edit' => admit($img['cat'], 'CAT') ? url('edit/3/' . $id, 'ref') : false, 'root' => isset($cfg['allCat']) ? $lang['cats'] : $lang['imgs'], 'cats' => url(isset($cfg['allCat']) ? 'cats' : 'cats/images'), 'lightbox' => isset($cfg['lightbox']))); #Tags if (isset($cfg['tags'])) { include './lib/tags.php'; tags($id, 3); } #Comments if (isset($cfg['icomm']) && $img['opt'] & 2) { require 'lib/comm.php'; comments($id, 3); }
$file['size'] = round($size / 1048576) . ' MB'; } else { $file['size'] = round($size / 1024) . ' KB'; } } } else { $file['size'] = 'File not found'; $file['url'] = '#'; } #Mark if (isset($cfg['frate']) && $file['opt'] & 4) { $view->css(SKIN_DIR . 'rate.css'); $rate = 'vote.php?type=2&id=' . $id; } else { $rate = 0; } #Date, author $file['date'] = genDate($file['date'], true); $file['author'] = autor($file['author']); #Template $view->add('file', array('file' => &$file, 'path' => catPath($file['cat']), 'rates' => $rate, 'edit' => admit($file['cat'], 'CAT') ? url('edit/2/' . $id, 'ref') : false, 'root' => isset($cfg['allCat']) ? $lang['cats'] : $lang['files'], 'cats' => url(isset($cfg['allCat']) ? 'cats' : 'cats/files'))); #Tags if (isset($cfg['tags'])) { include './lib/tags.php'; tags($id, 2); } #Comments if (isset($cfg['fcomm']) && $file['opt'] & 2) { require './lib/comm.php'; comments($id, 2); }