/
link.php
58 lines (50 loc) · 1.35 KB
/
link.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php /* Show link details */
if(iCMS!=1) exit;
require './cfg/content.php';
#Full view is disabled
if(!isset($cfg['linkFull']) && !IS_EDITOR) return;
#Get record
if(!$link = $db->query('SELECT l.*,c.opt FROM '.PRE.'links l INNER JOIN '.
PRE.'cats c ON l.cat=c.ID WHERE c.access!=3 AND l.ID='.$id)->fetch(2)) return;
#Disabled
if(!$link['access'])
{
if(!admit($link['cat'],'CAT')) return;
$view->info(sprintf($lang['NVAL'], $link['name']), null, 'warning');
}
#Tag title and meta description
$view->title = $link['name'];
$view->desc = $link['dsc'] ? $link['dsc'] : $cfg['metaDesc'];
#Ocena
if(isset($cfg['lrate']) AND $link['opt'] & 4)
{
$view->css(SKIN_DIR.'rate.css');
$rate = 'vote.php?type=4&id='.$id;
}
else
{
$rate = 0;
}
#Template
$view->add('link', array(
'link' => &$link,
'rates' => &$rate,
'count' => isset($cfg['lcnt']),
'href' => isset($cfg['lcnt']) ? url('go/'.$id) : $link['adr'],
'edit' => admit($link['cat'],'CAT') ? url('edit/4/'.$id,'ref') : false,
'path' => catPath($link['cat']),
'root' => isset($cfg['allCat']) ? $lang['cats'] : $lang['links'],
'cats' => url(isset($cfg['allCat']) ? 'cats' : 'cats/links')
));
#Tags
if(isset($cfg['tags']))
{
include './lib/tags.php';
tags($id, 4);
}
#Comments
if($link['opt'] & 2)
{
require './lib/comm.php';
comments($id, 4);
}