/** * Vytvoreni nahledu clanku pro vypis * @param array $art pole s daty clanku vcetne cat_title_seo * @param bool $info vypisovat radek s informacemi 1/0 * @param bool $perex vypisovat perex 1/0 * @param int|null pocet komentaru (null = nezobrazi se) * @return string */ function _articlePreview($art, $info = true, $perex = true, $comment_count = null) { // podpora nahrazeni static $overload; if (null === $overload) { _extend('call', 'article.preview', array('callback' => &$overload)); if (null === $overload) { $overload = false; } } if (false !== $overload) { return call_user_func($overload, $art, $info, $perex, $comment_count); } global $_lang; // titulek $link = _linkArticle($art['id'], $art['title_seo'], $art['cat_title_seo']); $output = "<h2 class='list-title'><a href='" . $link . "'>" . $art['title'] . "</a></h2>"; // perex a obrazek if ($perex == true) { $output .= "<p class='list-perex'>" . (isset($art['picture_uid']) ? "<a href='" . $link . "'><img class='list-perex-image' src='" . _pictureStorageGet(_indexroot . 'pictures/articles/', null, $art['picture_uid'], 'jpg') . "' alt='" . $art['title'] . "' /></a>" : '') . $art['perex'] . "</p>"; } // info if ($info == true) { // pocet komentaru if ($art['comments'] == 1 and _comments and $comment_count !== null) { $info_comments = _template_listinfoseparator . "<span>" . $_lang['article.comments'] . ":</span> " . $comment_count; } else { $info_comments = ""; } $output .= "\n <div class='list-info'>\n <span>" . $_lang['article.author'] . ":</span> " . _linkUser($art['author'], null, true) . _template_listinfoseparator . "<span>" . $_lang['article.posted'] . ":</span> " . _formatTime($art['time']) . _template_listinfoseparator . "<span>" . $_lang['article.readed'] . ":</span> " . $art['readed'] . "x" . $info_comments . "</div>"; } elseif ($perex && isset($art['picture_uid'])) { $output .= "<div class='cleaner'></div>\n"; } return $output . "\n"; }
} if (isset($_GET['created'])) { $message = _formMessage(1, $_lang['global.created']); } // wysiwyg editor $output .= _admin_wysiwyg(); // vypocet hodnoceni if (!$new) { if ($query['ratenum'] != 0) { $rate = DB::result(DB::query("SELECT ROUND(ratesum/ratenum) FROM `" . _mysql_prefix . "-articles` WHERE id=" . $query['id']), 0) . "%, " . $query['ratenum'] . "x"; } else { $rate = $_lang['article.rate.nodata']; } } else { $rate = ""; } // seo title input $seo_input = "<input type='text' name='title_seo' value='" . $query['title_seo'] . "' maxlength='255' class='input" . ($author_select != '' ? 'medium' : 'big') . "' />"; // obrazek $picture = ''; if (isset($query['picture_uid'])) { $picture .= "<img src='" . _pictureStorageGet(_indexroot . 'pictures/articles/', null, $query['picture_uid'], 'jpg') . "' alt='article picture' id='is-picture-file' />\n<label id='is-picture-delete'><input type='checkbox' name='picture-delete' value='1' /> <img src='images/icons/delete3.png' class='icon' alt='" . $_lang['global.delete'] . "' /></label>"; } else { $picture .= "<img src='images/art-no-pic.png' alt='no picture' />\n"; } $picture .= "<input type='file' name='picture' id='is-picture-upload' />\n"; // formular $output .= "\n<a href='" . $backlink . "' class='backlink'>< " . $_lang['global.return'] . "</a>\n<h1>" . $_lang['admin.content.articles.edit.title'] . "</h1>\n<p class='bborder'>" . $_lang['admin.content.articles.edit.p'] . "</p>" . $message . "\n\n" . (($new == true and _loginright_adminneedconfirm) ? _admin_smallNote($_lang['admin.content.articles.edit.newconfnote']) : '') . "\n" . ($query['confirmed'] != 1 ? _admin_smallNote($_lang['admin.content.articles.edit.confnote']) : '') . "\n\n" . (!$new && DB::result(DB::query('SELECT COUNT(*) FROM `' . _mysql_prefix . '-articles` WHERE `id`!=' . $query['id'] . ' AND `home1`=' . $query['home1'] . ' AND `title_seo`=\'' . $query['title_seo'] . '\''), 0) != 0 ? _formMessage(2, $_lang['admin.content.form.title_seo.collision']) : '') . "\n\n<form class='cform' action='index.php?p=content-articles-edit" . $actionplus . "' method='post' enctype='multipart/form-data' name='artform'" . _jsCheckForm("artform", array("title")) . ">\n\n<table class='formtable'>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['article.category'] . "</strong></td>\n<td>" . _admin_rootSelect("home1", 2, $query['home1'], false) . " " . _admin_rootSelect("home2", 2, $query['home2'], true) . " " . _admin_rootSelect("home3", 2, $query['home3'], true) . "</td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.form.title'] . "</strong></td>\n<td><input type='text' name='title' value='" . $query['title'] . "' class='inputbig' /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.form.title_seo'] . "</strong></td>\n<td>" . ($author_select == '' ? $seo_input : "\n <table class='ae-twoi'><tr>\n <td>" . $seo_input . "</td>\n <td class='rpad'><strong>" . $_lang['article.author'] . "</strong></td>\n <td>" . $author_select . "</td>\n </tr></table>\n") . "</td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.form.description'] . "</strong></td>\n<td>\n <table class='ae-twoi'><tr>\n <td><input type='text' name='description' value='" . $query['description'] . "' maxlength='128' class='inputmedium' /></td>\n <td class='rpad'><strong>" . $_lang['admin.content.form.keywords'] . "</strong></td>\n <td><input type='text' name='keywords' value='" . $query['keywords'] . "' maxlength='128' class='inputmedium' /></td>\n </tr></table>\n</td>\n</tr>\n\n<tr class='valign-top'>\n<td class='rpad'><strong>" . $_lang['admin.content.form.perex'] . "</strong></td>\n<td><textarea name='perex' rows='9' cols='94' class='areabigperex codemirror'>" . _htmlStr($query['perex']) . "</textarea></td>\n</tr>\n\n<tr class='valign-top'>\n<td class='rpad'><strong>" . $_lang['admin.content.form.content'] . "</strong>" . $artlink . "</td>\n<td>\n\n <table id='ae-table'>\n <tr class='valign-top'>\n <td id='content-cell'>\n <textarea name='content' rows='25' cols='68' class='wysiwyg_editor" . (!_wysiwyg || !_loginwysiwyg ? ' codemirror' : '') . "'>" . _htmlStr($query['content']) . "</textarea>\n </td>\n <td id='is-cell'>\n <div id='is-cell-wrapper'>\n <div id='is-cell-content'>\n\n <h2>" . $_lang['admin.content.form.picture'] . "</h2>\n <div id='is-picture'>" . $picture . "</div>\n\n <h2>" . $_lang['admin.content.form.settings'] . "</h2>\n <p id='is-settings'>\n <label><input type='checkbox' name='public' value='1'" . _checkboxActivate($query['public']) . " /> " . $_lang['admin.content.form.public'] . "</label>\n <label><input type='checkbox' name='visible' value='1'" . _checkboxActivate($query['visible']) . " /> " . $_lang['admin.content.form.visible'] . "</label>\n " . (_loginright_adminconfirm || !_loginright_adminneedconfirm && $query['author'] == _loginid ? "<label><input type='checkbox' name='confirmed' value='1'" . _checkboxActivate($query['confirmed']) . " /> " . $_lang['admin.content.form.confirmed'] . "</label>" : '') . "\n <label><input type='checkbox' name='comments' value='1'" . _checkboxActivate($query['comments']) . " /> " . $_lang['admin.content.form.comments'] . "</label>\n <label><input type='checkbox' name='commentslocked' value='1'" . _checkboxActivate($query['commentslocked']) . " /> " . $_lang['admin.content.form.commentslocked'] . "</label>\n <label><input type='checkbox' name='rateon' value='1'" . _checkboxActivate($query['rateon']) . " /> " . $_lang['admin.content.form.artrate'] . "</label>\n <label><input type='checkbox' name='showinfo' value='1'" . _checkboxActivate($query['showinfo']) . " /> " . $_lang['admin.content.form.showinfo'] . "</label>\n " . (!$new ? "<label><input type='checkbox' name='resetrate' value='1' /> " . $_lang['admin.content.form.resetartrate'] . " <small>(" . $rate . ")</small></label>" : '') . "\n " . (!$new ? "<label><input type='checkbox' name='delcomments' value='1' /> " . $_lang['admin.content.form.delcomments'] . " <small>(" . DB::result(DB::query("SELECT COUNT(id) FROM `" . _mysql_prefix . "-posts` WHERE home=" . $query['id'] . " AND type=2"), 0) . ")</small></label>" : '') . "\n " . (!$new ? "<label><input type='checkbox' name='resetread' value='1' /> " . $_lang['admin.content.form.resetartread'] . " <small>(" . $readed_counter . ")</small></label>" : '') . "\n </p>\n\n <h2>" . $_lang['admin.content.form.infobox'] . "</h2>\n <div id='infobox-wrapper'>\n <textarea name='infobox' rows='10' cols='20' class='codemirror'>" . _htmlStr($query['infobox']) . "</textarea>\n </div>\n\n </div>\n </div>\n </td>\n </tr>\n </table>\n\n</td>\n</tr>\n\n<tr id='time-cell'>\n<td class='rpad'><strong>" . $_lang['article.posted'] . "</strong></td>\n<td>" . _editTime('time', $query['time'], true, $new) . "</td>\n</tr>\n\n<tr>\n<td></td>\n<td id='ae-lastrow'><br /><input type='submit' value='" . $_lang[$submittext] . "' />\n" . (!$new ? "\n \n<span class='customsettings'><a href='index.php?p=content-articles-delete&id=" . $query['id'] . "&returnid=" . $query['home1'] . "&returnpage=1'><span><img src='images/icons/delete.png' alt='del' class='icon' />" . $_lang['global.delete'] . "</span></a></span> \n<span class='customsettings'><small>" . $_lang['admin.content.form.thisid'] . " " . $query['id'] . "</small></span>\n" : '') . "\n\n</td>\n</tr>\n\n</table>\n\n" . _xsrfProtect() . "</form>\n\n"; } else { $output .= "<a href='index.php?p=content-articles' class='backlink'>< " . $_lang['global.return'] . "</a>\n<h1>" . $_lang['admin.content.articles.edit.title'] . "</h1>\n" . _formMessage(3, $_lang['global.badinput']); }
/style/system.css" type="text/css" rel="stylesheet" /> <title><?php echo $query['title'] . " " . _titleseparator . " " . _title; ?> </title> </head> <body onload="setTimeout('this.print();', 500);"> <p id="informations"><?php echo "<strong>" . $_lang['global.source'] . ":</strong> <a href='" . $url . "'>" . $url . "</a>" . _template_listinfoseparator . "<strong>" . $_lang['article.posted'] . ":</strong> " . _formatTime($query['time']) . _template_listinfoseparator . "<strong>" . $_lang['article.author'] . ":</strong> " . _linkUser($query['author'], null, true, true); ?> </p> <h1><?php echo $query['title']; ?> </h1> <p><?php echo (isset($query['picture_uid']) ? "<img class='list-perex-image' src='" . _pictureStorageGet(_indexroot . 'pictures/articles/', null, $query['picture_uid'], 'jpg') . "' alt='" . $query['title'] . "' />" : '') . $query['perex']; ?> </p> <?php echo _parseHCM($query['content']); ?> </body> </html><?php } } }
$homes[$i] = "<a href='" . _linkRoot($homes[$i]['id'], $homes[$i]['title_seo']) . "'>" . $homes[$i]['title'] . "</a>"; } $content .= implode(', ', $homes) . "</div>\n"; unset($homes); } else { $cat_showinfo = null; } /* -- titulek -- */ $title = $query['title']; // if (_template_autoheadings) { $content .= "<h1>" . $title . "</h1>\n"; // } /* -- perex -- */ _extend('call', 'article.perex.before', $extend_args); // rozsireni pred perexem $content .= "<p class='article-perex'>" . (isset($query['picture_uid']) ? "<img class='article-perex-image' src='" . _pictureStorageGet(_indexroot . 'pictures/articles/', null, $query['picture_uid'], 'jpg') . "' alt='" . $query['title'] . "' />" : '') . $query['perex'] . "</p>\n"; // if (isset($query['picture_uid'])) $content .= "<div class='cleaner'></div>\n"; _extend('call', 'article.perex.after', $extend_args); // rozsireni za perexem /* -- obsah -- */ $content .= "<div class='article-content'>\n" . _parseHCM($query['content']) . "\n</div>\n"; /* -- informacni tabulka -- */ // zalomeni $content .= "<div class='cleaner'></div>\n"; // priprava $info = array("basicinfo" => null, "idlink" => null, "rateresults" => null, "rateform" => null, "infobox" => null); // zakladni informace if ($query['showinfo'] == 1 && (!isset($cat_showinfo) || $cat_showinfo === true)) { $info['basicinfo'] = "\n <strong>" . $_lang['article.author'] . ":</strong> " . _linkUser($query['author']) . "<br />\n <strong>" . $_lang['article.posted'] . ":</strong> " . _formatTime($query['time']) . "<br />\n <strong>" . $_lang['article.readed'] . ":</strong> " . $query['readed'] . "x\n "; } // ID clanku