• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP form_fileinput函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了form_fileinput函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 {
             /*
              * Qu 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP form_footer函数代码示例发布时间:2022-05-15
下一篇:
PHP form_fieldset_close函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap