case 3: $artorder = "art.title"; break; case 4: $artorder = "art.title DESC"; break; } // titulek kategorie $output .= "<h2>" . $catdata['title'] . " <a href='index.php?p=content-articles-edit&new_cat=" . $cid . "'><img src='images/icons/new.png' alt='new' class='icon' />" . $_lang['admin.content.articles.create'] . "</a></h2>\n"; // vypis clanku // zprava $message = ""; if (isset($_GET['artdeleted'])) { $message = _formMessage(1, $_lang['admin.content.articles.delete.done']); } $cond = "(art.home1=" . $cid . " OR art.home2=" . $cid . " OR art.home3=" . $cid . ")" . _admin_artAccess('art'); $paging = _resultPaging("index.php?p=content-articles-list&cat=" . $cid, $catdata['var2'], "articles:art", $cond); $s = $paging[2]; $output .= $paging[0] . "<div class='hr'><hr /></div>\n" . $message . "\n<table class='list'>\n<thead><tr><td>" . $_lang['global.article'] . "</td><td>" . $_lang['article.author'] . "</td><td>" . $_lang['article.posted'] . "</td><td>" . $_lang['global.action'] . "</td></tr></thead>\n<tbody>"; $arts = DB::query("SELECT art.id,art.title,art.title_seo,art.time,art.author,art.confirmed,art.visible,art.public,cat.title_seo AS cat_title_seo FROM `" . _mysql_prefix . "-articles` AS art JOIN `" . _mysql_prefix . "-root` AS cat ON(cat.id=art.home1) WHERE " . $cond . " ORDER BY " . $artorder . " " . $paging[1]); if (DB::size($arts) != 0) { while ($art = DB::row($arts)) { $output .= "<tr><td>" . _admin_articleEditLink($art) . "</td><td>" . _linkUser($art['author']) . "</td><td>" . _formatTime($art['time']) . "</td><td><a href='index.php?p=content-articles-edit&id=" . $art['id'] . "&returnid=" . $cid . "&returnpage=" . $s . "'><img src='images/icons/edit.png' alt='edit' class='icon' />" . $_lang['global.edit'] . "</a> <a href='index.php?p=content-articles-delete&id=" . $art['id'] . "&returnid=" . $cid . "&returnpage=" . $s . "'><img src='images/icons/delete.png' alt='del' class='icon' />" . $_lang['global.delete'] . "</a></td></tr>\n"; } } else { $output .= "<tr><td colspan='4'>" . $_lang['global.nokit'] . "</td></tr>"; } $output .= "</tbody></table>"; } else { $output .= _formMessage(3, $_lang['global.badinput']); }
} else { $catlimit = -1; $condplus = ""; } $output .= "\n<p class='bborder'>" . $_lang['admin.content.confirm.p'] . "</p>\n\n<form class='cform' action='index.php' method='get'>\n<input type='hidden' name='p' value='content-confirm' />\n" . $_lang['admin.content.confirm.filter'] . ": " . _admin_rootSelect("limit", 2, $catlimit, true, $_lang['global.all']) . " <input type='submit' value='" . $_lang['global.do'] . "' />\n</form>\n<div class='hr'><hr /></div>\n\n" . $message . "\n\n<table class='list'>\n<thead><tr><td>" . $_lang['global.article'] . "</td><td>" . $_lang['article.category'] . "</td><td>" . $_lang['article.posted'] . "</td><td>" . $_lang['article.author'] . "</td><td>" . $_lang['global.action'] . "</td></tr></thead>\n<tbody>"; // vypis $query = DB::query("SELECT art.id,art.title,art.title_seo,art.home1,art.home2,art.home3,art.author,art.time,art.visible,art.confirmed,art.public,cat.title_seo AS cat_title_seo FROM `" . _mysql_prefix . "-articles` AS art JOIN `" . _mysql_prefix . "-root` AS cat ON(cat.id=art.home1) WHERE art.confirmed=0" . $condplus . " ORDER BY art.time DESC"); if (DB::size($query) != 0) { while ($item = DB::row($query)) { // seznam kategorii $cats = ""; for ($i = 1; $i <= 3; $i++) { if ($item['home' . $i] != -1) { $hometitle = DB::query_row("SELECT title FROM `" . _mysql_prefix . "-root` WHERE id=" . $item['home' . $i]); $cats .= $hometitle['title']; } if ($i != 3 and $item['home' . ($i + 1)] != -1) { $cats .= ", "; } } if (DB::result(DB::query("SELECT COUNT(id) FROM `" . _mysql_prefix . "-articles` WHERE id=" . $item['id'] . _admin_artAccess()), 0) != 0) { $editlink = " / <a href='index.php?p=content-articles-edit&id=" . $item['id'] . "&returnid=load&returnpage=1' class='small'>" . $_lang['global.edit'] . "</a>"; } else { $editlink = ""; } $output .= "<tr><td>" . _admin_articleEditLink($item, false) . "</td><td>" . $cats . "</td><td>" . _formatTime($item['time']) . "</td><td>" . _linkUser($item['author']) . "</td><td><a href='index.php?p=content-confirm&id=" . $item['id'] . "&limit=" . $catlimit . "' class='small'>" . $_lang['admin.content.confirm.confirm'] . "</a>" . $editlink . "</td></tr>\n"; } } else { $output .= "<tr><td colspan='5'>" . $_lang['global.nokit'] . "</td></tr>"; } $output .= "</tbody></table>";