本文整理汇总了PHP中closeform函数的典型用法代码示例。如果您正苦于以下问题:PHP closeform函数的具体用法?PHP closeform怎么用?PHP closeform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了closeform函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showratings
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='" . $userdata['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='" . $userdata['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";
}
}
}
示例2: render_admin_login
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";
}
示例3: render_admin_login
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";
}
示例4: displayRanksForm
protected function displayRanksForm()
{
global $aidlink;
if (isset($_POST['cancel_rank'])) {
redirect(clean_request("", array("rank_id", "ref"), FALSE));
}
add_to_footer("<script src='" . FORUM . "admin/admin_rank.js'></script>");
$this->data['rank_language'] = LANGUAGE;
$array_apply_normal_opts = array(USER_LEVEL_MEMBER => self::$locale['424'], '104' => self::$locale['425'], USER_LEVEL_ADMIN => self::$locale['426'], USER_LEVEL_SUPER_ADMIN => self::$locale['427']);
// Special Select
$groups_arr = getusergroups();
$groups_except = array(USER_LEVEL_PUBLIC, USER_LEVEL_MEMBER, USER_LEVEL_ADMIN, USER_LEVEL_SUPER_ADMIN);
$group_opts = array();
foreach ($groups_arr as $group) {
if (!in_array($group[0], $groups_except)) {
$group_opts[$group[0]] = $group[1];
}
}
$language_opts = fusion_get_enabled_languages();
$this->post_forum_ranks();
$form_action = FUSION_SELF . $aidlink . '§ion=fr';
if (isset($_GET['rank_id']) && isnum($_GET['rank_id'])) {
$result = dbquery("SELECT * FROM " . DB_FORUM_RANKS . " WHERE rank_id='" . intval($_GET['rank_id']) . "'");
if (dbrows($result) > 0) {
$this->data = dbarray($result);
$form_action = FUSION_SELF . $aidlink . "§ion=fr&rank_id=" . $_GET['rank_id'];
} else {
redirect(clean_request("", array("rank_id", "ref"), FALSE));
}
}
$html = openform('rank_form', 'post', $form_action, array('class' => 'm-t-20')) . form_text('rank_title', self::$locale['420'], $this->data['rank_title'], array('required' => 1, 'error_text' => self::$locale['414'], "inline" => TRUE)) . form_select('rank_image', self::$locale['421'], $this->data['rank_image'], array('options' => $this->get_rank_images(), 'placeholder' => self::$locale['choose'], "inline" => TRUE));
if (multilang_table("FR")) {
$html .= form_select('rank_language', self::$locale['global_ML100'], $this->data['rank_language'], array('options' => $language_opts, 'placeholder' => self::$locale['choose'], "inline" => TRUE));
} else {
$html .= form_hidden('rank_language', '', $this->data['rank_language']);
}
$html .= form_checkbox('rank_type', self::$locale['429'], $this->data['rank_type'], array("options" => array(2 => self::$locale['429a'], 1 => self::$locale['429b'], 0 => self::$locale['429c']), "type" => "radio", "inline" => TRUE)) . form_text('rank_posts', self::$locale['422'], $this->data['rank_posts'], array('inline' => TRUE, 'type' => 'number', 'width' => '10%', 'disabled' => $this->data['rank_type'] != 0)) . "<span id='select_normal' " . ($this->data['rank_type'] == 2 ? "class='display-none'" : "") . " >" . form_select('rank_apply_normal', self::$locale['423'], $this->data['rank_apply'], array('options' => $array_apply_normal_opts, 'placeholder' => self::$locale['choose'], "inline" => TRUE)) . "</span>\n<span id='select_special'" . ($this->data['rank_type'] != 2 ? " class='display-none'" : "") . ">" . form_select('rank_apply_special', self::$locale['423'], $this->data['rank_apply'], array('options' => $group_opts, 'placeholder' => self::$locale['choose'], "inline" => TRUE)) . "</span>\n" . form_button('save_rank', self::$locale['428'], self::$locale['428'], array('class' => 'btn-primary m-r-10')) . form_button('cancel_rank', self::$locale['cancel'], self::$locale['cancel'], array('class' => 'btn-default')) . closeform();
return $html;
/* echo "<td class='tbl'><strong>".self::$locale['429']."</strong></td>\n";
echo "<td class='tbl'>\n";
echo "<label><input type='radio' name='rank_type' value='2'".($rank_type == 2 ? " checked='checked'" : "")." /> ".self::$locale['429a']."</label>\n";
echo "<label><input type='radio' name='rank_type' value='1'".($rank_type == 1 ? " checked='checked'" : "")." /> ".self::$locale['429b']."</label>\n";
echo "<label><input type='radio' name='rank_type' value='0'".($rank_type == 0 ? " checked='checked'" : "")." /> ".self::$locale['429c']."</label>\n";
echo "</td>\n";
echo "</tr>\n<tr>\n";
*/
}
示例5: forum_newtopic
function forum_newtopic()
{
global $settings, $locale;
if (isset($_POST['select_forum'])) {
$_POST['forum_sel'] = isset($_POST['forum_sel']) && isnum($_POST['forum_sel']) ? $_POST['forum_sel'] : 0;
redirect(FORUM . 'post.php?action=newthread&forum_id=' . $_POST['forum_sel']);
}
echo openmodal('newtopic', $locale['forum_0057'], array('button_id' => 'newtopic', 'class' => 'modal-md'));
$index = dbquery_tree(DB_FORUMS, 'forum_id', 'forum_cat');
$result = dbquery("SELECT a.forum_id, a.forum_name, b.forum_name as forum_cat_name, a.forum_post\n\t\t FROM " . DB_FORUMS . " a\n\t\t LEFT JOIN " . DB_FORUMS . " b ON a.forum_cat=b.forum_id\n\t\t WHERE " . groupaccess('a.forum_access') . " " . (multilang_table("FO") ? "AND a.forum_language='" . LANGUAGE . "' AND" : "AND") . "\n\t\t (a.forum_type ='2' or a.forum_type='4') AND a.forum_post < " . USER_LEVEL_PUBLIC . " AND a.forum_lock !='1' ORDER BY a.forum_cat ASC, a.forum_branch ASC, a.forum_name ASC");
$options = array();
if (dbrows($result) > 0) {
while ($data = dbarray($result)) {
$depth = get_depth($index, $data['forum_id']);
if (checkgroup($data['forum_post'])) {
$options[$data['forum_id']] = str_repeat("—", $depth) . $data['forum_name'] . " " . ($data['forum_cat_name'] ? "(" . $data['forum_cat_name'] . ")" : '');
}
}
echo "<div class='well clearfix m-t-10'>\n";
echo form_select('forum_sel', $locale['forum_0395'], '', array('options' => $options, 'inline' => 1, 'width' => '100%'));
echo "<div class='display-inline-block col-xs-12 col-sm-offset-3'>\n";
echo form_button('select_forum', $locale['forum_0396'], 'select_forum', array('class' => 'btn-primary btn-sm'));
echo "</div>\n";
echo "</div>\n";
echo closeform();
} else {
echo "<div class='well text-center'>\n";
echo $locale['forum_0328'];
echo "</div>\n";
}
echo closemodal();
}
示例6: set_newThreadInfo
//.........这里部分代码省略.........
}
// update current forum
dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . $post_data['post_datestamp'] . "', forum_postcount=forum_postcount+1, forum_threadcount=forum_threadcount+1, forum_lastpostid='" . $post_data['post_id'] . "', forum_lastuser='" . $post_data['post_author'] . "' WHERE forum_id='" . $post_data['forum_id'] . "'");
// update current thread
dbquery("UPDATE " . DB_FORUM_THREADS . " SET thread_lastpost='" . $post_data['post_datestamp'] . "', thread_lastpostid='" . $post_data['post_id'] . "', thread_lastuser='" . $post_data['post_author'] . "' WHERE thread_id='" . $post_data['thread_id'] . "'");
// set notify
if ($forum_settings['thread_notify'] && isset($_POST['notify_me']) && $post_data['thread_id']) {
if (!dbcount("(thread_id)", DB_FORUM_THREAD_NOTIFY, "thread_id='" . $post_data['thread_id'] . "' AND notify_user='" . $post_data['post_author'] . "'")) {
dbquery("INSERT INTO " . DB_FORUM_THREAD_NOTIFY . " (thread_id, notify_datestamp, notify_user, notify_status) VALUES('" . $post_data['thread_id'] . "', '" . $post_data['post_datestamp'] . "', '" . $post_data['post_author'] . "', '1')");
}
}
// Add poll if exist
if (!empty($option_data) && isset($_POST['add_poll'])) {
dbquery_insert(DB_FORUM_POLLS, $pollData, 'save');
$poll_option_data['thread_id'] = $pollData['thread_id'];
$i = 1;
foreach ($option_data as $option_text) {
if ($option_text) {
$poll_option_data['forum_poll_option_id'] = $i;
$poll_option_data['forum_poll_option_text'] = $option_text;
$poll_option_data['forum_poll_option_votes'] = 0;
dbquery_insert(DB_FORUM_POLL_OPTIONS, $poll_option_data, 'save');
$i++;
}
}
dbquery("UPDATE " . DB_FORUM_THREADS . " SET thread_poll='1' WHERE thread_id='" . $pollData['thread_id'] . "'");
}
}
if (\defender::safe()) {
redirect(INFUSIONS . "forum/postify.php?post=new&error=0&forum_id=" . intval($post_data['forum_id']) . "&parent_id=" . intval($post_data['forum_cat']) . "&thread_id=" . intval($post_data['thread_id'] . ""));
}
}
}
$this->info = array('title' => $locale['forum_0057'], 'description' => '', 'openform' => openform('input_form', 'post', FORUM . "newthread.php?forum_id=" . $post_data['forum_id'], array('enctype' => self::getPermission("can_upload_attach"))), 'closeform' => closeform(), 'forum_id_field' => '', 'thread_id_field' => '', "forum_field" => "", 'subject_field' => form_text('thread_subject', $locale['forum_0600'], $thread_data['thread_subject'], array('required' => 1, 'placeholder' => $locale['forum_2001'], 'error_text' => '', 'class' => 'm-t-20 m-b-20')), 'tags_field' => form_select('thread_tags[]', $locale['forum_tag_0100'], $thread_data['thread_tags'], array('options' => $this->tag()->get_TagOpts(TRUE), 'width' => '100%', 'multiple' => TRUE, 'delimiter' => '.', 'max_select' => 3)), 'message_field' => form_textarea('post_message', $locale['forum_0601'], $post_data['post_message'], array('required' => 1, 'error_text' => '', 'autosize' => 1, 'no_resize' => 1, 'preview' => 1, 'form_name' => 'input_form', 'bbcode' => 1)), 'attachment_field' => self::getPermission("can_upload_attach") ? form_fileinput('file_attachments[]', $locale['forum_0557'], "", array('input_id' => 'file_attachments', 'upload_path' => INFUSIONS . 'forum/attachments/', 'type' => 'object', 'preview_off' => TRUE, "multiple" => TRUE, "inline" => FALSE, 'max_count' => $forum_settings['forum_attachmax_count'], 'valid_ext' => $forum_settings['forum_attachtypes'], "class" => "m-b-0")) . " <div class='m-b-20'>\n<small>\n " . sprintf($locale['forum_0559'], parsebytesize($forum_settings['forum_attachmax']), str_replace('|', ', ', $forum_settings['forum_attachtypes']), $forum_settings['forum_attachmax_count']) . "</small>\n</div>\n" : "", 'poll_form' => $poll_form, 'smileys_field' => form_checkbox('post_smileys', $locale['forum_0622'], $post_data['post_smileys'], array('class' => 'm-b-0', 'reverse_label' => TRUE)), 'signature_field' => array_key_exists("user_sig", $userdata) && $userdata['user_sig'] ? form_checkbox('post_showsig', $locale['forum_0623'], $post_data['post_showsig'], array('class' => 'm-b-0', 'reverse_label' => TRUE)) : '', 'sticky_field' => iMOD || iSUPERADMIN ? form_checkbox('thread_sticky', $locale['forum_0620'], $thread_data['thread_sticky'], array('class' => 'm-b-0', 'reverse_label' => TRUE)) : '', 'lock_field' => iMOD || iSUPERADMIN ? form_checkbox('thread_locked', $locale['forum_0621'], $thread_data['thread_locked'], array('class' => 'm-b-0', 'reverse_label' => TRUE)) : '', 'edit_reason_field' => '', 'delete_field' => '', 'hide_edit_field' => '', 'post_locked_field' => '', 'notify_field' => $forum_settings['thread_notify'] ? form_checkbox('notify_me', $locale['forum_0626'], $post_data['notify_me'], array('class' => 'm-b-0', 'reverse_label' => TRUE)) : '', 'post_buttons' => form_button('post_newthread', $locale['forum_0057'], $locale['forum_0057'], array('class' => 'btn-primary btn-sm')) . form_button('cancel', $locale['cancel'], $locale['cancel'], array('class' => 'btn-default btn-sm m-l-10')), 'last_posts_reply' => '');
// add a jquery to toggle the poll form
add_to_jquery("\n if (\$('#add_poll').is(':checked')) {\n \$('#poll_form').show();\n } else {\n \$('#poll_form').hide();\n }\n \$('#add_poll').bind('click', function() {\n if (\$(this).is(':checked')) {\n \$('#poll_form').slideDown();\n } else {\n \$('#poll_form').slideUp();\n }\n });\n ");
} else {
redirect(FORUM . "index.php");
}
} else {
/*
* Quick New Forum Posting.
* Does not require to run permissions.
* Does not contain forum poll.
* Does not contain attachment
*/
if (!dbcount("(forum_id)", DB_FORUMS, "forum_type !='1'")) {
redirect(INFUSIONS . "forum/index.php");
}
if (!dbcount("(forum_id)", DB_FORUMS, "forum_language ='" . LANGUAGE . "'")) {
redirect(INFUSIONS . "forum/index.php");
}
add_breadcrumb(array("link" => FORUM . "newthread.php?forum_id=0", "title" => $locale['forum_0057']));
$thread_data = array('forum_id' => isset($_POST['forum_id']) ? form_sanitizer($_POST['forum_id'], 0, "forum_id") : 0, 'thread_id' => 0, 'thread_subject' => isset($_POST['thread_subject']) ? form_sanitizer($_POST['thread_subject'], '', 'thread_subject') : '', 'thread_tags' => isset($_POST['thread_tags']) ? form_sanitizer($_POST['thread_tags'], '', 'thread_tags') : '', 'thread_author' => $userdata['user_id'], 'thread_views' => 0, 'thread_lastpost' => time(), 'thread_lastpostid' => 0, 'thread_lastuser' => $userdata['user_id'], 'thread_postcount' => 1, 'thread_poll' => 0, 'thread_sticky' => isset($_POST['thread_sticky']) ? TRUE : FALSE, 'thread_locked' => isset($_POST['thread_sticky']) ? TRUE : FALSE, 'thread_hidden' => 0);
$post_data = array('forum_id' => isset($_POST['forum_id']) ? form_sanitizer($_POST['forum_id'], 0, "forum_id") : 0, "forum_cat" => 0, 'thread_id' => 0, 'post_id' => 0, 'post_message' => isset($_POST['post_message']) ? form_sanitizer($_POST['post_message'], '', 'post_message') : '', 'post_showsig' => isset($_POST['post_showsig']) ? TRUE : FALSE, 'post_smileys' => !isset($_POST['post_smileys']) || isset($_POST['post_message']) && preg_match("#(\\[code\\](.*?)\\[/code\\]|\\[geshi=(.*?)\\](.*?)\\[/geshi\\]|\\[php\\](.*?)\\[/php\\])#si", $_POST['post_message']) ? FALSE : TRUE, 'post_author' => $userdata['user_id'], 'post_datestamp' => time(), 'post_ip' => USER_IP, 'post_ip_type' => USER_IP_TYPE, 'post_edituser' => 0, 'post_edittime' => 0, 'post_editreason' => '', 'post_hidden' => 0, 'notify_me' => isset($_POST['notify_me']) ? TRUE : FALSE, 'post_locked' => 0);
// go for a new thread posting.
// check data
// and validate
// do not run attach, and do not run poll.
if (isset($_POST['post_newthread']) && \defender::safe()) {
require_once INCLUDES . "flood_include.php";
// all data is sanitized here.
if (!flood_control("post_datestamp", DB_FORUM_POSTS, "post_author='" . $userdata['user_id'] . "'")) {
// have notice
if (ForumServer::verify_forum($thread_data['forum_id'])) {
$forum_data = dbarray(dbquery("SELECT f.*, f2.forum_name AS forum_cat_name\n FROM " . DB_FORUMS . " f\n LEFT JOIN " . DB_FORUMS . " f2 ON f.forum_cat=f2.forum_id\n WHERE f.forum_id='" . intval($thread_data['forum_id']) . "'\n AND " . groupaccess('f.forum_access') . "\n "));
示例7: render_edit_form
//.........这里部分代码省略.........
$post_data = array('forum_id' => $thread_data['forum_id'], 'thread_id' => $thread_data['thread_id'], 'post_id' => $post_data['post_id'], 'thread_subject' => '', 'post_message' => form_sanitizer($_POST['post_message'], '', 'post_message'), 'post_showsig' => isset($_POST['post_showsig']) ? 1 : 0, 'post_smileys' => isset($_POST['post_smileys']) || isset($_POST['post_message']) && preg_match("#(\\[code\\](.*?)\\[/code\\]|\\[geshi=(.*?)\\](.*?)\\[/geshi\\]|\\[php\\](.*?)\\[/php\\])#si", $_POST['post_message']) ? 1 : 0, 'post_author' => $userdata['user_id'], 'post_datestamp' => $post_data['post_datestamp'], 'post_ip' => USER_IP, 'post_ip_type' => USER_IP_TYPE, 'post_edituser' => $userdata['user_id'], 'post_edittime' => isset($_POST['hide_edit']) ? 0 : time(), 'post_editreason' => form_sanitizer($_POST['post_editreason'], '', 'post_editreason'), 'post_hidden' => 0, 'notify_me' => 0, 'post_locked' => $forum_settings['forum_edit_lock'] || isset($_POST['post_locked']) ? 1 : 0);
// require thread_subject if first post
if ($is_first_post) {
$post_data['thread_subject'] = form_sanitizer($_POST['thread_subject'], '', 'thread_subject');
$current_thread_tags = form_sanitizer($_POST['thread_tags'], '', 'thread_tags');
if ($thread_data['thread_tags'] !== $current_thread_tags) {
// Assign the old ones into history
$thread_data['thread_tags_old'] = $thread_data['thread_tags'];
$thread_data['thread_tags_change'] = time();
}
$thread_data['thread_tags'] = $current_thread_tags;
$thread_data['thread_subject'] = $post_data['thread_subject'];
}
$thread_data['thread_sticky'] = isset($_POST['thread_sticky']) ? 1 : 0;
if (\defender::safe()) {
// If post delete checkbox
$this->delete_post($post_data['post_id'], $post_data['thread_id'], $post_data['forum_id']);
// Update thread subject
if ($is_first_post) {
dbquery_insert(DB_FORUM_THREADS, $thread_data, "update", array("keep_session" => TRUE));
}
// Prepare forum merging action
$last_post_author = dbarray(dbquery("SELECT post_author FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC LIMIT 1"));
if ($last_post_author == $post_data['post_author'] && $thread_data['forum_merge']) {
$last_message = dbarray(dbquery("SELECT post_id, post_message FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC"));
$post_data['post_id'] = $last_message['post_id'];
$post_data['post_message'] = $last_message['post_message'] . "\n\n" . $locale['forum_0640'] . " " . showdate("longdate", time()) . ":\n" . $post_data['post_message'];
dbquery_insert(DB_FORUM_POSTS, $post_data, 'update', array('primary_key' => 'post_id', 'keep_session' => TRUE));
} else {
dbquery_insert(DB_FORUM_POSTS, $post_data, 'update', array('primary_key' => 'post_id', 'keep_session' => TRUE));
}
// Delete attachments if there is any
foreach ($_POST as $key => $value) {
if (!strstr($key, "delete_attach")) {
continue;
}
$key = str_replace("delete_attach_", "", $key);
$result = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . $post_data['post_id'] . "' AND attach_id='" . (isnum($key) ? $key : 0) . "'");
if (dbrows($result) != 0 && $value) {
$adata = dbarray($result);
unlink(FORUM . "attachments/" . $adata['attach_name']);
dbquery("DELETE FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . $post_data['post_id'] . "' AND attach_id='" . (isnum($key) ? $key : 0) . "'");
}
}
if (!empty($_FILES) && is_uploaded_file($_FILES['file_attachments']['tmp_name'][0]) && $thread->getThreadPermission("can_upload_attach")) {
$upload = form_sanitizer($_FILES['file_attachments'], '', 'file_attachments');
if ($upload['error'] == 0) {
foreach ($upload['target_file'] as $arr => $file_name) {
$attachment = array('thread_id' => $thread_data['thread_id'], 'post_id' => $post_data['post_id'], 'attach_name' => $file_name, 'attach_mime' => $upload['type'][$arr], 'attach_size' => $upload['source_size'][$arr], 'attach_count' => '0');
dbquery_insert(DB_FORUM_ATTACHMENTS, $attachment, 'save', array('keep_session' => TRUE));
}
}
}
if (\defender::safe()) {
redirect(FORUM . "postify.php?post=edit&error=0&forum_id=" . intval($post_data['forum_id']) . "&thread_id=" . intval($post_data['thread_id']) . "&post_id=" . intval($post_data['post_id']));
}
}
}
}
// template data
$form_action = FORUM . "viewthread.php?action=edit&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id'] . "&post_id=" . $_GET['post_id'];
// get attachment.
$attachments = array();
$attach_rows = 0;
if ($thread->getThreadPermission("can_upload_attach") && !empty($thread_info['post_items'][$post_data['post_id']]['post_attachments'])) {
// need id
$a_result = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . intval($post_data['post_id']) . "' AND thread_id='" . intval($thread_data['thread_id']) . "'");
$attach_rows = dbrows($a_result);
if ($attach_rows > 0) {
while ($a_data = dbarray($a_result)) {
$attachments[] = $a_data;
}
}
}
$info = array('title' => $locale['forum_0507'], 'description' => $locale['forum_2000'] . $thread_data['thread_subject'], 'openform' => openform('input_form', 'post', $form_action, array('enctype' => $thread->getThreadPermission("can_upload_attach") ? TRUE : FALSE)), 'closeform' => closeform(), 'forum_id_field' => form_hidden('forum_id', '', $post_data['forum_id']), 'thread_id_field' => form_hidden('thread_id', '', $post_data['thread_id']), 'tags_field' => $is_first_post ? form_select('thread_tags[]', $locale['forum_tag_0100'], $thread_data['thread_tags'], array('options' => $this->tag()->get_TagOpts(), 'width' => '100%', 'multiple' => TRUE, 'delimiter' => '.', 'max_select' => 3)) : '', "forum_field" => "", 'subject_field' => $thread_info['post_firstpost'] == $_GET['post_id'] ? form_text('thread_subject', $locale['forum_0600'], $thread_data['thread_subject'], array('required' => TRUE, 'placeholder' => $locale['forum_2001'], "class" => 'm-t-20 m-b-20')) : form_hidden("thread_subject", "", $thread_data['thread_subject']), 'message_field' => form_textarea('post_message', $locale['forum_0601'], $post_data['post_message'], array('required' => TRUE, 'autosize' => TRUE, 'no_resize' => TRUE, 'preview' => TRUE, 'form_name' => 'input_form', 'bbcode' => TRUE)), 'delete_field' => form_checkbox('delete', $locale['forum_0624'], '', array('class' => 'm-b-0', 'reverse_label' => TRUE)), 'edit_reason_field' => form_text('post_editreason', $locale['forum_0611'], $post_data['post_editreason'], array('placeholder' => '', 'class' => 'm-t-20 m-b-20')), 'attachment_field' => $thread->getThreadPermission("can_upload_attach") ? form_fileinput('file_attachments[]', $locale['forum_0557'], "", array('input_id' => 'file_attachments', 'upload_path' => FORUM . 'attachments/', 'type' => 'object', 'preview_off' => TRUE, 'multiple' => TRUE, 'max_count' => $attach_rows > 0 ? $forum_settings['forum_attachmax_count'] - $attach_rows : $forum_settings['forum_attachmax_count'], 'valid_ext' => $forum_settings['forum_attachtypes'])) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t <div class='m-b-20'>\n<small>" . sprintf($locale['forum_0559'], parsebytesize($forum_settings['forum_attachmax']), str_replace('|', ', ', $forum_settings['forum_attachtypes']), $forum_settings['forum_attachmax_count']) . "</small>\n</div>\n" : "", "poll_form" => "", 'smileys_field' => form_checkbox('post_smileys', $locale['forum_0622'], $post_data['post_smileys'], array('class' => 'm-b-0', 'reverse_label' => TRUE)), 'signature_field' => array_key_exists("user_sig", $userdata) && $userdata['user_sig'] ? form_checkbox('post_showsig', $locale['forum_0623'], $post_data['post_showsig'], array('class' => 'm-b-0', 'reverse_label' => TRUE)) : '', 'sticky_field' => (iMOD || iSUPERADMIN) && $is_first_post ? form_checkbox('thread_sticky', $locale['forum_0620'], $thread_data['thread_sticky'], array('class' => 'm-b-0', 'reverse_label' => TRUE)) : '', 'lock_field' => iMOD || iSUPERADMIN ? form_checkbox('thread_locked', $locale['forum_0621'], $thread_data['thread_locked'], array('class' => 'm-b-0', 'reverse_label' => TRUE)) : '', 'hide_edit_field' => form_checkbox('hide_edit', $locale['forum_0627'], !empty($post_data['post_editreason']) && empty($post_data['post_edittime']) ? 1 : 0, array('class' => 'm-b-0', 'reverse_label' => TRUE)), 'post_locked_field' => iMOD || iSUPERADMIN ? form_checkbox('post_locked', $locale['forum_0628'], $post_data['post_locked'], array('class' => 'm-b-0', 'reverse_label' => TRUE)) : '', 'notify_field' => '', 'post_buttons' => form_button('post_edit', $locale['forum_0504'], $locale['forum_0504'], array('class' => 'btn-primary')) . form_button('cancel', $locale['cancel'], $locale['cancel'], array('class' => 'btn-default m-l-10')), 'last_posts_reply' => '');
$a_info = '';
if (!empty($attachments)) {
foreach ($attachments as $a_data) {
$a_info .= form_checkbox("delete_attach_" . $a_data['attach_id'], $locale['forum_0625'], 0, array("reverse_label" => TRUE, "ext_tip" => "<a href='" . FORUM . "attachments/" . $a_data['attach_name'] . "'>" . $a_data['attach_name'] . "</a> [" . parsebytesize($a_data['attach_size']) . "]"));
}
$info['attachment_field'] = $a_info . $info['attachment_field'];
}
display_forum_postform($info);
} else {
if (fusion_get_settings("site_seo")) {
redirect(fusion_get_settings("siteurl") . "infusions/forum/index.php");
}
redirect(FORUM . 'index.php');
// no access
}
} else {
redirect(FORUM . "postify.php?post=edit&error=4&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id'] . "&post_id=" . $_GET['post_id']);
}
} else {
if (fusion_get_settings("site_seo")) {
redirect(fusion_get_settings("siteurl") . "infusions/forum/index.php");
}
redirect(FORUM . "index.php");
}
}
示例8: display_quickReply
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;
}
示例9: showcomments
//.........这里部分代码省略.........
$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']);
}
}
示例10: customPage_form
//.........这里部分代码省略.........
if (isset($_POST['preview'])) {
if (\defender::safe()) {
echo openmodal("cp_preview", $locale['429']);
echo "<h3>" . $data['page_title'] . "</h3>\n";
if (fusion_get_settings("allow_php_exe")) {
ob_start();
eval("?>" . stripslashes($_POST['page_content']) . "<?php ");
$eval = ob_get_contents();
ob_end_clean();
echo $eval;
} else {
echo "<p>" . nl2br(parse_textarea($_POST['page_content'])) . "</p>\n";
}
echo closemodal();
}
$data = array('page_id' => form_sanitizer($_POST['page_id'], 0, 'page_id'), 'link_id' => form_sanitizer($_POST['link_id'], 0, 'link_id'), 'link_order' => form_sanitizer($_POST['link_order'], 0, 'link_order'), 'page_link_cat' => form_sanitizer($_POST['page_link_cat'], 0, 'page_link_cat'), 'page_title' => form_sanitizer($_POST['page_title'], '', 'page_title'), 'page_access' => form_sanitizer($_POST['page_access'], 0, 'page_access'), 'page_content' => form_sanitizer($_POST['page_content'], "", "page_content"), 'page_keywords' => form_sanitizer($_POST['page_keywords'], '', 'page_keywords'), 'page_language' => implode('.', isset($_POST['page_language']) ? sanitize_array($_POST['page_language']) : array()), 'page_allow_comments' => isset($_POST['page_allow_comments']) ? 1 : 0, 'page_allow_ratings' => isset($_POST['page_allow_ratings']) ? 1 : 0);
}
echo openform('inputform', 'post', FUSION_REQUEST, array("class" => "m-t-20"));
if (isset($_POST['edit']) && isset($_POST['page_id'])) {
echo form_hidden('edit', '', 'edit');
}
echo "<div class='row m-t-20' >\n";
echo "<div class='col-xs-12 col-sm-8'>\n";
echo form_text('page_title', $locale['422'], $data['page_title'], array('required' => 1));
echo form_select('page_keywords', $locale['432'], $data['page_keywords'], array('max_length' => 320, 'width' => '100%', 'tags' => 1, 'multiple' => 1));
$textArea_config = array('width' => '100%', 'height' => '260px', 'form_name' => 'inputform', 'type' => "html", 'class' => 'm-t-20');
if (isset($_COOKIE['custom_pages_tinymce']) && $_COOKIE['custom_pages_tinymce'] == 1 && fusion_get_settings('tinymce_enabled')) {
$textArea_config = array("type" => "tinymce", "tinymce" => "advanced", "class" => "m-t-20");
}
echo form_textarea('page_content', '', $data['page_content'], $textArea_config);
echo "</div>\n";
echo "<div class='col-xs-12 col-sm-4'>\n";
openside("");
echo form_button('save', $locale['430'], $locale['430'], array('class' => 'btn-primary m-r-10 m-t-10'));
echo form_button('preview', $locale['429'], $locale['429'], array('class' => 'btn-default m-r-10 m-t-10'));
closeside();
if (fusion_get_settings('tinymce_enabled')) {
openside('');
$val = !isset($_COOKIE['custom_pages_tinymce']) || $_COOKIE['custom_pages_tinymce'] == 0 ? $locale['461'] . " TINYMCE" : $locale['462'] . " TINYMCE";
echo form_button('tinymce_switch', $val, $val, array('class' => 'btn-default btn-block', 'type' => 'button'));
add_to_jquery("\n\t\t\t\$('#tinymce_switch').bind('click', function() {\n\t\t\t\tSetTinyMCE(" . (!isset($_COOKIE['custom_pages_tinymce']) || $_COOKIE['custom_pages_tinymce'] == 0 ? 1 : 0) . ");\n\t\t\t});\n\t\t\t");
closeside();
}
if (fusion_get_settings('comments_enabled') == "0" || fusion_get_settings('ratings_enabled') == "0") {
echo "<div class='tbl2 well'>\n";
if (fusion_get_settings('comments_enabled') == "0" && fusion_get_settings('ratings_enabled') == "0") {
$sys = $locale['457'];
} elseif (fusion_get_settings('comments_enabled') == "0") {
$sys = $locale['455'];
} else {
$sys = $locale['456'];
}
echo sprintf($locale['454'], $sys);
echo "</div>\n";
}
if (!$data['page_id']) {
openside("");
echo form_checkbox('add_link', $locale['426'], 1);
echo "<div id='link_add_sel' style='display:none;'>\n";
echo form_select_tree("page_link_cat", $locale['SL_0029'], $data['page_link_cat'], array("parent_value" => $locale['parent'], 'width' => '100%', 'query' => (multilang_table("SL") ? "WHERE link_language='" . LANGUAGE . "' AND" : '') . " link_position >= 2", 'disable_opts' => $data['link_id'], 'hide_disabled' => 1), DB_SITE_LINKS, "link_name", "link_id", "link_cat");
echo "</div>\n";
add_to_jquery("\n var checked = \$('#add_link').is(':checked');\n if (checked) {\n \$('#link_add_sel').show();\n } else {\n \$('#link_add_sel').hide();\n }\n \$('#add_link').bind('click', function(e) {\n var checked = \$(this).is(':checked');\n if (checked) {\n \$('#link_add_sel').show();\n } else {\n \$('#link_add_sel').hide();\n }\n });\n ");
closeside();
}
openside("");
echo form_checkbox('page_allow_comments', $locale['427'], $data['page_allow_comments'], array('class' => 'm-b-0'));
echo form_checkbox('page_allow_ratings', $locale['428'], $data['page_allow_ratings'], array('class' => 'm-b-0'));
echo form_hidden('link_id', '', $data['link_id']);
echo form_hidden('link_order', '', $data['link_order']);
closeside();
openside();
if (multilang_table("CP")) {
$page_lang = !empty($data['page_language']) ? explode('.', $data['page_language']) : array();
foreach (fusion_get_enabled_languages() as $language => $language_name) {
$isDisabled = LANGUAGE == $language ? TRUE : FALSE;
echo form_checkbox('page_language[]', $language_name, in_array($language, $page_lang) ? TRUE : FALSE, array('class' => 'm-b-0', 'value' => $language, 'input_id' => 'page_lang-' . $language, "disabled" => $isDisabled ? TRUE : FALSE, "delimiter" => "."));
if ($isDisabled) {
echo form_hidden("page_language[]", "", $language);
}
}
} else {
echo form_hidden('page_language', '', $data['page_language']);
}
closeside();
openside();
echo form_select('page_access', $locale['423'], $data['page_access'], array('options' => fusion_get_groups(), 'width' => '100%'));
closeside();
echo "</div></div>\n";
echo form_hidden('page_id', '', $data['page_id']);
echo form_button('save', $locale['430'], $locale['430'], array('class' => 'btn-primary m-r-10'));
if (isset($_POST['edit'])) {
echo form_button('cancel', $locale['cancel'], $locale['cancel'], array('class' => 'btn-default m-r-10'));
}
echo closeform();
closetable();
add_to_jquery("\n\t\t\t\$('#delete').bind('click', function() { confirm('" . $locale['450'] . "'); });\n\t\t\t\$('#save').bind('click', function() {\n\t\t\tvar page_title = \$('#page_title').val();\n\t\t\tif (page_title =='') { alert('" . $locale['451'] . "'); return false; }\n\t\t\t});\n\t\t");
if (fusion_get_settings('tinymce_enabled')) {
add_to_jquery("\n\t\t\tfunction SetTinyMCE(val) {\n\t\t\tnow=new Date();\n" . "now.setTime(now.getTime()+1000*60*60*24*365);\n\t\t\texpire=(now.toGMTString());\n" . "document.cookie=\"custom_pages_tinymce=\"+escape(val)+\";expires=\"+expire;\n\t\t\tlocation.href='" . FUSION_SELF . $aidlink . "§ion=cp2';\n\t\t\t}\n\t\t ");
}
}
示例11: display_mood_buttons
/**
* Mood should be present.
* Static calls for caching, so only single query
* Label parsing
* @return string
*/
public function display_mood_buttons()
{
$html = openform('mood_form-' . $this->post_id, 'post', FUSION_REQUEST . "#post_" . $this->post_id);
$mood_cache = $this->cache_mood();
if (!empty($mood_cache)) {
foreach ($mood_cache as $mood_id => $mood_data) {
//jQuery data model for ajax
$html .= form_hidden('post_author', '', $this->post_author);
$html .= form_hidden('post_id', '', $this->post_id);
if (!$this->mood_exists($this->post_author, $mood_id, $this->post_id)) {
// Post Button
$html .= "<button name='post_mood' id='" . $this->post_id . "-{$mood_id}' class='btn btn-sm btn-default m-r-5' data-mood='{$mood_id}' data-post='{$this->post_id}' value='" . $mood_id . "'>" . (!empty($mood_data['mood_icon']) ? "<i class='" . $mood_data['mood_icon'] . "'></i>" : "") . QuantumFields::parse_label($mood_data['mood_name']) . "</button>";
} else {
// Unpost Button
$html .= "<button name='unpost_mood' id='" . $this->post_id . "-{$mood_id}' class='btn btn-sm btn-default active m-r-5' data-mood='{$mood_id}' data-post='{$this->post_id}' value='" . $mood_id . "'>" . (!empty($mood_data['mood_icon']) ? "<i class='" . $mood_data['mood_icon'] . "'></i>" : "") . QuantumFields::parse_label($mood_data['mood_name']) . "</button>";
}
}
}
$html .= closeform();
return (string) $html;
}
示例12: lang_switcher
/**
* Language switcher function
* Icon - True or False (True = Icon mode, False = Dropdown Selector)
*/
function lang_switcher($icon = TRUE)
{
global $locale;
$enabled_languages = fusion_get_enabled_languages();
if (count($enabled_languages) <= 1) {
return;
}
openside($locale['global_ML102']);
echo "<h5><strong>" . $locale['UM101'] . "</strong></h5>\n";
if ($icon) {
$language_switch = fusion_get_language_switch();
if (!empty($language_switch)) {
$row = 0;
foreach ($language_switch as $folder => $langData) {
$icon = "<img class='display-block img-responsive' alt='" . $langData['language_name'] . "' src='" . $langData['language_icon'] . "' title='" . $langData['language_name'] . "' style='min-width:20px;'/>\n";
if ($folder != LANGUAGE) {
$icon = "<a class='side pull-left display-block' href='" . $langData['language_link'] . "'>" . $icon . "</a>\n ";
}
echo ($row > 0 and $row % 4 === 0) ? '<br />' : '';
echo "<div class='display-inline-block clearfix'>\n" . $icon . "</div>\n";
$row++;
}
}
} else {
include_once INCLUDES . "translate_include.php";
echo openform('lang_menu_form', 'post', FUSION_SELF, array('max_tokens' => 1));
echo form_select('lang_menu', '', fusion_get_settings('locale'), array("options" => fusion_get_enabled_languages(), "width" => "100%"));
echo closeform();
add_to_jquery("\n\t\t\tfunction showflag(item){\n\t\t\t\treturn '<div class=\"clearfix\" style=\"width:100%; padding-left:10px;\"><img style=\"height:20px; margin-top:3px !important;\" class=\"img-responsive pull-left\" src=\"" . LOCALE . "' + item.text + '/'+item.text + '-s.png\"/><span class=\"p-l-10\">'+ item.text +'</span></div>';\n\t\t\t}\n\t\t\t\$('#lang_menu').select2({\n\t\t\tplaceholder: 'Switch Language',\n\t\t\tformatSelection: showflag,\n\t\t\tescapeMarkup: function(m) { return m; },\n\t\t\tformatResult: showflag,\n\t\t\t}).bind('change', function(item) {\n\t\t\t\twindow.location.href = '" . FUSION_REQUEST . "?lang='+\$(this).val();\n\t\t\t});\n\t\t");
}
closeside();
}
示例13: displayHeader
/**
* Septenary Header
*/
public function displayHeader()
{
global $aidlink;
$userdata = fusion_get_userdata();
$locale = self::$locale;
echo "<header id='top'>";
echo "<div class='overlay'>\n";
$this->open_grid('section-1', 1);
echo "<div class='row hidden-xs'>\n";
echo "<div id='logo' class='hidden-xs hidden-md col-lg-3 p-t-5 text-smaller'>\n</div>\n";
echo "<div class='col-xs-12 col-md-9 col-lg-9 text-right clearfix'>\n";
echo "<div class='display-inline-block' style='width:30%; float:right;'>\n";
echo openform('searchform', 'post', BASEDIR . 'search.php?stype=all', array('class' => 'm-b-10'));
echo form_text('stext', '', '', array('placeholder' => $locale['sept_006'], 'append_button' => TRUE, 'append_type' => "submit", "append_form_value" => $locale['sept_006'], "append_value" => "<i class='fa fa-search'></i> " . $locale['sept_006'], "append_button_name" => "search", 'class' => 'no-border m-b-0'));
echo closeform();
echo "</div>\n";
echo "<ul id='head_nav' class='display-inline-block'>\n";
$language_opts = '';
if (count(fusion_get_enabled_languages()) > 1) {
$language_opts = "<li class='dropdown'>\n";
$language_opts .= "<a class='dropdown-toggle pointer' data-toggle='dropdown' title='" . fusion_get_locale('UM101') . "'><i class='fa fa-globe fa-lg'></i> " . translate_lang_names(LANGUAGE) . " <span class='caret'></span></a>\n";
$language_opts .= "<ul class='dropdown-menu' role='menu'>\n";
$language_switch = fusion_get_language_switch();
if (!empty($language_switch)) {
foreach ($language_switch as $folder => $langData) {
$language_opts .= "<li class='text-left'><a href='" . $langData['language_link'] . "'>\n";
$language_opts .= "<img alt='" . $langData['language_name'] . "' class='m-r-5' src='" . $langData['language_icon_s'] . "'/>\n";
$language_opts .= $langData['language_name'];
$language_opts .= "</a></li>\n";
}
}
$language_opts .= "</ul>\n";
$language_opts .= "</li>\n";
}
if (!iMEMBER) {
echo "<li><a href='" . BASEDIR . "login.php'>" . $locale['sept_001'] . "</a></li>\n";
if (fusion_get_settings("enable_registration")) {
echo "<li><a href='" . BASEDIR . "register.php'>" . $locale['sept_002'] . "</a></li>\n";
}
echo $language_opts;
} else {
if (iADMIN) {
echo "<li>\n<a href='" . ADMIN . $aidlink . "&pagenum=0'>" . $locale['sept_003'] . "</a>\n</li>\n";
}
echo "<li>\n<a href='" . BASEDIR . "profile.php?lookup=" . $userdata['user_id'] . "'>" . $locale['sept_004'] . "</a>\n</li>\n";
echo $language_opts;
echo "<li>\n<a href='" . BASEDIR . "index.php?logout=yes'>" . $locale['sept_005'] . "</a></li>\n";
}
echo "</ul>\n";
echo "</div>\n";
echo "</div>\n";
$this->close_grid(1);
$this->open_grid('section-2', 1);
echo "<div class='header-nav'>\n";
echo showsublinks('') . "\n";
echo "</div>\n";
$this->close_grid();
echo "</div>\n";
$this->display_Showcase();
echo "</header>\n";
}
示例14: user_posts_migrate_console
function user_posts_migrate_console()
{
global $aidlink, $locale;
$result = dbquery("SELECT user_id, user_name FROM " . DB_USERS . "");
if (dbrows($result) > 0) {
while ($user_data = dbarray($result)) {
$data[$user_data['user_id']] = "" . $user_data['user_name'] . "";
}
} else {
$data['0'] = $locale['124'];
}
echo openform('inputform', 'post', "" . FUSION_SELF . $aidlink . "", array('max_tokens' => 1));
echo "<table style='width:100%' class='table table-striped'>\n";
echo "<thead>\n";
echo "<tr style='height:30px;'><th style='width:33%; text-align:left'>" . $locale['125'] . "</th><th style='width:33%; text-align:left;'>" . $locale['126'] . "</th><th class='text-left'> </th>\n</tr>\n";
echo "</thead>\n";
echo "<tbody>\n";
echo "<tr>\n";
echo "<td>\n";
echo form_user_select('user_primary', '', isset($_POST['user_primary']) && isnum($_POST['user_primary'] ?: ''), array('placeholder' => $locale['127']));
echo "</td>\n";
echo "<td>\n";
echo form_user_select('user_migrate', '', isset($_POST['user_migrate']) && isnum($_POST['user_migrate'] ?: ''), array('placeholder' => $locale['128']));
echo "</td>\n";
echo "<td>\n";
echo form_button('migrate', $locale['129'], $locale['129'], array('inline' => '1', 'class' => 'btn btn-sm btn-primary'));
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>" . $locale['130'] . "</td>";
echo "<td colspan='2'>\n";
echo "<input type='checkbox' name='comments' value='1' " . (isset($_POST['comments']) == '1' ? 'checked' : '') . "> " . $locale['132'] . "<br />";
echo "<input type='checkbox' name='ratings' value='1' " . (isset($_POST['ratings']) == '1' ? 'checked' : '') . "> " . $locale['133'] . "<br />";
echo "<input type='checkbox' name='polls' value='1' " . (isset($_POST['polls']) == '1' ? 'checked' : '') . "> " . $locale['134'] . "<br />";
echo "<input type='checkbox' name='messages' value='1' " . (isset($_POST['messages']) == '1' ? 'checked' : '') . "> " . $locale['136'] . "<br />";
echo "<input type='checkbox' name='user_level' value='1' " . (isset($_POST['user_level']) == '1' ? 'checked' : '') . "> " . $locale['142'] . "<br />";
if (db_exists(DB_FORUMS)) {
echo "<input type='checkbox' name='forum' value='1' " . (isset($_POST['forum']) == '1' ? 'checked' : '') . "> " . $locale['131'] . "<br />\n";
}
if (db_exists(DB_ARTICLES)) {
echo "<input type='checkbox' name='articles' value='1' " . (isset($_POST['articles']) == '1' ? 'checked' : '') . "> " . $locale['137'] . "<br />";
}
if (db_exists(DB_NEWS)) {
echo "<input type='checkbox' name='news' value='1' " . (isset($_POST['news']) == '1' ? 'checked' : '') . "> " . $locale['138'] . "<br />";
}
if (db_exists(DB_BLOG)) {
echo "<input type='checkbox' name='blog' value='1' " . (isset($_POST['blog']) == '1' ? 'checked' : '') . "> " . $locale['139'] . "<br />";
}
if (db_exists(DB_DOWNLOADS)) {
echo "<input type='checkbox' name='downloads' value='1' " . (isset($_POST['downloads']) == '1' ? 'checked' : '') . "> " . $locale['140'] . "<br />";
}
if (db_exists(DB_PHOTOS)) {
echo "<input type='checkbox' name='photos' value='1' " . (isset($_POST['photos']) == '1' ? 'checked' : '') . "> " . $locale['141'] . "<br />";
}
$shoutbox = dbcount("(inf_id)", DB_INFUSIONS, "inf_folder='shoutbox_panel'");
if ($shoutbox > 0) {
echo "<input type='checkbox' name='shoutbox' value='1' " . (isset($_POST['shoutbox']) == '1' ? 'checked' : '') . "> " . $locale['135'] . "<br />";
}
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>" . $locale['143'] . "</td>";
echo "<td colspan='3'>\n";
echo "<input type='checkbox' name='del_user' value='1'> " . $locale['144'] . "<br /> " . $locale['145'] . "\n";
echo "</td>\n";
echo "</tr>\n";
echo "</tbody>\n";
echo "</table>\n";
echo closeform();
}
示例15: displayTagForm
protected function displayTagForm()
{
global $aidlink;
if (isset($_POST['cancel_tag'])) {
redirect(clean_request("", array("tag_id", "ref"), FALSE));
}
$this->data['rank_language'] = LANGUAGE;
// Special Select
$groups_arr = getusergroups();
$groups_except = array(USER_LEVEL_PUBLIC, USER_LEVEL_MEMBER, USER_LEVEL_ADMIN, USER_LEVEL_SUPER_ADMIN);
$group_opts = array();
foreach ($groups_arr as $group) {
if (!in_array($group[0], $groups_except)) {
$group_opts[$group[0]] = $group[1];
}
}
$language_opts = fusion_get_enabled_languages();
$this->post_tags();
$form_action = FUSION_SELF . $aidlink . '&section=ft&ref=tag_form';
if (isset($_GET['tag_id']) && isnum($_GET['tag_id'])) {
$result = dbquery("SELECT * FROM " . DB_FORUM_TAGS . " WHERE tag_id='" . intval($_GET['tag_id']) . "'");
if (dbrows($result) > 0) {
$this->data = dbarray($result);
$form_action = FUSION_SELF . $aidlink . "&section=ft&ref=tag_form&tag_id=" . $_GET['tag_id'];
} else {
redirect(clean_request("", array("rank_id", "ref"), FALSE));
}
}
$button_locale = $this->data['tag_id'] ? self::$locale['forum_tag_0208'] : self::$locale['forum_tag_0207'];
$html = openform('tag_form', 'post', $form_action, array('class' => 'm-t-20')) . form_text('tag_title', self::$locale['forum_tag_0200'], $this->data['tag_title'], array('required' => 1, 'error_text' => self::$locale['414'], "inline" => TRUE)) . form_textarea('tag_description', self::$locale['forum_tag_0201'], $this->data['tag_description'], array('inline' => TRUE, 'type' => 'bbcode', 'autosize' => TRUE, 'preview' => TRUE)) . form_colorpicker('tag_color', self::$locale['forum_tag_0202'], $this->data['tag_color'], array('inline' => TRUE, 'required' => TRUE));
if (multilang_table("FR")) {
$html .= form_select('tag_language', self::$locale['forum_tag_0203'], $this->data['tag_language'], array('options' => $language_opts, 'placeholder' => self::$locale['choose'], "inline" => TRUE));
} else {
$html .= form_hidden('tag_language', '', $this->data['tag_language']);
}
$html .= form_checkbox('tag_status', self::$locale['forum_tag_0204'], $this->data['tag_status'], array("options" => array(1 => self::$locale['forum_tag_0205'], 0 => self::$locale['forum_tag_0206']), "type" => "radio", "inline" => TRUE)) . form_button('save_tag', $button_locale, $button_locale, array('class' => 'btn-primary m-r-10')) . form_button('cancel_tag', self::$locale['cancel'], self::$locale['cancel'], array('class' => 'btn-default')) . closeform();
return $html;
}