function showratings($rating_type, $rating_item_id, $rating_link) { global $locale, $userdata; $settings = \fusion_get_settings(); if ($settings['ratings_enabled'] == "1") { if (iMEMBER) { $d_rating = dbarray(dbquery("SELECT rating_vote,rating_datestamp FROM " . DB_RATINGS . " WHERE rating_item_id='" . $rating_item_id . "' AND rating_type='" . $rating_type . "' AND rating_user='******'user_id'] . "'")); if (isset($_POST['post_rating'])) { // Rate if (isnum($_POST['rating']) && $_POST['rating'] > 0 && $_POST['rating'] < 6 && !isset($d_rating['rating_vote'])) { $result = dbquery("INSERT INTO " . DB_RATINGS . " (rating_item_id, rating_type, rating_user, rating_vote, rating_datestamp, rating_ip, rating_ip_type) VALUES ('{$rating_item_id}', '{$rating_type}', '" . $userdata['user_id'] . "', '" . $_POST['rating'] . "', '" . time() . "', '" . USER_IP . "', '" . USER_IP_TYPE . "')"); if ($result) { defender::unset_field_session(); } } redirect($rating_link); } elseif (isset($_POST['remove_rating'])) { // Unrate $result = dbquery("DELETE FROM " . DB_RATINGS . " WHERE rating_item_id='{$rating_item_id}' AND rating_type='{$rating_type}' AND rating_user='******'user_id'] . "'"); if ($result) { defender::unset_field_session(); } redirect($rating_link); } } $ratings = array(5 => $locale['r120'], 4 => $locale['r121'], 3 => $locale['r122'], 2 => $locale['r123'], 1 => $locale['r124']); if (!iMEMBER) { $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a>", $locale['r104']); if (fusion_get_settings("enable_registration") == TRUE) { $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a> " . $locale['or'] . " <a href='" . BASEDIR . "register.php'>" . $locale['register'] . "</a>", $locale['r104']); } echo "<div class='text-center'>" . $message . "</div>\n"; } elseif (isset($d_rating['rating_vote'])) { echo "<div class='display-block'>\n"; echo openform('removerating', 'post', $rating_link, array('class' => 'display-block text-center')); echo sprintf($locale['r105'], $ratings[$d_rating['rating_vote']], showdate("longdate", $d_rating['rating_datestamp'])) . "<br /><br />\n"; echo form_button('remove_rating', $locale['r102'], $locale['r102'], array('class' => 'btn-default', 'icon' => 'fa fa-times m-r-10')); echo closeform(); echo "</div>\n"; } else { echo "<div class='display-block'>\n"; echo openform('postrating', 'post', $rating_link, array('max_tokens' => 1, 'notice' => 0, 'class' => 'm-b-20 text-center')); echo form_select('rating', $locale['r106'], '', array('options' => $ratings, 'class' => 'display-block text-center')); echo form_button('post_rating', $locale['r103'], $locale['r103'], array('class' => 'btn-primary btn-sm', 'icon' => 'fa fa-thumbs-up m-r-10')); echo closeform(); echo "</div>\n"; } $rating_votes = dbarray(dbquery("\n\t\tSELECT\n\t\tSUM(IF(rating_vote='5', 1, 0)) as r120,\n\t\tSUM(IF(rating_vote='4', 1, 0)) as r121,\n\t\tSUM(IF(rating_vote='3', 1, 0)) as r122,\n\t\tSUM(IF(rating_vote='2', 1, 0)) as r123,\n\t\tSUM(IF(rating_vote='1', 1, 0)) as r124\n\t\tFROM " . DB_RATINGS . " WHERE rating_type='" . $rating_type . "' and rating_item_id='" . intval($rating_item_id) . "'\n\t\t")); if (!empty($rating_votes)) { echo "<div id='ratings' class='rating_container'>\n"; foreach ($rating_votes as $key => $num) { echo progress_bar($num, $locale[$key], FALSE, '10px', TRUE, FALSE); } echo "</div>\n"; } else { echo "<div class='text-center'>" . $locale['r101'] . "</div>\n"; } } }
function render_admin_login() { global $locale, $aidlink, $userdata, $defender; // TODO: Remove this, add the required styling to acp_styles.css add_to_head("<link rel='stylesheet' href='" . THEMES . "templates/setup_styles.css' type='text/css' />"); echo "<aside class='block-container'>\n"; echo "<div class='block'>\n"; echo "<div class='block-content clearfix' style='font-size:13px;'>\n"; echo "<h6><strong>" . $locale['280'] . "</strong></h6>\n"; echo "<img src='" . IMAGES . "php-fusion-icon.png' class='pf-logo position-absolute' alt='PHP-Fusion'/>"; echo "<p class='fusion-version text-right mid-opacity text-smaller'>" . $locale['version'] . fusion_get_settings('version') . "</p>"; echo "<div class='row m-0'>\n<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12'>"; $form_action = FUSION_SELF . $aidlink == ADMIN . "index.php" . $aidlink ? FUSION_SELF . $aidlink . "&pagenum=0" : FUSION_SELF . "?" . FUSION_QUERY; echo openform('admin-login-form', 'post', $form_action, array('max_tokens' => 1)); openside(''); if (!$defender->safe()) { setNotice('danger', $locale['global_182']); } // Get all notices $notices = getNotices(); echo renderNotices($notices); echo "<div class='m-t-10 clearfix row'>\n"; echo "<div class='col-xs-3 col-sm-3 col-md-3 col-lg-3'>\n"; echo "<div class='pull-right'>\n"; echo display_avatar($userdata, '90px'); echo "</div>\n"; echo "</div>\n<div class='col-xs-9 col-sm-9 col-md-8 col-lg-7'>\n"; echo "<div class='clearfix'>\n"; $label = "<span class='h5 display-inline' style='color: #222'><strong>" . $locale['welcome'] . ", " . $userdata['user_name'] . "</strong><br/>" . getuserlevel($userdata['user_level']) . "</span>"; add_to_head('<style>#admin_password-field .required {display:none}</style>'); echo form_text('admin_password', $label, '', array('callback_check' => 'check_admin_pass', 'placeholder' => $locale['281'], 'autocomplete_off' => 1, 'type' => 'password', 'required' => 1)); echo "</div>\n"; echo "</div>\n"; echo "</div>\n"; closeside(); echo form_button('admin_login', $locale['login'], 'Sign in', array('class' => 'btn-primary btn-block')); echo closeform(); echo "</div>\n</div>\n"; // .col-*, .row echo "</div>\n"; // .block-content echo "</div>\n"; // .block echo "<div class='copyright-note clearfix m-t-10'>" . showcopyright() . "</div>\n"; echo "</aside>\n"; }
function render_admin_login() { global $locale, $aidlink, $userdata; echo "<section class='login-bg'>\n"; echo "<aside class='block-container'>\n"; echo "<div class='block'>\n"; echo "<div class='block-content clearfix' style='font-size:13px;'>\n"; echo "<h6><strong>" . $locale['280'] . "</strong></h6>\n"; echo "<img src='" . IMAGES . "php-fusion-icon.png' class='pf-logo position-absolute' alt='PHP-Fusion'/>"; echo "<p class='fusion-version text-right mid-opacity text-smaller'>" . $locale['version'] . fusion_get_settings('version') . "</p>"; echo "<div class='row m-0'>\n<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12'>"; $form_action = FUSION_SELF . $aidlink == ADMIN . "index.php" . $aidlink ? FUSION_SELF . $aidlink . "&pagenum=0" : FUSION_SELF . "?" . FUSION_QUERY; // Get all notices $notices = getNotices(); echo renderNotices($notices); echo openform('admin-login-form', 'post', $form_action); openside(''); echo "<div class='m-t-10 clearfix row'>\n"; echo "<div class='col-xs-3 col-sm-3 col-md-3 col-lg-3'>\n"; echo "<div class='pull-right'>\n"; echo display_avatar($userdata, '90px'); echo "</div>\n"; echo "</div>\n<div class='col-xs-9 col-sm-9 col-md-8 col-lg-7'>\n"; echo "<div class='clearfix'>\n"; add_to_head('<style>#admin_password-field .required {display:none}</style>'); echo "<h5><strong>" . $locale['welcome'] . ", " . $userdata['user_name'] . "</strong><br/>" . getuserlevel($userdata['user_level']) . "</h5>"; echo form_text('admin_password', "", "", array('callback_check' => 'check_admin_pass', 'placeholder' => $locale['281'], 'error_text' => $locale['global_182'], 'autocomplete_off' => TRUE, 'type' => 'password', 'required' => TRUE)); echo "</div>\n"; echo "</div>\n"; echo "</div>\n"; closeside(); echo form_button('admin_login', $locale['login'], $locale['login'], array('class' => 'btn-primary btn-block')); echo closeform(); echo "</div>\n</div>\n"; // .col-*, .row echo "</div>\n"; // .block-content echo "</div>\n"; // .block echo "<div class='copyright-note clearfix m-t-10'>" . showcopyright() . "</div>\n"; echo "</aside>\n"; echo "</section>\n"; }
| 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")); echo form_select("article_allow_submission", $locale['articles_0033'], $article_settings['article_allow_submission'], array("inline" => TRUE, "options" => array($locale['disable'], $locale['enable']))); echo form_checkbox("article_extended_required", $locale['articles_0034'], $article_settings['article_extended_required'], array("inline" => TRUE)); closeside(); echo form_button('savesettings', $locale['750'], $locale['750'], array('class' => 'btn-primary')); echo closeform();
if (!sendemail($settings['siteusername'], $settings['siteemail'], $input['mailname'], $input['email'], $input['subject'], $input['message'])) { $defender->stop(); addNotice('warning', $locale['425']); } } opentable($locale['400']); echo "<div class='alert alert-success' style='text-align:center'><br />\n" . $locale['440'] . "<br /><br />\n" . $locale['441'] . "</div><br />\n"; closetable(); } } opentable($locale['400']); $message = str_replace("[SITE_EMAIL]", hide_email(fusion_get_settings('siteemail')), $locale['401']); $message = str_replace("[PM_LINK]", "<a href='messages.php?msg_send=1'>" . $locale['global_121'] . "</a>", $message); echo $message . "<br /><br />\n"; echo "<!--contact_pre_idx-->"; echo openform('contactform', 'post', FUSION_SELF, array('max_tokens' => 1)); echo "<div class='panel panel-default tbl-border'>\n"; echo "<div class='panel-body'>\n"; echo form_text('mailname', $locale['402'], $input['mailname'], array('required' => 1, 'error_text' => $locale['420'], 'max_length' => 64)); echo form_text('email', $locale['403'], $input['email'], array('required' => 1, 'error_text' => $locale['421'], 'type' => 'email', 'max_length' => 64)); echo form_text('subject', $locale['404'], $input['subject'], array('required' => 1, 'error_text' => $locale['422'], 'max_length' => 64)); echo form_textarea('message', $locale['405'], $input['message'], array('required' => 1, 'error_text' => $locale['423'], 'max_length' => 128)); echo "<div class='panel panel-default tbl-border'>\n"; echo "<div class='panel-body clearfix'>\n"; echo "<div class='row m-0'>\n<div class='col-xs-12 col-sm-12 col-md-6 col-lg-6 p-b-20'>\n"; include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_display.php"; echo "</div>\n<div class='col-xs-12 col-sm-12 col-md-6 col-lg-6'>\n"; if (!isset($_CAPTCHA_HIDE_INPUT) || isset($_CAPTCHA_HIDE_INPUT) && !$_CAPTCHA_HIDE_INPUT) { echo form_text('captcha_code', $locale['408'], '', array('required' => 1, 'autocomplete_off' => 1)); } echo "</div>\n</div>\n";
/** * Quick create */ private function quick_create_forum() { opentable(self::$locale['forum_001']); echo openform('forum_create_form', 'post', FUSION_REQUEST); echo form_text('forum_name', self::$locale['forum_006'], '', array('required' => 1, 'inline' => TRUE, 'placeholder' => self::$locale['forum_018'])); echo form_button('init_forum', self::$locale['forum_001'], 'init_forum', array('class' => 'btn btn-sm btn-primary')); echo closeform(); closetable(); }
function showcomments($ctype, $cdb, $ccol, $cid, $clink) { global $settings, $locale, $userdata, $aidlink; $link = FUSION_SELF . (FUSION_QUERY ? "?" . FUSION_QUERY : ""); $link = preg_replace("^(&|\\?)c_action=(edit|delete)&comment_id=\\d*^", "", $link); $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 . "\r\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : "\r\n\t\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) { $comment_name = $userdata['user_id']; } elseif ($settings['guestposts'] == "1") { if (!isset($_POST['comment_name'])) { redirect($link); } $comment_name = trim(stripinput($_POST['comment_name'])); $comment_name = preg_replace("(^[+0-9\\s]*)", "", $comment_name); if (isnum($comment_name)) { $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_message = trim(stripinput(censorwords($_POST['comment_message']))); if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) { $comment_updated = FALSE; if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\tAND comment_type='" . $ctype . "' AND comment_name='" . $userdata['user_id'] . "'\r\n\t\t\t\t\t\tAND comment_hidden='0'")) { if ($comment_message) { $result = dbquery("UPDATE " . DB_COMMENTS . " SET comment_message='" . $comment_message . "'\r\n\t\t\t\t\t\t\t\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : "\r\n\t\t\t\t\t\t\t\t\t\t\tAND comment_name='" . $userdata['user_id'] . "'")); $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 . "'" . $_GET['comment_id'] . "'\r\n\t\t\t\t\t\t\t\tAND comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\t\t\tAND comment_type='" . $ctype . "'"); $c_start = (ceil($c_count / $cpp) - 1) * $cpp; } redirect($clink . "&c_start=" . (isset($c_start) && isnum($c_start) ? $c_start : "")); } else { if (!dbcount("(" . $ccol . ")", $cdb, $ccol . "='" . $cid . "'")) { redirect(BASEDIR . "index.php"); } if ($comment_name && $comment_message) { require_once INCLUDES . "flood_include.php"; if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='" . USER_IP . "'")) { $result = dbquery("INSERT INTO " . DB_COMMENTS . " (\r\n\t\t\t\t\t\t\t\tcomment_item_id, comment_type, comment_name, comment_message, comment_datestamp,\r\n\t\t\t\t\t\t\t\tcomment_ip, comment_ip_type, comment_hidden\r\n\t\t\t\t\t\t\t) VALUES (\r\n\t\t\t\t\t\t\t\t'" . $cid . "', '" . $ctype . "', '" . $comment_name . "', '" . $comment_message . "', '" . time() . "',\r\n\t\t\t\t\t\t\t\t'" . USER_IP . "', '" . USER_IP_TYPE . "', '0'\r\n\t\t\t\t\t\t\t)"); } } if ($settings['comments_sorting'] == "ASC") { $c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\t\t\t\t\tAND comment_type='" . $ctype . "'"); $c_start = (ceil($c_count / $cpp) - 1) * $cpp; } else { $c_start = 0; } redirect($clink . "&c_start=" . $c_start); } } $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='" . $cid . "'\r\n\t\t\t\t\t\t\tAND comment_type='" . $ctype . "' 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,\r\n\t\t\t\t\ttcu.user_id, tcu.user_name, tcu.user_avatar, tcu.user_status\r\n\t\t\tFROM " . DB_COMMENTS . " tcm\r\n\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\r\n\t\t\tWHERE comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "' AND comment_hidden='0'\r\n\t\t\tORDER BY comment_datestamp " . $settings['comments_sorting'] . " LIMIT " . $_GET['c_start'] . "," . $cpp); if (dbrows($result)) { $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']); } else { $c_arr['c_con'][$i]['comment_name'] = $data['comment_name']; } //Add user avatar in comments new feature in v7.02.04 $c_arr['c_con'][$i]['user_avatar'] = display_avatar($data, '80px'); $c_arr['c_con'][$i]['comment_datestamp'] = $locale['global_071'] . showdate("longdate", $data['comment_datestamp']); $c_arr['c_con'][$i]['comment_message'] = "<!--comment_message-->\n" . nl2br(parseubb(parsesmileys($data['comment_message']))); if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) { $c_arr['c_con'][$i]['edit_dell'] = "<!--comment_actions-->\n"; $c_arr['c_con'][$i]['edit_dell'] .= "<a href='" . FUSION_REQUEST . "&c_action=edit&comment_id=" . $data['comment_id'] . "#edit_comment'>"; $c_arr['c_con'][$i]['edit_dell'] .= $locale['c108'] . "</a> |\n"; $c_arr['c_con'][$i]['edit_dell'] .= "<a href='" . FUSION_REQUEST . "&c_action=delete&comment_id=" . $data['comment_id'] . "' onclick=\"return confirm('" . $locale['c110'] . "');\">"; $c_arr['c_con'][$i]['edit_dell'] .= $locale['c109'] . "</a>"; } $settings['comments_sorting'] == "ASC" ? $i++ : $i--; } if (iADMIN && checkrights("C")) { $c_arr['c_info']['admin_link'] = "<!--comment_admin-->\n"; $c_arr['c_info']['admin_link'] .= "<a href='" . ADMIN . "comments.php" . $aidlink . "&ctype=" . $ctype . "&cid=" . $cid . "'>" . $locale['c106'] . "</a>"; } } // Render comments echo "<a id='comments' name='comments'></a>"; render_comments($c_arr['c_con'], $c_arr['c_info']); // Add / edit comment opentable($locale['c102']); if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) { $eresult = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcu.user_name\r\n\t\t\t\tFROM " . DB_COMMENTS . " tcm\r\n\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\r\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "'\r\n\t\t\t\t\tAND comment_type='" . $ctype . "' AND comment_hidden='0'"); if (dbrows($eresult)) { $edata = dbarray($eresult); if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) { $clink .= "&c_action=edit&comment_id=" . $edata['comment_id']; $comment_message = $edata['comment_message']; } } else { $comment_message = ""; } } else { $comment_message = ""; } if (iMEMBER || $settings['guestposts'] == "1") { require_once INCLUDES . "bbcode_include.php"; echo "<a id='edit_comment' name='edit_comment'></a>\n"; echo openform('inputform', 'inputform', 'post', $clink); if (iGUEST) { echo "<div align='center' class='tbl'>\n" . $locale['c104'] . "<br />\n"; echo "<input type='text' name='comment_name' maxlength='30' class='textbox' style='width:360px' />\n"; echo "</div>\n"; } echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n"; echo form_textarea('', 'comment_message', 'comment_message', $comment_message, array('required' => 1)); echo display_bbcodes("360px", "comment_message"); if (iGUEST && (!isset($_CAPTCHA_HIDE_INPUT) || isset($_CAPTCHA_HIDE_INPUT) && !$_CAPTCHA_HIDE_INPUT)) { $_CAPTCHA_HIDE_INPUT = FALSE; echo "<div style='width:360px; margin:10px auto;'>"; echo $locale['global_150'] . "<br />\n"; include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_display.php"; if (!$_CAPTCHA_HIDE_INPUT) { echo "<br />\n<label for='captcha_code'>" . $locale['global_151'] . "</label>"; echo "<br />\n<input type='text' id='captcha_code' name='captcha_code' class='textbox' autocomplete='off' style='width:100px' />\n"; } echo "</div>\n"; } echo form_button($comment_message ? $locale['c103'] : $locale['c102'], 'post_comment', 'post_comment', $comment_message ? $locale['c103'] : $locale['c102'], array('class' => 'btn btn-primary m-t-10')); echo "</div>\n</div>\n"; echo closeform(); } else { echo $locale['c105'] . "\n"; } closetable(); } }
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 { echo form_hidden('article_language', '', $criteriaArray['article_language']); } echo form_select('article_keywords', $locale['articles_0204'], $criteriaArray['article_keywords'], array("max_length" => 320, "inline" => TRUE, "placeholder" => $locale['articles_0204a'], "width" => "100%", "error_text" => $locale['articles_0204a'], "tags" => TRUE, "multiple" => TRUE)); echo form_select_tree("article_cat", $locale['articles_0201'], $criteriaArray['article_cat'], array("width" => "250px", "inline" => TRUE, "no_root" => TRUE, "query" => multilang_table("AR") ? "WHERE article_cat_language='" . LANGUAGE . "'" : ""), DB_ARTICLE_CATS, "article_cat_name", "article_cat_id", "article_cat_parent"); $textArea_opts = array("required" => TRUE, "type" => fusion_get_settings("tinymce_enabled") ? "tinymce" : "html", "tinymce" => fusion_get_settings("tinymce_enabled") && iADMIN ? "advanced" : "simple", "autosize" => TRUE, "form_name" => "submit_form"); echo form_textarea('article_snippet', $locale['articles_0202'], $criteriaArray['article_snippet'], $textArea_opts); $textArea_opts['required'] = $article_settings['article_extended_required'] ? TRUE : FALSE; echo form_textarea('article_article', $locale['articles_0203'], $criteriaArray['article_article'], $textArea_opts); echo fusion_get_settings("site_seo") ? "" : form_button('preview_article', $locale['articles_0240'], $locale['articles_0240'], array('class' => 'btn-primary m-r-10')); echo form_button('submit_article', $locale['articles_0060'], $locale['articles_0060'], array('class' => 'btn-primary')); echo closeform();
if (isset($_POST['saveoptions'])) { $error = 0; if (!defined('FUSION_NULL')) { dbquery("UPDATE " . DB_MESSAGES_OPTIONS . " SET\r\n\t\tpm_email_notify = '" . (isnum($_POST['pm_email_notify']) ? $_POST['pm_email_notify'] : 0) . "',\r\n\t\tpm_save_sent = '" . (isnum($_POST['pm_save_sent']) ? $_POST['pm_save_sent'] : 0) . "',\r\n\t\tpm_inbox = '" . (isnum($_POST['pm_inbox']) ? $_POST['pm_inbox'] : 0) . "',\r\n\t\tpm_sentbox = '" . (isnum($_POST['pm_sentbox']) ? $_POST['pm_sentbox'] : 0) . "',\r\n\t\tpm_savebox = '" . (isnum($_POST['pm_savebox']) ? $_POST['pm_savebox'] : 0) . "'\r\n\t\tWHERE user_id='0'"); if (!$result) { $error = 1; } redirect(FUSION_SELF . $aidlink . "&error=" . $error); } } $options = dbarray(dbquery("SELECT * FROM " . DB_MESSAGES_OPTIONS . " WHERE user_id='0'"), 0); $pm_inbox = $options['pm_inbox']; $pm_sentbox = $options['pm_sentbox']; $pm_savebox = $options['pm_savebox']; opentable($locale['400']); echo openform('settingsform', 'settingsform', 'post', FUSION_SELF . $aidlink, array('downtime' => 0)); echo "<table class='table table-responsive center'>\n<tbody>\n<tr>\n"; echo "<td class='tbl2' align='center' colspan='2'><strong>" . $locale['707'] . "</strong></td>\n"; echo "</tr>\n<tr>\n"; echo "<td class='tbl' width='50%'><label for='pm_inbox'>" . $locale['701'] . "</label><br /><span class='small2'>" . $locale['704'] . "</span></td>\n"; echo "<td class='tbl' width='50%'>\n"; echo form_text('', 'pm_inbox', 'pm_inbox', $pm_inbox, array('max_length' => 4, 'width' => '100px')); echo "</td>\n</tr>\n<tr>\n"; echo "<td class='tbl' width='50%'><label for='pm_sentbox'>" . $locale['702'] . "</label><br /><span class='small2'>" . $locale['704'] . "</span></td>\n"; echo "<td class='tbl' width='50%'>\n"; echo form_text('', 'pm_sentbox', 'pm_sentbox', $pm_sentbox, array('max_length' => 4, 'width' => '100px')); echo "</td>\n</tr>\n<tr>\n"; echo "<td class='tbl' width='50%'><label for='pm_savebox'>" . $locale['703'] . "</label><br /><span class='small2'>" . $locale['704'] . "</span></td>\n"; echo "<td class='tbl' width='50%'>\n"; echo form_text('', 'pm_savebox', 'pm_savebox', $pm_savebox, array('max_length' => 4, 'width' => '100px')); echo "</td>\n</tr>\n<tr>\n";
/** * @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'); } else { $c_arr['c_con'][$i]['comment_name'] = $data['comment_name']; } $c_arr['c_con'][$i]['user_avatar'] = display_avatar($data, '35px', '', true, 'img-rounded'); $c_arr['c_con'][$i]['user'] = array('user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'user_avatar' => $avatar = $data['user_avatar'] !== '' && file_exists(IMAGES . 'avatars/' . $data['user_avatar']) ? IMAGES . 'avatars/' . $data['user_avatar'] : IMAGES . "avatars/noavatar50.png", 'user_status' => $data['user_status']); $c_arr['c_con'][$i]['comment_datestamp'] = showdate('shortdate', $data['comment_datestamp']); $c_arr['c_con'][$i]['comment_time'] = timer($data['comment_datestamp']); $c_arr['c_con'][$i]['comment_message'] = "<!--comment_message-->\n" . nl2br(parseubb(parsesmileys($data['comment_message']))); if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) { $edit_link = clean_request('c_action=edit&comment_id=' . $data['comment_id'], array('c_action', 'comment_id'), false) . "#edit_comment"; $delete_link = clean_request('c_action=delete&comment_id=' . $data['comment_id'], array('c_action', 'comment_id'), false); $c_arr['c_con'][$i]['edit_link'] = array('link' => $edit_link, 'name' => $locale['c108']); $c_arr['c_con'][$i]['delete_link'] = array('link' => $delete_link, 'name' => $locale['c109']); $c_arr['c_con'][$i]['edit_dell'] = "<!--comment_actions-->\n"; $c_arr['c_con'][$i]['edit_dell'] .= "<div class='btn-group'>"; $c_arr['c_con'][$i]['edit_dell'] .= "<a class='btn btn-xs btn-default' href='" . $edit_link . "'>"; $c_arr['c_con'][$i]['edit_dell'] .= $locale['c108'] . "</a>\n"; $c_arr['c_con'][$i]['edit_dell'] .= "<a class='btn btn-xs btn-default' href='" . $delete_link . "' onclick=\"return confirm('" . $locale['c110'] . "');\">"; $c_arr['c_con'][$i]['edit_dell'] .= "<i class='fa fa-trash'></i> " . $locale['c109'] . "</a>"; $c_arr['c_con'][$i]['edit_dell'] .= "</div>\n"; } $settings['comments_sorting'] == "ASC" ? $i++ : $i--; } if (iADMIN && checkrights("C")) { $c_arr['c_info']['admin_link'] = "<!--comment_admin-->\n"; $c_arr['c_info']['admin_link'] .= "<a href='" . ADMIN . "comments.php" . $aidlink . "&ctype=" . $comment_type . "&comment_item_id=" . $comment_item_id . "'>" . $locale['c106'] . "</a>"; } } opentable($locale['c102']); $comment_message = ""; if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) { $eresult = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcu.user_name\n\t\t\t\tFROM " . DB_COMMENTS . " tcm\n\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $comment_item_id . "'\n\t\t\t\tAND comment_type='" . $comment_type . "' AND comment_hidden='0'"); if (dbrows($eresult) > 0) { $edata = dbarray($eresult); if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) { $clink .= "&c_action=edit&comment_id=" . $edata['comment_id']; $comment_message = $edata['comment_message']; } } else { $comment_message = ""; } } if (iMEMBER || $settings['guestposts'] == "1") { require_once INCLUDES . "bbcode_include.php"; echo "<a id='edit_comment' name='edit_comment'></a>\n"; echo openform('inputform', 'post', $clink, array('class' => 'm-b-20', 'max_tokens' => 1)); if (iGUEST) { echo form_text('comment_name', $locale['c104'], '', array('max_length' => 30)); } echo form_textarea('comment_message', '', $comment_message, array('required' => 1, 'autosize' => 1, 'form_name' => 'inputform', 'bbcode' => 1)); if (iGUEST && (!isset($_CAPTCHA_HIDE_INPUT) || isset($_CAPTCHA_HIDE_INPUT) && !$_CAPTCHA_HIDE_INPUT)) { $_CAPTCHA_HIDE_INPUT = FALSE; echo "<div style='width:360px; margin:10px auto;'>"; echo $locale['global_150'] . "<br />\n"; include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_display.php"; if (!$_CAPTCHA_HIDE_INPUT) { echo "<br />\n<label for='captcha_code'>" . $locale['global_151'] . "</label>"; echo "<br />\n<input type='text' id='captcha_code' name='captcha_code' class='textbox' autocomplete='off' style='width:100px' />\n"; } echo "</div>\n"; } echo form_button('post_comment', $comment_message ? $locale['c103'] : $locale['c102'], $comment_message ? $locale['c103'] : $locale['c102'], array('class' => 'btn-success m-t-10')); echo closeform(); } else { echo "<div class='well'>\n"; echo $locale['c105'] . "\n"; echo "</div>\n"; } closetable(); echo "<a id='comments' name='comments'></a>"; render_comments($c_arr['c_con'], $c_arr['c_info']); } }
$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']); } echo form_select('news_keywords', $locale['news_0205'], $criteriaArray['news_keywords'], array("max_length" => 320, "inline" => TRUE, "placeholder" => $locale['news_0205a'], "width" => "100%", "error_text" => $locale['news_0255'], "tags" => TRUE, "multiple" => TRUE)); echo form_select_tree("news_cat", $locale['news_0201'], $criteriaArray['news_cat'], array("width" => "250px", "inline" => TRUE, "parent_value" => $locale['news_0202'], "query" => multilang_table("NS") ? "WHERE news_cat_language='" . LANGUAGE . "'" : ""), DB_NEWS_CATS, "news_cat_name", "news_cat_id", "news_cat_parent"); if ($news_settings['news_allow_submission_files']) { $file_input_options = array('upload_path' => IMAGES_N, 'max_width' => $news_settings['news_photo_max_w'], 'max_height' => $news_settings['news_photo_max_h'], 'max_byte' => $news_settings['news_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $news_settings['news_thumb_w'], 'thumbnail_h' => $news_settings['news_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $news_settings['news_photo_w'], 'thumbnail2_h' => $news_settings['news_photo_h'], 'type' => 'image', "inline" => TRUE); echo form_fileinput("news_image", $locale['news_0216'], "", $file_input_options); echo "<div class='small col-sm-offset-3 m-b-10'><span class='p-l-15'>" . sprintf($locale['news_0217'], parsebytesize($news_settings['news_photo_max_b'])) . "</span></div>\n"; $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']); echo form_select('news_ialign', $locale['news_0218'], $criteriaArray['news_ialign'], array("options" => $alignOptions, "inline" => TRUE)); }
if ($data['blog_extended']) { $data['blog_extended'] = nl2br(parse_textarea($data['blog_extended'])); } } if (defender::safe()) { echo openmodal('blog_preview', $locale['blog_0141']); echo "<h4>" . $data['blog_subject'] . "</h4>\n"; echo "<p class='text-bigger'>" . parse_textarea($data['blog_blog']) . "</p>\n"; if (isset($data['blog_extended'])) { echo parse_textarea($data['blog_extended']); } echo closemodal(); } } echo "<div class='m-t-20'>\n"; echo openform('inputform', 'post', $formaction, array('enctype' => 1, 'max_tokens' => 1)); echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-12 col-md-7 col-lg-8'>\n"; echo form_hidden("blog_id", "", $data['blog_id']); echo form_hidden("blog_datestamp", "", $data['blog_datestamp']); echo form_text('blog_subject', $locale['blog_0422'], $data['blog_subject'], array('required' => TRUE, 'max_length' => 200, 'error_text' => $locale['blog_0450'])); // move keywords here because it's required echo form_select('blog_keywords', $locale['blog_0443'], $data['blog_keywords'], array("max_length" => 320, "placeholder" => $locale['blog_0444'], "width" => "100%", "error_text" => $locale['blog_0457'], "tags" => TRUE, "multiple" => TRUE)); echo "<div class='pull-left m-r-10 display-inline-block'>\n"; echo form_datepicker('blog_start', $locale['blog_0427'], $data['blog_start'], array("placeholder" => $locale['blog_0429'], "join_to_id" => "blog_end")); echo "</div>\n<div class='pull-left m-r-10 display-inline-block'>\n"; echo form_datepicker('blog_end', $locale['blog_0428'], $data['blog_end'], array("placeholder" => $locale['blog_0429'], "join_from_id" => "blog_start")); echo "</div>\n"; echo "</div>\n<div class='col-xs-12 col-sm-12 col-md-5 col-lg-4'>\n"; openside(''); echo form_select_tree("blog_cat[]", $locale['blog_0423'], $data['blog_cat'], array("width" => "100%", "delimiter" => ".", "inline" => TRUE, "no_root" => TRUE, "tags" => TRUE, "multiple" => TRUE, "query" => multilang_table("BL") ? "WHERE blog_cat_language='" . LANGUAGE . "'" : ""), DB_BLOG_CATS, "blog_cat_name", "blog_cat_id", "blog_cat_parent");
if (!in_array($imgext, $image_types)) { addNotice('success', $locale['420']); redirect(FUSION_SELF . $aidlink . "&ifolder=" . $_GET['ifolder']); } elseif (is_uploaded_file($imgtemp)) { move_uploaded_file($imgtemp, $afolder . $imgname . $imgext); @chmod($afolder . $imgname . $imgext, 0644); if ($settings['tinymce_enabled'] == 1) { include INCLUDES . "buildlist.php"; } addNotice('success', $locale['420']); redirect(FUSION_SELF . $aidlink . "&ifolder=" . $_GET['ifolder'] . "&img=" . $imgname . $imgext); } } else { opentable($locale['420']); add_breadcrumb(array('link' => ADMIN . "images.php" . $aidlink, 'title' => $locale['420'])); echo openform('uploadform', 'post', "" . FUSION_SELF . $aidlink . "&ifolder=" . $_GET['ifolder'] . "", array('enctype' => 1, 'max_tokens' => 1)); echo "<table cellpadding='0' cellspacing='0' class='table table-responsive center'>\n<tr>\n"; echo "<td width='80' class='tbl'><label for='myfile'>" . $locale['421'] . "</label></td>\n"; echo "<td class='tbl'><input type='file' id='myfile' name='myfile' class='textbox' style='width:250px;' /></td>\n"; echo "</tr>\n<tr>\n"; echo "<td align='center' colspan='2' class='tbl'>\n"; echo form_button('uploadimage', $locale['420'], $locale['420'], array('class' => 'btn-primary')); echo "</td>\n</tr>\n</table>\n</form>\n"; closetable(); echo "<hr />\n"; if (isset($_GET['view']) && in_array($_GET['view'], $image_list)) { opentable($locale['440']); echo "<div style='text-align:center'><br />\n"; $image_ext = strrchr($afolder . stripinput($_GET['view']), "."); if (in_array($image_ext, array(".gif", ".GIF", ".ico", ".jpg", ".JPG", ".jpeg", ".JPEG", ".png", ".PNG"))) { echo "<img class='img-responsive img-thumbnail' src='" . $afolder . stripinput($_GET['view']) . "' alt='" . stripinput($_GET['view']) . "' /><br /><br />\n";
echo "</script>\n"; //Photo-Mass Upload End } closetable(); } opentable($album_title . ": " . $locale['402']); $rows = dbcount("(photo_id)", DB_PHOTOS, "album_id='" . $_GET['album_id'] . "'"); if ($rows) { if (!isset($_GET['rowstart']) || isset($_GET['rowstart']) && !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; } $result = dbquery("SELECT tp.photo_id, tp.photo_title, tp.photo_thumb1, tp.photo_datestamp, tp.photo_views, tp.photo_order, tu.user_id, tu.user_name, tu.user_status\r\n\t\t\tFROM " . DB_PHOTOS . " tp\r\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON tp.photo_user=tu.user_id\r\n\t\t\tWHERE album_id='" . $_GET['album_id'] . "' ORDER BY photo_order\r\n\t\t\tLIMIT " . $_GET['rowstart'] . "," . $settings['thumbs_per_page']); $counter = 0; $k = $_GET['rowstart'] == 0 ? 1 : $_GET['rowstart'] + 1; //echo "<form name='move_form' method='post' action='".FUSION_SELF.$aidlink."&album_id=".$_GET['album_id']."'>\n"; echo openform('move_form', 'move_form', 'post', FUSION_SELF . $aidlink . "&album_id=" . $_GET['album_id'], array('notice' => 0, 'downtime' => 0)); //echo "<table cellpadding='0' cellspacing='1' width='100%'>\n<tr>\n"; echo "<div class='row'>\n"; if ($rows > $settings['thumbs_per_page']) { echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], $settings['thumbs_per_page'], $rows, 3, FUSION_SELF . $aidlink . "&album_id=" . $_GET['album_id'] . "&") . "\n</div>\n"; } $move = dbcount("(album_id)", DB_PHOTO_ALBUMS, "album_id!='" . $_GET['album_id'] . "'"); while ($data = dbarray($result)) { $up = ""; $down = ""; if ($rows != 1) { $orderu = $data['photo_order'] - 1; $orderd = $data['photo_order'] + 1; if ($k == 1) { $down = " ·\n<a href='" . FUSION_SELF . $aidlink . "&album_id=" . $_GET['album_id'] . "&rowstart=" . $_GET['rowstart'] . "&action=mdown&order={$orderd}&photo_id=" . $data['photo_id'] . "'><img src='" . get_image("right") . "' alt='" . $locale['453'] . "' title='" . $locale['453'] . "' style='border:0px;vertical-align:middle' /></a>\n"; } elseif ($k < $rows) {
$cat_name = ""; $cat_description = ""; $cat_language = LANGUAGE; $cat_sort_by = "weblink_name"; $cat_sort_order = "ASC"; $cat_access = ""; $formaction = FUSION_SELF . $aidlink; $openTable = $locale['400']; } $user_groups = getusergroups(); $access_opts = array(); while (list($key, $user_group) = each($user_groups)) { $access_opts[$user_group['0']] = $user_group['1']; } opentable($openTable); echo openform('addcat', 'addcat', 'post', $formaction, array('downtime' => 0)); echo "<table cellpadding='0' cellspacing='0' class='table table-responsive'>\n<tr>\n"; echo "<td width='1%' class='tbl' style='white-space:nowrap'><label for='cat_name'>" . $locale['420'] . "</label></td>\n"; echo "<td class='tbl'>\n"; echo form_text('', 'cat_name', 'cat_name', $cat_name, array('required' => 1, 'error_text' => $locale['460'])); echo "</td>\n</tr>\n<tr>\n"; echo "<td width='1%' class='tbl' style='white-space:nowrap'><label for='cat_description'>" . $locale['421'] . "</label></td>\n"; echo "<td class='tbl'>\n"; echo form_text('', 'cat_description', 'cat_description', $cat_description); echo "</tr>\n"; if (multilang_table("WL")) { echo "<tr><td class='tbl'><label for='cat_language'>\n" . $locale['global_ML100'] . "</label></td>\n"; echo "<td class='tbl'>\n"; echo form_select('', 'cat_language', 'cat_language', $language_opts, $cat_language, array('placeholder' => $locale['choose'])); echo "</td>\n</tr>\n"; } else {
dbquery_order(DB_PHOTOS, $photo_data['photo_order'], "photo_order", $photo_data['photo_id'], "photo_id", $photo_data['album_id'], "album_id", FALSE, FALSE, "delete"); dbquery_insert(DB_PHOTOS, $photo_data, 'delete'); addNotice("success", $locale['photo_0024']); redirect(clean_request("", array("aid", "album_id"), TRUE)); } } // purge photos if (isset($_GET['action']) && $_GET['action'] == "purge" && isset($_GET['cat_id']) && isnum($_GET['cat_id'])) { $result = dbquery("select * from " . DB_PHOTO_ALBUMS . " where album_id='" . intval($_GET['cat_id']) . "'"); if (dbrows($result) > 0) { // album verified $albumData = dbarray($result); $photoResult = dbquery("select photo_id, photo_filename, photo_thumb1, photo_thumb2\n\t\tfrom " . DB_PHOTOS . " where album_id='" . intval($_GET['cat_id']) . "'"); if (dbrows($photoResult) > 0) { if (!isset($_POST['purge_confirm'])) { echo $locale['photo_0026'] . "<br/><br/>\n"; echo openform("purgephotos", "post", FUSION_REQUEST); echo form_button("purge_confirm", $locale['photo_0027'], $locale['photo_0027'], array("class" => "btn-danger m-r-10")); echo form_button("cancel", $locale['photo_0028'], $locale['photo_0028'], array("class" => "btn-default m-r-10")); echo closeform(); } else { while ($pData = dbarray($photoResult)) { purgePhotoImage($pData); // purging everything, order is not relevant dbquery_insert(DB_PHOTOS, $pData, "delete"); } redirect(clean_request("album_id=" . $_GET['cat_id'], array("aid")), TRUE); } } } }
public function render_poll_form($edit = 0) { global $locale, $defender; $poll_field = ''; // Build Polls Info. $thread_data = $this->thread_info['thread']; if ($edit ? $this->getThreadPermission("can_edit_poll") : $this->getThreadPermission("can_create_poll")) { // if permitted to create new poll. $data = array('thread_id' => $thread_data['thread_id'], 'forum_poll_title' => isset($_POST['forum_poll_title']) ? form_sanitizer($_POST['forum_poll_title'], '', 'forum_poll_title') : '', 'forum_poll_start' => time(), 'forum_poll_length' => 2, 'forum_poll_votes' => 0); // counter of lengths $option_data[1] = ""; $option_data[2] = ""; // calculate poll lengths if (isset($_POST['poll_options'])) { // callback on post. foreach ($_POST['poll_options'] as $i => $value) { $option_data[$i] = form_sanitizer($value, '', "poll_options[{$i}]"); } // reindex the whole array with blank values. if ($defender->safe()) { $option_data = array_values(array_filter($option_data)); array_unshift($option_data, NULL); unset($option_data[0]); $data['forum_poll_length'] = count($option_data); } } // add a Blank Poll option if (isset($_POST['add_poll_option']) && $defender->safe()) { array_push($option_data, ''); } if ($edit) { $result = dbquery("SELECT * FROM " . DB_FORUM_POLLS . " WHERE thread_id='" . $thread_data['thread_id'] . "'"); if (dbrows($result) > 0) { if (isset($_POST['update_poll']) || isset($_POST['add_poll_option'])) { $load = FALSE; $data += dbarray($result); // append if not available. } else { $load = TRUE; $data = dbarray($result); // call } if (isset($_POST['update_poll'])) { $data = array('thread_id' => $thread_data['thread_id'], 'forum_poll_title' => form_sanitizer($_POST['forum_poll_title'], '', 'forum_poll_title'), 'forum_poll_start' => $data['forum_poll_start'], 'forum_poll_length' => $data['forum_poll_length']); dbquery_insert(DB_FORUM_POLLS, $data, 'update', array('primary_key' => 'thread_id', 'no_unique' => TRUE)); $i = 1; // populate data for matches $poll_result = dbquery("SELECT forum_poll_option_id FROM " . DB_FORUM_POLL_OPTIONS . " WHERE thread_id='" . $thread_data['thread_id'] . "'"); while ($_data = dbarray($poll_result)) { $_poll[$_data['forum_poll_option_id']] = $_data; // Prune the emptied fields AND field is not required. if (empty($option_data[$_data['forum_poll_option_id']]) && $defender->safe()) { dbquery("DELETE FROM " . DB_FORUM_POLL_OPTIONS . " WHERE thread_id='" . $thread_data['thread_id'] . "' AND forum_poll_option_id='" . $_data['forum_poll_option_id'] . "'"); } } foreach ($option_data as $option_text) { if ($option_text) { if ($defender->safe()) { if (isset($_poll[$i])) { // has record dbquery("UPDATE " . DB_FORUM_POLL_OPTIONS . " SET forum_poll_option_text='" . $option_text . "' WHERE thread_id='" . $thread_data['thread_id'] . "' AND forum_poll_option_id='" . $i . "'"); } else { // no record - create $array = array('thread_id' => $thread_data['thread_id'], 'forum_poll_option_id' => $i, 'forum_poll_option_text' => $option_text, 'forum_poll_option_votes' => 0); dbquery_insert(DB_FORUM_POLL_OPTIONS, $array, 'save'); } } $i++; } } if ($defender->safe()) { redirect(INFUSIONS . "forum/postify.php?post=editpoll&error=0&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id']); } } // how to make sure values containing options votes $poll_field['openform'] = openform('pollform', 'post', INFUSIONS . 'forum/viewthread.php?action=editpoll&forum_id=' . $_GET['forum_id'] . '&thread_id=' . $_GET['thread_id']); $poll_field['openform'] .= "<div class='text-info m-b-20 m-t-10'>" . $locale['forum_0613'] . "</div>\n"; $poll_field['poll_field'] = form_text('forum_poll_title', $locale['forum_0604'], $data['forum_poll_title'], array('max_length' => 255, 'placeholder' => $locale['forum_0604a'], 'inline' => TRUE, 'required' => TRUE)); if ($load == FALSE) { for ($i = 1; $i <= count($option_data); $i++) { $poll_field['poll_field'] .= form_text("poll_options[{$i}]", sprintf($locale['forum_0606'], $i), $option_data[$i], array('max_length' => 255, 'placeholder' => $locale['forum_0605'], 'inline' => 1, 'required' => $i <= 2 ? TRUE : FALSE)); } } else { $result = dbquery("SELECT forum_poll_option_text, forum_poll_option_votes FROM " . DB_FORUM_POLL_OPTIONS . " WHERE thread_id='" . $_GET['thread_id'] . "' ORDER BY forum_poll_option_id ASC"); $i = 1; while ($_pdata = dbarray($result)) { $poll_field['poll_field'] .= form_text("poll_options[{$i}]", $locale['forum_0605'] . ' ' . $i, $_pdata['forum_poll_option_text'], array('max_length' => 255, 'placeholder' => 'Poll Options', 'inline' => 1, 'required' => $i <= 2 or $_pdata['forum_poll_option_votes'] ? TRUE : FALSE)); $i++; } } $poll_field['poll_field'] .= "<div class='col-xs-12 col-sm-offset-3'>\n"; $poll_field['poll_field'] .= form_button('add_poll_option', $locale['forum_0608'], $locale['forum_0608'], array('class' => 'btn-primary btn-sm')); $poll_field['poll_field'] .= "</div>\n"; $poll_field['poll_button'] = form_button('update_poll', $locale['forum_2013'], $locale['forum_2013'], array('class' => 'btn-default')); $poll_field['closeform'] = closeform(); } else { redirect(INFUSIONS . 'forum/index.php'); // redirect because the poll id is not available. } } else { // Save New Poll if (isset($_POST['add_poll'])) { dbquery_insert(DB_FORUM_POLLS, $data, 'save'); $data['forum_poll_id'] = dblastid(); $i = 1; foreach ($option_data as $option_text) { if ($option_text) { $data['forum_poll_option_id'] = $i; $data['forum_poll_option_text'] = $option_text; $data['forum_poll_option_votes'] = 0; dbquery_insert(DB_FORUM_POLL_OPTIONS, $data, 'save'); $i++; } } if ($defender->safe()) { dbquery("UPDATE " . DB_FORUM_THREADS . " SET thread_poll='1' WHERE thread_id='" . $thread_data['thread_id'] . "'"); redirect(INFUSIONS . "forum/postify.php?post=newpoll&error=0&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id']); } } // blank poll - no poll on edit or new thread $poll_field['openform'] = openform('pollform', 'post', INFUSIONS . 'forum/viewthread.php?action=newpoll&forum_id=' . $_GET['forum_id'] . '&thread_id=' . $_GET['thread_id'], array('max_tokens' => 1)); $poll_field['poll_field'] = form_text('forum_poll_title', $locale['forum_0604'], $data['forum_poll_title'], array('max_length' => 255, 'placeholder' => $locale['forum_0604a'], 'inline' => TRUE, 'required' => TRUE)); for ($i = 1; $i <= count($option_data); $i++) { $poll_field['poll_field'] .= form_text("poll_options[{$i}]", sprintf($locale['forum_0606'], $i), $option_data[$i], array('max_length' => 255, 'placeholder' => $locale['forum_0605'], 'inline' => 1, 'required' => $i <= 2 ? TRUE : FALSE)); } $poll_field['poll_field'] .= "<div class='col-xs-12 col-sm-offset-3'>\n"; $poll_field['poll_field'] .= form_button('add_poll_option', $locale['forum_0608'], $locale['forum_0608'], array('class' => 'btn-primary btn-sm')); $poll_field['poll_field'] .= "</div>\n"; $poll_field['poll_button'] = form_button('add_poll', $locale['forum_2011'], $locale['forum_2011'], array('class' => 'btn-success btn-md')); $poll_field['closeform'] = closeform(); } $info = array('title' => $locale['forum_0366'], 'description' => $locale['forum_2000'] . $thread_data['thread_subject'], 'field' => $poll_field); pollform($info); } else { redirect(FORUM . "index.php"); } }
$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']); if (multilang_table("FQ")) { echo form_select("faq_cat_language", $locale['global_ML100'], $data['faq_cat_language'], array('options' => fusion_get_enabled_languages())); } else { echo form_hidden("faq_cat_language", '', LANGUAGE); } echo form_button('save_cat', $locale['faq_0203'], $locale['faq_0203'], array('class' => 'btn-primary m-t-10')); echo closeform();
if (dbrows($result)) { $data = dbarray($result); $field_cat = $data['field_cat']; $field_required = $data['field_required']; $field_log = $data['field_log']; $field_registration = $data['field_registration']; $form_title = $locale['420']; } else { $field_cat = ""; $field_required = ""; $field_log = ""; $field_registration = ""; $form_title = $locale['421']; } opentable($form_title); echo openform('cat_form', 'cat_form', 'post', FUSION_SELF . $aidlink . "&enable=" . stripinput($_GET['enable']) . "", array('downtime' => 0)); echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n"; echo "<td class='tbl'>" . $locale['422'] . "</td>\n"; echo "<td class='tbl'>" . $user_field_name . "</td>\n"; echo "</tr>\n<tr>\n"; echo "<td class='tbl'>" . $locale['426'] . "</td>\n"; echo "<td class='tbl'>" . $user_field_api_version . "</td>\n"; echo "</tr>\n<tr>\n"; echo "<td class='tbl'>" . $locale['423'] . "</td>\n"; echo "<td class='tbl'><select id='field_cat_select' name='field_cat' class='form-control textbox input-sm'>\n"; $result = dbquery("SELECT field_cat_id, field_cat_name, field_cat_db FROM " . DB_USER_FIELD_CATS . " ORDER BY field_cat_order"); $sel = ""; if (dbrows($result)) { echo "<option>" . $locale['choose'] . "</option>\n"; while ($data = dbarray($result)) { if ($field_cat) {
} } } elseif (isset($_GET['action']) && $_GET['action'] == "edit" && (isset($_GET['cat_id']) && isnum($_GET['cat_id']))) { $result = dbquery("SELECT blog_cat_id, blog_cat_name, blog_cat_parent, blog_cat_image, blog_cat_language FROM " . DB_BLOG_CATS . " " . (multilang_table("BL") ? "WHERE blog_cat_language='" . LANGUAGE . "' AND" : "WHERE") . " blog_cat_id='" . intval($_GET['cat_id']) . "'"); if (dbrows($result)) { $data = dbarray($result); $data['blog_cat_hidden'] = array($data['blog_cat_id']); $formTitle = $locale['blog_0402']; } else { // FUSION_REQUEST without the "action" gets redirect(clean_request("", array("action"), FALSE)); } } add_breadcrumb(array('link' => "", 'title' => $formTitle)); opentable($formTitle); echo openform("addcat", "post", $formAction); openside(""); echo form_hidden("blog_cat_id", "", $data['blog_cat_id']); echo form_text("blog_cat_name", $locale['blog_0530'], $data['blog_cat_name'], array("required" => TRUE, "inline" => TRUE, "error_text" => $locale['blog_0560'])); echo form_select_tree("blog_cat_parent", $locale['blog_0533'], $data['blog_cat_parent'], array("inline" => TRUE, "disable_opts" => $data['blog_cat_hidden'], "hide_disabled" => TRUE, "query" => multilang_table("BL") ? "WHERE blog_cat_language='" . LANGUAGE . "'" : ""), DB_BLOG_CATS, "blog_cat_name", "blog_cat_id", "blog_cat_parent"); if (multilang_table("BL")) { echo form_select("blog_cat_language", $locale['global_ML100'], $data['blog_cat_language'], array("inline" => TRUE, "options" => fusion_get_enabled_languages(), "placeholder" => $locale['choose'])); } else { echo form_hidden("blog_cat_language", "", $data['blog_cat_language']); } echo form_select("blog_cat_image", $locale['blog_0531'], $data['blog_cat_image'], array("inline" => TRUE, "options" => blogCatImageOpts())); echo form_button("save_cat", $locale['blog_0532'], $locale['blog_0532'], array("class" => "btn-success")); closeside(); openside($locale['blog_0407']); $result = dbquery("SELECT blog_cat_id, blog_cat_name FROM " . DB_BLOG_CATS . " " . (multilang_table("BL") ? "WHERE blog_cat_language='" . LANGUAGE . "'" : "") . " ORDER BY blog_cat_name"); $rows = dbrows($result);
if (!in_array($available_rewrite, $enabled_rewrites)) { if (file_exists(INCLUDES . "rewrites/" . $available_rewrite . "_rewrite_info.php") && file_exists(LOCALE . LOCALESET . "permalinks/" . $available_rewrite . ".php")) { include LOCALE . LOCALESET . "permalinks/" . $available_rewrite . ".php"; include INCLUDES . "rewrites/" . $available_rewrite . "_rewrite_info.php"; echo "<tr>\n"; echo "<td width='15%' style='white-space:nowrap'><strong>" . $permalink_name . "</strong></td>\n"; echo "<td style='white-space:nowrap'>" . $permalink_desc . "</td>\n"; echo "<td width='1%' style='white-space:nowrap'><a href='" . FUSION_SELF . $aidlink . "&enable=" . $available_rewrite . "'>" . $locale['404a'] . "</td>\n"; echo "</tr>\n"; } } } } echo "</tbody>\n</table>\n"; break; case "pls": echo openform('settingsseo', 'post', FUSION_SELF . $aidlink); echo "<div class='well m-t-20'><i class='fa fa-lg fa-exclamation-circle m-r-10'></i>" . $locale['seo_htc_warning'] . "</div>"; echo "<div class='panel panel-default m-t-20'>\n<div class='panel-body'>\n"; $opts = array('0' => $locale['disable'], '1' => $locale['enable']); echo form_select('site_seo', $locale['438'], $settings_seo['site_seo'], array("options" => $opts, 'inline' => 1)); echo form_select('normalize_seo', $locale['439'], $settings_seo['normalize_seo'], array("options" => $opts, 'inline' => 1)); echo form_select('debug_seo', $locale['440'], $settings_seo['debug_seo'], array("options" => $opts, 'inline' => 1)); echo form_button('savesettings', $locale['750'], $locale['750'], array('class' => 'btn-primary', 'inline' => 1)); echo "</div></div>\n"; echo closeform(); break; } echo closetab(); closetable(); require_once THEMES . "templates/footer.php";
public function viewSettingsAdmin() { global $aidlink; pageAccess('F'); $forum_settings = $this->get_forum_settings(); add_breadcrumb(array('link' => ADMIN . 'settings_forum.php' . $aidlink, 'title' => self::$locale['forum_settings'])); if (isset($_POST['recount_user_post'])) { $result = dbquery("SELECT post_author, COUNT(post_id) as num_posts FROM " . DB_FORUM_POSTS . " GROUP BY post_author"); if (dbrows($result)) { while ($data = dbarray($result)) { $result2 = dbquery("UPDATE " . DB_USERS . " SET user_posts='" . $data['num_posts'] . "' WHERE user_id='" . $data['post_author'] . "'"); } addNotice('success', self::$locale['forum_061']); } } if (isset($_POST['savesettings'])) { $numofthreads = form_sanitizer($_POST['numofthreads'], 20, 'numofthreads'); $threads_num = form_sanitizer($_POST['threads_per_page'], 20, 'threads_per_page'); $posts_num = form_sanitizer($_POST['posts_per_page'], 20, 'posts_per_page'); $forum_ips = form_sanitizer($_POST['forum_ips'], -103, 'forum_ips'); $attachmax = form_sanitizer($_POST['calc_b'], 1, 'calc_b') * form_sanitizer($_POST['calc_c'], 1000000, 'calc_c'); $attachmax_count = form_sanitizer($_POST['forum_attachmax_count'], 5, 'forum_attachmax_count'); $attachtypes = form_sanitizer($_POST['forum_attachtypes'], '.pdf,.gif,.jpg,.png,.zip,.rar,.tar,.bz2,.7z', 'forum_attachtypes'); $thread_notify = form_sanitizer($_POST['thread_notify'], '0', 'thread_notify'); $forum_ranks = form_sanitizer($_POST['forum_ranks'], '0', 'forum_ranks'); $forum_rank_style = form_sanitizer($_POST['forum_rank_style'], '0', 'forum_rank_style'); $forum_edit_lock = form_sanitizer($_POST['forum_edit_lock'], '0', 'forum_edit_lock'); $forum_edit_timelimit = form_sanitizer($_POST['forum_edit_timelimit'], '0', 'forum_edit_timelimit'); $popular_threads_timeframe = form_sanitizer($_POST['popular_threads_timeframe'], '604800', 'popular_threads_timeframe'); $forum_last_posts_reply = form_sanitizer($_POST['forum_last_posts_reply'], '0', 'forum_last_posts_reply'); $forum_last_post_avatar = form_sanitizer($_POST['forum_last_post_avatar'], '0', 'forum_last_post_avatar'); $forum_editpost_to_lastpost = form_sanitizer($_POST['forum_editpost_to_lastpost'], '0', 'forum_editpost_to_lastpost'); if (\defender::safe()) { dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$numofthreads}' WHERE settings_name='numofthreads' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$threads_num}' WHERE settings_name='threads_per_page' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$posts_num}' WHERE settings_name='posts_per_page' AND settings_inf='forum'"); //".(isnum($_POST['forum_ips']) ? $_POST['forum_ips'] : "103")." dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_ips}' WHERE settings_name='forum_ips' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$attachmax}' WHERE settings_name='forum_attachmax' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$attachmax_count}' WHERE settings_name='forum_attachmax_count' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$attachtypes}' WHERE settings_name='forum_attachtypes' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$thread_notify}' WHERE settings_name='thread_notify' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_ranks}' WHERE settings_name='forum_ranks' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_rank_style}' WHERE settings_name='forum_rank_style' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_edit_lock}' WHERE settings_name='forum_edit_lock' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_edit_timelimit}' WHERE settings_name='forum_edit_timelimit' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$popular_threads_timeframe}' WHERE settings_name='popular_threads_timeframe' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_last_posts_reply}' WHERE settings_name='forum_last_posts_reply' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_last_post_avatar}' WHERE settings_name='forum_last_post_avatar' AND settings_inf='forum'"); dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_editpost_to_lastpost}' WHERE settings_name='forum_editpost_to_lastpost' AND settings_inf='forum'"); addNotice('success', self::$locale['900']); redirect(FUSION_SELF . $aidlink . '§ion=fs'); } } $yes_no_array = array('1' => self::$locale['yes'], '0' => self::$locale['no']); echo "<div class='well'>" . self::$locale['forum_description'] . "</div>"; echo openform('forum_settings_form', 'post', FUSION_REQUEST, array('class' => 'm-t-20')); echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-8'>\n"; openside(''); echo "<span class='small pull-right'>* " . self::$locale['506'] . "</span><br/>\n"; echo form_text('numofthreads', self::$locale['505'], $forum_settings['numofthreads'], array('error_text' => self::$locale['error_value'], 'inline' => 1, 'width' => '150px', 'type' => 'number')); closeside(); openside(''); echo form_text('threads_per_page', self::$locale['forum_080'], $forum_settings['threads_per_page'], array('error_text' => self::$locale['error_value'], 'inline' => 1, 'width' => '150px', 'type' => 'number')); echo form_text('posts_per_page', self::$locale['forum_081'], $forum_settings['posts_per_page'], array('error_text' => self::$locale['error_value'], 'inline' => 1, 'width' => '150px', 'type' => 'number')); closeside(); openside(''); echo form_select('thread_notify', self::$locale['512'], $forum_settings['thread_notify'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1)); closeside(); openside(''); echo "<span class='pull-right position-absolute small' style='right:30px;'>" . self::$locale['537'] . "</span>\n"; echo form_select('forum_edit_timelimit', self::$locale['536'], $forum_settings['forum_edit_timelimit'], array('options' => array('0', '10', '30', '45', '60'), 'max_length' => 2, 'width' => '100px', 'required' => 1, 'error_text' => self::$locale['error_value'], 'inline' => 1)); echo form_select('forum_ips', self::$locale['507'], $forum_settings['forum_ips'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1)); echo form_select('forum_ranks', self::$locale['520'], $forum_settings['forum_ranks'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1)); echo form_select('forum_rank_style', self::$locale['forum_064'], $forum_settings['forum_rank_style'], array('options' => array(self::$locale['forum_063'], self::$locale['forum_062']), 'error_text' => self::$locale['error_value'], 'inline' => 1)); echo form_select('forum_last_post_avatar', self::$locale['539'], $forum_settings['forum_last_post_avatar'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1)); echo form_select('forum_edit_lock', self::$locale['521'], $forum_settings['forum_edit_lock'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1)); echo form_select('forum_editpost_to_lastpost', self::$locale['538'], $forum_settings['forum_editpost_to_lastpost'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1)); closeside(); echo "</div>\n"; echo "<div class='col-xs-12 col-sm-4'>\n"; openside(''); $calc_opts = array(1 => 'Bytes (bytes)', 1000 => 'KB (Kilobytes)', 1000000 => 'MB (Megabytes)'); $calc_c = self::calculate_byte($forum_settings['forum_attachmax']); $calc_b = $forum_settings['forum_attachmax'] / $calc_c; require_once INCLUDES . "mimetypes_include.php"; $mime = mimeTypes(); $mime_opts = array(); foreach ($mime as $m => $Mime) { $ext = ".{$m}"; $mime_opts[$ext] = $ext; } sort($mime_opts); echo "<div class='clearfix'>\n"; echo "<span class='pull-right small'>" . self::$locale['509'] . "</span>"; echo "<label for='calc_c'>" . self::$locale['508'] . "</label><br />\n"; echo form_text('calc_b', '', $calc_b, array('required' => 1, 'number' => 1, 'error_text' => self::$locale['error_rate'], 'width' => '100px', 'max_length' => '3', 'class' => 'm-r-10 pull-left')); echo form_select('calc_c', '', $calc_c, array('options' => $calc_opts, 'placeholder' => self::$locale['choose'], 'class' => 'pull-left', 'width' => '100%')); echo "</div>\n"; echo "<div class='clearfix'>\n"; echo "<span class='small pull-right'>" . self::$locale['535'] . "</span>\n"; echo "<label for='attachmax_count'>" . self::$locale['534'] . "</label>\n"; echo form_select('forum_attachmax_count', '', $forum_settings['forum_attachmax_count'], array('options' => range(1, 10), 'error_text' => self::$locale['error_value'], 'width' => '100%')); echo "</div>\n"; echo "<div class='clearfix'>\n"; echo "<span class='small pull-right'>" . self::$locale['511'] . "</span>\n"; echo form_select('forum_attachtypes', self::$locale['510'], $forum_settings['forum_attachtypes'], array('options' => $mime_opts, 'width' => '100%', 'error_text' => self::$locale['error_type'], 'tags' => 1, 'multiple' => 1, 'placeholder' => self::$locale['choose'])); echo "</div>\n"; closeside(); openside(''); $timeframe_opts = array('604800' => self::$locale['527'], '2419200' => self::$locale['528'], '31557600' => self::$locale['529'], '0' => self::$locale['530']); $lastpost_opts = array('0' => self::$locale['519'], '1' => self::$locale['533']); for ($i = 2; $i <= 20; $i++) { $array_opts[$i] = sprintf(self::$locale['532'], $i); } if (isset($_GET['action']) && $_GET['action'] == "count_posts") { echo alert(self::$locale['524'], '', array('class' => 'warning')); } echo "<div class='clearfix'>\n"; echo form_select('popular_threads_timeframe', self::$locale['525'], $forum_settings['popular_threads_timeframe'], array('options' => $timeframe_opts, 'error_text' => self::$locale['error_value'], 'width' => '100%')); echo "</div>\n"; echo "<div class='clearfix'>\n"; echo form_select('forum_last_posts_reply', self::$locale['531'], $forum_settings['forum_last_posts_reply'], array('options' => $lastpost_opts, 'error_text' => self::$locale['error_value'], 'width' => '100%')); echo "</div>\n"; echo form_button('recount_user_post', self::$locale['523'], '1', array('class' => 'btn-primary btn-block')); closeside(); echo "</div>\n"; echo "</div>\n"; echo form_button('savesettings', self::$locale['750'], self::$locale['750'], array('class' => 'btn-success')); echo closeform(); }
if (dbrows($result)) { $data = dbarray($result); $group_name = $data['group_name']; $group_description = $data['group_description']; $form_action = FUSION_SELF . $aidlink . "&group_id=" . $_GET['group_id']; opentable($locale['430']); } else { redirect(FUSION_SELF . $aidlink); } } else { $group_name = ""; $group_description = ""; $form_action = FUSION_SELF . $aidlink; opentable($locale['431']); } echo openform('editform', 'editform', 'post', $form_action, array('downtime' => 0)); echo "<table cellpadding='0' cellspacing='0' class='table table-responsive center'>\n<tbody>\n"; echo "<tr>\n<td class='tbl' width='1%' style='white-space:nowrap;'><label for='group_name'>" . $locale['432'] . "</label></td>\n"; echo "<td class='tbl'>\n"; echo form_text('', 'group_name', 'group_name', $group_name, array('required' => 1, 'error_text' => $locale['464'])); echo "</td>\n</tr>\n<tr>\n<td class='tbl' width='1%' style='white-space:nowrap;'><label for='group_description'>" . $locale['433'] . "</label></td>\n"; echo "<td class='tbl'>\n"; echo form_textarea('', 'group_description', 'group_description', $group_description, ''); echo "</td>\n</tr>\n<tr>\n<td align='center' colspan='2' class='tbl'><br />\n"; echo form_button($locale['434'], 'save_group', 'save_group', $locale['434'], array('class' => 'btn-primary')); echo "</td>\n</tr>\n</tbody>\n</table>\n</form>"; closetable(); if (isset($_GET['group_id']) && isnum($_GET['group_id'])) { opentable($locale['440']); if (!isset($_POST['search_users'])) { // no need token for this form.
$poll_option[$i] = $data["poll_opt_" . $i]; } } if (iMEMBER) { $result2 = dbquery("SELECT * FROM " . DB_POLL_VOTES . " WHERE vote_user='******'user_id'] . "' AND poll_id='" . $data['poll_id'] . "'"); } if (iMEMBER && !dbrows($result2) && $data['poll_ended'] == 0) { $poll = ""; $i = 0; $num_opts = count($poll_option); while ($i < $num_opts) { $poll .= "<label><input type='radio' name='voteoption' value='{$i}' /> {$poll_option[$i]}</label><br /><br />\n"; $i++; } $form_action = FUSION_SELF . (FUSION_QUERY ? "?" . FUSION_QUERY : ""); echo openform('voteform', 'post', $form_action, array('max_tokens' => 1)); echo "<strong>" . $poll_title . "</strong><br /><br />\n" . $poll; echo "<div style='text-align:center'><input type='hidden' name='poll_id' value='" . $data['poll_id'] . "' />\n"; echo form_button("cast_vote", $locale['global_131'], $locale['global_131'], array('class' => 'btn-primary m-r-10')); echo "</div>\n"; echo closeform(); } else { $poll = ""; $i = 0; $num_opts = count($poll_option); $poll_votes = dbcount("(vote_opt)", DB_POLL_VOTES, "poll_id='" . $data['poll_id'] . "'"); while ($i < $num_opts) { $num_votes = dbcount("(vote_opt)", DB_POLL_VOTES, "vote_opt='{$i}' AND poll_id='" . $data['poll_id'] . "'"); $opt_votes = $poll_votes ? number_format(100 / $poll_votes * $num_votes) : 0; $poll .= progress_bar($opt_votes, $poll_option[$i]); $poll .= "<div>" . $opt_votes . "% [" . (empty($num_votes) ? 0 : $num_votes) . ($num_votes == 1 ? $locale['global_133'] : $locale['global_134']) . "]</div><br />\n";
} $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')); echo form_button('save_banners', $locale['854'], $locale['854'], array('class' => 'btn-success m-r-10')); echo closeform(); closetable(); require_once THEMES . "templates/footer.php";
function display_quickReply($info) { $locale = fusion_get_locale("", FORUM_LOCALE); $forum_settings = \PHPFusion\Forums\ForumServer::get_forum_settings(); $userdata = fusion_get_userdata(); $qr_form = "<!--sub_forum_thread-->\n"; $form_url = INFUSIONS . "forum/viewthread.php?thread_id=" . $info['thread_id']; $qr_form .= openform('quick_reply_form', 'post', $form_url, array('class' => 'm-b-20 m-t-20')); $qr_form .= "<h4 class='m-t-20 pull-left'>" . $locale['forum_0168'] . "</h4>\n"; $qr_form .= form_textarea('post_message', $locale['forum_0601'], '', array('bbcode' => true, 'required' => true, 'autosize' => true, 'preview' => true, 'form_name' => 'quick_reply_form')); $qr_form .= "<div class='m-t-10 pull-right'>\n"; $qr_form .= form_button('post_quick_reply', $locale['forum_0172'], $locale['forum_0172'], array('class' => 'btn-primary btn-sm m-r-10')); $qr_form .= "</div>\n"; $qr_form .= "<div class='overflow-hide'>\n"; $qr_form .= form_checkbox('post_smileys', $locale['forum_0169'], '', array('class' => 'm-b-0', 'reverse_label' => TRUE)); if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) { $qr_form .= form_checkbox('post_showsig', $locale['forum_0170'], '1', array('class' => 'm-b-0', 'reverse_label' => TRUE)); } if ($forum_settings['thread_notify']) { $qr_form .= form_checkbox('notify_me', $locale['forum_0171'], $info['user_tracked'], array('class' => 'm-b-0', 'reverse_label' => TRUE)); } $qr_form .= "</div>\n"; $qr_form .= closeform(); return (string) $qr_form; }
if (!$result) { $error = 1; } $result = dbquery("UPDATE " . DB_SETTINGS . " SET settings_value='{$license_lastupdate}' WHERE settings_name='license_lastupdate'"); if (!$result) { $error = 1; } if ($error) { addNotice('danger', $locale['901']); } else { addNotice('success', $locale['900']); } redirect(FUSION_SELF . $aidlink); } opentable($locale['register_settings']); echo openform('settingsform', 'post', FUSION_SELF . $aidlink, array('max_tokens' => 1)); $opts = array('1' => $locale['yes'], '0' => $locale['no']); echo "<div class='well'>" . $locale['register_description'] . "</div>\n"; echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-8'>\n"; openside(''); echo form_select('enable_terms', $locale['558'], $settings2['enable_terms'], array("options" => $opts)); echo form_textarea('license_agreement', $locale['559'], $settings2['license_agreement'], array('form_name' => 'settingsform', 'input_id' => 'enable_license_agreement', 'autosize' => !$settings['tinymce_enabled'], 'html' => !$settings['tinymce_enabled'])); closeside(); echo "</div><div class='col-xs-12 col-sm-4'>\n"; openside(''); echo form_select('enable_registration', $locale['551'], $settings2['enable_registration'], array("options" => $opts)); echo form_select('email_verification', $locale['552'], $settings2['email_verification'], array("options" => $opts)); echo form_select('admin_activation', $locale['557'], $settings2['admin_activation'], array("options" => $opts)); echo form_select('display_validation', $locale['553'], $settings2['display_validation'], array("options" => $opts)); closeside();
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"; if (isset($callback_data['article_article'])) { echo $callback_data['article_article']; } echo closemodal(); } } echo openform("publish_article", "post", FUSION_REQUEST); echo "<div class='well clearfix'>\n"; echo "<div class='pull-left'>\n"; echo display_avatar($data, "30px", "", "", ""); echo "</div>\n"; echo "<div class='overflow-hide'>\n"; echo $locale['articles_0052'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "<br/>\n"; echo $locale['articles_0053'] . timer($data['submit_datestamp']) . " - " . showdate("shortdate", $data['submit_datestamp']); echo "</div>\n"; echo "</div>\n"; echo "<div class='container-fluid'>\n"; echo "<div class='col-xs-12 col-sm-12 col-md-12 col-lg-8'>"; echo form_text("article_subject", $locale['articles_0200'], $callback_data['article_subject'], array("required" => TRUE, "inline" => FALSE)); echo form_select('article_keywords', $locale['articles_0204'], $callback_data['article_keywords'], array("max_length" => 320, "placeholder" => $locale['articles_0204a'], "width" => "100%", "error_text" => $locale['articles_0257'], "tags" => TRUE, "multiple" => TRUE)); $snippetSettings = array("required" => TRUE, "preview" => TRUE, "html" => TRUE, "autosize" => TRUE, "form_name" => "inputform"); if (fusion_get_settings("tinymce_enabled")) {
$subject = ""; $body = ""; $body2 = ""; $draft = ""; $breaks = " checked='checked'"; $comments = " checked='checked'"; $ratings = " checked='checked'"; } opentable($locale['400']); } $result = dbquery("SELECT article_cat_id, article_cat_name FROM " . DB_ARTICLE_CATS . " ORDER BY article_cat_name DESC"); $catlist = array(); while ($data = dbarray($result)) { $catlist[$data['article_cat_id']] = $data['article_cat_name']; } echo openform('input_form', 'input_form', 'post', FUSION_SELF . $aidlink, array('downtime' => 0)); echo "<table cellpadding='0' cellspacing='0' class='table table-responsive center'>\n<tr>\n"; echo "<td width='100' class='tbl'><label for='article_cat'>" . $locale['422'] . "</label></td>\n"; echo "<td class='tbl'>\n"; echo form_select('', 'article_cat', 'article_cat', $catlist, $article_cat, array('placeholder' => $locale['choose'])); echo "</td>\n</tr>\n<tr>\n"; echo "<td width='100' class='tbl'><label for='subject'>" . $locale['423'] . " <span class='required'>*</span></label></td>\n"; echo "<td class='tbl'>\n"; echo form_text('', 'subject', 'subject', $subject, array('required' => 1)); echo "</td>\n"; echo "</tr>\n<tr>\n"; echo "<td valign='top' width='100' class='tbl'><label for='body'>" . $locale['424'] . "</label></td>\n"; echo "<td class='tbl'>\n"; echo form_textarea('', 'body', 'body', $body); echo "</td>\n"; echo "</tr>\n";
function render_article($subject, $article, $info) { echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n<td class='capmain'>{$subject}</td>\n</tr>\n<tr>\n<td class='main-body'>\n" . ($info['article_breaks'] == "y" ? nl2br($article) : $article) . "\n</td>\n</tr>\n<tr>\n<td align='center' class='news-footer'>\n"; echo openform("A", $info['article_id']) . articleposter($info, " ·") . articleopts($info, "·") . closeform("A", $info['article_id']); echo "</td>\n</tr>\n</table>\n"; }