Example #1
0
function showRatings($post, $userfrom, $userto, $wrapper = true)
{
    global $ratingsExist;
    $types = dbquery("select * from " . DB_PREFIX . "fb_rate_type");
    if ($userfrom !== $userto && dbrows($types)) {
        if ($wrapper) {
            echo "<div style='float:right;' id='rb_" . $post . "'>";
        }
        echo "<span id='ratename{$post}' class='small'></span>&nbsp;\n";
        while ($type = dbarray($types)) {
            if (!dbrows(dbquery("select * from " . DB_PREFIX . "fb_rate where rate_type='" . $type['type_id'] . "' and rate_user='******' and rate_post='{$post}' and rate_by='{$userfrom}'"))) {
                echo "<span onMouseOver='document.getElementById(\"ratename{$post}\").innerHTML=\"" . stripslash($type['type_name']) . "\";' onMouseOut='document.getElementById(\"ratename{$post}\").innerHTML=\" \"' onClick='giveRating({$post}, {$userfrom}, {$userto}, " . $type['type_id'] . ");'><img src='" . INFUSIONS . "fusionboard4/images/forum_icons/" . $type['type_icon'] . "' alt='" . stripslash($type['type_name']) . "' title='" . stripslash($type['type_name']) . "' style='vertical-align:middle;cursor:pointer;' /></span>\n";
            }
        }
        if ($wrapper) {
            echo "</div>\n";
        }
    }
}
function post_ratings_do($post, $userfrom, $userto, $wrapper = true)
{
    global $post_rating_type_cache;
    #, $post_rating_cache;
    $res = '';
    if (!$post_rating_type_cache) {
        cache_post_ratings_type();
    }
    if ($userfrom !== $userto && is_array($post_rating_type_cache) && count($post_rating_type_cache)) {
        if ($wrapper) {
            $res .= "<div style='float:right;' id='rb_" . $post . "'>";
        }
        $res .= "<span id='ratename{$post}' class='small'></span>&nbsp;\n";
        foreach ($post_rating_type_cache as $type) {
            if (!dbrows(dbquery("SELECT * from " . DB_POST_RATINGS . " where rate_type='" . $type['type_id'] . "' and rate_user='******' and rate_post='{$post}' and rate_by='{$userfrom}'"))) {
                $res .= "<span onMouseOver='document.getElementById(\"ratename{$post}\").innerHTML=\"" . stripslash(parseubb($type['type_name'])) . "\";' onMouseOut='document.getElementById(\"ratename{$post}\").innerHTML=\" \"' onclick='giveRating({$post}, {$userfrom}, {$userto}, " . $type['type_id'] . ");'><img src='" . IMAGES . "forum_post_ratings/" . $type['type_icon'] . "' alt='" . stripslash(parseubb($type['type_name'])) . "' title='" . stripslash(parseubb($type['type_name'])) . "' style='vertical-align:middle;cursor:pointer;' /></span>\n";
            }
        }
        if ($wrapper) {
            $res .= "</div>\n";
        }
    }
    return $res;
}
Example #3
0
     if (dbrows($titleLookup)) {
         $titleData = dbarray($titleLookup);
         $title .= "<b>" . stripslash($titleData['title_title']) . "</b>";
     } else {
         $title .= "<b>" . stripslash($data['user_title']) . "</b>";
     }
     if ($settings['forum_ranks'] || $fb4['show_ulevel']) {
         $title .= " :: ";
     }
 }
 echo "</span><br /><br />\n";
 renderAwards($data['user_id'], "", "<br /><br />");
 echo "<!--forum_thread_user_info--><span class='small'><strong>" . $locale['502'] . "</strong> " . $data['user_posts'] . "</span><br />\n";
 echo "<span class='small'><strong>" . $locale['504'] . "</strong> " . showdate("%d.%m.%y", $data['user_joined']) . "</span>\n";
 if ($data['user_location']) {
     echo "<br /><span class='small'><strong>" . $locale['fb500'] . ":</strong> " . stripslash($data['user_location']) . "</span>\n";
 }
 if ($data['user_birthdate'] !== "0000-00-00") {
     $birthday = explode("-", $data['user_birthdate']);
     $age = strftime("%Y") - $birthday[0];
     if (strftime("%m") < $birthday[1]) {
         $age--;
     } elseif (strftime("%m") == $birthday[1]) {
         if (strftime("%d") < $birthday[2]) {
             $age--;
         }
     }
     echo "<br /><span class='small'><strong>" . $locale['fb512'] . "</strong> {$age}</span>\n";
 }
 echo showWarning($data['user_id']);
 echo "<br /></td>";
Example #4
0
    $error = 0;
    $result = dbquery("UPDATE " . DB_SETTINGS . " SET settings_value='" . addslash($_POST['sitebanner1']) . "' WHERE settings_name='sitebanner1'");
    if (!$result) {
        $error = 1;
    }
    $result = dbquery("UPDATE " . DB_SETTINGS . " SET settings_value='" . addslash($_POST['sitebanner2']) . "' WHERE settings_name='sitebanner2'");
    if (!$result) {
        $error = 1;
    }
    redirect(FUSION_SELF . $aidlink . "&error=" . $error, TRUE);
}
if (isset($_POST['preview_banners'])) {
    $sitebanner1 = "";
    $sitebanner2 = "";
    $sitebanner1 = stripslash($_POST['sitebanner1']);
    $sitebanner2 = stripslash($_POST['sitebanner2']);
} else {
    $sitebanner1 = stripslashes($settings['sitebanner1']);
    $sitebanner2 = stripslashes($settings['sitebanner2']);
}
opentable($locale['850']);
echo openform("banner_form", "post", FUSION_REQUEST);
echo form_textarea('sitebanner1', $locale['851'], $sitebanner1, array("type" => "html", "form_name" => "banner_form", "inline" => FALSE));
if (isset($_POST['preview_banners']) && $sitebanner1) {
    eval("?><div class='list-group-item'>" . $sitebanner1 . "</div><?php ");
}
echo form_textarea('sitebanner2', $locale['852'], $sitebanner2, array("type" => "html", "form_name" => "banner_form", "inline" => FALSE));
if (isset($_POST['preview_banners']) && $sitebanner2) {
    eval("?><div class='list-group-item'>" . $sitebanner2 . "</div><?php ");
}
echo form_button('preview_banners', $locale['855'], $locale['855'], array('class' => 'btn-default m-r-10'));
Example #5
0
| 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).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/settings.php";
if (!checkrights("S1") || !defined("iAUTH") || $_GET['aid'] != iAUTH) {
    redirect("../index.php");
}
if (isset($_POST['savesettings'])) {
    $error = 0;
    $siteintro = descript(stripslash($_POST['intro']));
    $sitefooter = descript(stripslash($_POST['footer']));
    $localeset = stripinput($_POST['localeset']);
    $old_localeset = stripinput($_POST['old_localeset']);
    $result = dbquery("UPDATE " . DB_SETTINGS . " SET\n\t\tsitename='" . stripinput($_POST['sitename']) . "',\n\t\tsiteurl='" . stripinput($_POST['siteurl']) . (strrchr($_POST['siteurl'], "/") != "/" ? "/" : "") . "',\n\t\tsitebanner='" . stripinput($_POST['sitebanner']) . "',\n\t\tsiteemail='" . stripinput($_POST['siteemail']) . "',\n\t\tsiteusername='******'username']) . "',\n\t\tsiteintro='" . addslashes(addslashes($siteintro)) . "',\n\t\tdescription='" . stripinput($_POST['description']) . "',\n\t\tkeywords='" . stripinput($_POST['keywords']) . "',\n\t\tfooter='" . addslashes(addslashes($sitefooter)) . "',\n\t\topening_page='" . stripinput($_POST['opening_page']) . "',\n\t\tnews_style='" . (isnum($_POST['news_style']) ? $_POST['news_style'] : "0") . "',\n\t\tlocale='{$localeset}',\n\t\ttheme='" . stripinput($_POST['theme']) . "',\n\t\tdefault_search='" . stripinput($_POST['default_search']) . "',\n\t\texclude_left='" . stripinput($_POST['exclude_left']) . "',\n\t\texclude_upper='" . stripinput($_POST['exclude_upper']) . "',\n\t\texclude_lower='" . stripinput($_POST['exclude_lower']) . "',\n\t\texclude_right='" . stripinput($_POST['exclude_right']) . "'\n\t");
    if (!$result) {
        $error = 1;
    }
    if ($localeset != $old_localeset && !$error) {
        include LOCALE . $localeset . "/admin/main.php";
        $result = dbquery("UPDATE " . DB_ADMIN . " SET admin_title='" . $locale['201'] . "' WHERE admin_link='administrators.php'");
        if (!$result) {
            $error = 1;
        }
        $result = dbquery("UPDATE " . DB_ADMIN . " SET admin_title='" . $locale['202'] . "' WHERE admin_link='article_cats.php'");
        if (!$result) {
            $error = 1;
Example #6
0
function stripinput($text)
{
    if (!is_array($text)) {
        $text = stripslash(trim($text));
        $text = preg_replace("/(&amp;)+(?=\\#([0-9]{2,3});)/i", "&", $text);
        $search = array("&", "\"", "'", "\\", '\\"', "\\'", "<", ">", "&nbsp;");
        $replace = array("&amp;", "&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&lt;", "&gt;", " ");
        $text = str_replace($search, $replace, $text);
    } else {
        foreach ($text as $key => $value) {
            $text[$key] = stripinput($value);
        }
    }
    return $text;
}
    }
    echo "<td colspan='2' align='center' class='tbl'><input type='submit' class='button' name='ads_save' value='" . $locale['ads_save'] . "' /></td></tr>\n";
    echo "</table>\n";
    echo "</form>\n";
    closetable();
} elseif ($_GET['page'] == 2) {
    if (isset($_POST['ads_save'])) {
        $error = 0;
        if (check_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "")) {
            if (!set_mainsetting('ads_in_name', stripinput($_POST['ads_in_name']))) {
                $error = 1;
            }
            if (!set_mainsetting('ads_in_show', isnum($_POST['ads_in_show']) ? $_POST['ads_in_show'] : "0")) {
                $error = 1;
            }
            if (!set_mainsetting('ads_in_code', addslashes(stripslash($_POST['ads_in_code'])))) {
                $error = 1;
            }
            log_admin_action("admin-3", "admin_adssystem_in_save");
            set_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "");
            redirect(FUSION_SELF . $aidlink . "&amp;page=2&amp;error=" . $error);
        } else {
            redirect(FUSION_SELF . $aidlink . "&amp;page=2&amp;error=2");
        }
    }
    opentable($locale['ads_title']);
    echo $navigation;
    echo "<form name='ads_form' method='post' action='" . FUSION_SELF . $aidlink . "&amp;page=2'>\n";
    echo "<table cellpadding='0' cellspacing='0' width='450' align='center'>\n";
    echo "<tr>\n";
    echo "<td class='tbl'>" . $locale['ads_name'] . "</td>";
Example #8
0
             $forum_description = $data['forum_description'];
             $forum_cat = $data['forum_cat'];
             $forum_access = $data['forum_access'];
             $forum_post = $data['forum_post'];
             $forum_reply = $data['forum_reply'];
             $forum_attach = $data['forum_attach'];
             $forum_poll = $data['forum_poll'];
             $forum_vote = $data['forum_vote'];
             $forum_title = $locale['501'];
             $forum_action = FUSION_SELF . $aidlink . "&section=forums&amp;action=edit&amp;forum_id=" . $data['forum_id'] . "&amp;t=forum";
             $cat_title = $locale['400'];
             $cat_action = FUSION_SELF . $aidlink . "&section=forums";
             $fbResult = dbquery("select * from " . $db_prefix . "fb_forums where forum_id='" . $_GET['forum_id'] . "'");
             if (dbrows($fbResult)) {
                 $fbData = dbarray($fbResult);
                 $forum_icon = stripslash($fbData['forum_icon']);
                 $forum_parent = $fbData['forum_parent'];
             } else {
                 $fbQuery = dbquery("insert into " . $db_prefix . "fb_forums (forum_id, forum_icon) VALUES('" . $_GET['forum_id'] . "', '')");
                 $forum_icon = "";
                 $forum_parent = "";
             }
         } else {
             redirect(FUSION_SELF . $aidlink . "&section=forums");
         }
     }
 } else {
     $cat_name = "";
     $cat_order = "";
     $cat_title = $locale['400'];
     $cat_action = FUSION_SELF . $aidlink . "&section=forums";
Example #9
0
| 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).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "contact.php";
add_to_title($locale['global_200'] . $locale['400']);
if (isset($_POST['sendmessage'])) {
    $error = "";
    $mailname = isset($_POST['mailname']) ? substr(stripinput(trim($_POST['mailname'])), 0, 50) : "";
    $email = isset($_POST['email']) ? substr(stripinput(trim($_POST['email'])), 0, 100) : "";
    $subject = isset($_POST['subject']) ? substr(str_replace(array("\r", "\n", "@"), "", descript(stripslash(trim($_POST['subject'])))), 0, 50) : "";
    $message = isset($_POST['message']) ? descript(stripslash(trim($_POST['message']))) : "";
    if ($mailname == "") {
        $error .= " <span class='alt'>" . $locale['420'] . "</span><br />\n";
    }
    if ($email == "" || !preg_match("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $email)) {
        $error .= " <span class='alt'>" . $locale['421'] . "</span><br />\n";
    }
    if ($subject == "") {
        $error .= " <span class='alt'>" . $locale['422'] . "</span><br />\n";
    }
    if ($message == "") {
        $error .= " <span class='alt'>" . $locale['423'] . "</span><br />\n";
    }
    $_CAPTCHA_IS_VALID = false;
    include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_check.php";
    if ($_CAPTCHA_IS_VALID == false) {
         $data = dbarray($result);
     }
     $result = dbquery("DELETE FROM " . DB_CUSTOM_PAGES . " WHERE page_id='" . $_POST['page_id'] . "'");
     $result = dbquery("DELETE FROM " . DB_SITE_LINKS . " WHERE link_url='viewpage.php?page_id=" . $_POST['page_id'] . "'");
     if ($settings['enable_tags']) {
         delete_tags($_POST['page_id'], "C");
     }
     // Pimped: tag
     log_admin_action("admin-1", "admin_custompage_deleted", "", "", $data['page_title'] . " (ID: " . $_POST['page_id'] . ")");
     redirect(FUSION_SELF . $aidlink . "&status=del");
 } else {
     if (isset($_POST['preview'])) {
         $addlink = isset($_POST['add_link']) ? " checked='checked'" : "";
         $page_title = stripinput($_POST['page_title']);
         $page_access = $_POST['page_access'];
         $page_content = stripslash($_POST['page_content']);
         $page_keywords = $_POST['page_keywords'];
         // meta
         $comments = isset($_POST['page_comments']) ? " checked='checked'" : "";
         $ratings = isset($_POST['page_ratings']) ? " checked='checked'" : "";
         if (check_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "")) {
             log_admin_action("admin-1", "admin_custompage_preview", "", "", $page_title);
             opentable($page_title);
             eval("?>" . $page_content . "<?php ");
             closetable();
             set_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "");
         } else {
             echo "<div id='close-message'><div class='admin-message'>" . $locale['global_182'] . "</div></div>\n";
         }
         $page_content = phpentities($page_content);
     }
/**
 * Strip Input Function, prevents HTML in unwanted places
 * @param string|string[] $text
 * @return string|string[]
 */
function stripinput($text)
{
    if (!is_array($text)) {
        return str_replace('\\', '&#092;', htmlspecialchars(stripslash(trim($text)), ENT_QUOTES));
    }
    foreach ($text as $i => $item) {
        $text[$i] = stripinput($item);
    }
    return $text;
}
Example #12
0
        }
    } else {
        redirect(FUSION_SELF . $aidlink . "&status=pw");
    }
} else {
    if (isset($_POST['delete']) && (isset($_POST['page_id']) && isnum($_POST['page_id']))) {
        $result = dbquery("DELETE FROM " . DB_CUSTOM_PAGES . " WHERE page_id='" . $_POST['page_id'] . "'");
        $result = dbquery("DELETE FROM " . DB_SITE_LINKS . " WHERE link_url='viewpage.php?page_id=" . $_POST['page_id'] . "'");
        redirect(FUSION_SELF . $aidlink . "&status=del");
    } else {
        if (isset($_POST['preview'])) {
            $addlink = isset($_POST['add_link']) ? " checked='checked'" : "";
            $page_title = stripinput($_POST['page_title']);
            $page_access = $_POST['page_access'];
            $page_content = stripslash($_POST['page_content']);
            $page_language = stripslash($_POST['page_language']);
            $comments = isset($_POST['page_comments']) ? " checked='checked'" : "";
            $ratings = isset($_POST['page_ratings']) ? " checked='checked'" : "";
            if (check_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "")) {
                opentable($page_title);
                echo "<div class='panel panel-default'>\n";
                echo "<div class='panel-body'>\n";
                eval("?>" . $page_content . "<?php ");
                echo "</div>\n</div>\n";
                closetable();
                set_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "");
            } else {
                echo "<div id='close-message'><div class='admin-message alert alert-info m-t-10'>" . $locale['global_182'] . "</div></div>\n";
            }
            $page_content = phpentities($page_content);
        }
Example #13
0
        $type_icon = "";
        $action = FUSION_SELF . $aidlink . "&section=ratings";
        $panel = $locale['fb851'];
        $button = $locale['fb853'];
    }
    opentable($panel);
    $iconOpts = makefileopts(makefilelist(INFUSIONS . "fusionboard4/images/forum_icons/", ".|..|index.php|Thumbs.db"), $type_icon);
    echo "<form action='{$action}' name='ratingForm' method='post'>\n\t\t<table width='300' cellspacing='1' cellpadding='0' class='tbl-border center'>\n\t\t<tr>\n\t\t\t<td class='tbl1'>" . $locale['fb855'] . "</td>\n\t\t\t<td class='tbl2'><input type='text' name='type_name' class='textbox' value='{$type_name}'></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class='tbl1'>" . $locale['fb856'] . "</td>\n\t\t\t<td class='tbl2'><select name='type_icon' class='textbox'>\n\t\t\t{$iconOpts}\n\t\t\t</select></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class='tbl1' colspan='2' style='text-align:center;'>\n\t\t\t<input type='submit' name='goRating' value='{$button}' class='button'>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t</form>\n";
    closetable();
    tablebreak();
    opentable($locale['fb860']);
    $result = dbquery("select * from " . DB_PREFIX . "fb_rate_type");
    if (dbrows($result)) {
        echo "<table width='300' cellspacing='1' cellpadding='0' class='tbl-border center'>\n\t\t\t<tr>\n\t\t\t\t<td class='tbl2' style='font-weight:bold;'>" . $locale['fb855'] . "</td>\n\t\t\t\t<td class='tbl2' style='font-weight:bold;'>" . $locale['fb856'] . "</td>\n\t\t\t\t<td class='tbl2' style='font-weight:bold;'>" . $locale['fb857'] . "</td>\n\t\t\t</tr>\n";
        while ($data = dbarray($result)) {
            echo "<tr>\n\t\t\t\t\t<td class='tbl1'>" . stripslash($data['type_name']) . "</td>\n\t\t\t\t\t<td class='tbl1'><img src='" . INFUSIONS . "fusionboard4/images/forum_icons/" . $data['type_icon'] . "' alt=''></td>\n\t\t\t\t\t<td class='tbl1'><a href='" . FUSION_SELF . $aidlink . "&amp;section=ratings&amp;edit=" . $data['type_id'] . "'>" . $locale['fb858'] . "</a> :: \n\t\t\t\t\t<a href='" . FUSION_SELF . $aidlink . "&amp;section=ratings&amp;del=" . $data['type_id'] . "' onclick=\"return confirm('" . $locale['fb869'] . "');\">" . $locale['fb859'] . "</a></td>\n\t\t\t\t</tr>\n";
        }
        echo "</table>\n";
    } else {
        echo "<div align='center'>" . $locale['fb861'] . "</div>\n";
    }
    closetable();
} elseif ($_GET['section'] == "forums") {
    include INFUSIONS . "fusionboard4/includes/forumadmin.php";
} elseif ($_GET['section'] == "warnings") {
    if (isset($_POST['goRule']) && isNum($_GET['level']) && isset($_GET['level'])) {
        $pm = isset($_POST['rule_pm']) ? addslash(stripinput($_POST['rule_pm'])) : "";
        $email = isset($_POST['rule_email']) ? addslash(stripinput($_POST['rule_email'])) : "";
        $bantime = isset($_POST['rule_bantime']) && isNum($_POST['rule_bantime']) ? $_POST['rule_bantime'] : 0;
        $perma = isset($_POST['rule_perma']) && isNum($_POST['rule_perma']) ? $_POST['rule_perma'] : 0;
        $result = dbquery("update " . DB_PREFIX . "fb_warn_rules set rule_pm='{$pm}', rule_email='{$email}', rule_bantime='{$bantime}', rule_perma='{$perma}' where rule_level='" . $_GET['level'] . "'");
if (isset($_GET['error']) && (isnum($_GET['error']) or $_GET['error'] == "pw") && !isset($message)) {
    if ($_GET['error'] == "0") {
        $message = $locale['900'];
    } elseif ($_GET['error'] == "1") {
        $message = $locale['901'];
    } elseif ($_GET['error'] == "pw") {
        $message = "Admin-Password incorrect";
    }
    if (isset($message)) {
        echo "<div id='close-message'><div class='admin-message'>" . $message . "</div></div>\n";
    }
}
if (isset($_POST['savesettings'])) {
    if (check_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "")) {
        $error = 0;
        if (!set_mainsetting('siteintro', addslashes(descript(stripslash($_POST['intro']))))) {
            $error = 1;
        }
        if (!set_mainsetting('siteintro_collapse', isset($_POST['siteintro_collapse']) ? "1" : "0")) {
            $error = 1;
        }
        if (!set_mainsetting('siteintro_collapse_state', isset($_POST['siteintro_collapse_state']) ? "on" : "off")) {
            $error = 1;
        }
        if (!set_mainsetting('welome_panel_dis', isnum($_POST['welome_panel_dis']) ? $_POST['welome_panel_dis'] : "0")) {
            $error = 1;
        }
        set_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "");
        log_admin_action("admin-1", "admin_wel_panel_edited");
        redirect(FUSION_SELF . $aidlink . "&error=" . $error);
    } else {
Example #15
0
/*
 * GUI
 */
opentable($locale['PRP800']);
prp_admin_menu();
if (isset($_GET['edit']) || isset($_GET['new'])) {
    if (isset($id)) {
        $query_id = dbquery("SELECT license_id, license_text," . " license_name" . " FROM " . DB_PRP_LICENSES . "" . " WHERE license_id='{$id}'");
        $data = dbarray($query_id);
        $action = FUSION_SELF . "?id={$id}";
    } else {
        $data['license_text'] = "";
        $data['license_name'] = "";
        $action = FUSION_SELF;
    }
    echo "<form action='{$action}' method='POST'>\n<div align='center'>\n" . $locale['PRP002'] . ": <input type='text' value='" . $data['license_name'] . "'" . " size='40' maxlength='255' name='name' class='textbox'>\n<p>\n<textarea cols='70' rows='15' class='textbox' name='text'>" . phpentities(stripslash($data['license_text'])) . "</textarea>\n<p>\n<input type='submit' value='" . $locale['PRP010'] . "' class='button' name='save'>\n</div>\n<hr>\n</form>\n";
}
/*
 * show all
 */
$query_id = dbquery("SELECT CHAR_LENGTH(license_text) AS length," . " license_id, license_name" . " FROM " . DB_PRP_LICENSES . "" . " ORDER BY license_name ASC");
if (dbrows($query_id)) {
    echo "<table align='center' cellspacing='1' class='tbl-border'>\n<thead>\n<tr>\n\t<th class='tbl2' width='16'></th>\n\t<th class='tbl2' width='150'>" . $locale['PRP002'] . " [<a href='" . FUSION_SELF . "?new=1'>" . $locale['prp_new'] . "]</a></th>\n\t<th class='tbl2'>" . $locale['PRP801'] . "</th>\n\t<th class='tbl2' colspan='2'># " . $locale['prp_reviews'] . "</th>\n\t<th class='tbl2' width='16'></th>\n</tr>\n</thead>\n<tbody>";
} else {
    if (!isset($_GET['new'])) {
        fallback(FUSION_SELF . "?new=1");
    }
    echo "<p>" . $locale['PRP802'];
}
$lcount = 0;
while ($data = dbarray($query_id)) {
Example #16
0
 $result = dbquery("SELECT\n\t\t\tts.submit_datestamp, ts.submit_criteria, tu.user_id, tu.user_name, tu.user_avatar, tu.user_status\n\t\t\tFROM " . DB_SUBMISSIONS . " ts\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON ts.submit_user=tu.user_id\n\t\t\tWHERE submit_type='b' order by submit_datestamp desc");
 if (dbrows($result) > 0) {
     $data = dbarray($result);
     $submit_criteria = unserialize($data['submit_criteria']);
     $callback_data = array("blog_start" => $data['submit_datestamp'], "blog_datestamp" => $data['submit_datestamp'], "blog_keywords" => $submit_criteria['blog_keywords'], "blog_visibility" => 0, "blog_image" => $submit_criteria['blog_image'], "blog_image_t1" => $submit_criteria['blog_image_t1'], "blog_image_t2" => $submit_criteria['blog_image_t2'], "blog_ialign" => $submit_criteria['blog_ialign'], "blog_end" => "", "blog_draft" => 0, "blog_sticky" => 0, "blog_language" => $submit_criteria['blog_language'], "blog_subject" => $submit_criteria['blog_subject'], "blog_cat" => $submit_criteria['blog_cat'], "blog_blog" => phpentities(stripslashes($submit_criteria['blog_blog'])), "blog_extended" => phpentities(stripslashes($submit_criteria['blog_body'])), "blog_breaks" => fusion_get_settings("tinyce_enabled") ? TRUE : FALSE);
     add_to_title($locale['global_200'] . $locale['503'] . $locale['global_201'] . $callback_data['blog_subject'] . "?");
     if (isset($_POST['preview'])) {
         $blog_blog = "";
         if ($_POST['blog_blog']) {
             $blog_blog = phpentities(stripslash($_POST['blog_blog']));
             $blog_blog = str_replace("src='" . str_replace("../", "", IMAGES_B), "src='" . IMAGES_B, stripslash($_POST['blog_blog']));
         }
         $blog_extended = "";
         if ($_POST['blog_extended']) {
             $blog_extended = phpentities(stripslash($_POST['blog_extended']));
             $blog_extended = str_replace("src='" . str_replace("../", "", IMAGES_B), "src='" . IMAGES_B, stripslash($_POST['blog_extended']));
         }
         $callback_data = array("blog_subject" => form_sanitizer($_POST['blog_subject'], '', 'blog_subject'), "blog_cat" => isnum($_POST['blog_cat']) ? $_POST['blog_cat'] : 0, "blog_language" => form_sanitizer($_POST['blog_language'], '', 'blog_language'), "blog_blog" => form_sanitizer($blog_blog, "", "blog_blog"), "blog_extended" => form_sanitizer($blog_extended, "", "blog_extended"), "blog_keywords" => form_sanitizer($_POST['blog_keywords'], '', 'blog_keywords'), "blog_start" => isset($_POST['blog_start']) && $_POST['blog_start'] ? $_POST['blog_start'] : '', "blog_end" => isset($_POST['blog_end']) && $_POST['blog_end'] ? $_POST['blog_end'] : '', "blog_visibility" => isnum($_POST['blog_visibility']) ? $_POST['blog_visibility'] : "0", "blog_draft" => isset($_POST['blog_draft']) ? TRUE : FALSE, "blog_sticky" => isset($_POST['blog_sticky']) ? TRUE : FALSE, "blog_datestamp" => $callback_data['blog_datestamp'], "blog_ialign" => isset($_POST['blog_ialign']) ? $_POST['blog_ialign'] : '', "blog_image" => isset($_POST['blog_image']) ? $_POST['blog_image'] : '', "blog_image_t1" => isset($_POST['blog_image_t1']) ? $_POST['blog_image_t1'] : "", "blog_image_t2" => isset($_POST['blog_image_t2']) ? $_POST['blog_image_t2'] : "");
         $callback_data['blog_breaks'] = "";
         if (isset($_POST['blog_breaks'])) {
             $callback_data['blog_breaks'] = TRUE;
             $callback_data['blog_blog'] = nl2br($callback_data['blog_blog']);
             if ($callback_data['blog_extended']) {
                 $callback_data['blog_extended'] = nl2br($callback_data['blog_extended']);
             }
         }
         if (defender::safe()) {
             echo openmodal('blog_preview', $locale['blog_0141']);
             echo "<h3>" . $callback_data['blog_subject'] . "</h3>\n";
             echo $callback_data['blog_blog'];
             echo "<hr/>\n";
Example #17
0
     		if($data['group_moderate']){
     			echo "<tr>\n<td class='tbl2 navsection'>".$locale['uc370']."</td>\n</tr>\n<tr>\n<td class='tbl1' style='padding:6px;'>\n";
     			
     			echo "</td>\n</tr>\n";
     		}
     		*/
     if ($data['group_wall']) {
         include INFUSIONS . "fusionboard4/includes/comments_enhanced.php";
         echo "<tr>\n<td class='tbl2 navsection'>" . $locale['uc280'] . "</td>\n</tr>\n<tr>\n<td class='tbl2' style='padding:6px;'>\n";
         showcomments("G", DB_USER_GROUPS, "group_id", $_GET['view'], FUSION_SELF . "?section=groups&amp;view=" . $_GET['view'], $in_group);
         echo "</td>\n</tr>\n";
     }
 } else {
     echo "<tr>\n<td class='tbl2 navtitle'>" . stripslash($data['group_name']) . "</td>\n</tr>\n";
     echo "<tr>\n<td class='tbl1'><div style='float:right;'>" . $locale['uc278'] . "<b>" . ($data['group_access'] == "1" ? $locale['uc269'] : ($data['group_access'] == "2" ? $locale['uc270'] : $locale['uc291'])) . "</b></div>\n";
     echo "<span style='font-size:18px;'>" . stripslash($data['group_name']) . "</span><br />\n";
     echo $locale['uc276'] . "<a href='" . BASEDIR . "profile.php?lookup=" . $data['user_id'] . "'>" . $data['user_name'] . "</a><br /><br />\n";
     echo $locale['uc290'] . "</td>\n</tr>\n";
 }
 echo "<tr>\n<td class='tbl2 small' align='center'>";
 $invited = dbcount("(invite_to)", DB_PREFIX . "fb_invites", "invite_to='" . $userdata['user_id'] . "' and invite_group='" . $data['group_id'] . "'");
 if ($in_group) {
     if ($userdata['user_id'] !== $data['group_leader']) {
         echo "<a href='" . FUSION_SELF . "?section=groups&amp;leave=" . $data['group_id'] . "'>" . $locale['uc287'] . "</a> :: \n";
     }
     echo "<a href='" . FUSION_SELF . "?section=groups&amp;members=" . $data['group_id'] . "'>" . $locale['uc288'] . "</a>\n";
 } elseif ($invited) {
     echo "<a href='" . FUSION_SELF . "?section=groups&amp;acceptinvite=" . $data['group_id'] . "'>" . $locale['uc330'] . "</a>\n";
 } elseif ($data['group_access'] == "1") {
     echo "<a href='" . FUSION_SELF . "?section=groups&amp;join=" . $data['group_id'] . "'>" . $locale['uc286'] . "</a>\n";
     // join group
Example #18
0
function stripslash($var)
{
    if (is_array($var)) {
        foreach ($var as $k => $v) {
            $result[$k] = stripslash($v);
        }
    }
    if (is_string($var)) {
        $result = stripslashes($var);
    }
    return $result ? $result : $var;
}
Example #19
0
 function showtitle($user)
 {
     global $db_prefix;
     $titleLookup = dbquery("select * from " . DB_PREFIX . "fb_titles where title_id='" . $user['user_title'] . "' and (" . useraccess_better("title_access", $user) . ")");
     if (dbrows($titleLookup)) {
         $titleData = dbarray($titleLookup);
         $title = stripslash($titleData['title_title']);
     } else {
         $title = stripslash($user['user_title']);
     }
     return $title;
 }
Example #20
0
                break;
        }
    }
    if ($message) {
        echo "<div id='close-message'><div class='admin-message'>" . $message . "</div></div>\n";
    }
}
if (isset($_POST['save_robots'])) {
    $error = 0;
    $file = BASEDIR . "robots.txt";
    $robots_content = $_POST['robots_content'];
    if (!is_writable($file)) {
        $error = 1;
    }
    if ($error == 0) {
        if (openFile($file, "WRITE", stripslash($robots_content))) {
            redirect(FUSION_SELF . $aidlink . "&amp;status=su");
        } else {
            redirect(FUSION_SELF . $aidlink . "&amp;status=se&amp;error=2");
        }
    } else {
        redirect(FUSION_SELF . $aidlink . "&amp;status=se&amp;error=" . $error);
    }
}
if (isset($_POST['set_default'])) {
    $error = 0;
    $file = BASEDIR . "robots.txt";
    $robots_content = "User-agent: *\n";
    $robots_content .= "Disallow: /administration/\n";
    $robots_content .= "Disallow: /locale/\n";
    $robots_content .= "Disallow: /themes/\n";
Example #21
0
            echo $locale['485'] . "<br /><br />\n";
        }
        echo "<a href='panels.php" . $aidlink . "'>" . $locale['486'] . "</a><br /><br />\n";
        echo "<a href='index.php" . $aidlink . "'>" . $locale['487'] . "</a><br /><br />\n";
        echo "</div>\n";
        closetable();
        set_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "");
    }
} else {
    if (isset($_POST['preview'])) {
        $panel_name = stripinput($_POST['panel_name']);
        $panel_url_list = stripinput($_POST['panel_url_list']);
        $exclude_check = $_POST['panel_restriction'] == "1" ? " checked='checked'" : "";
        $include_check = $_POST['panel_restriction'] == "0" ? " checked='checked'" : "";
        $panel_filename = $_POST['panel_filename'];
        $panel_content = isset($_POST['panel_content']) ? stripslash($_POST['panel_content']) : "";
        $panel_access = $_POST['panel_access'];
        $panelon = isset($_POST['panel_display']) ? " checked='checked'" : "";
        $panelopts = $panel_side == "1" || $panel_side == "4" ? " style='display:none'" : " style='display:block'";
        $panel_type = $panel_filename == "none" ? "php" : "file";
        if (check_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "")) {
            opentable($panel_name);
            if ($panel_type == "file") {
                @(include INFUSIONS . $panel_filename . "/" . $panel_filename . ".php");
            } else {
                eval($panel_content);
            }
            $panel_content = phpentities($panel_content);
            closetable();
            set_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "");
        } else {
Example #22
0
        }
        $object->use_resume = true;
        if (!$object->review()) {
            echo '<p>FIXME:F**K!';
        }
        exit;
    }
    // show license
} else {
    opentable($prp->settings['title']);
    echo "<div align='text-align:center;'>\n<p>\n\t<a href='review.php?did=" . $review->id . "'>" . $locale['PRP026'] . "</a>\n</p>\n</div>\n";
    // get from database
    if ($review->data['license_id']) {
        $res = dbquery("SELECT license_text, license_name" . " FROM " . DB_PRP_LICENSES . "" . " WHERE license_id='" . $review->data['license_id'] . "'");
        $data = dbarray($res);
        echo "<p><h2>" . $data['license_name'] . "</h2>\n" . "<div style='max-height:320px; overflow:auto;'" . " class='textbox'>\n" . stripslash($data['license_text']) . "\n</div>\n";
        //
    } else {
        if ($review->data['lizenz_url']) {
            echo "<p><b>" . $locale['PRP402'] . "</b>";
            echo "<p><b>" . $locale['PRP404'] . "</b>";
            echo "<p><a href='http://" . $review->data['lizenz_url'] . "'>" . $locale['prp_license'] . "</a>";
        } else {
            echo "<b>\n";
            if ($review->data['lizenz_packet'] == "Y") {
                echo "<p>" . $locale['PRP402'];
                echo "<p>" . $locale['PRP403'];
            } else {
                echo "<p>" . $locale['PRP406'];
            }
            echo "</b>\n";
Example #23
0
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "contact.php";
add_to_title($locale['global_200'] . $locale['400']);
$settings = fusion_get_settings();
$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) {
Example #24
0
 $result = dbquery("SELECT\n\t\t\tts.submit_datestamp, ts.submit_criteria, tu.user_id, tu.user_name, tu.user_avatar, tu.user_status\n\t\t\tFROM " . DB_SUBMISSIONS . " ts\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON ts.submit_user=tu.user_id\n\t\t\tWHERE submit_type='n' order by submit_datestamp desc");
 if (dbrows($result) > 0) {
     $data = dbarray($result);
     $submit_criteria = unserialize($data['submit_criteria']);
     $callback_data = array("news_start" => $data['submit_datestamp'], "news_datestamp" => $data['submit_datestamp'], "news_keywords" => $submit_criteria['news_keywords'], "news_visibility" => 0, "news_image" => $submit_criteria['news_image'], "news_image_t1" => $submit_criteria['news_image_t1'], "news_image_t2" => $submit_criteria['news_image_t2'], "news_ialign" => $submit_criteria['news_ialign'], "news_end" => "", "news_draft" => 0, "news_sticky" => 0, "news_language" => $submit_criteria['news_language'], "news_subject" => $submit_criteria['news_subject'], "news_cat" => $submit_criteria['news_cat'], "news_news" => phpentities(stripslashes($submit_criteria['news_snippet'])), "news_extended" => phpentities(stripslashes($submit_criteria['news_body'])), "news_breaks" => fusion_get_settings("tinyce_enabled") ? TRUE : FALSE);
     add_to_title($locale['global_200'] . $locale['503'] . $locale['global_201'] . $callback_data['news_subject'] . "?");
     if (isset($_POST['preview'])) {
         $news_news = "";
         if ($_POST['news_news']) {
             $news_news = phpentities(stripslash($_POST['news_news']));
             $news_news = str_replace("src='" . str_replace("../", "", IMAGES_N), "src='" . IMAGES_N, stripslash($_POST['news_news']));
         }
         $news_extended = "";
         if ($_POST['news_extended']) {
             $news_extended = phpentities(stripslash($_POST['news_extended']));
             $news_extended = str_replace("src='" . str_replace("../", "", IMAGES_N), "src='" . IMAGES_N, stripslash($_POST['news_extended']));
         }
         $callback_data = array("news_subject" => form_sanitizer($_POST['news_subject'], '', 'news_subject'), "news_cat" => isnum($_POST['news_cat']) ? $_POST['news_cat'] : 0, "news_language" => form_sanitizer($_POST['news_language'], '', 'news_language'), "news_news" => form_sanitizer($news_news, "", "news_news"), "news_extended" => form_sanitizer($news_extended, "", "news_extended"), "news_keywords" => form_sanitizer($_POST['news_keywords'], '', 'news_keywords'), "news_start" => isset($_POST['news_start']) && $_POST['news_start'] ? $_POST['news_start'] : '', "news_end" => isset($_POST['news_end']) && $_POST['news_end'] ? $_POST['news_end'] : '', "news_visibility" => isnum($_POST['news_visibility']) ? $_POST['news_visibility'] : "0", "news_draft" => isset($_POST['news_draft']) ? TRUE : FALSE, "news_sticky" => isset($_POST['news_sticky']) ? TRUE : FALSE, "news_datestamp" => $callback_data['news_datestamp'], "news_ialign" => isset($_POST['news_ialign']) ? $_POST['news_ialign'] : '', "news_image" => isset($_POST['news_image']) ? $_POST['news_image'] : '', "news_image_t1" => isset($_POST['news_image_t1']) ? $_POST['news_image_t1'] : "", "news_image_t2" => isset($_POST['news_image_t2']) ? $_POST['news_image_t2'] : "");
         $callback_data['news_breaks'] = "";
         if (isset($_POST['news_breaks'])) {
             $callback_data['news_breaks'] = TRUE;
             $callback_data['news_news'] = nl2br($callback_data['news_news']);
             if ($callback_data['news_extended']) {
                 $callback_data['news_extended'] = nl2br($callback_data['news_extended']);
             }
         }
         if (defender::safe()) {
             echo openmodal('news_preview', $locale['news_0141']);
             echo "<h3>" . $callback_data['news_subject'] . "</h3>\n";
             echo $callback_data['news_news'];
             echo "<hr/>\n";
Example #25
0
function admin_sell()
{
    //executes the admin sale of a members item
    global $locale, $aidlink;
    $searchfor = stripinput($_POST['searchfor']);
    $userid = stripinput($_GET['userid']);
    $username = stripinput($_GET['username']);
    $id = stripinput($_GET['id']);
    $amtpaid = stripinput($_GET['amtpaid']);
    opentable(stripslash($username . '\'s Item sold'), '');
    $context['shop_inventory_search'] = 2;
    $result = dbquery("DELETE FROM " . DB_UG3_INVENTORY . " WHERE id = '" . $id . "' LIMIT 1");
    payuser($userid, $amtpaid, 'cash');
    echo "<div align='center'>" . sprintf('item %s has been sold for the amount of %s.', $id, $amtpaid);
    echo "<form action='index.php" . $aidlink . "&amp;op=viewmember' method='post'>\n";
    echo "<input name='searchfor' class='textbox' type='hidden' value='" . $username . "'>\n";
    echo "<input type='submit' class='button' value='" . $locale['urg_a_inventry_125'] . "'>\n";
    echo "</form>\n";
    closetable();
}
Example #26
0
         $titleData = dbarray($titleLookup);
         $title = stripslash($titleData['title_title']);
     } else {
         $title = stripslash($data['user_title']);
     }
 } else {
     $title = getusergroups($data['user_id']);
 }
 echo "<span class='small'>" . $title . "</span><br />";
 renderMods(true, false);
 echo "<br /><br />";
 renderAwards($data['user_id'], "", "<br /><br />");
 echo "<!--forum_thread_user_info-->" . $locale['502'] . " <span class='alt'>" . $data['user_posts'] . "</span><br />\n";
 echo "" . $locale['504'] . " <span class='alt'>" . showdate("%d.%m.%y", $data['user_joined']) . "</span>\n";
 if ($data['user_location']) {
     echo "<br />" . $locale['fb500'] . ": <span class='alt'>" . stripslash($data['user_location']) . "</span>\n";
 }
 if ($data['user_birthdate'] !== "0000-00-00") {
     $birthday = explode("-", $data['user_birthdate']);
     $age = strftime("%Y") - $birthday[0];
     if (strftime("%m") < $birthday[1]) {
         $age--;
     } elseif (strftime("%m") == $birthday[1]) {
         if (strftime("%d") < $birthday[2]) {
             $age--;
         }
     }
     echo "<br />" . $locale['fb512'] . " <span class='alt'>{$age}</span>\n";
 }
 echo showWarning($data['user_id']);
 echo "</div>\n";
Example #27
0
 $article_breaks = "";
 $result2 = dbquery("SELECT article_cat_id, article_cat_name FROM " . DB_ARTICLE_CATS . " ORDER BY article_cat_name DESC");
 $article_cat_opts = "";
 $sel = "";
 while ($data2 = dbarray($result2)) {
     if (isset($article_cat)) {
         $sel = $article_cat == $data2['article_cat_id'] ? " selected='selected'" : "";
     }
     $article_cat_opts .= "<option value='" . $data2['article_cat_id'] . "'{$sel}>" . $data2['article_cat_name'] . "</option>\n";
 }
 add_to_title($locale['global_200'] . $locale['543'] . $locale['global_201'] . $article_subject . "?");
 if (isset($_POST['preview']) && (isset($_GET['submit_id']) && isnum($_GET['submit_id']))) {
     $article_cat = isnum($_POST['article_cat']) ? $_POST['article_cat'] : "0";
     $article_subject = stripinput($_POST['article_subject']);
     $article_snippet = stripslash($_POST['article_snippet']);
     $article_body = stripslash($_POST['article_body']);
     $breaks = isset($_POST['line_breaks']) ? " checked='checked'" : "";
     opentable($article_subject);
     echo $locale['547'] . " " . (isset($_POST['line_breaks']) ? nl2br($article_snippet) : $article_snippet) . "<br /><br />";
     echo $locale['548'] . " " . (isset($_POST['line_breaks']) ? nl2br($article_body) : $article_body);
     closetable();
 }
 opentable($locale['540']);
 echo "<form name='publish' method='post' action='" . FUSION_SELF . $aidlink . "&amp;sub=submissions&amp;action=2&amp;t=a&amp;submit_id=" . $_GET['submit_id'] . "'>\n";
 echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
 echo "<td width='100' class='tbl'>" . $locale['506'] . "</td>\n";
 echo "<td width='80%' class='tbl'><select name='article_cat' class='textbox'>\n" . $article_cat_opts . "</select></td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td width='100' class='tbl'>" . $locale['505'] . "</td>\n";
 echo "<td width='80%' class='tbl'><input type='text' name='article_subject' value='{$article_subject}' class='textbox' style='width: 250px' /></td>\n";
 echo "</tr>\n<tr>\n";
function parentdir($path)
{
    return dirname(stripslash($path));
}
Example #29
0
         redirect(FUSION_SELF . $aidlink . "&status=sn");
     }
 } else {
     if (isset($_POST['delete']) && (isset($_POST['article_id']) && isnum($_POST['article_id']))) {
         $result = dbquery("DELETE FROM " . DB_ARTICLES . " WHERE article_id='" . $_POST['article_id'] . "'");
         $result = dbquery("DELETE FROM " . DB_COMMENTS . " WHERE comment_item_id='" . $_POST['article_id'] . "' and comment_type='A'");
         $result = dbquery("DELETE FROM " . DB_RATINGS . " WHERE rating_item_id='" . $_POST['article_id'] . "' and rating_type='A'");
         redirect(FUSION_SELF . $aidlink . "&status=del");
     } else {
         if (isset($_POST['preview'])) {
             $article_cat = $_POST['article_cat'];
             $subject = stripinput($_POST['subject']);
             $body = phpentities(stripslash($_POST['body']));
             $body2 = phpentities(stripslash($_POST['body2']));
             $bodypreview = str_replace("src='" . str_replace("../", "", IMAGES_A), "src='" . IMAGES_A, stripslash($_POST['body']));
             $body2preview = str_replace("src='" . str_replace("../", "", IMAGES_A), "src='" . IMAGES_A, stripslash($_POST['body2']));
             $draft = isset($_POST['article_draft']) ? " checked='checked'" : "";
             if (isset($_POST['line_breaks'])) {
                 $breaks = " checked='checked'";
                 $bodypreview = nl2br($bodypreview);
                 $body2preview = nl2br($body2preview);
             } else {
                 $breaks = "";
             }
             $comments = isset($_POST['article_comments']) ? " checked='checked'" : "";
             $ratings = isset($_POST['article_ratings']) ? " checked='checked'" : "";
             opentable($subject);
             echo "<div class='panel panel-default'>\n";
             echo "<div class='panel-body'>\n";
             echo "<div class='well'>\n";
             echo "<small><strong>" . $locale['424'] . "</strong></small><br/>";
}
if ($captcha == "2") {
    require_once INCLUDES . "recaptcha/recaptchalib.php";
    $resp = null;
    $recaptcha_error = null;
}
if (isset($_POST['sendmessage'])) {
    if ($captcha == "1") {
        // Captcha
        include_once INCLUDES . "securimage/securimage.php";
    }
    $error = "";
    $mailname = substr(stripinput(trim($_POST['mailname'])), 0, 50);
    $email = substr(stripinput(trim($_POST['email'])), 0, 100);
    $subject = substr(str_replace(array("\r", "\n", "@"), "", descript(stripslash(trim($_POST['subject'])))), 0, 50);
    $message = descript(stripslash(trim($_POST['message'])));
    if ($mailname == "") {
        $error .= "&middot; <span class='alt'>" . $locale['420'] . "</span><br />\n";
    }
    if ($email == "" || !preg_match("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $email)) {
        $error .= "&middot; <span class='alt'>" . $locale['421'] . "</span><br />\n";
    }
    if ($subject == "") {
        $error .= "&middot; <span class='alt'>" . $locale['422'] . "</span><br />\n";
    }
    if ($message == "") {
        $error .= "&middot; <span class='alt'>" . $locale['423'] . "</span><br />\n";
    }
    if ($captcha == "1") {
        // Captcha
        $securimage = new Securimage();