本文整理汇总了PHP中form_sanitizer函数的典型用法代码示例。如果您正苦于以下问题:PHP form_sanitizer函数的具体用法?PHP form_sanitizer怎么用?PHP form_sanitizer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_sanitizer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: post_forum_ranks
protected function post_forum_ranks()
{
global $aidlink;
if (isset($_POST['save_rank'])) {
$this->data = array('rank_id' => isset($_GET['rank_id']) && isnum($_GET['rank_id']) ? intval($_GET['rank_id']) : 0, 'rank_title' => form_sanitizer($_POST['rank_title'], '', 'rank_title'), 'rank_image' => form_sanitizer($_POST['rank_image'], "", "rank_image"), 'rank_language' => form_sanitizer($_POST['rank_language'], "", "rank_language"), 'rank_posts' => isset($_POST['rank_posts']) && isnum($_POST['rank_posts']) ? $_POST['rank_posts'] : 0, 'rank_type' => isset($_POST['rank_type']) && isnum($_POST['rank_type']) ? $_POST['rank_type'] : 0, 'rank_apply_normal' => isset($_POST['rank_apply_normal']) && isnum($_POST['rank_apply_normal']) ? $_POST['rank_apply_normal'] : USER_LEVEL_MEMBER, 'rank_apply_special' => isset($_POST['rank_apply_special']) && isnum($_POST['rank_apply_special']) ? $_POST['rank_apply_special'] : 1);
$this->data += array('rank_apply' => $this->data['rank_type'] == 2 ? $this->data['rank_apply_special'] : $this->data['rank_apply_normal']);
if (\defender::safe()) {
if (!empty($this->data['rank_id']) && !$this->check_duplicate_ranks()) {
/**
* Update
*/
dbquery_insert(DB_FORUM_RANKS, $this->data, "update");
addNotice('info', self::$locale['411']);
redirect(FUSION_SELF . $aidlink . '§ion=fr');
} elseif (!$this->check_duplicate_ranks()) {
/**
* Save New
*/
dbquery_insert(DB_FORUM_RANKS, $this->data, "save");
addNotice('info', self::$locale['410']);
redirect(FUSION_SELF . $aidlink . '§ion=fr');
}
}
}
if (isset($_GET['delete']) && isnum($_GET['delete'])) {
$result = dbquery("DELETE FROM " . DB_FORUM_RANKS . " WHERE rank_id='" . $_GET['delete'] . "'");
if ($result) {
addNotice("success", self::$locale['412']);
redirect(FUSION_SELF . $aidlink . '§ion=fr');
}
}
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:32,代码来源:ranks.php
示例2: post_tags
protected function post_tags()
{
global $aidlink;
if (isset($_POST['save_tag'])) {
$this->data = array('tag_id' => isset($_GET['tag_id']) && isnum($_GET['tag_id']) ? intval($_GET['tag_id']) : 0, 'tag_title' => form_sanitizer($_POST['tag_title'], '', 'tag_title'), 'tag_language' => form_sanitizer($_POST['tag_language'], '', 'tag_language'), 'tag_color' => form_sanitizer($_POST['tag_color'], '', 'tag_color'), 'tag_description' => form_sanitizer($_POST['tag_description'], '', 'tag_description'), 'tag_status' => isset($_POST['tag_status']) && isnum($_POST['tag_status']) ? intval($_POST['tag_status']) : 0);
if (\defender::safe()) {
if (!empty($this->data['tag_id'])) {
/**
* Update
*/
dbquery_insert(DB_FORUM_TAGS, $this->data, "update");
addNotice('success', self::$locale['forum_tag_0105']);
redirect(FUSION_SELF . $aidlink . '§ion=ft');
} else {
/**
* Save New
*/
dbquery_insert(DB_FORUM_TAGS, $this->data, "save");
addNotice('success', self::$locale['forum_tag_0106']);
redirect(FUSION_SELF . $aidlink . '§ion=ft');
}
}
}
if (isset($_GET['delete']) && isnum($_GET['delete'])) {
$result = dbquery("DELETE FROM " . DB_FORUM_TAGS . " WHERE tag_id='" . $_GET['delete'] . "'");
if ($result) {
addNotice("success", self::$locale['forum_tag_0107']);
redirect(FUSION_SELF . $aidlink . '§ion=ft');
}
}
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:tags.php
示例3: composeSelection
/**
* Serialization of choices
* @param $input
* @return $string
*/
function composeSelection($input)
{
$inputArray = "";
if ($input !== "") {
$inputArray['selected'] = $input;
foreach (fusion_get_enabled_languages() as $lang) {
$inputArray['options'][$lang] = isset($_POST[$input . '-' . $lang]) ? form_sanitizer($_POST[$input . '-' . $lang], 0, $input . '-' . $lang) : "";
}
return serialize($inputArray);
}
return $inputArray;
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:17,代码来源:functions.php
示例4: post_Mood
/**
* Post execution of forum mood
*/
protected function post_Mood()
{
$locale = fusion_get_locale('', FORUM_ADMIN_LOCALE);
if (isset($_POST['cancel_mood'])) {
redirect(clean_request('', array('mood_id', 'ref'), FALSE));
}
if (isset($_POST['save_mood'])) {
$this->data = array("mood_id" => form_sanitizer($_POST['mood_id'], 0, 'mood_id'), "mood_name" => form_sanitizer($_POST['mood_name'], '', 'mood_name', TRUE), "mood_description" => form_sanitizer($_POST['mood_description'], '', 'mood_description', TRUE), "mood_icon" => form_sanitizer($_POST['mood_icon'], '', 'mood_icon'), "mood_status" => form_sanitizer($_POST['mood_status'], '', 'mood_status'), "mood_notify" => form_sanitizer($_POST['mood_notify'], '', 'mood_notify'), "mood_access" => form_sanitizer($_POST['mood_access'], '', 'mood_access'));
if (\defender::safe()) {
if (!empty($this->data['mood_id'])) {
dbquery_insert(DB_FORUM_MOODS, $this->data, 'update');
addNotice('success', $locale['forum_notice_16']);
} else {
dbquery_insert(DB_FORUM_MOODS, $this->data, 'save');
addNotice('success', $locale['forum_notice_15']);
}
redirect(clean_request('', array('mood_id', 'ref'), FALSE));
}
}
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:23,代码来源:mood.php
示例5: post_mood
public function post_mood()
{
$response = FALSE;
// this is general single static output
if (isset($_POST['post_mood']) && isnum($_POST['post_mood'])) {
// if is a valid mood
// insert into post notify
$notify_data = array('post_id' => form_sanitizer($_POST['post_id'], 0, 'post_id'), 'notify_mood_id' => intval($_POST['post_mood']), 'notify_datestamp' => time(), 'notify_user' => form_sanitizer($_POST['post_author'], 0, 'post_author'), 'notify_sender' => fusion_get_userdata('user_id'), 'notify_status' => 1);
if (\defender::safe() && dbcount('(mood_id)', DB_FORUM_MOODS, "mood_id='" . $notify_data['notify_mood_id'] . "'") && !$this->mood_exists($notify_data['notify_sender'], $notify_data['notify_mood_id'], $notify_data['post_id'])) {
dbquery_insert(DB_POST_NOTIFY, $notify_data, 'save');
$response = TRUE;
}
} elseif (isset($_POST['unpost_mood']) && isnum($_POST['unpost_mood'])) {
// if is a valid mood
// insert into post notify
$notify_data = array('post_id' => form_sanitizer($_POST['post_id'], 0, 'post_id'), 'notify_mood_id' => intval($_POST['unpost_mood']), 'notify_user' => form_sanitizer($_POST['post_author'], 0, 'post_author'), 'notify_sender' => fusion_get_userdata('user_id'));
if (\defender::safe() && dbcount('(mood_id)', DB_FORUM_MOODS, "mood_id='" . $notify_data['notify_mood_id'] . "'") && $this->mood_exists($notify_data['notify_sender'], $notify_data['notify_mood_id'], $notify_data['post_id'])) {
dbquery("DELETE FROM " . DB_POST_NOTIFY . " WHERE post_id=" . $notify_data['post_id'] . "\n AND notify_mood_id=" . $notify_data['notify_mood_id'] . "\n AND notify_user=" . $notify_data['notify_user'] . "\n AND notify_sender=" . $notify_data['notify_sender']);
$response = TRUE;
}
}
return (bool) $response;
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:23,代码来源:mood.php
示例6: addNotice
if (!empty($result)) {
addNotice("danger", $locale['blog_0522'] . "-<span class='small'>" . $locale['blog_0523'] . "</span>");
redirect(FUSION_SELF . $aidlink);
} else {
$result = dbquery("DELETE FROM " . DB_BLOG_CATS . " WHERE blog_cat_id='" . intval($_GET['cat_id']) . "'");
addNotice("success", $locale['blog_0524b']);
redirect(FUSION_SELF . $aidlink);
}
redirect(clean_request("", array("action"), FALSE));
}
$data = array("blog_cat_id" => 0, "blog_cat_name" => "", "blog_cat_hidden" => array(), "blog_cat_parent" => 0, "blog_cat_image" => "", "blog_cat_language" => LANGUAGE);
$formAction = FUSION_REQUEST;
$formTitle = $locale['blog_0409'];
// if edit, override $data
if (isset($_POST['save_cat'])) {
$inputArray = array("blog_cat_id" => form_sanitizer($_POST['blog_cat_id'], "", "blog_cat_id"), "blog_cat_name" => form_sanitizer($_POST['blog_cat_name'], "", "blog_cat_name"), "blog_cat_parent" => form_sanitizer($_POST['blog_cat_parent'], 0, "blog_cat_parent"), "blog_cat_image" => form_sanitizer($_POST['blog_cat_image'], "", "blog_cat_image"), "blog_cat_language" => form_sanitizer($_POST['blog_cat_language'], LANGUAGE, "blog_cat_language"));
$categoryNameCheck = array("when_updating" => "blog_cat_name='" . $inputArray['blog_cat_name'] . "' and blog_cat_id !='" . $inputArray['blog_cat_id'] . "' " . (multilang_table("BL") ? "and blog_cat_language = '" . LANGUAGE . "'" : ""), "when_saving" => "blog_cat_name='" . $inputArray['blog_cat_name'] . "' " . (multilang_table("BL") ? "and blog_cat_language = '" . LANGUAGE . "'" : ""));
if (defender::safe()) {
// check category name is unique when updating
if (dbcount("(blog_cat_id)", DB_BLOG_CATS, "blog_cat_id='" . $inputArray['blog_cat_id'] . "'")) {
if (!dbcount("(blog_cat_id)", DB_BLOG_CATS, $categoryNameCheck['when_updating'])) {
dbquery_insert(DB_BLOG_CATS, $inputArray, "update");
addNotice("success", $locale['blog_0521']);
// FUSION_REQUEST without the "action" gets
redirect(clean_request("", array("action"), FALSE));
} else {
addNotice('danger', $locale['blog_0561']);
}
} else {
// check category name is unique when saving new
if (!dbcount("(blog_cat_id)", DB_BLOG_CATS, $categoryNameCheck['when_saving'])) {
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:blog_cat.php
示例7: dbarray
$data = dbarray($result);
$submit_criteria = unserialize($data['submit_criteria']);
$callback_data = array("article_subject" => $submit_criteria['article_subject'], "article_cat" => $submit_criteria['article_cat'], "article_keywords" => $submit_criteria['article_keywords'], "article_visibility" => 0, "article_language" => $submit_criteria['article_language'], "article_snippet" => parse_textarea($submit_criteria['article_snippet']), "article_article" => parse_textarea($submit_criteria['article_article']), "article_breaks" => !fusion_get_settings("tinyce_enabled") ? TRUE : FALSE, "article_draft" => FALSE, "article_datestamp" => $data['submit_datestamp']);
add_to_title($locale['global_200'] . $locale['global_201'] . $callback_data['article_subject'] . "?");
if (isset($_POST['preview'])) {
$article_snippet = "";
if ($_POST['article_snippet']) {
$article_snippet = parse_textarea($_POST['article_snippet']);
$article_snippet = str_replace("src='" . str_replace("../", "", IMAGES_A), "src='" . IMAGES_A, $article_snippet);
}
$article_article = "";
if ($_POST['article_article']) {
$article_article = parse_textarea($_POST['article_article']);
$article_article = str_replace("src='" . str_replace("../", "", IMAGES_A), "src='" . IMAGES_A, $article_article);
}
$callback_data = array("article_subject" => form_sanitizer($_POST['article_subject'], '', 'article_subject'), "article_cat" => isnum($_POST['article_cat']) ? $_POST['article_cat'] : 0, "article_language" => form_sanitizer($_POST['article_language'], '', 'article_language'), "article_snippet" => form_sanitizer($article_snippet, "", "article_snippet"), "article_article" => form_sanitizer($article_article, "", "article_article"), "article_keywords" => form_sanitizer($_POST['article_keywords'], '', 'article_keywords'), "article_visibility" => isnum($_POST['article_visibility']) ? $_POST['article_visibility'] : "0", "article_draft" => isset($_POST['article_draft']) ? TRUE : FALSE, "article_datestamp" => $callback_data['article_datestamp']);
$callback_data['article_breaks'] = "";
$callback_data['article_snippet'] = parse_textarea($callback_data['article_snippet']);
$callback_data['article_article'] = parse_textarea($callback_data['article_article']);
if (isset($_POST['article_breaks'])) {
$callback_data['article_breaks'] = TRUE;
$callback_data['article_snippet'] = nl2br($callback_data['article_snippet']);
if ($callback_data['article_article']) {
$callback_data['article_article'] = nl2br($callback_data['article_article']);
}
}
if (defender::safe()) {
echo openmodal('article_preview', $locale['articles_0240']);
echo "<h3>" . $callback_data['article_snippet'] . "</h3>\n";
echo $callback_data['article_snippet'];
echo "<hr/>\n";
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:article_submissions.php
示例8: showcomments
/**
* @param $comment_type - abbr or short ID
* @param $comment_db - Current Application DB - DB_BLOG for example.
* @param $comment_col - current sql primary key column - 'blog_id' for example
* @param $comment_item_id - current sql primary key value '$_GET['blog_id']' for example
* @param $clink - current page link 'FUSION_SELF' is ok.
*/
function showcomments($comment_type, $comment_db, $comment_col, $comment_item_id, $clink)
{
global $settings, $locale, $userdata, $aidlink;
$link = FUSION_SELF . (FUSION_QUERY ? "?" . FUSION_QUERY : "");
$link = preg_replace("^(&|\\?)c_action=(edit|delete)&comment_id=\\d*^", "", $link);
$_GET['comment'] = isset($_GET['comment']) && isnum($_GET['comment']) ? $_GET['comment'] : 0;
$cpp = $settings['comments_per_page'];
if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "delete") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_name='" . $userdata['user_id'] . "'")) {
$result = dbquery("DELETE FROM " . DB_COMMENTS . "\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : "\n\t\t\t\tAND comment_name='" . $userdata['user_id'] . "'"));
}
redirect($clink . ($settings['comments_sorting'] == "ASC" ? "" : "&c_start=0"));
}
if ($settings['comments_enabled'] == "1") {
if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) {
if (!iMEMBER && $settings['guestpost'] == 1) {
if (!isset($_POST['comment_name'])) {
redirect($link);
}
if (isnum($_POST['comment_name'])) {
$_POST['comment_name'] = '';
}
$_CAPTCHA_IS_VALID = FALSE;
include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_check.php";
if (!isset($_POST['captcha_code']) || $_CAPTCHA_IS_VALID == FALSE) {
redirect($link);
}
}
$comment_data = array('comment_id' => isset($_GET['comment_id']) && isnum($_GET['comment_id']) ? $_GET['comment_id'] : 0, 'comment_name' => iMEMBER ? $userdata['user_id'] : form_sanitizer($_POST['comment_name'], '', 'comment_name'), 'comment_message' => form_sanitizer($_POST['comment_message'], '', 'comment_message'), 'comment_datestamp' => time(), 'comment_item_id' => $comment_item_id, 'comment_type' => $comment_type, 'comment_cat' => 0, 'comment_ip' => USER_IP, 'comment_ip_type' => USER_IP_TYPE, 'comment_hidden' => 0);
if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && $comment_data['comment_id']) {
$comment_updated = FALSE;
if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $comment_data['comment_id'] . "' \n\t\t\t\tAND comment_item_id='" . $comment_item_id . "'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tAND comment_type='" . $comment_type . "' \n\t\t\t\tAND comment_name='" . $userdata['user_id'] . "' \n\t\t\t\tAND comment_hidden='0'")) {
dbquery_insert(DB_COMMENTS, $comment_data, 'update');
if ($comment_data['comment_message']) {
$result = dbquery("UPDATE " . DB_COMMENTS . " SET comment_message='" . $comment_data['comment_message'] . "'\n \t\t\t\t\t\t\t\t\t WHERE comment_id='" . $_GET['comment_id'] . "' " . (iADMIN ? "" : "AND comment_name='" . $userdata['user_id'] . "'"));
if ($result) {
$comment_updated = TRUE;
}
}
}
if ($comment_updated) {
if ($settings['comments_sorting'] == "ASC") {
$c_operator = "<=";
} else {
$c_operator = ">=";
}
$c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_id" . $c_operator . "'" . $comment_data['comment_id'] . "'\n\t\t\t\t\t\t\t\tAND comment_item_id='" . $comment_item_id . "'\n\t\t\t\t\t\t\t\tAND comment_type='" . $comment_type . "'");
$c_start = (ceil($c_count / $cpp) - 1) * $cpp;
}
redirect($clink . "&c_start=" . (isset($c_start) && isnum($c_start) ? $c_start : ""));
} else {
if (!dbcount("(" . $comment_col . ")", $comment_db, $comment_col . "='" . $comment_item_id . "'")) {
redirect(BASEDIR . "index.php");
}
$id = 0;
if ($comment_data['comment_name'] && $comment_data['comment_message']) {
require_once INCLUDES . "flood_include.php";
if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='" . USER_IP . "'")) {
dbquery_insert(DB_COMMENTS, $comment_data, 'save');
$id = dblastid();
}
}
if ($settings['comments_sorting'] == "ASC") {
$c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "'");
$c_start = (ceil($c_count / $cpp) - 1) * $cpp;
} else {
$c_start = 0;
}
//if (!$settings['site_seo']) {
redirect($clink . "&c_start=" . $c_start . "#c" . $id);
//}
}
}
$c_arr = array("c_con" => array(), "c_info" => array("c_makepagenav" => FALSE, "admin_link" => FALSE));
$c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "' AND comment_hidden='0'");
if (!isset($_GET['c_start']) && $c_rows > $cpp) {
$_GET['c_start'] = (ceil($c_rows / $cpp) - 1) * $cpp;
}
if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) {
$_GET['c_start'] = 0;
}
$result = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcm.comment_datestamp,\n\t\t\t\t\ttcu.user_id, tcu.user_name, tcu.user_avatar, tcu.user_status\n\t\t\t\t\tFROM " . DB_COMMENTS . " tcm\n\t\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\t\t\tWHERE comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "' AND comment_hidden='0'\n\t\t\t\t\tORDER BY comment_datestamp " . $settings['comments_sorting'] . " LIMIT " . $_GET['c_start'] . "," . $cpp);
if (dbrows($result) > 0) {
$i = $settings['comments_sorting'] == "ASC" ? $_GET['c_start'] + 1 : $c_rows - $_GET['c_start'];
if ($c_rows > $cpp) {
$c_arr['c_info']['c_makepagenav'] = makepagenav($_GET['c_start'], $cpp, $c_rows, 3, $clink . "&", "c_start");
}
while ($data = dbarray($result)) {
$c_arr['c_con'][$i]['comment_id'] = $data['comment_id'];
$c_arr['c_con'][$i]['edit_dell'] = FALSE;
$c_arr['c_con'][$i]['i'] = $i;
if ($data['user_name']) {
$c_arr['c_con'][$i]['comment_name'] = profile_link($data['comment_name'], $data['user_name'], $data['user_status'], 'strong text-dark');
//.........这里部分代码省略.........
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:101,代码来源:comments_include.php
示例9: dbquery
$result = dbquery("DELETE FROM " . DB_FAQ_CATS . " WHERE faq_cat_id='" . intval($_GET['cat_id']) . "'");
addNotice("success", $locale['faq_0206']);
redirect(FUSION_SELF . $aidlink);
}
}
$data = array("faq_cat_id" => 0, "faq_cat_name" => "", "faq_cat_description" => "", "faq_cat_language" => LANGUAGE);
if ($faqCat_edit) {
$result = dbquery("select * from " . DB_FAQ_CATS . " WHERE faq_cat_id='" . intval($_GET['cat_id']) . "'");
if (dbrows($result) > 0) {
$data = dbarray($result);
} else {
redirect(FUSION_SELF . $aidlink);
}
}
if (isset($_POST['save_cat'])) {
$data = array("faq_cat_id" => form_sanitizer($_POST['faq_cat_id'], 0, "faq_cat_id"), "faq_cat_name" => form_sanitizer($_POST['faq_cat_name'], "", "faq_cat_name"), "faq_cat_description" => form_sanitizer($_POST['faq_cat_description'], "", "faq_cat_description"), "faq_cat_language" => form_sanitizer($_POST['faq_cat_language'], "", "faq_cat_language"));
if (defender::safe()) {
if (dbcount("(faq_cat_id)", DB_FAQ_CATS, "faq_cat_id='" . $data['faq_cat_id'] . "'")) {
dbquery_insert(DB_FAQ_CATS, $data, "update");
addNotice("success", $locale['faq_0205']);
} else {
dbquery_insert(DB_FAQ_CATS, $data, "save");
addNotice("success", $locale['faq_0204']);
}
redirect(FUSION_SELF . $aidlink);
}
}
echo openform('faqCat_form', 'post', FUSION_REQUEST, array("class" => "m-t-20"));
echo form_hidden('faq_cat_id', "", $data['faq_cat_id']);
echo form_text('faq_cat_name', $locale['faq_0200'], $data['faq_cat_name'], array('error_text' => $locale['faq_0201'], 'required' => 1));
echo form_text('faq_cat_description', $locale['faq_0202'], $data['faq_cat_description']);
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:faq_cats.php
示例10: elseif
$message = $locale['402'];
} elseif ($_GET['status'] == "remall") {
$message = $locale['403'];
} elseif ($_GET['status'] == "addsel") {
$message = $locale['404'];
} elseif ($_GET['status'] == "deln") {
$message = $locale['405'] . "<br />\n<span class='small'>" . $locale['406'] . "</span>";
} elseif ($_GET['status'] == "dely") {
$message = $locale['407'];
}
if ($message) {
echo "<div id='close-message'><div class='admin-message alert alert-info m-t-10'>" . $message . "</div></div>\n";
}
}
if (isset($_POST['save_group'])) {
$group_name = form_sanitizer($_POST['group_name'], '', 'group_name');
$group_description = stripinput($_POST['group_description']);
if (!defined('FUSION_NULL')) {
if (isset($_GET['group_id']) && isnum($_GET['group_id'])) {
$result = dbquery("UPDATE " . DB_USER_GROUPS . " SET group_name='{$group_name}', group_description='{$group_description}' WHERE group_id='" . $_GET['group_id'] . "'");
redirect(FUSION_SELF . $aidlink . "&status=su");
} else {
$result = dbquery("INSERT INTO " . DB_USER_GROUPS . " (group_name, group_description) VALUES ('{$group_name}', '{$group_description}')");
redirect(FUSION_SELF . $aidlink . "&status=sn");
}
}
} elseif (isset($_POST['add_sel']) && isnum($_GET['group_id'])) {
$user_ids = "";
$check_count = 0;
if (isset($_POST['add_check_mark'])) {
if (is_array($_POST['add_check_mark']) && count($_POST['add_check_mark']) > 1) {
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:user_groups.php
示例11: die
die("Access Denied");
}
pageAccess("W");
if (fusion_get_settings("tinymce_enabled")) {
echo "<script language='javascript' type='text/javascript'>advanced();</script>\n";
}
$result = dbcount("(weblink_cat_id)", DB_WEBLINK_CATS);
if (!empty($result)) {
$data = array("weblink_id" => 0, "weblink_name" => "", "weblink_cat" => 0, "weblink_description" => "", "weblink_visibility" => iGUEST, "weblink_url" => "", "weblink_datestamp" => time());
if (isset($_GET['action']) && $_GET['action'] == "delete" && (isset($_GET['weblink_id']) && isnum($_GET['weblink_id']))) {
$result = dbquery("DELETE FROM " . DB_WEBLINKS . " WHERE weblink_id='" . $_GET['weblink_id'] . "'");
addNotice("success", $locale['wl_0302']);
redirect(FUSION_SELF . $aidlink);
}
if (isset($_POST['save_link'])) {
$data = array("weblink_id" => form_sanitizer($_POST['weblink_id'], 0, 'weblink_id'), "weblink_cat" => form_sanitizer($_POST['weblink_cat'], 0, 'weblink_cat'), "weblink_name" => form_sanitizer($_POST['weblink_name'], '', 'weblink_name'), "weblink_description" => form_sanitizer($_POST['weblink_description'], '', 'weblink_description'), "weblink_visibility" => form_sanitizer($_POST['weblink_visibility'], '0', 'weblink_visibility'), "weblink_url" => form_sanitizer($_POST['weblink_url'], '', 'weblink_url'), "weblink_datestamp" => form_sanitizer($_POST['weblink_datestamp'], '', 'weblink_datestamp'));
if (defender::safe()) {
if (dbcount("(weblink_id)", DB_WEBLINKS, "weblink_id='" . intval($data['weblink_id']) . "'")) {
$data['weblink_datestamp'] = isset($_POST['update_datestamp']) ? time() : $data['weblink_datestamp'];
dbquery_insert(DB_WEBLINKS, $data, "update");
addNotice("success", $locale['wl_0301']);
redirect(FUSION_SELF . $aidlink);
} else {
dbquery_insert(DB_WEBLINKS, $data, "save");
addNotice("success", $locale['wl_0300']);
redirect(FUSION_SELF . $aidlink);
}
}
}
if ($weblink_edit) {
$result = dbquery("SELECT * FROM " . DB_WEBLINKS . " WHERE weblink_id='" . intval($_GET['weblink_id']) . "'");
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:weblinks.php
示例12: str_replace
echo "<div class='well text-center'><p><strong>" . $locale['news_0701'] . "</strong></p>";
echo "<p><a href='submit.php?stype=n'>" . $locale['news_0702'] . "</a></p>";
echo "<p><a href='index.php'>" . str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['news_0704']) . "</a></p>\n";
echo "</div>\n";
} else {
// Preview
if (isset($_POST['preview_news'])) {
$news_snippet = "";
if ($_POST['news_news']) {
$news_snippet = parse_textarea($_POST['news_news']);
}
$news_body = "";
if ($_POST['news_body']) {
$news_body = parse_textarea($_POST['news_body']);
}
$criteriaArray = array("news_subject" => form_sanitizer($_POST['news_subject'], "", "news_subject"), "news_language" => form_sanitizer($_POST['news_language'], "", "news_language"), "news_ialign" => form_sanitizer($_POST['news_ialign'], "", "news_ialign"), "news_keywords" => form_sanitizer($_POST['news_keywords'], "", "news_keywords"), "news_cat" => form_sanitizer($_POST['news_cat'], 0, "news_cat"), "news_snippet" => form_sanitizer($_POST['news_news'], "", "news_news"), "news_body" => form_sanitizer($_POST['news_body'], "", "news_body"));
opentable($criteriaArray['news_subject']);
echo $locale['news_0203'] . " " . nl2br(parseubb($news_snippet)) . "<br /><br />";
echo $locale['news_0204'] . " " . nl2br(parseubb($news_body));
closetable();
}
add_to_title($locale['global_200'] . $locale['news_0400']);
echo "<div class='panel panel-default tbl-border'>\n<div class='panel-body'>\n";
echo "<div class='alert alert-info m-b-20 submission-guidelines'>" . str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['news_0703']) . "</div>\n";
echo openform('submit_form', 'post', BASEDIR . "submit.php?stype=n", array("enctype" => $news_settings['news_allow_submission_files'] ? TRUE : FALSE));
echo form_text('news_subject', $locale['news_0200'], $criteriaArray['news_subject'], array("required" => TRUE, "inline" => TRUE));
if (multilang_table("NS")) {
echo form_select('news_language', $locale['global_ML100'], $criteriaArray['news_language'], array("options" => fusion_get_enabled_languages(), "placeholder" => $locale['choose'], "width" => "250px", "inline" => TRUE));
} else {
echo form_hidden('news_language', '', $criteriaArray['news_language']);
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:news_submit.php
示例13: str_replace
echo "<p><a href='index.php'>" . str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['articles_0064']) . "</a></p>\n";
echo "</div>\n";
} else {
// Preview
if (isset($_POST['preview_article'])) {
$article_snippet = "";
if ($_POST['article_snippet']) {
$article_snippet = str_replace("src='" . str_replace("../", "", IMAGES_A), "src='" . IMAGES_A, parseubb(stripslashes($_POST['article_snippet'])));
$article_snippet = parse_textarea($article_snippet);
}
$article_article = "";
if ($_POST['article_article']) {
$article_article = str_replace("src='" . str_replace("../", "", IMAGES_A), "src='" . IMAGES_A, parseubb(stripslashes($_POST['article_article'])));
$article_article = parse_textarea($article_article);
}
$criteriaArray = array("article_subject" => form_sanitizer($_POST['article_subject'], "", "article_subject"), "article_cat" => form_sanitizer($_POST['article_cat'], 0, "article_cat"), "article_snippet" => form_sanitizer($article_snippet, "", "article_snippet"), "article_article" => form_sanitizer($article_article, "", "article_article"), "article_keywords" => form_sanitizer($_POST['article_keywords'], "", "article_keywords"), "article_language" => form_sanitizer($_POST['article_language'], "", "article_language"));
$criteriaArray['article_snippet'] = parse_textarea($article_snippet);
$criteriaArray['article_article'] = parse_textarea($article_article);
opentable($criteriaArray['article_subject']);
echo "<p class='text-bigger'>" . $criteriaArray['article_snippet'] . "</p>";
echo $criteriaArray['article_article'];
closetable();
}
add_to_title($locale['global_200'] . $locale['articles_0060']);
echo "<div class='panel panel-default tbl-border'>\n<div class='panel-body'>\n";
echo "<div class='alert alert-info m-b-20 submission-guidelines'>" . str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['articles_0063']) . "</div>\n";
echo openform('submit_form', 'post', BASEDIR . "submit.php?stype=a");
echo form_text('article_subject', $locale['articles_0304'], $criteriaArray['article_subject'], array("required" => TRUE, "inline" => TRUE));
if (multilang_table("AR")) {
echo form_select('article_language', $locale['global_ML100'], $criteriaArray['article_language'], array("options" => fusion_get_enabled_languages(), "placeholder" => $locale['choose'], "width" => "250px", "inline" => TRUE));
} else {
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:article_submit.php
示例14: Chan
+--------------------------------------------------------+
| Filename: admin/blog_settings.php
| Author: Frederick MC Chan (Chan)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
pageAccess("S8");
if (isset($_POST['savesettings'])) {
$error = 0;
$inputArray = array("article_pagination" => form_sanitizer($_POST['article_pagination'], 0, "article_pagination"), "article_allow_submission" => form_sanitizer($_POST['article_allow_submission'], 0, "article_allow_submission"), "article_extended_required" => isset($_POST['article_extended_required']) ? 1 : 0);
if (defender::safe()) {
foreach ($inputArray as $settings_name => $settings_value) {
$inputSettings = array("settings_name" => $settings_name, "settings_value" => $settings_value, "settings_inf" => "article");
dbquery_insert(DB_SETTINGS_INF, $inputSettings, "update", array("primary_key" => "settings_name"));
}
addNotice("success", $locale['900']);
redirect(FUSION_REQUEST);
} else {
addNotice('danger', $locale['901']);
}
}
echo "<div class='well'>" . $locale['articles_0031'] . "</div>";
echo openform('settingsform', 'post', FUSION_REQUEST);
openside('');
echo form_text("article_pagination", $locale['articles_0032'], $article_settings['article_pagination'], array("inline" => TRUE, "max_length" => 4, "width" => "150px", "type" => "number"));
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:article_settings.php
示例15: array
$input = array('mailname' => '', 'email' => '', 'subject' => '', 'message' => '', 'captcha_code' => '');
if (isset($_POST['sendmessage'])) {
foreach ($input as $key => $value) {
if (isset($_POST[$key])) {
// Subject needs 'special' treatment
if ($key == 'subject') {
$input['subject'] = substr(str_replace(array("\r", "\n", "@"), "", descript(stripslash(trim($_POST['subject'])))), 0, 128);
// most unique in the entire CMS. keep.
$input['subject'] = form_sanitizer($input['subject'], $input[$key], $key);
// Others don't
} else {
$input[$key] = form_sanitizer($_POST[$key], $input[$key], $key);
}
// Input not posted, fallback to the default
} else {
$input[$key] = form_sanitizer($input[$key], $input[$key], $key);
}
}
$_CAPTCHA_IS_VALID = FALSE;
include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_check.php";
// Dynamics need to develop Captcha. Before that, use method 2.
if ($_CAPTCHA_IS_VALID == FALSE) {
$defender->stop();
addNotice('warning', $locale['424']);
}
if (!defined('FUSION_NULL')) {
require_once INCLUDES . "sendmail_include.php";
$template_result = dbquery("\n\t\t\tSELECT template_key, template_active, template_sender_name, template_sender_email\n\t\t\tFROM " . DB_EMAIL_TEMPLATES . "\n\t\t\tWHERE template_key='CONTACT'\n\t\t\tLIMIT 1");
if (dbrows($template_result)) {
$template_data = dbarray($template_result);
if ($template_data['template_active'] == "1") {
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:contact.php
示例16: unlink
unlink(IMAGES_G . $pData['album_image']);
}
if ($pData['album_thumb1'] && file_exists(IMAGES_G . $pData['album_thumb1'])) {
unlink(IMAGES_G_T . $pData['album_thumb1']);
}
if ($pData['album_thumb2'] && file_exists(IMAGES_G . $pData['album_thumb2'])) {
unlink(IMAGES_G_T . $pData['album_thumb2']);
}
$data['album_image'] = "";
$data['album_thumb1'] = "";
$data['album_thumb2'] = "";
}
} else {
$data['album_image'] = form_sanitizer(isset($_POST['album_image']) ? $_POST['album_image'] : "", "", "album_image");
$data['album_thumb2'] = form_sanitizer(isset($_POST['album_thumb2']) ? $_POST['album_thumb2'] : "", "", "album_thumb2");
$data['album_thumb1'] = form_sanitizer(isset($_POST['album_thumb1']) ? $_POST['album_thumb1'] : "", "", "album_thumb1");
}
}
}
if (defender::safe()) {
if (dbcount("(album_id)", DB_PHOTO_ALBUMS, "album_id='" . intval($data['album_id']) . "'")) {
// update album
$result = dbquery_order(DB_PHOTO_ALBUMS, $data['album_order'], 'album_order', $data['album_id'], 'album_id', FALSE, FALSE, TRUE, 'album_language', 'update');
dbquery_insert(DB_PHOTO_ALBUMS, $data, "update");
addNotice('success', $locale['album_0013']);
redirect(FUSION_SELF . $aidlink);
} else {
// create album
$result = dbquery_order(DB_PHOTO_ALBUMS, $data['album_order'], 'album_order', 0, "album_id", FALSE, FALSE, TRUE, 'album_language', 'save');
dbquery_insert(DB_PHOTO_ALBUMS, $data, "save");
addNotice('success', $locale['album_0014']);
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:galle |
请发表评论