コード例 #1
0
    }
    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'>&lt; " . $_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&nbsp;&nbsp;\n<span class='customsettings'><a href='index.php?p=content-articles-delete&amp;id=" . $query['id'] . "&amp;returnid=" . $query['home1'] . "&amp;returnpage=1'><span><img src='images/icons/delete.png' alt='del' class='icon' />" . $_lang['global.delete'] . "</span></a></span>&nbsp;&nbsp;\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'>&lt; " . $_lang['global.return'] . "</a>\n<h1>" . $_lang['admin.content.articles.edit.title'] . "</h1>\n" . _formMessage(3, $_lang['global.badinput']);
}
コード例 #2
0
                    $paramvar = "new_" . $param;
                    $paramval = ${$paramvar};
                    if ($paramval == 0 or $paramval == 1) {
                        DB::query("UPDATE `" . _mysql_prefix . "-articles` SET " . $param . "=" . $paramval . " WHERE id=" . $item['id']);
                    }
                }
            }
            $message = _formMessage(1, $_lang['global.done']);
        }
    } else {
        $message = _formMessage(2, $_lang['admin.content.artfilter.f1.noresult']);
    }
}
/* ---  vystup  --- */
$output .= "\n<p class='bborder'>" . $_lang['admin.content.artfilter.p'] . "</p>\n" . $message . "\n<form action='index.php?p=content-artfilter' method='post'>\n";
if (!$infopage) {
    $output .= "\n<h2>" . $_lang['admin.content.artfilter.f1.title'] . "</h2>\n<p>" . $_lang['admin.content.artfilter.f1.p'] . "</p>\n<table>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['article.category'] . "</strong></td>\n<td>" . _admin_rootSelect("category", 2, -1, true, $_lang['global.any2']) . "</td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['article.author'] . "</strong></td>\n<td>" . _admin_authorSelect("author", -1, "adminart=1", "selectmedium", $_lang['global.any']) . "</td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['article.posted'] . "</strong></td>\n<td>\n\n<select name='ba'>\n<option value='0'>" . $_lang['admin.content.artfilter.f1.time0'] . "</option>\n<option value='1'>" . $_lang['admin.content.artfilter.f1.time1'] . "</option>\n<option value='2'>" . $_lang['admin.content.artfilter.f1.time2'] . "</option>\n<option value='3'>" . $_lang['admin.content.artfilter.f1.time3'] . "</option>\n</select>\n\n" . _editTime('time', -1) . "\n\n</td>\n</tr>\n\n<tr class='valign-top'>\n<td class='rpad'><strong>" . $_lang['admin.content.form.settings'] . "</strong></td>\n<td>\n" . _admin_boolSelect("public") . $_lang['admin.content.form.public'] . "<br />\n" . _admin_boolSelect("visible") . $_lang['admin.content.form.visible'] . "<br />\n" . _admin_boolSelect("confirmed") . $_lang['admin.content.form.confirmed'] . "<br />\n" . _admin_boolSelect("comments") . $_lang['admin.content.form.comments'] . "<br />\n" . _admin_boolSelect("rateon") . $_lang['admin.content.form.artrate'] . "<br />\n" . _admin_boolSelect("showinfo") . $_lang['admin.content.form.showinfo'] . "\n</td>\n</tr>\n\n</table>\n\n<br /><div class='hr'><hr /></div><br />\n\n<h2>" . $_lang['admin.content.artfilter.f2.title'] . "</h2>\n<p>" . $_lang['admin.content.artfilter.f2.p'] . "</p>\n<table>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['article.category'] . "</strong></td>\n<td>" . _admin_rootSelect("new_category", 2, -1, true, $_lang['global.nochange']) . "</td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['article.author'] . "</strong></td>\n<td>" . _admin_authorSelect("new_author", -1, "adminart=1", "selectmedium", $_lang['global.nochange']) . "</td>\n</tr>\n\n<tr class='valign-top'>\n<td class='rpad'><strong>" . $_lang['admin.content.form.settings'] . "</strong></td>\n<td>\n" . _admin_boolSelect("new_public", true) . $_lang['admin.content.form.public'] . "<br />\n" . _admin_boolSelect("new_visible", true) . $_lang['admin.content.form.visible'] . "<br />\n" . (_loginright_adminconfirm ? _admin_boolSelect("new_confirmed", true) . $_lang['admin.content.form.confirmed'] . "<br />" : '') . "\n" . _admin_boolSelect("new_comments", true) . $_lang['admin.content.form.comments'] . "<br />\n" . _admin_boolSelect("new_rateon", true) . $_lang['admin.content.form.artrate'] . "<br />\n" . _admin_boolSelect("new_showinfo", true) . $_lang['admin.content.form.showinfo'] . "\n</td>\n</tr>\n\n<tr class='valign-top'>\n<td class='rpad'><strong>" . $_lang['global.action'] . "</strong></td>\n<td>\n<label><input type='checkbox' name='new_delete' value='1' /> " . $_lang['global.delete'] . "</label><br />\n<label><input type='checkbox' name='new_resetrate' value='1' /> " . $_lang['admin.content.form.resetartrate'] . "</label><br />\n<label><input type='checkbox' name='new_delcomments' value='1' /> " . $_lang['admin.content.form.delcomments'] . "</label><br />\n<label><input type='checkbox' name='new_resetread' value='1' /> " . $_lang['admin.content.form.resetartread'] . "</label>\n</td>\n</tr>\n\n</table>\n\n<br /><div class='hr'><hr /></div><br />\n\n<input type='submit' value='" . $_lang['mod.search.submit'] . "' />\n";
} else {
    $output .= _getPostdata() . "\n<input type='hidden' name='_process' value='1' />\n" . _formMessage(1, str_replace("*found*", $found, $_lang['admin.content.artfilter.f1.infotext'])) . "\n<ul>";
    $counter = 0;
    while ($r = DB::row($query)) {
        if ($counter >= 30) {
            $output .= "<li><em>... (+" . ($found - $counter) . ")</em></li>\n";
            break;
        }
        $output .= "<li><a href='" . _indexroot . _linkArticle($r['id'], $r['title_seo'], $r['cat_title_seo']) . "' target='_blank'>" . $r['title'] . "</a></li>\n";
        ++$counter;
    }
    $output .= "</ul>\n<input type='submit' value='" . $_lang['global.do2'] . "' />&nbsp;&nbsp;<a href='index.php?p=content-artfilter'>" . $_lang['global.cancel'] . "</a>\n";
}
$output .= _xsrfProtect() . "</form>";