-
Notifications
You must be signed in to change notification settings - Fork 3
/
common_news.inc.php
39 lines (32 loc) · 1.37 KB
/
common_news.inc.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
<?php if (!defined("__HIDE_TEST__")) exit; /* zamezeni samostatneho vykonani */ ?>
<?
function PrintNewsItem(&$zaznam,$admin, $user, $passive)
{
global $g_www_admin_id;
$show_all = true;
$class_item = 'NewsItem';
$class_title = 'NewsItemTitle';
$class_date = 'NewsItemDate';
if ($zaznam['internal'])
{
$show_all = ($admin || $user->logged);
$class_item .= 'Int';
$class_title .= 'Int';
$class_date .= 'Int';
}
$datum = Date2String($zaznam['datum']);
echo '<TR><TD class="'.$class_date.'">'.$datum.' </TD>';
if ($zaznam['nadpis']!='') echo '<TD class="'.$class_title.'">'.$zaznam['nadpis'].' </TD></TR><TR><TD></TD>';
$name_id = $zaznam['id_user'];
echo '<TD class="'.$class_item.'">';
if ($show_all)
echo $zaznam['text'];
else
echo ('<i>- interní novinka / po přihlášení -</i>');
if ($name_id && $zaznam['podpis'] != '' && $name_id != $g_www_admin_id)
echo ' <span class="NewsAutor">[ '.$zaznam['podpis'].' ]</span>';
if ( ( ($user->account_id == $name_id) || $admin ) && !$passive)
echo '<span class="DisableText"> ( <A HREF="./news_edit.php?id='.$zaznam['id'].'" class="NewsEdit">Editovat</A> / <A HREF="./news_del_exc.php?id='.$zaznam['id'].'" onclick="return confirm_delete(\''.$datum.'\')" class="NewsErase">Smazat</A> )</span>';
echo '</TD></TR>';
}
?>