当前位置: 首页>>代码示例>>PHP>>正文


PHP form_fileinput函数代码示例

本文整理汇总了PHP中form_fileinput函数的典型用法代码示例。如果您正苦于以下问题:PHP form_fileinput函数的具体用法?PHP form_fileinput怎么用?PHP form_fileinput使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了form_fileinput函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: openform

// add features to purge all album photos and it's administration
// add features to move all album photos to another album.
echo openform('albumform', 'post', FUSION_REQUEST, array('enctype' => TRUE, 'class' => 'm-t-20'));
echo "<div class='row'>\n<div class='col-xs-12 col-sm-8'>\n";
echo form_hidden('album_id', '', $data['album_id']);
echo form_text('album_title', $locale['album_0001'], $data['album_title'], array('placeholder' => $locale['album_0002'], 'inline' => TRUE, 'required' => TRUE, "error_text" => $locale['album_0015']));
echo form_select("album_keywords", $locale['album_0005'], $data['album_keywords'], array('max_length' => 320, 'width' => '100%', 'placeholder' => $locale['album_0006'], 'tags' => TRUE, 'multiple' => TRUE, "inline" => TRUE));
echo form_textarea('album_description', $locale['album_0003'], $data['album_description'], array('placeholder' => $locale['album_0004'], 'inline' => 1));
if ($data['album_image'] || $data['album_thumb1']) {
    echo "<div class='well col-sm-offset-3'>\n";
    echo form_hidden("album_image", "", $data['album_image']);
    echo form_hidden("album_thumb2", "", $data['album_thumb2']);
    echo form_hidden("album_thumb1", "", $data['album_thumb1']);
    echo "<label for='del_image'>\n";
    echo displayAlbumImage($data['album_image'], $data['album_thumb1'], $data['album_thumb2'], "");
    echo "</label>\n";
    echo form_checkbox("del_image", $locale['album_0016'], "");
    echo "</div>\n";
} else {
    $album_upload_settings = array("upload_path" => INFUSIONS . "gallery/photos/", 'thumbnail_folder' => 'thumbs', 'thumbnail' => TRUE, 'thumbnail_w' => $gll_settings['thumb_w'], 'thumbnail_h' => $gll_settings['thumb_h'], 'thumbnail_suffix' => '_t1', 'thumbnail2' => TRUE, 'thumbnail2_w' => $gll_settings['photo_w'], 'thumbnail2_h' => $gll_settings['photo_h'], 'thumbnail2_suffix' => '_t2', 'max_width' => $gll_settings['photo_max_w'], 'max_height' => $gll_settings['photo_max_h'], 'max_byte' => $gll_settings['photo_max_b'], 'multiple' => 0, 'delete_original' => FALSE, "inline" => TRUE, "template" => "modern", "class" => "m-b-0");
    echo form_fileinput('album_image', $locale['album_0009'], "", $album_upload_settings);
    echo "<div class='m-b-10 col-xs-12 col-sm-offset-3'>" . sprintf($locale['album_0010'], parsebytesize($gll_settings['photo_max_b']), str_replace(',', ' ', ".jpg,.gif,.png"), $gll_settings['photo_max_w'], $gll_settings['photo_max_h']) . "</div>\n";
}
echo "</div>\n";
echo "<div class='col-xs-12 col-sm-4'>\n";
echo form_select('album_access', $locale['album_0007'], $data['album_access'], array('options' => fusion_get_groups(), 'inline' => TRUE));
echo form_select('album_language', $locale['album_0008'], $data['album_language'], array('options' => fusion_get_enabled_languages(), 'inline' => TRUE));
echo form_text('album_order', $locale['album_0011'], $data['album_order'], array("type" => "number", 'inline' => TRUE));
echo "</div>\n</div>\n";
echo form_button('save_album', $locale['album_0012'], $locale['album_0012'], array('class' => 'btn-success btn-sm m-r-10'));
echo closeform();
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:gallery_cat.php

示例2: debonair_banner_widget

function debonair_banner_widget()
{
    global $locale;
    $acceptedMode = array("edit", "new", "del");
    echo "<a class='btn btn-default m-t-10 m-b-20' href='" . clean_request("slides=new", array(), false) . "'>" . $locale['debonair_0203'] . "</a>\n";
    echo "<div class='alert alert-info'>" . $locale['debonair_0700'] . "</div>\n";
    if (isset($_GET['slides']) && in_array($_GET['slides'], $acceptedMode)) {
        $_GET['id'] = isset($_GET['id']) && isnum($_GET['id']) ? $_GET['id'] : 0;
        $data = array();
        $db_keys = fieldgenerator(DB_DEBONAIR);
        foreach ($db_keys as $keys) {
            $value = "";
            if ($keys == "banner_id") {
                $value = 0;
            }
            if ($keys == "banner_language") {
                $value = LANGUAGE;
            }
            if ($keys == "banner_visibility") {
                $value = iGUEST;
            }
            if ($keys == "banner_datestamp") {
                $value = time();
            }
            if ($keys == "banner_order") {
                $value = dbcount("(banner_id)", DB_DEBONAIR, "banner_language='" . LANGUAGE . "'") + 1;
            }
            $data[$keys] = $value;
        }
        if ($_GET['slides'] == "edit" || $_GET['slides'] == "del") {
            $data = dbarray(dbquery("select * from " . DB_DEBONAIR . " WHERE banner_id='" . intval($_GET['id']) . "'"));
            if ($_GET['slides'] == "del" && !empty($data)) {
                // process deletion
                if ($data['banner_image']) {
                    unlink(THEME . "upload/" . $data['banner_image']);
                    unlink(THEME . "upload/" . $data['banner_thumb']);
                }
                dbquery_insert(DB_DEBONAIR, $data, "delete");
                addNotice("success", $locale['debonair_0217']);
                redirect(clean_request("", array("slides"), false));
            }
        }
        if (isset($_POST['save_slide'])) {
            $data = array("banner_id" => form_sanitizer($_POST['banner_id'], 0, "banner_id"), "banner_subject" => form_sanitizer($_POST['banner_subject'], "", "banner_subject"), "banner_description" => form_sanitizer($_POST['banner_description'], "", "banner_description"), "banner_link" => form_sanitizer($_POST['banner_link'], "", "banner_link"), "banner_language" => form_sanitizer($_POST['banner_language'], LANGUAGE, "banner_language"), "banner_visibility" => form_sanitizer($_POST['banner_visibility'], iGUEST, "banner_visibility"), "banner_datestamp" => time());
            if (defender::safe()) {
                $upload = form_sanitizer($_FILES['banner_image'], "", "banner_image");
                if (isset($upload['error']) && !$upload['error']) {
                    $data['banner_image'] = $upload['image_name'];
                    $data['banner_thumb'] = $upload['thumb1'];
                }
                if ($data['banner_id'] > 0 && dbcount("(banner_id)", DB_DEBONAIR, "banner_id='" . $data['banner_id'] . "'")) {
                    // get old data. do ordering
                    $old_data = dbquery("select banner_image, banner_thumb, banner_order from " . DB_DEBONAIR . " where banner_id='" . $data['banner_id'] . "'");
                    if ($old_data['banner_image']) {
                        unlink(THEME . "upload/" . $old_data['banner_image']);
                        unlink(THEME . "upload/" . $old_data['banner_thumb']);
                    }
                    dbquery_insert(DB_DEBONAIR, $data, "update");
                } else {
                    dbquery_insert(DB_DEBONAIR, $data, "save");
                }
                addNotice("success", $locale['debonair_0212']);
                redirect(clean_request("", array("slides"), false));
            }
        }
        echo "<h3>" . $locale['debonair_0203'] . "</h3>\n";
        echo openform("debonair_banner", "post", FUSION_REQUEST, array("enctype" => true));
        echo "<div class='row'>\n";
        echo "<div class='col-xs-12 col-sm-8'>\n";
        openside("");
        echo form_hidden("banner_id", "", $data['banner_id']);
        echo form_text("banner_subject", $locale['debonair_0205'], $data['banner_subject'], array("required" => true, "inline" => true, "placeholder" => $locale['debonair_0206']));
        echo form_textarea("banner_description", $locale['debonair_0207'], $data['banner_subject'], array("required" => true, "inline" => true, "placeholder" => $locale['debonair_0208'], "bbcode" => true));
        echo form_text("banner_link", $locale['debonair_0209'], $data['banner_subject'], array("required" => true, "inline" => true, "placeholder" => "ie. news.php?readmore=1"));
        closeside();
        openside("");
        echo form_fileinput("banner_image", $locale['debonair_0210'], $data['banner_image'] ? THEME . "upload/" . $data['banner_image'] : "", array("upload_path" => THEME . "upload/", "inline" => true, "placeholder" => $locale['debonair_0210'], "template" => "modern"));
        closeside();
        echo "</div>\n<div class='col-xs-12 col-sm-4'>\n";
        openside("");
        echo form_select("banner_language", $locale['debonair_0214'], $data['banner_language'], array("options" => fusion_get_enabled_languages(), "inline" => true, "placeholder" => $locale['debonair_0206']));
        echo form_select("banner_visibility", $locale['debonair_0215'], $data['banner_visibility'], array("options" => fusion_get_groups(), "inline" => true, "placeholder" => $locale['debonair_0206']));
        closeside();
        echo form_button("save_slide", $locale['save_changes'], "save_slide", array("class" => "btn-primary"));
        echo "<a class='btn btn-default m-l-10' href='" . clean_request("", array("slides"), false) . "'>" . $locale['cancel'] . "</a>\n";
        echo "</div>\n</div>\n";
        echo closeform();
    } else {
        if (isset($_GET['move']) && isset($_GET['id']) && isnum($_GET['id'])) {
            $data = dbarray(dbquery("select banner_id, banner_order FROM " . DB_DEBONAIR . " where banner_id='" . intval($_GET['id']) . "' AND banner_language='" . LANGUAGE . "'"));
            if ($_GET['move'] == "md") {
                dbquery("UPDATE " . DB_DEBONAIR . " SET banner_order=banner_order-1 WHERE banner_order= '" . ($data['banner_order'] + 1) . "' AND banner_language='" . LANGUAGE . "'");
                dbquery("UPDATE " . DB_DEBONAIR . " SET banner_order=banner_order+1 WHERE banner_id='" . $data['banner_id'] . "' AND banner_language='" . LANGUAGE . "'");
            }
            if ($_GET['move'] == "mup") {
                dbquery("UPDATE " . DB_DEBONAIR . " SET banner_order=banner_order+1 WHERE banner_order= '" . ($data['banner_order'] - 1) . "' AND banner_language='" . LANGUAGE . "'");
                dbquery("UPDATE " . DB_DEBONAIR . " SET banner_order=banner_order-1 WHERE banner_id='" . $data['banner_id'] . "' AND banner_language='" . LANGUAGE . "'");
            }
            addNotice("success", $locale['debonair_0220']);
            redirect(clean_request("", array("move", "id"), false));
//.........这里部分代码省略.........
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:101,代码来源:widget.php

示例3: addNotice

                if ($settings['tinymce_enabled'] == 1) {
                    include INCLUDES . "buildlist.php";
                }
                if (defender::safe()) {
                    addNotice('success', $locale['420']);
                    redirect(FUSION_SELF . $aidlink . "&amp;ifolder=" . $_GET['ifolder'] . "&img=" . $data['myfile']);
                }
            }
            redirect(FUSION_SELF . $aidlink . "&amp;ifolder=" . $_GET['ifolder']);
        }
    }
} else {
    opentable($locale['420']);
    add_breadcrumb(array('link' => ADMIN . "images.php" . $aidlink, 'title' => $locale['420']));
    echo openform('uploadform', 'post', FUSION_REQUEST, array('enctype' => TRUE));
    echo form_fileinput("myfile", $locale['421'], "", array('upload_path' => $afolder, 'type' => 'image', 'required' => true));
    echo form_button('uploadimage', $locale['420'], $locale['420'], array('class' => 'btn-primary'));
    echo closeform();
    closetable();
    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";
        } else {
            echo "<strong>" . $locale['441'] . "</strong><br /><br />\n";
        }
        echo "<a href='" . FUSION_SELF . $aidlink . "&amp;ifolder=" . $_GET['ifolder'] . "&amp;del=" . stripinput($_GET['view']) . "' onclick=\"return confirm('" . $locale['470'] . "');\">" . $locale['442'] . "</a>";
        echo "<br /><br />\n<a href='" . FUSION_SELF . $aidlink . "'>" . $locale['402'] . "</a><br /><br />\n</div>\n";
        closetable();
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:images.php

示例4: form_button

    echo "<a class='btn btn-default' href=\"javascript:void(0)\" onclick=\"javascript:backupSelectAll()\">" . $locale['436'] . "</a>\n";
    echo "<a class='btn btn-default' a href=\"javascript:void(0)\" onclick=\"javascript:backupSelectNone()\">" . $locale['437'] . "</a>\n";
    echo "</div>\n";
    echo "</div>\n";
    echo "</td>\n</tr>\n</tbody>\n</table>\n";
    echo "</td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td align='center' colspan='2' class='tbl'>";
    echo form_button('btn_create_backup', $locale['459'], $locale['459'], array('class' => 'btn-primary'));
    echo "</td>\n</tr>\n</tbody>\n</table>\n</form>\n";
    closetable();
    opentable($locale['480']);
    $file_types = function_exists("gzencode") ? ".gz " : "";
    // added
    echo openform('restore', 'post', FUSION_SELF . $aidlink . "&amp;action=restore", array('enctype' => 1, "class" => 'list-group-item'));
    echo form_fileinput("upload_backup_file", $locale['431'], "", array('inline' => FALSE, 'type' => "object", "valid_ext" => $file_types));
    echo "<small>" . $locale['440'] . " " . $file_types . ".sql</small>\n";
    // added
    echo "<hr/>\n";
    echo form_button('restore', $locale['438'], $locale['438'], array('class' => 'btn-primary'));
    echo closeform();
    closetable();
}
function get_database_size($prefix = "")
{
    global $db_name;
    $db_size = 0;
    $result = dbquery("SHOW TABLE STATUS FROM `" . $db_name . "`");
    while ($row = dbarray($result)) {
        if (!isset($row['Type'])) {
            $row['Type'] = "";
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:db_backup.php

示例5: get_profile_input

 public function get_profile_input()
 {
     global $locale;
     $this->method = "input";
     $section_links = $this->renderPageLink();
     $_GET['section'] = isset($_GET['section']) && isset($section_links[$_GET['section']]) ? $_GET['section'] : 1;
     if ($_GET['section'] == '1') {
         $user_name = isset($_POST['user_name']) ? $_POST['user_name'] : $this->userData['user_name'];
         $user_email = isset($_POST['user_email']) ? $_POST['user_email'] : $this->userData['user_email'];
         $user_hide_email = isset($_POST['user_hide_email']) ? $_POST['user_hide_email'] : $this->userData['user_hide_email'];
         $this->info['user_name'] = form_para($locale['u129'], 'account', 'profile_category_name');
         if (iADMIN || $this->_userNameChange) {
             $this->info['user_name'] .= form_text('user_name', $locale['u127'], $user_name, array('max_length' => 30, 'required' => 1, 'error_text' => $locale['u122'], 'inline' => 1));
         }
         // User Password
         $this->info['user_password'] = form_para($locale['u132'], 'password', 'profile_category_name');
         if ($this->registration || $this->admin_mode) {
             $this->info['user_password'] .= form_text('user_password1', $locale['u134a'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u134'] . $locale['u143a'], 'required' => $this->admin_mode ? FALSE : TRUE));
             $this->info['user_password'] .= form_text('user_password2', $locale['u134b'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133'], 'required' => $this->admin_mode ? FALSE : TRUE));
         } else {
             $this->info['user_password'] .= form_hidden('user_id', '', isset($this->userData['user_id']) && isnum($this->userData['user_id']) ? $this->userData['user_id'] : 0);
             $this->info['user_password'] .= form_text('user_password', $locale['u135a'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133']));
             $this->info['user_password'] .= form_text('user_password1', $locale['u135b'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133']));
             $this->info['user_password'] .= form_text('user_password2', $locale['u135c'], '', array('class' => 'm-b-0', 'type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133']));
             $this->info['user_password'] .= "<input type='hidden' name='user_hash' value='" . $this->userData['user_password'] . "' />\n";
         }
         $this->info['user_password'] .= "<div class='col-xs-12 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-3'><span class='text-smaller'>" . $locale['u147'] . "</span></div>\n";
         // Admin Password - not available for everyone except edit profile.
         $this->info['user_admin_password'] = '';
         if (!$this->registration && iADMIN && !defined('ADMIN_PANEL')) {
             if ($this->userData['user_admin_password']) {
                 $this->info['user_admin_password'] = form_text('user_admin_password', $locale['u144a'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u136']));
                 $this->info['user_admin_password'] .= form_text('user_admin_password1', $locale['u144'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u136']));
             } else {
                 $this->info['user_admin_password'] = form_text('user_admin_password', $locale['u144'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u136']));
             }
             $this->info['user_admin_password'] .= form_text('user_admin_password2', $locale['u145'], '', array('class' => 'm-b-0', 'type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u136']));
             $this->info['user_admin_password'] .= "<div class='col-xs-12 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-3'><span class='text-smaller'>" . $locale['u147'] . "</span></div>\n";
         }
         // User Password Verification
         $this->info['user_password_verify'] = iADMIN && checkrights("M") ? "" : form_text('user_password_verify', $locale['u135a'], '', array('type' => 'password', 'autocomplete_off' => 1, 'inline' => 1, 'max_length' => 64, 'error_text' => $locale['u133']));
         // Avatar Field
         $this->info['user_avatar'] = '';
         if (!$this->registration) {
             if (isset($this->userData['user_avatar']) && $this->userData['user_avatar'] != "") {
                 $this->info['user_avatar'] = "<label for='user_avatar_upload'><img src='" . IMAGES . "avatars/" . $this->userData['user_avatar'] . "' alt='" . $locale['u185'] . "' />\n\t\t\t\t\t\t\t\t\t\t\t</label>\n<br />\n\n\t\t\t\t\t\t\t\t\t\t\t" . form_checkbox("delAvatar", $locale['u187'], "", array("reverse_label" => TRUE));
             } else {
                 $this->info['user_avatar'] = form_fileinput('user_avatar', $locale['u185'], '', array('upload_path' => IMAGES . "avatars/", 'input_id' => 'user_avatar_upload', 'type' => 'image', 'max_byte' => fusion_get_settings('avatar_filesize'), 'max_height' => fusion_get_settings('avatar_width'), 'max_width' => fusion_get_settings('avatar_height'), 'inline' => TRUE, 'thumbnail' => 0, 'width' => '100%', "delete_original" => FALSE, 'class' => 'm-t-10 m-b-0', "error_text" => $locale['u180'], "template" => "modern"));
                 $this->info['user_avatar'] .= "<div class='col-xs-12 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-3'>\n\t\t\t\t\t" . sprintf($locale['u184'], parsebytesize(fusion_get_settings('avatar_filesize')), fusion_get_settings('avatar_width'), fusion_get_settings('avatar_height')) . "</div>\n";
             }
         }
         // Email
         $this->info['user_email'] = form_text('user_email', $locale['u128'], $user_email, array('type' => 'email', "required" => TRUE, 'inline' => 1, 'max_length' => '100', 'error_text' => $locale['u126']));
         // Hide email toggler
         $this->info['user_hide_email'] = form_btngroup('user_hide_email', $locale['u051'], $user_hide_email, array('inline' => TRUE, $options = array($locale['u053'], $locale['u052'])));
         // Captcha
         if ($this->displayValidation == 1 && !defined('ADMIN_PANEL')) {
             $this->info['validate'] = $this->renderValidation();
         }
         // Website terms
         if ($this->displayTerms == 1) {
             $this->info['terms'] = $this->renderTerms();
         }
     }
     $this->info += array('register' => $this->registration, 'pages' => $this->paginate && !$this->registration ? $this->info['section'] = $section_links : '', 'openform' => openform($this->formname, 'post', FUSION_REQUEST, array('enctype' => $this->showAvatarInput ? TRUE : FALSE)), 'closeform' => closeform(), 'button' => $this->renderButton());
     $this->get_userFields();
     return (array) $this->info;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:68,代码来源:UserFields.php

示例6: render_edit_form

 public function render_edit_form()
 {
     global $locale, $userdata, $forum_settings, $defender;
     $thread_data = $this->thread_info['thread'];
     if ((!iMOD or !iSUPERADMIN) && $thread_data['thread_locked']) {
         redirect(INFUSIONS . 'forum/index.php');
     }
     if (isset($_GET['post_id']) && isnum($_GET['post_id'])) {
         add_to_title($locale['global_201'] . $locale['forum_0503']);
         add_breadcrumb(array('link' => '', 'title' => $locale['forum_0503']));
         $result = dbquery("SELECT tp.*, tt.thread_subject, tt.thread_poll, tt.thread_author, tt.thread_locked, MIN(tp2.post_id) AS first_post\n\t\t\t\tFROM " . DB_FORUM_POSTS . " tp\n\t\t\t\tINNER JOIN " . DB_FORUM_THREADS . " tt on tp.thread_id=tt.thread_id\n\t\t\t\tINNER JOIN " . DB_FORUM_POSTS . " tp2 on tp.thread_id=tp2.thread_id\n\t\t\t\tWHERE tp.post_id='" . intval($_GET['post_id']) . "' AND tp.thread_id='" . intval($thread_data['thread_id']) . "' AND tp.forum_id='" . intval($thread_data['forum_id']) . "'\n\t\t\t\tGROUP BY tp2.post_id\n\t\t\t\t");
         if (dbrows($result) > 0) {
             $post_data = dbarray($result);
             if ((iMOD or iSUPERADMIN) || $this->getThreadPermission("can_reply") && $post_data['post_author'] == $userdata['user_id']) {
                 $is_first_post = $post_data['post_id'] == $this->thread_info['post_firstpost'] ? TRUE : FALSE;
                 // no edit if locked
                 if ($post_data['post_locked'] && !iMOD) {
                     redirect(INFUSIONS . "forum/postify.php?post=edit&error=5&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id'] . "&post_id=" . $post_data['post_id']);
                 }
                 // no edit if time limit reached
                 if (!iMOD && ($forum_settings['forum_edit_timelimit'] > 0 && time() - $forum_settings['forum_edit_timelimit'] * 60 > $post_data['post_datestamp'])) {
                     redirect(INFUSIONS . "forum/postify.php?post=edit&error=6&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id'] . "&post_id=" . $post_data['post_id']);
                 }
                 // execute form post actions
                 if (isset($_POST['post_edit'])) {
                     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
                         $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' => 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 == TRUE) {
                             $post_data['thread_subject'] = form_sanitizer($_POST['thread_subject'], '', 'thread_subject');
                         }
                         if ($defender->safe()) {
                             // 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]) && $this->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(INFUSIONS . "forum/postify.php?post=edit&error=0&amp;forum_id=" . intval($post_data['forum_id']) . "&amp;thread_id=" . intval($post_data['thread_id']) . "&amp;post_id=" . intval($post_data['post_id']));
                             }
                         }
                     }
                 }
                 // template data
                 $form_action = INFUSIONS . "forum/viewthread.php?action=edit&amp;forum_id=" . $thread_data['forum_id'] . "&amp;thread_id=" . $thread_data['thread_id'] . "&amp;post_id=" . $_GET['post_id'];
                 // get attachment.
                 $attachments = array();
                 $attach_rows = 0;
                 if ($this->getThreadPermission("can_upload_attach") && !empty($this->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' => $this->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']), "forum_field" => "", 'subject_field' => $this->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')), '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' => $this->getThreadPermission("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, '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')), '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')) : '', 'sticky_field' => (iMOD || iSUPERADMIN) && $is_first_post ? form_checkbox('thread_sticky', $locale['forum_0620'], $thread_data['thread_sticky'], array('class' => 'm-b-0')) : '', 'lock_field' => iMOD || iSUPERADMIN ? form_checkbox('thread_locked', $locale['forum_0621'], $thread_data['thread_locked'], array('class' => 'm-b-0')) : '', 'hide_edit_field' => form_checkbox('hide_edit', $locale['forum_0627'], '', array('class' => 'm-b-0')), 'post_locked_field' => iMOD || iSUPERADMIN ? form_checkbox('post_locked', $locale['forum_0628'], $post_data['post_locked'], array('class' => 'm-b-0')) : '', '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 .= "<label><input type='checkbox' name='delete_attach_" . $a_data['attach_id'] . "' value='1' /> " . $locale['forum_0625'] . "</label>\n" . "<a href='" . INFUSIONS . "forum/attachments/" . $a_data['attach_name'] . "'>" . $a_data['attach_name'] . "</a> [" . parsebytesize($a_data['attach_size']) . "]\n" . "<br/>\n";
                     }
                     $info['attachment_field'] = $a_info . $info['attachment_field'];
                 }
                 postform($info);
             } else {
                 redirect(INFUSIONS . 'forum/index.php');
                 // no access
//.........这里部分代码省略.........
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:101,代码来源:Viewthread.php

示例7: display_fields


//.........这里部分代码省略.........
                 $options += array('type' => 'url');
                 return form_text($data['field_name'], $options['show_title'] ? self::parse_label($data['field_title']) : '', $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
         case 'email':
             if ($method == 'input') {
                 $options += array('type' => 'email');
                 return form_text($data['field_name'], $options['show_title'] ? self::parse_label($data['field_title']) : '', $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
         case 'select':
             if ($method == 'input') {
                 $options['options'] = $option_list;
                 return form_select($data['field_name'], self::parse_label($data['field_title']), $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 $options_value = explode(",", $data['field_options']);
                 return array('title' => self::parse_label($data['field_title']), 'value' => !empty($options_value[$field_value]) ? $options_value[$field_value] : $field_value);
             }
             break;
         case 'tags':
             if ($method == 'input') {
                 $options += array('options' => $option_list, 'tags' => 1, 'multiple' => 1, 'width' => '100%');
                 return form_select($data['field_name'], $options['show_title'] ? self::parse_label($data['field_title']) : '', $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
         case 'location':
             if ($method == 'input') {
                 $options += array('width' => '100%');
                 return form_location($data['field_name'], self::parse_label($data['field_title']), $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
         case 'textarea':
             if ($method == 'input') {
                 return form_textarea($data['field_name'], $options['show_title'] ? self::parse_label($data['field_title']) : '', $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
         case 'checkbox':
             if ($method == 'input') {
                 return form_checkbox($data['field_name'], $options['show_title'] ? self::parse_label($data['field_title']) : '', $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
         case 'datepicker':
             if ($method == 'input') {
                 return form_datepicker($data['field_name'], $options['show_title'] ? self::parse_label($data['field_title']) : '', $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => showdate('shortdate', $field_value));
             }
             break;
         case 'colorpicker':
             if ($method == 'input') {
                 return form_colorpicker($data['field_name'], $options['show_title'] ? self::parse_label($data['field_title']) : '', $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
         case 'uploader':
             if ($method == 'input') {
                 return form_fileinput($data['field_name'], self::parse_label($data['field_title']), $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
         case 'hidden':
             if ($method == 'input') {
                 return form_hidden($data['field_name'], self::parse_label($data['field_title']), $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
         case 'address':
             if ($method == 'input') {
                 return form_geo($data['field_name'], $options['show_title'] ? self::parse_label($data['field_title']) : '', $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => implode('|', $field_value));
             }
             break;
         case 'toggle':
             $options['toggle'] = 1;
             $options['toggle_text'] = array($this->locale['off'], $this->locale['on']);
             if ($method == 'input') {
                 return form_checkbox($data['field_name'], $options['show_title'] ? self::parse_label($data['field_title']) : '', $field_value, $options);
             } elseif ($method == 'display' && $field_value) {
                 return array('title' => self::parse_label($data['field_title']), 'value' => $field_value);
             }
             break;
     }
     return FALSE;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:101,代码来源:QuantumFields.php

示例8: 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&amp;forum_id=" . intval($post_data['forum_id']) . "&amp;parent_id=" . intval($post_data['forum_cat']) . "&amp;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                            "));
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:67,代码来源:new_thread.php

示例9: theme_uploader

 public static function theme_uploader()
 {
     global $locale, $aidlink, $defender;
     if (isset($_POST['upload'])) {
         require_once INCLUDES . "infusions_include.php";
         $src_file = 'theme_files';
         $target_folder = THEMES;
         $valid_ext = '.zip';
         $max_size = 5 * 1000 * 1000;
         $upload = upload_file($src_file, '', $target_folder, $valid_ext, $max_size);
         if ($upload['error'] != '0') {
             $defender->stop();
             switch ($upload['error']) {
                 case 1:
                     addNotice('danger', sprintf($locale['theme_error_001'], parsebytesize($max_size, 2)));
                     break;
                 case 2:
                     addNotice('danger', $locale['theme_error_002']);
                     break;
                 case 3:
                     addNotice('danger', $locale['theme_error_003']);
                     break;
                 case 4:
                     addNotice('danger', $locale['theme_error_004']);
                     break;
                 default:
                     addNotice('danger', $locale['theme_error_003']);
             }
         } else {
             $target_file = $target_folder . $upload['target_file'];
             if (is_file($target_file)) {
                 $path = pathinfo(realpath($target_file), PATHINFO_DIRNAME);
                 if (class_exists('ZipArchive')) {
                     $zip = new ZipArchive();
                     $res = $zip->open($target_file);
                     if ($res === TRUE) {
                         // checks if first folder is theme.php
                         if ($zip->locateName('theme.php') !== FALSE) {
                             // extract it to the path we determined above
                             $zip->extractTo($path);
                             addNotice('success', $locale['theme_success_001']);
                         } else {
                             $defender->stop();
                             addNotice('danger', $locale['theme_error_005']);
                         }
                         $zip->close();
                         @unlink($target_file);
                         redirect(FUSION_SELF . $aidlink);
                     } else {
                         addNotice('danger', $locale['theme_error_005']);
                         @unlink($target_file);
                         redirect(FUSION_SELF . $aidlink);
                     }
                 } else {
                     addNotice('warning', $locale['theme_error_006']);
                     @unlink($target_file);
                     redirect(FUSION_SELF . $aidlink);
                 }
             }
         }
     }
     echo openform('inputform', 'post', FUSION_SELF . $aidlink, array('enctype' => 1, 'max_tokens' => 1));
     echo form_fileinput('theme_files', $locale['theme_1007'], '', array());
     echo form_button('upload', $locale['theme_1007'], 'upload theme', array('class' => 'btn btn-primary'));
     echo closeform();
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:66,代码来源:Admin.php

示例10: form_text

echo form_text('text_input_safe', 'Required text input in SAFEMODE', $settings_test['text_input_safe'], array('required' => 1, 'safemode' => 1, 'inline' => 1));
echo form_text('password_input', 'Password input', $settings_test['password_input'], array('type' => 'password', 'autocomplete_off' => 1, 'required' => 1, 'error_text' => 'Ummm, please enter a valid password here', 'inline' => 1));
echo form_text('text_input', 'Text input', $settings_test['text_input'], array('required' => 1, 'inline' => 1));
echo form_text('text_input2', 'An extra text input<br /><small>This input is not accounted for and will be ignored</small>', 'something', array('required' => 1, 'inline' => 1));
echo form_text('email_input', 'Email', $settings_test['email_input'], array('required' => 0, 'type' => 'email', 'inline' => 1));
echo form_text('email_input_required', 'Email required', $settings_test['email_input_required'], array('required' => 1, 'type' => 'email', 'inline' => 1));
echo form_text('url_input', 'URL', $settings_test['url_input'], array('type' => 'url', 'inline' => 1));
echo form_text('regex_input', 'Regex', $settings_test['regex_input'], array('tip' => 'Characters from A to Z only', 'regex' => '[a-z]+', 'inline' => 1));
echo form_text('regex_input_required', 'Regex required', $settings_test['regex_input_required'], array('required' => 1, 'tip' => 'Characters from A to Z only', 'regex' => '[a-z]+', 'inline' => 1));
echo form_text('number_input', 'Number', $settings_test['number_input'], array('required' => 1, 'type' => 'number', 'inline' => 1));
echo form_checkbox('checkbox_input', 'Checkbox', $settings_test['checkbox_input'], array('required' => 1, 'inline' => 1));
// Experimental 'child_of'
echo form_checkbox('checkbox_input2', 'Checkbox 2, child of Checkbox', $settings_test['checkbox_input2'], array('child_of' => 'checkbox_input', 'inline' => 1));
echo form_checkbox('checkbox_input_bs', 'Bootstrap switch checkbox', $settings_test['checkbox_input_bs'], array('toggle' => 1, 'toggle_text' => array('OFF', 'ON'), 'disabled' => 0, 'inline' => 1));
//echo form_checkbox('Checkbox 3, child of Checkbox', 'checkbox_input3', 'checkbox_input3', $settings_test['checkbox_input3'], array('child_of' => 'checkbox_input', 'inline' => 1));
//echo form_checkbox('Checkbox 4, child of Checkbox 3', 'checkbox_input4', 'checkbox_input4', $settings_test['checkbox_input4'], array('child_of' => 'checkbox_input3', 'inline' => 1));
//echo form_name('Name', 'name_input', 'name_input', $settings_test['name_input'], array('required' => 1, 'inline' => 1));
//echo form_address('Address', 'address_input', 'address_input', explode('|', $settings_test['address_input']), array('inline' => 1));
echo form_textarea('textarea', 'Text area', $settings_test['textarea'], array('autosize' => 1, 'inline' => 1));
//var_dump($_SESSION['form_fields'][$_SERVER['PHP_SELF']]);
$file_options = array('upload_path' => DOWNLOADS . "images/", 'max_width' => $settings['download_screen_max_w'], 'max_height' => $settings['download_screen_max_w'], 'max_byte' => $settings['download_screen_max_b'], 'type' => 'image', 'required' => 0, 'delete_original' => 0, 'thumbnail_folder' => '', 'thumbnail' => 1, 'thumbnail_suffix' => '_thumb', 'thumbnail_w' => $settings['download_thumb_max_w'], 'thumbnail_h' => $settings['download_thumb_max_h'], 'error_text' => 'Please select an image', 'inline' => 1, 'thumbnail2' => 0);
echo form_fileinput('file_input', 'File upload', '', $file_options);
// all file types.
echo form_button('submit', 'Submit', 'value', array('class' => 'btn-success'));
echo closeform();
echo "<br>These are the default and posted settings merged, which would endup being inserted in the DB:";
var_dump($settings_test);
echo "<br>These are the tokens available for this form:";
var_dump($_SESSION['csrf_tokens']['form']);
closetable();
require_once THEMES . "templates/footer.php";
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:testDefender.php

示例11: dbquery

        echo "<div class='well text-center'><p><strong>" . $locale['gallery_0101'] . "</strong></p>";
        echo "<p><a href='submit.php?stype=p'>" . $locale['gallery_0102'] . "</a></p>";
        echo "<p><a href='index.php'>" . $locale['gallery_0113'] . "</a></p>\n";
        echo "</div>\n";
    } else {
        $result = dbquery("SELECT album_id, album_title FROM " . DB_PHOTO_ALBUMS . " " . (multilang_table("PG") ? "WHERE album_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess("album_access") . " ORDER BY album_title");
        if (dbrows($result) > 0) {
            $opts = array();
            while ($data = dbarray($result)) {
                $opts[$data['album_id']] = $data['album_title'];
            }
            echo openform('submit_form', 'post', BASEDIR . "submit.php?stype=p", array("enctype" => TRUE));
            echo "<div class='panel panel-default tbl-border'>\n<div class='panel-body'>\n";
            echo "<div class='m-b-20 submission-guidelines'>" . $locale['gallery_0107'] . "</div>\n";
            echo form_select('album_id', $locale['gallery_0103'], '', array("options" => $opts, "inline" => TRUE));
            echo form_text('photo_title', $locale['gallery_0104'], '', array('required' => TRUE, "inline" => TRUE));
            echo form_select('photo_keywords', $locale['gallery_0105'], $data['photo_keywords'], array('placeholder' => $locale['photo_0007'], 'inline' => TRUE, 'multiple' => TRUE, "tags" => TRUE, 'width' => '100%'));
            echo form_textarea('photo_description', $locale['gallery_0106'], '', array("inline" => TRUE, "required" => $gll_settings['gallery_extended_required'] ? TRUE : FALSE));
            echo form_fileinput('photo_image', $locale['gallery_0109'], '', array("upload_path" => INFUSIONS . "gallery/submissions/", "required" => TRUE, 'thumbnail_folder' => 'thumbs', 'thumbnail' => TRUE, 'thumbnail_w' => $gll_settings['thumb_w'], 'thumbnail_h' => $gll_settings['thumb_h'], 'thumbnail_suffix' => '_t1', 'thumbnail2' => TRUE, 'thumbnail2_w' => $gll_settings['photo_w'], 'thumbnail2_h' => $gll_settings['photo_h'], 'thumbnail2_suffix' => '_t2', 'max_width' => $gll_settings['photo_max_w'], 'max_height' => $gll_settings['photo_max_h'], 'max_byte' => $gll_settings['photo_max_b'], 'delete_original' => FALSE, "multiple" => FALSE, "inline" => TRUE, "error_text" => $locale['gallery_0110']));
            echo "<div class='m-b-10 col-xs-12 col-sm-offset-3'>" . sprintf($locale['photo_0017'], parsebytesize($gll_settings['photo_max_b']), str_replace(',', ' ', ".jpg,.gif,.png"), $gll_settings['photo_max_w'], $gll_settings['photo_max_h']) . "</div>\n";
            echo "</div>\n</div>\n";
            echo form_button('submit_photo', $locale['gallery_0111'], $locale['gallery_0111'], array('class' => 'btn-primary'));
            echo closeform();
        } else {
            echo "<div class='well' style='text-align:center'><br />\n" . $locale['gallery_0024'] . "<br /><br />\n</div>\n";
        }
    }
} else {
    echo "<div class='well text-center'>" . $locale['gallery_0112'] . "</div>\n";
}
closetable();
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:photo_submit.php

示例12: thumbnail

if ($dl_settings['download_screenshot']) {
    if (!empty($data['download_image']) && !empty($data['download_image_thumb'])) {
        echo "<div class='clearfix list-group-item m-b-20'>\n";
        echo "<div class='pull-left m-r-10'>\n";
        echo thumbnail(DOWNLOADS . "images/" . $data['download_image_thumb'], '80px');
        echo "</div>\n";
        echo "<div class='overflow-hide'>\n";
        echo "<span class='text-dark strong'>" . $locale['download_0220'] . "</span>\n";
        echo form_checkbox('del_image', $locale['download_0216'], '');
        echo form_hidden('download_image', '', $data['download_image']);
        echo form_hidden('download_image_thumb', '', $data['download_image_thumb']);
        echo "</div>\n</div>\n";
    } else {
        require_once INCLUDES . "mimetypes_include.php";
        $file_options = array('upload_path' => DOWNLOADS . "images/", 'max_width' => $dl_settings['download_screen_max_w'], 'max_height' => $dl_settings['download_screen_max_w'], 'max_byte' => $dl_settings['download_screen_max_b'], 'type' => 'image', 'delete_original' => 0, 'thumbnail_folder' => '', 'thumbnail' => 1, 'thumbnail_suffix' => '_thumb', 'thumbnail_w' => $dl_settings['download_thumb_max_w'], 'thumbnail_h' => $dl_settings['download_thumb_max_h'], 'thumbnail2' => 0, 'valid_ext' => implode('.', array_keys(img_mimeTypes())), "width" => "100%", "template" => "modern");
        echo form_fileinput('download_image', $locale['download_0220'], '', $file_options);
        // all file types.
        echo "<div class='m-b-10'>" . sprintf($locale['download_0219'], parsebytesize($dl_settings['download_screen_max_b']), str_replace(',', ' ', ".jpg,.gif,.png"), $dl_settings['download_screen_max_w'], $dl_settings['download_screen_max_h']) . "</div>\n";
    }
}
echo form_button('save_download', $locale['download_0212'], $locale['download_0212'], array('class' => 'btn-success m-r-10', 'icon' => 'fa fa-check-square-o'));
closeside();
openside('');
echo form_checkbox('download_allow_comments', $locale['download_0223'], $data['download_allow_comments'], array('class' => 'm-b-0'));
echo form_checkbox('download_allow_ratings', $locale['download_0224'], $data['download_allow_ratings'], array('class' => 'm-b-0'));
if (isset($_GET['action']) && $_GET['action'] == "edit") {
    echo form_checkbox('update_datestamp', $locale['download_0213'], '', array('class' => 'm-b-0'));
}
closeside();
openside();
echo form_text('download_license', $locale['download_0208'], $data['download_license'], array('inline' => 1));
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:downloads.php

示例13: dbquery_insert

                                 $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&amp;forum_id=" . intval($post_data['forum_id']) . "&amp;parent_id=" . intval($post_data['forum_cat']) . "&amp;thread_id=" . intval($post_data['thread_id'] . ""));
                 }
             }
         }
         $form_action = INFUSIONS . "forum/newthread.php?forum_id=" . $post_data['forum_id'];
         $info = array('title' => $locale['forum_0057'], 'description' => '', 'openform' => openform('input_form', 'post', $form_action, array('enctype' => $permission['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')), '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' => $forum->getForumPermission("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")) . "\n\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' => $poll_form, 'smileys_field' => form_checkbox('post_smileys', $locale['forum_0622'], $post_data['post_smileys'], array('class' => 'm-b-0')), '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')) : '', 'sticky_field' => iMOD || iSUPERADMIN ? form_checkbox('thread_sticky', $locale['forum_0620'], $thread_data['thread_sticky'], array('class' => 'm-b-0')) : '', 'lock_field' => iMOD || iSUPERADMIN ? form_checkbox('thread_locked', $locale['forum_0621'], $thread_data['thread_locked'], array('class' => 'm-b-0')) : '', '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')) : '', '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\t\t\tif (\$('#add_poll').is(':checked')) {\n\t\t\t\t\$('#poll_form').show();\n\t\t\t} else {\n\t\t\t\t\$('#poll_form').hide();\n\t\t\t}\n\t\t\t\$('#add_poll').bind('click', function() {\n\t\t\t\tif (\$(this).is(':checked')) {\n\t\t\t\t\t\$('#poll_form').slideDown();\n\t\t\t\t} else {\n\t\t\t\t\t\$('#poll_form').slideUp();\n\t\t\t\t}\n\t\t\t});\n\t\t\t");
         postform($info);
     } else {
         redirect(INFUSIONS . '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");
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:newthread.php

示例14: opentable

     $formaction = FUSION_SELF . $aidlink . "&amp;album_id=" . $_GET['album_id'] . "";
     opentable($album_title . ": " . $locale['400']);
 }
 echo "<!--- start single photo -->\n";
 if (!isset($_GET['action'])) {
     echo "<div class='tbl2 list-group-item' id='show_singleform' style='font-weight:bold;cursor:pointer;margin-bottom:2px;'><i class='entypo camera'></i> " . $locale['493'] . "</div>";
 }
 require_once BASEDIR . 'includes/mimetypes_include.php';
 echo "<div class='panel panel-default image_upload' id='single_upload'>\n<div class='panel-body'>\n";
 echo openform('input_form', 'post', $formaction, array('enctype' => 1, 'max_tokens' => 1));
 echo "<div class='row'>\n";
 echo "<div class='col-xs-12 col-sm-8 col-md-8 col-lg-8'>\n";
 echo form_text('photo_title', $locale['432'], $photo_title, array('max_length' => 100, 'required' => 1, 'error_text' => ''));
 echo form_textarea('photo_description', $locale['433'], $photo_description, array('bbcode' => 1, 'autosize' => 1, 'resize' => 0));
 if (!isset($_GET['action'])) {
     echo form_fileinput('photo_pic_file', $locale['436'], '', array('upload_path' => PHOTODIR, 'type' => 'image', 'thumbnail_path' => PHOTODIR, 'required' => 1, 'error_text' => $locale['421']));
 }
 echo form_text('photo_order', $locale['434'], $photo_order, array('number' => 1, 'width' => '100px'));
 echo "</div>\n<div class='col-xs-12 col-sm-4 col-md-4 col-lg-4'>\n";
 echo "<div class='panel panel-default'>\n<div class='panel-heading'>\n" . $locale['511'] . "</div>\n";
 echo "<div class='panel-body'>\n";
 if ($gallery_settings['comments_enabled'] == "0" || $gallery_settings['ratings_enabled'] == "0") {
     $sys = "";
     if ($gallery_settings['comments_enabled'] == "0" && $gallery_settings['ratings_enabled'] == "0") {
         $sys = $locale['523'];
     } elseif ($gallery_settings['comments_enabled'] == "0") {
         $sys = $locale['521'];
     } else {
         $sys = $locale['522'];
     }
     echo "<div class='alert alert-info m-b-10'>" . sprintf($locale['520'], $sys) . "</div>";
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:photos_admin_bak.php

示例15: display_forum_form

 /**
  * Display Forum Form
  */
 public function display_forum_form()
 {
     require_once INCLUDES . 'photo_functions_include.php';
     require_once INCLUDES . 'infusions_include.php';
     $forum_settings = $this->get_forum_settings();
     $language_opts = fusion_get_enabled_languages();
     add_breadcrumb(array('link' => '', 'title' => self::$locale['forum_001']));
     if (!isset($_GET['action']) && $_GET['parent_id']) {
         $data['forum_cat'] = $_GET['parent_id'];
     }
     $type_opts = array('1' => self::$locale['forum_opts_001'], '2' => self::$locale['forum_opts_002'], '3' => self::$locale['forum_opts_003'], '4' => self::$locale['forum_opts_004']);
     $forum_image_path = FORUM . "images/";
     if (isset($_POST['remove_image']) && isset($_POST['forum_id'])) {
         $data['forum_id'] = form_sanitizer($_POST['forum_id'], '', 'forum_id');
         if ($data['forum_id']) {
             $data = self::get_forum($data['forum_id']);
             if (!empty($data)) {
                 $forum_image = $forum_image_path . $data['forum_image'];
                 if (!empty($data['forum_image']) && file_exists($forum_image) && !is_dir($forum_image)) {
                     @unlink($forum_image);
                     $data['forum_image'] = '';
                 }
                 dbquery_insert(DB_FORUMS, $data, 'update');
                 addNotice('success', self::$locale['forum_notice_8']);
                 redirect(FUSION_REQUEST);
             }
         }
     }
     opentable(self::$locale['forum_001']);
     echo openform('inputform', 'post', FUSION_REQUEST, array('enctype' => 1));
     echo "<div class='row'>\n<div class='col-xs-12 col-sm-8 col-md-8 col-lg-8'>\n";
     echo form_text('forum_name', self::$locale['forum_006'], $this->data['forum_name'], array('required' => 1, 'error_text' => self::$locale['forum_error_1'])) . form_textarea('forum_description', self::$locale['forum_007'], $this->data['forum_description'], array('autosize' => 1, 'type' => 'bbcode', 'form_name' => 'inputform', 'preview' => TRUE)) . form_text('forum_alias', self::$locale['forum_011'], $this->data['forum_alias']);
     echo "</div><div class='col-xs-12 col-sm-4 col-md-4 col-lg-4'>\n";
     openside('');
     $self_id = $this->data['forum_id'] ? $this->data['forum_id'] : '';
     echo form_select_tree('forum_cat', self::$locale['forum_008'], $this->data['forum_cat'], array('add_parent_opts' => 1, 'disable_opts' => $self_id, 'hide_disabled' => 1), DB_FORUMS, 'forum_name', 'forum_id', 'forum_cat', $self_id) . form_select('forum_type', self::$locale['forum_009'], $this->data['forum_type'], array("options" => $type_opts)) . form_select('forum_language', self::$locale['forum_010'], $this->data['forum_language'], array("options" => $language_opts)) . form_text('forum_order', self::$locale['forum_043'], $this->data['forum_order'], array('number' => 1)) . form_button('save_forum', $this->data['forum_id'] ? self::$locale['forum_000a'] : self::$locale['forum_000'], self::$locale['forum_000'], array('class' => 'btn btn-sm btn-success'));
     closeside();
     echo "</div>\n</div>\n";
     echo "<div class='row'>\n<div class='col-xs-12 col-sm-8 col-md-8 col-lg-8'>\n";
     echo form_select('forum_meta', self::$locale['forum_012'], $this->data['forum_meta'], array('tags' => 1, 'multiple' => 1, 'width' => '100%'));
     if ($this->data['forum_image'] && file_exists(FORUM . "images/" . $this->data['forum_image'])) {
         openside();
         echo "<div class='pull-left m-r-10'>\n";
         echo thumbnail(FORUM . "images/" . $this->data['forum_image'], '80px', '80px');
         echo "</div>\n<div class='overflow-hide'>\n";
         echo "<span class='strong'>" . self::$locale['forum_013'] . "</span><br/>\n";
         $image_size = @getimagesize(FORUM . "images/" . $this->data['forum_image']);
         echo "<span class='text-smaller'>" . sprintf(self::$locale['forum_027'], $image_size[0], $image_size[1]) . "</span><br/>";
         echo form_hidden('forum_image', '', $this->data['forum_image']);
         echo form_button('remove_image', self::$locale['forum_028'], self::$locale['forum_028'], array('class' => 'btn-danger btn-sm m-t-10', 'icon' => 'fa fa-trash'));
         echo "</div>\n";
         closeside();
     } else {
         $tab_title['title'][] = self::$locale['forum_013'];
         $tab_title['id'][] = 'fir';
         $tab_title['icon'][] = '';
         $tab_title['title'][] = self::$locale['forum_014'];
         $tab_title['id'][] = 'ful';
         $tab_title['icon'][] = '';
         $tab_active = tab_active($tab_title, 0);
         echo opentab($tab_title, $tab_active, 'forum-image-tab', FALSE, "m-t-20 m-b-20");
         // Upload Image
         echo opentabbody($tab_title['title'][0], 'fir', $tab_active);
         echo "<span class='display-inline-block m-t-10 m-b-10'>" . sprintf(self::$locale['forum_015'], parsebytesize($forum_settings['forum_attachmax'])) . "</span>\n";
         $fileOptions = array("upload_path" => $forum_image_path, "thumbnail" => TRUE, "thumbnail_folder" => $forum_image_path, "type" => "image", "delete_original" => TRUE, "max_count" => $forum_settings['forum_attachmax']);
         echo form_fileinput('forum_image', "", '', $fileOptions);
         echo closetabbody();
         // Upload image via Web Address
         echo opentabbody($tab_title['title'][1], 'ful', $tab_active);
         echo "<span class='display-inline-block m-t-10 m-b-10'>" . self::$locale['forum_016'] . "</strong></span>\n";
         $header_opts = array('0' => 'Local Server', '1' => 'URL');
         echo form_select('forum_image_header', self::$locale['forum_056'], '', array('inline' => TRUE, 'options' => $header_opts));
         echo form_text('forum_image_url', self::$locale['forum_014'], '', array('placeholder' => 'images/forum/', 'inline' => TRUE));
         echo closetabbody();
         echo closetab();
     }
     echo form_textarea('forum_rules', self::$locale['forum_017'], $this->data['forum_rules'], array('autosize' => 1, 'bbcode' => 1));
     echo "</div><div class='col-xs-12 col-sm-4 col-md-4 col-lg-4'>\n";
     openside('');
     // need to get parent category
     echo form_select_tree('forum_permissions', self::$locale['forum_025'], $this->data['forum_branch'], array('no_root' => 1, 'deactivate' => $this->data['forum_id'] ? TRUE : FALSE), DB_FORUMS, 'forum_name', 'forum_id', 'forum_cat');
     if ($this->data['forum_id']) {
         echo form_button('jp_forum', self::$locale['forum_029'], self::$locale['forum_029'], array('class' => 'btn-sm btn-default m-r-10'));
     }
     closeside();
     openside('');
     echo form_checkbox('forum_lock', self::$locale['forum_026'], $this->data['forum_lock'], array("reverse_label" => TRUE)) . form_checkbox('forum_users', self::$locale['forum_024'], $this->data['forum_users'], array("reverse_label" => TRUE)) . form_checkbox('forum_quick_edit', self::$locale['forum_021'], $this->data['forum_quick_edit'], array("reverse_label" => TRUE)) . form_checkbox('forum_merge', self::$locale['forum_019'], $this->data['forum_merge'], array("reverse_label" => TRUE)) . form_checkbox('forum_allow_attach', self::$locale['forum_020'], $this->data['forum_allow_attach'], array("reverse_label" => TRUE)) . form_checkbox('forum_allow_poll', self::$locale['forum_022'], $this->data['forum_allow_poll'], array("reverse_label" => TRUE)) . form_hidden('forum_id', '', $this->data['forum_id']) . form_hidden('forum_branch', '', $this->data['forum_branch']);
     closeside();
     echo "</div>\n</div>\n";
     echo form_button('save_forum', $this->data['forum_id'] ? self::$locale['forum_000a'] : self::$locale['forum_000'], self::$locale['forum_000'], array('class' => 'btn-sm btn-success'));
     echo closeform();
     closetable();
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:96,代码来源:view.php


注:本文中的form_fileinput函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。