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

PHP wfu_plugin_encode_string函数代码示例

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

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



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

示例1: wfu_ajax_action_read_subfolders

function wfu_ajax_action_read_subfolders()
{
    if (!isset($_POST['folder1']) || !isset($_POST['folder2'])) {
        die;
    }
    $temp_params = array('uploadpath' => wfu_plugin_decode_string($_POST['folder1']), 'accessmethod' => 'normal', 'ftpinfo' => '', 'useftpdomain' => 'false');
    $path = wfu_upload_plugin_full_path($temp_params);
    if (!is_dir($path)) {
        die("wfu_read_subfolders:error:Parent folder is not valid! Cannot retrieve subfolder list.");
    }
    $path2 = wfu_plugin_decode_string($_POST['folder2']);
    $dirlist = "";
    if ($handle = opendir($path)) {
        $blacklist = array('.', '..');
        while (false !== ($file = readdir($handle))) {
            if (!in_array($file, $blacklist)) {
                $filepath = $path . $file;
                if (is_dir($filepath)) {
                    if ($file == $path2) {
                        $file = '[[' . $file . ']]';
                    }
                    $dirlist .= ($dirlist == "" ? "" : ",") . $file;
                }
            }
        }
        closedir($handle);
    }
    if ($path2 != "") {
        $dirlist2 = $path2;
        $path .= $path2 . "/";
        if (is_dir($path)) {
            if ($handle = opendir($path)) {
                $blacklist = array('.', '..');
                while (false !== ($file = readdir($handle))) {
                    if (!in_array($file, $blacklist)) {
                        $filepath = $path . $file;
                        if (is_dir($filepath)) {
                            $dirlist2 .= ",*" . $file;
                        }
                    }
                }
                closedir($handle);
            }
        }
        $dirlist = str_replace('[[' . $path2 . ']]', $dirlist2, $dirlist);
    }
    die("wfu_read_subfolders:success:" . wfu_plugin_encode_string($dirlist));
}
开发者ID:epis2048,项目名称:wyyhome,代码行数:48,代码来源:wfu_ajaxactions.php


示例2: wfu_encode_plugin_options

function wfu_encode_plugin_options($plugin_options)
{
    $encoded_options = 'version=' . $plugin_options['version'] . ';';
    $encoded_options .= 'shortcode=' . wfu_plugin_encode_string($plugin_options['shortcode']) . ';';
    $encoded_options .= 'hashfiles=' . $plugin_options['hashfiles'] . ';';
    $encoded_options .= 'basedir=' . wfu_plugin_encode_string($plugin_options['basedir']) . ';';
    $encoded_options .= 'postmethod=' . $plugin_options['postmethod'] . ';';
    $encoded_options .= 'relaxcss=' . $plugin_options['relaxcss'] . ';';
    $encoded_options .= 'captcha_sitekey=' . wfu_plugin_encode_string($plugin_options['captcha_sitekey']) . ';';
    $encoded_options .= 'captcha_secretkey=' . wfu_plugin_encode_string($plugin_options['captcha_secretkey']) . ';';
    $encoded_options .= 'browser_permissions=' . wfu_encode_array_to_string($plugin_options['browser_permissions']);
    return $encoded_options;
}
开发者ID:epis2048,项目名称:wyyhome,代码行数:13,代码来源:wfu_functions.php


示例3: wfu_set_javascript_constants

function wfu_set_javascript_constants()
{
    $consts = array("nofilemessage" => WFU_ERROR_UPLOAD_NOFILESELECTED, "enable_popups" => WFU_ERROR_ENABLE_POPUPS, "remoteserver_noresult" => WFU_ERROR_REMOTESERVER_NORESULT, "message_header" => WFU_ERRORMESSAGE, "message_failed" => WFU_ERROR_UPLOAD_FAILED_WHILE, "message_cancelled" => WFU_ERROR_UPLOAD_CANCELLED, "message_unknown" => WFU_ERROR_UNKNOWN, "adminmessage_unknown" => WFU_FAILMESSAGE_DETAILS, "message_timelimit" => WFU_ERROR_FILE_PHP_TIME, "message_admin_timelimit" => WFU_ERROR_ADMIN_FILE_PHP_TIME, "cancel_upload_prompt" => WFU_CANCEL_UPLOAD_PROMPT, "file_cancelled" => WFU_ERROR_FILE_CANCELLED, "jsonparse_filemessage" => WFU_ERROR_JSONPARSE_FILEMESSAGE, "jsonparse_message" => WFU_ERROR_JSONPARSE_MESSAGE, "jsonparse_adminmessage" => WFU_ERROR_JSONPARSE_ADMINMESSAGE, "jsonparse_headermessage" => WFU_ERROR_JSONPARSE_HEADERMESSAGE, "jsonparse_headeradminmessage" => WFU_ERROR_JSONPARSE_HEADERADMINMESSAGE, "same_pluginid" => WFU_ERROR_SAME_PLUGINID, "default_colors" => WFU_VAR("WFU_DEFAULTMESSAGECOLORS"), "fail_colors" => WFU_VAR("WFU_FAILMESSAGECOLORS"), "max_time_limit" => WFU_MAX_TIME_LIMIT, "response_url" => WFU_RESPONSE_URL, "ajax_url" => wfu_ajaxurl(), "wfu_pageexit_prompt" => WFU_PAGEEXIT_PROMPT, "wfu_subdir_typedir" => WFU_SUBDIR_TYPEDIR);
    $consts_txt = "";
    foreach ($consts as $key => $val) {
        $consts_txt .= ($consts_txt == "" ? "" : ";") . wfu_plugin_encode_string($key) . ":" . wfu_plugin_encode_string($val);
    }
    return $consts_txt;
}
开发者ID:axeljohansson1988,项目名称:oddcv,代码行数:9,代码来源:wfu_constants.php


示例4: wfu_encode_plugin_options

function wfu_encode_plugin_options($plugin_options)
{
    $encoded_options = 'version=' . (isset($plugin_options['version']) ? $plugin_options['version'] : "1.0") . ';';
    $encoded_options .= 'shortcode=' . (isset($plugin_options['shortcode']) ? wfu_plugin_encode_string($plugin_options['shortcode']) : "") . ';';
    $encoded_options .= 'hashfiles=' . (isset($plugin_options['hashfiles']) ? $plugin_options['hashfiles'] : "") . ';';
    $encoded_options .= 'basedir=' . (isset($plugin_options['basedir']) ? wfu_plugin_encode_string($plugin_options['basedir']) : "") . ';';
    $encoded_options .= 'postmethod=' . (isset($plugin_options['postmethod']) ? $plugin_options['postmethod'] : "") . ';';
    $encoded_options .= 'modsecurity=' . (isset($plugin_options['modsecurity']) ? $plugin_options['modsecurity'] : "") . ';';
    $encoded_options .= 'relaxcss=' . (isset($plugin_options['relaxcss']) ? $plugin_options['relaxcss'] : "") . ';';
    $encoded_options .= 'admindomain=' . (isset($plugin_options['admindomain']) ? $plugin_options['admindomain'] : "") . ';';
    $encoded_options .= 'mediacustom=' . (isset($plugin_options['mediacustom']) ? $plugin_options['mediacustom'] : "") . ';';
    $encoded_options .= 'captcha_sitekey=' . (isset($plugin_options['captcha_sitekey']) ? wfu_plugin_encode_string($plugin_options['captcha_sitekey']) : "") . ';';
    $encoded_options .= 'captcha_secretkey=' . (isset($plugin_options['captcha_secretkey']) ? wfu_plugin_encode_string($plugin_options['captcha_secretkey']) : "") . ';';
    $encoded_options .= 'dropbox_accesstoken=' . (isset($plugin_options['dropbox_accesstoken']) ? wfu_plugin_encode_string($plugin_options['dropbox_accesstoken']) : "") . ';';
    $encoded_options .= 'dropbox_defaultpath=' . (isset($plugin_options['dropbox_defaultpath']) ? wfu_plugin_encode_string($plugin_options['dropbox_defaultpath']) : "") . ';';
    $encoded_options .= 'browser_permissions=' . (isset($plugin_options['browser_permissions']) ? wfu_encode_array_to_string($plugin_options['browser_permissions']) : "");
    return $encoded_options;
}
开发者ID:brettratner,项目名称:TCNJ-IMM-Showcase-2016,代码行数:18,代码来源:wfu_functions.php


示例5: wfu_view_log

function wfu_view_log($page = 1, $only_table_rows = false)
{
    global $wpdb;
    $siteurl = site_url();
    $table_name1 = $wpdb->prefix . "wfu_log";
    $table_name2 = $wpdb->prefix . "wfu_userdata";
    $plugin_options = wfu_decode_plugin_options(get_option("wordpress_file_upload_options"));
    if (!current_user_can('manage_options')) {
        return;
    }
    //get log data from database
    $files_total = $wpdb->get_var('SELECT COUNT(idlog) FROM ' . $table_name1);
    $filerecs = $wpdb->get_results('SELECT * FROM ' . $table_name1 . ' ORDER BY date_from DESC' . (WFU_VAR("WFU_HISTORYLOG_TABLE_MAXROWS") > 0 ? ' LIMIT ' . WFU_VAR("WFU_HISTORYLOG_TABLE_MAXROWS") . ' OFFSET ' . ($page - 1) * (int) WFU_VAR("WFU_HISTORYLOG_TABLE_MAXROWS") : ''));
    $echo_str = "";
    if (!$only_table_rows) {
        $echo_str .= "\n" . '<div class="wrap">';
        $echo_str .= "\n\t" . '<h2>Wordpress File Upload Control Panel</h2>';
        $echo_str .= "\n\t" . '<div style="margin-top:20px;">';
        $echo_str .= wfu_generate_dashboard_menu("\n\t\t", "View Log");
        $echo_str .= "\n\t" . '<div style="position:relative;">';
        $echo_str .= wfu_add_loading_overlay("\n\t\t", "historylog");
        $echo_str .= "\n\t\t" . '<div class="wfu_historylog_header" style="width: 100%;">';
        if (WFU_VAR("WFU_HISTORYLOG_TABLE_MAXROWS") > 0) {
            $pages = ceil($files_total / WFU_VAR("WFU_HISTORYLOG_TABLE_MAXROWS"));
            $echo_str .= wfu_add_pagination_header("\n\t\t\t", "historylog", 1, $pages);
        }
        $echo_str .= "\n\t\t" . '</div>';
        $echo_str .= "\n\t\t" . '<table id="wfu_historylog_table" class="wp-list-table widefat fixed striped">';
        $echo_str .= "\n\t\t\t" . '<thead>';
        $echo_str .= "\n\t\t\t\t" . '<tr>';
        $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="5%" style="text-align:center;">';
        $echo_str .= "\n\t\t\t\t\t\t" . '<label>#</label>';
        $echo_str .= "\n\t\t\t\t\t" . '</th>';
        $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="15%" style="text-align:left;">';
        $echo_str .= "\n\t\t\t\t\t\t" . '<label>Date</label>';
        $echo_str .= "\n\t\t\t\t\t" . '</th>';
        $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="10%" style="text-align:center;">';
        $echo_str .= "\n\t\t\t\t\t\t" . '<label>Action</label>';
        $echo_str .= "\n\t\t\t\t\t" . '</th>';
        $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="30%" style="text-align:left;">';
        $echo_str .= "\n\t\t\t\t\t\t" . '<label>File</label>';
        $echo_str .= "\n\t\t\t\t\t" . '</th>';
        $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="15%" style="text-align:center;">';
        $echo_str .= "\n\t\t\t\t\t\t" . '<label>User</label>';
        $echo_str .= "\n\t\t\t\t\t" . '</th>';
        $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="25%" style="text-align:left;">';
        $echo_str .= "\n\t\t\t\t\t\t" . '<label>Remarks</label>';
        $echo_str .= "\n\t\t\t\t\t" . '</th>';
        $echo_str .= "\n\t\t\t\t" . '</tr>';
        $echo_str .= "\n\t\t\t" . '</thead>';
        $echo_str .= "\n\t\t\t" . '<tbody>';
    }
    $userdatarecs = $wpdb->get_results('SELECT * FROM ' . $table_name2);
    $deletedfiles = array();
    $filecodes = array();
    $time0 = strtotime("0000-00-00 00:00:00");
    $i = ($page - 1) * (int) WFU_VAR("WFU_HISTORYLOG_TABLE_MAXROWS");
    foreach ($filerecs as $filerec) {
        $remarks = '';
        $filepath = ABSPATH;
        if (substr($filepath, -1) == '/') {
            $filepath = substr($filepath, 0, -1);
        }
        $filepath .= $filerec->filepath;
        $enc_file = wfu_plugin_encode_string($filepath . '[[name]]');
        if ($filerec->action == 'delete') {
            array_push($deletedfiles, $filerec->linkedto);
        } elseif ($filerec->action == 'rename') {
            $prevfilepath = '';
            foreach ($filerecs as $key => $prevfilerec) {
                if ($prevfilerec->idlog == $filerec->linkedto) {
                    $prevfilepath = $prevfilerec->filepath;
                    break;
                }
            }
            if ($prevfilepath != '') {
                $remarks = "\n\t\t\t\t\t\t" . '<label>Previous filepath: ' . $prevfilepath . '</label>';
            }
        } elseif ($filerec->action == 'upload' || $filerec->action == 'modify') {
            foreach ($userdatarecs as $userdata) {
                if ($userdata->uploadid == $filerec->uploadid) {
                    $userdata_datefrom = strtotime($userdata->date_from);
                    $userdata_dateto = strtotime($userdata->date_to);
                    $filerec_datefrom = strtotime($filerec->date_from);
                    if ($filerec_datefrom >= $userdata_datefrom && ($userdata_dateto == $time0 || $filerec_datefrom < $userdata_dateto)) {
                        $remarks .= "\n\t\t\t\t\t\t\t" . '<option>' . $userdata->property . ': ' . $userdata->propvalue . '</option>';
                    }
                }
            }
            if ($remarks != '') {
                $remarks = "\n\t\t\t\t\t\t" . '<select multiple="multiple" style="width:100%; height:40px; background:none; font-size:small;">' . $remarks;
                $remarks .= "\n\t\t\t\t\t\t" . '</select>';
            }
        } elseif ($filerec->action == 'other') {
            $info = $filerec->filepath;
            $filerec->filepath = '';
            $remarks = "\n\t\t\t\t\t\t" . '<textarea style="width:100%; resize:vertical; background:none;" readonly="readonly">' . $info . '</textarea>';
        }
        $i++;
        $otheraction = $filerec->action == 'other';
//.........这里部分代码省略.........
开发者ID:axeljohansson1988,项目名称:oddcv,代码行数:101,代码来源:wfu_admin_log.php


示例6: wfu_prepare_message_block_skeleton


//.........这里部分代码省略.........
            $fileheader_message = '[fileheader_message]';
            $filesubheadermessage_display = '[filesubheadermessage_display]';
            $filesubheader_message = '[filesubheader_message]';
            $filesubheaderadminmessage_display = '[filesubheaderadminmessage_display]';
            $filesubheader_adminmessage = '[filesubheader_adminmessage]';
        }
        $messageblock_file[$i++] = "\t" . '<tr id="' . $messageblock_main . '_' . $file_id . '" class="file_messageblock_fileheader_tr" style="display:none;">';
        $messageblock_file[$i++] = "\t\t" . '<td id="' . $messageblock_main . '_filenumber_' . $file_id . '" class="file_messageblock_filenumber_td"' . $filenumber_display . '>' . $file_id . '</td>';
        $messageblock_file[$i++] = "\t\t" . '<td id="' . $messageblock_header . '_container_' . $file_id . '" class="file_messageblock_fileheader_td">';
        $messageblock_file[$i++] = "\t\t\t" . '<div id="' . $messageblock_header . '_' . $file_id . '" class="file_messageblock_fileheader" style="color:' . $fileheader_color . '; background-color:' . $fileheader_bgcolor . '; border:1px solid ' . $fileheader_borcolor . ';">';
        $messageblock_file[$i++] = "\t\t\t\t" . '<label id="' . $messageblock_header . '_label_' . $file_id . '" class="file_messageblock_fileheader_label">' . $fileheader_message . '</label>';
        /* The following hidden input holds state of arrow (open or close) */
        $messageblock_file[$i++] = "\t\t\t\t" . '<input id="' . $messageblock_header . '_state_' . $file_id . '" type="hidden" value="none" />';
        $messageblock_file[$i++] = "\t\t\t" . '</div>';
        $messageblock_file[$i++] = "\t\t" . '</td>';
        /* Add a drop down arrow to the file header (file has always details to be shown) */
        $messageblock_file[$i++] = "\t\t" . '<td id="' . $messageblock_arrow . '_' . $file_id . '" class="file_messageblock_filearrow_td" onclick="wfu_filedetails_toggle(' . $sid . ', ' . $file_id . ');">';
        $messageblock_file[$i++] = "\t\t\t" . '<div id="' . $messageblock_arrow . '_up_' . $file_id . '" class="file_messageblock_file_arrow_up" style="display:none;"></div>';
        $messageblock_file[$i++] = "\t\t\t" . '<div id="' . $messageblock_arrow . '_down_' . $file_id . '" class="file_messageblock_file_arrow_down"></div>';
        $messageblock_file[$i++] = "\t\t" . '</td>';
        $messageblock_file[$i++] = "\t" . '</tr>';
        /* Prepare the files subheader block HTML template */
        $messageblock_file[$i++] = "\t" . '<tr id="' . $messageblock_subheader . '_' . $file_id . '" class="file_messageblock_filesubheader_tr" style="display:none;">';
        $messageblock_file[$i++] = "\t\t" . '<td id="' . $messageblock_subheader . '_fileempty_' . $file_id . '" class="file_messageblock_filesubheaderempty_td"' . $filenumber_display . '></td>';
        $messageblock_file[$i++] = "\t\t" . '<td colspan="2" id="' . $messageblock_subheader . '_container_' . $file_id . '" class="file_messageblock_filesubheader_td">';
        $messageblock_file[$i++] = "\t\t\t" . '<div id="' . $messageblock_subheader . '_message_' . $file_id . '" class="file_messageblock_filesubheader_message"' . $filesubheadermessage_display . '>';
        $messageblock_file[$i++] = "\t\t\t\t" . '<label id="' . $messageblock_subheader . '_messagelabel_' . $file_id . '" class="file_messageblock_filesubheader_messagelabel">' . $filesubheader_message . '</label>';
        $messageblock_file[$i++] = "\t\t\t" . '</div>';
        $messageblock_file[$i++] = "\t\t\t" . '<div id="' . $messageblock_subheader . '_adminmessage_' . $file_id . '" class="file_messageblock_filesubheader_adminmessage"' . $filesubheaderadminmessage_display . '>';
        $messageblock_file[$i++] = "\t\t\t\t" . '<label id="' . $messageblock_subheader . '_adminmessagelabel_' . $file_id . '" class="file_messageblock_filesubheader_adminmessagelabel">' . $filesubheader_adminmessage . '</label>';
        $messageblock_file[$i++] = "\t\t\t" . '</div>';
        $messageblock_file[$i++] = "\t\t" . '</td>';
        $messageblock_file[$i++] = "\t" . '</tr>';
    }
    /* Construct the main header block HTML text
    	/* Construct the header block HTML text */
    $i = 1;
    $messageblock["msgblock"]["line" . $i++] = '<table id="' . $messageblock_main . '" class="file_messageblock_table"' . $styles . '><tbody>';
    $messageblock["msgblock"]["line" . $i++] = "\t" . '<tr id="' . $messageblock_header . '" class="file_messageblock_header_tr"' . ($test ? '' : ' style="display:none;"') . '>';
    $messageblock["msgblock"]["line" . $i++] = "\t\t" . '<td colspan="2" id="' . $messageblock_header . '_container" class="file_messageblock_header_td">';
    /* Inside this td element the appropriate upload state HTML block is going to be inserted using Javascript 
       If the plugin is in test mode, then State9 HTML block is inserted now */
    if ($test) {
        foreach ($messageblock_headers as $messageblock_header_part) {
            $messageblock["msgblock"]["line" . $i++] = strtr($messageblock_header_part, array("[header_safe]" => "", "[header_color]" => $header_styles["State9"]["color"], "[header_bgcolor]" => $header_styles["State9"]["bgcolor"], "[header_borcolor]" => $header_styles["State9"]["borcolor"], "[header_message]" => $header_styles["State9"]["message"]));
        }
    }
    $messageblock["msgblock"]["line" . $i++] = "\t\t" . '</td>';
    /* Add a drop down arrow to the header */
    $messageblock["msgblock"]["line" . $i++] = "\t\t" . '<td id="' . $messageblock_arrow . '" class="file_messageblock_arrow_td"' . ($test ? '' : ' style="display:none;"') . ' onclick="wfu_headerdetails_toggle(' . $sid . ');">';
    $messageblock["msgblock"]["line" . $i++] = "\t\t\t" . '<input id="' . $messageblock_header . '_state" type="hidden" value="none" />';
    $messageblock["msgblock"]["line" . $i++] = "\t\t\t" . '<div id="' . $messageblock_arrow . '_up" class="file_messageblock_header_arrow_up" style="display:none;"></div>';
    $messageblock["msgblock"]["line" . $i++] = "\t\t\t" . '<div id="' . $messageblock_arrow . '_down" class="file_messageblock_header_arrow_down"></div>';
    $messageblock["msgblock"]["line" . $i++] = "\t\t" . '</td>';
    $messageblock["msgblock"]["line" . $i++] = "\t" . '</tr>';
    /* Construct the subheader block HTML text if exists */
    $messageblock["msgblock"]["line" . $i++] = "\t" . '<tr id="' . $messageblock_subheader . '" class="file_messageblock_subheader_tr" style="display:none;">';
    $messageblock["msgblock"]["line" . $i++] = "\t\t" . '<td colspan="3" id="' . $messageblock_subheader . '_td" class="file_messageblock_subheader_td">';
    $messageblock["msgblock"]["line" . $i++] = "\t\t\t" . '<div id="' . $messageblock_subheader . '_message" class="file_messageblock_subheader_message"' . ($test ? '' : ' style="display:none;"') . '>';
    $messageblock["msgblock"]["line" . $i++] = "\t\t\t\t" . '<label id="' . $messageblock_subheader . '_messagelabel" class="file_messageblock_subheader_messagelabel">' . ($test ? WFU_TESTMESSAGE_MESSAGE : '') . '</label>';
    $messageblock["msgblock"]["line" . $i++] = "\t\t\t" . '</div>';
    $messageblock["msgblock"]["line" . $i++] = "\t\t\t" . '<div id="' . $messageblock_subheader . '_adminmessage" class="file_messageblock_subheader_adminmessage"' . ($test ? '' : ' style="display:none;"') . '>';
    $messageblock["msgblock"]["line" . $i++] = "\t\t\t\t" . '<label id="' . $messageblock_subheader . '_adminmessagelabel" class="file_messageblock_subheader_adminmessagelabel">' . ($test ? WFU_TESTMESSAGE_ADMINMESSAGE : '') . '</label>';
    $messageblock["msgblock"]["line" . $i++] = "\t\t\t" . '</div>';
    $messageblock["msgblock"]["line" . $i++] = "\t\t" . '</td>';
    $messageblock["msgblock"]["line" . $i++] = "\t" . '</tr>';
    /* After the above tr the file blocks are appended by Javascript dynamically as additional tr elements
       If the plugin is in test mode, then two test file blocks are appended now */
    if ($test) {
        foreach ($messageblock_file as $messageblock_file_part) {
            $messageblock["msgblock"]["line" . $i++] = $messageblock_file_part;
        }
    }
    $messageblock["msgblock"]["line" . $i++] = '</tbody></table>';
    /* Construct a div element that will hold the State10 header and use it in case JSON parse fails and upload results cannot be decoded */
    $messageblock["msgblock"]["line" . $i++] = '<div id="' . $messageblock_header . '_safecontainer" style="display:none;">';
    foreach ($messageblock_headers as $messageblock_header_part) {
        $messageblock["msgblock"]["line" . $i++] = strtr($messageblock_header_part, array("[header_safe]" => "_safe", "[header_color]" => $header_styles["State10"]["color"], "[header_bgcolor]" => $header_styles["State10"]["bgcolor"], "[header_borcolor]" => $header_styles["State10"]["borcolor"], "[header_message]" => $header_styles["State10"]["message"]));
    }
    $messageblock["msgblock"]["line" . $i++] = '</div>';
    /* Construct header HTML text for all upload states and save it to hidden input, to be used later on by Javascript to adjust the upload state dynamically */
    $messageblock_header_template = "";
    foreach ($messageblock_headers as $messageblock_header_part) {
        $messageblock_header_template .= $dlp . $messageblock_header_part;
    }
    foreach ($ExposedStateIndex as $ii) {
        $messageblock["header"]["State" . $ii] = strtr($messageblock_header_template, array("[header_safe]" => "", "[header_color]" => $header_styles["State" . $ii]["color"], "[header_bgcolor]" => $header_styles["State" . $ii]["bgcolor"], "[header_borcolor]" => $header_styles["State" . $ii]["borcolor"], "[header_message]" => $header_styles["State" . $ii]["message"]));
    }
    $messageblock_header_str = wfu_encode_array_to_string($messageblock["header"]);
    $messageblock["msgblock"]["line" . $i++] = '<input id="' . $messageblock_header . '_states" type="hidden" value="' . $messageblock_header_str . '" />';
    /* Construct file HTML block template and save it to hidden div to be used later on by Javascript to add file results to the upload message dynamically */
    $messageblock_file_str = "";
    foreach ($messageblock_file as $messageblock_file_part) {
        $messageblock_file_str .= $dlp . $messageblock_file_part;
    }
    $messageblock_file_str = wfu_plugin_encode_string($messageblock_file_str);
    $messageblock["msgblock"]["line" . $i++] = '<input id="' . $messageblock_main . '_filetemplate" type="hidden" value="' . $messageblock_file_str . '" />';
    $messageblock["msgblock"]["line" . $i++] = '<div id="' . $messageblock_main . '_door" style="display:none;"></div>';
    return $messageblock;
}
开发者ID:axeljohansson1988,项目名称:oddcv,代码行数:101,代码来源:wfu_message.php


示例7: wfu_view_log

function wfu_view_log()
{
    global $wpdb;
    $siteurl = site_url();
    $table_name1 = $wpdb->prefix . "wfu_log";
    $table_name2 = $wpdb->prefix . "wfu_userdata";
    $plugin_options = wfu_decode_plugin_options(get_option("wordpress_file_upload_options"));
    if (!current_user_can('manage_options')) {
        return;
    }
    $echo_str = "\n" . '<div class="wrap">';
    $echo_str .= "\n\t" . '<h2>Wordpress File Upload Control Panel</h2>';
    $echo_str .= "\n\t" . '<div style="margin-top:20px;">';
    $echo_str .= "\n\t\t" . '<a href="' . $siteurl . '/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=manage_mainmenu" class="button" title="go back">Go to Main Menu</a>';
    $echo_str .= "\n\t" . '</div>';
    $echo_str .= "\n\t" . '<h2 style="margin-bottom: 10px; margin-top: 20px;">History Log</h2>';
    $echo_str .= "\n\t" . '<div>';
    $echo_str .= "\n\t\t" . '<table class="widefat">';
    $echo_str .= "\n\t\t\t" . '<thead>';
    $echo_str .= "\n\t\t\t\t" . '<tr>';
    $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="5%" style="text-align:center;">';
    $echo_str .= "\n\t\t\t\t\t\t" . '<label>#</label>';
    $echo_str .= "\n\t\t\t\t\t" . '</th>';
    $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="15%" style="text-align:left;">';
    $echo_str .= "\n\t\t\t\t\t\t" . '<label>Date</label>';
    $echo_str .= "\n\t\t\t\t\t" . '</th>';
    $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="10%" style="text-align:center;">';
    $echo_str .= "\n\t\t\t\t\t\t" . '<label>Action</label>';
    $echo_str .= "\n\t\t\t\t\t" . '</th>';
    $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="30%" style="text-align:left;">';
    $echo_str .= "\n\t\t\t\t\t\t" . '<label>File</label>';
    $echo_str .= "\n\t\t\t\t\t" . '</th>';
    $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="15%" style="text-align:center;">';
    $echo_str .= "\n\t\t\t\t\t\t" . '<label>User</label>';
    $echo_str .= "\n\t\t\t\t\t" . '</th>';
    $echo_str .= "\n\t\t\t\t\t" . '<th scope="col" width="25%" style="text-align:left;">';
    $echo_str .= "\n\t\t\t\t\t\t" . '<label>Remarks</label>';
    $echo_str .= "\n\t\t\t\t\t" . '</th>';
    $echo_str .= "\n\t\t\t\t" . '</tr>';
    $echo_str .= "\n\t\t\t" . '</thead>';
    $echo_str .= "\n\t\t\t" . '<tbody>';
    $filerecs = $wpdb->get_results('SELECT * FROM ' . $table_name1 . ' ORDER BY date_from DESC');
    $userdatarecs = $wpdb->get_results('SELECT * FROM ' . $table_name2);
    $i = 0;
    foreach ($filerecs as $filerec) {
        $remarks = '';
        $filepath = ABSPATH;
        if (substr($filepath, -1) == '/') {
            $filepath = substr($filepath, 0, -1);
        }
        $filepath .= $filerec->filepath;
        $enc_file = wfu_plugin_encode_string($filepath . '[[name]]');
        if ($filerec->action == 'rename') {
            $prevfilepath = '';
            foreach ($filerecs as $key => $prevfilerec) {
                if ($prevfilerec->idlog == $filerec->linkedto) {
                    $prevfilepath = $prevfilerec->filepath;
                    break;
                }
            }
            if ($prevfilepath != '') {
                $remarks = "\n\t\t\t\t\t\t" . '<label>Previous filepath: ' . $prevfilepath . '</label>';
            }
        } elseif ($filerec->action == 'upload' || $filerec->action == 'modify') {
            foreach ($userdatarecs as $userdata) {
                if ($userdata->uploadid == $filerec->uploadid && $userdata->date_from == $filerec->date_from) {
                    $remarks .= "\n\t\t\t\t\t\t\t" . '<option>' . $userdata->property . ': ' . $userdata->propvalue . '</option>';
                }
            }
            if ($remarks != '') {
                $remarks = "\n\t\t\t\t\t\t" . '<select multiple="multiple" style="width:100%; height:40px; background:none; font-size:small;">' . $remarks;
                $remarks .= "\n\t\t\t\t\t\t" . '</select>';
            }
        } elseif ($filerec->action == 'other') {
            $info = $filerec->filepath;
            $filerec->filepath = '';
            $remarks = "\n\t\t\t\t\t\t" . '<textarea style="width:100%; resize:vertical; background:none;" readonly="readonly">' . $info . '</textarea>';
        }
        $i++;
        $otheraction = $filerec->action == 'other';
        $echo_str .= "\n\t\t\t\t" . '<tr>';
        $echo_str .= "\n\t\t\t\t\t" . '<td style="padding: 5px 5px 5px 10px; text-align:center;">' . $i . '</td>';
        $echo_str .= "\n\t\t\t\t\t" . '<td style="padding: 5px 5px 5px 10px; text-align:left;">' . $filerec->date_from . '</td>';
        $echo_str .= "\n\t\t\t\t\t" . '<td style="padding: 5px 5px 5px 10px; text-align:center;">' . $filerec->action . '</td>';
        if (!$otheraction) {
            $echo_str .= "\n\t\t\t\t\t" . '<td style="padding: 5px 5px 5px 10px; text-align:left;">';
            $echo_str .= "\n\t\t\t\t\t\t" . '<a class="row-title" href="' . $siteurl . '/wp-admin/options-general.php?page=wordpress_file_upload&action=file_details&file=' . $enc_file . '" title="View and edit file details" style="font-weight:normal;">' . $filerec->filepath . '</a>';
            $echo_str .= "\n\t\t\t\t\t" . '</td>';
            $echo_str .= "\n\t\t\t\t\t" . '<td style="padding: 5px 5px 5px 10px; text-align:center;">' . wfu_get_username_by_id($filerec->userid) . '</td>';
        }
        $echo_str .= "\n\t\t\t\t\t" . '<td style="padding: 5px 5px 5px 10px; text-align:left;"' . ($otheraction ? ' colspan="3"' : '') . '>';
        $echo_str .= $remarks;
        $echo_str .= "\n\t\t\t\t\t" . '</td>';
        $echo_str .= "\n\t\t\t\t" . '</tr>';
    }
    $echo_str .= "\n\t\t\t" . '</tbody>';
    $echo_str .= "\n\t\t" . '</table>';
    $echo_str .= "\n\t" . '</div>';
    $echo_str .= "\n" . '</div>';
    return $echo_str;
//.........这里部分代码省略.........
开发者ID:epis2048,项目名称:wyyhome,代码行数:101,代码来源:wfu_admin_log.php


示例8: wfu_ajax_action_get_historylog_page

function wfu_ajax_action_get_historylog_page()
{
    if (!isset($_POST['token']) || !isset($_POST['page'])) {
        die;
    }
    check_ajax_referer('wfu-historylog-page', 'token');
    if (!current_user_can('manage_options')) {
        die;
    }
    if (WFU_HISTORYLOG_TABLE_MAXROWS <= 0) {
        die;
    }
    $page = wfu_sanitize_int($_POST['page']);
    $rows = wfu_view_log($page, true);
    die('wfu_historylog_page_success:' . wfu_plugin_encode_string($rows));
}
开发者ID:seanlon,项目名称:profile-page,代码行数:16,代码来源:wfu_ajaxactions.php


示例9: wfu_shortcode_composer


//.........这里部分代码省略.........
            $ii = max(1, $occurrences) + 1;
            while (array_key_exists($attr . $ii, $shortcode_attrs)) {
                $defs[$key]['additional_values'][$ii] = $shortcode_attrs[$attr . $ii];
                $ii++;
            }
        }
        $key++;
    }
    $echo_str = '<div id="wfu_wrapper" class="wrap">';
    $echo_str .= "\n\t" . '<h2>Wordpress File Upload Control Panel</h2>';
    $echo_str .= "\n\t" . '<div id="wfu_page_obsolete_message" class="error" style="display:none;">';
    $echo_str .= "\n\t\t" . '<p>' . WFU_DASHBOARD_PAGE_OBSOLETE . '</p>';
    $echo_str .= "\n\t" . '</div>';
    $echo_str .= "\n\t" . '<div id="wfu_update_rejected_message" class="error" style="display:none;">';
    $echo_str .= "\n\t\t" . '<p>' . WFU_DASHBOARD_UPDATE_SHORTCODE_REJECTED . '</p>';
    $echo_str .= "\n\t" . '</div>';
    $echo_str .= "\n\t" . '<div id="wfu_update_failed_message" class="error" style="display:none;">';
    $echo_str .= "\n\t\t" . '<p>' . WFU_DASHBOARD_UPDATE_SHORTCODE_FAILED . '</p>';
    $echo_str .= "\n\t" . '</div>';
    $echo_str .= "\n\t" . '<div style="margin-top:20px;">';
    if (current_user_can('manage_options')) {
        $echo_str .= "\n\t" . '<a href="' . $siteurl . '/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=manage_mainmenu" class="button" title="go back">Go to Main Menu</a>';
    }
    $echo_str .= "\n\t" . '</div>';
    if ($widgetid == "") {
        $echo_str .= "\n\t" . '<h2 style="margin-bottom: 10px; margin-top: 20px;">' . ($data == "" ? 'Test' : $posttype . ' <strong>' . $postname . '</strong>') . ': Shortcode Composer for ' . $plugin_title . ' <strong>ID ' . $shortcode_id . '</strong></h2>';
    } else {
        $echo_str .= "\n\t" . '<h2 style="margin-bottom: 10px; margin-top: 20px;">Sidebar <strong>' . $sidebar . '</strong>: Shortcode Composer for Uploader <strong>ID ' . $shortcode_id . '</strong></h2>';
    }
    $echo_str .= "\n\t" . '<div style="margin-top:10px; display:inline-block;">';
    if ($data != "") {
        $echo_str .= "\n\t\t" . '<input id="wfu_update_shortcode" type="button" value="Update" class="button-primary" disabled="disabled" onclick="wfu_save_shortcode()" /><span id="wfu_update_shortcode_wait" class="spinner" style="float:right; display:none;"></span>';
    }
    $echo_str .= "\n\t\t" . '<input id="wfu_shortcode_original_enc" type="hidden" value="' . wfu_plugin_encode_string($shortcode_full) . '" />';
    $echo_str .= "\n\t\t" . '<input id="wfu_shortcode_tag" type="hidden" value="' . $shortcode_tag . '" />';
    $echo_str .= "\n\t\t" . '<input id="wfu_shortcode_postid" type="hidden" value="' . $postid . '" />';
    $echo_str .= "\n\t\t" . '<input id="wfu_shortcode_posthash" type="hidden" value="' . $posthash . '" />';
    $echo_str .= "\n\t\t" . '<input id="wfu_shortcode_position" type="hidden" value="' . $shortcode_position . '" />';
    $echo_str .= "\n\t\t" . '<input id="wfu_shortcode_widgetid" type="hidden" value="' . $widgetid . '" />';
    $echo_str .= "\n\t" . '</div>';
    $echo_str .= "\n\t" . '<div style="margin-top:20px;">';
    $echo_str .= "\n\t\t" . '<div class="wfu_shortcode_container">';
    $echo_str .= "\n\t\t\t" . '<span><strong>Generated Shortcode</strong></span>';
    $echo_str .= "\n\t\t\t" . '<span id="wfu_save_label" class="wfu_save_label">saved</span>';
    $echo_str .= "\n\t\t\t" . '<textarea id="wfu_shortcode" class="wfu_shortcode" rows="5">[' . $shortcode_tag . ']</textarea>';
    $echo_str .= "\n\t\t\t" . '<div id="wfu_attribute_defaults" style="display:none;">';
    // remove hidden attributes from defs array
    foreach ($defs as $key => $def) {
        if ($def['type'] == "hidden") {
            unset($defs[$key]);
        }
    }
    foreach ($defs as $def) {
        $echo_str .= "\n\t\t\t\t" . '<input id="wfu_attribute_default_' . $def['attribute'] . '" type="hidden" value="' . $def['default'] . '" />';
    }
    $echo_str .= "\n\t\t\t" . '</div>';
    $echo_str .= "\n\t\t\t" . '<div id="wfu_attribute_values" style="display:none;">';
    foreach ($defs as $def) {
        $echo_str .= "\n\t\t\t\t" . '<input id="wfu_attribute_value_' . $def['attribute'] . '" type="hidden" value="' . $def['value'] . '" />';
        //add additional values, if exist
        foreach ($def['additional_values'] as $key => $val) {
            $echo_str .= "\n\t\t\t\t" . '<input id="wfu_attribute_value_' . $def['attribute'] . $key . '" type="hidden" value="' . $val . '" />';
        }
    }
    $echo_str .= "\n\t\t\t" . '</div>';
    $echo_str .= "\n\t\t" . '</div>';
开发者ID:RA2WP,项目名称:RA2WP,代码行数:67,代码来源:wfu_admin_composer.php


示例10: wfu_process_files


//.........这里部分代码省略.........
    if ($only_check) {
        $params_output_array["general"]['files_count'] = 0;
    }
    $somefiles_Ok = $warning_count + $success_count > 0;
    $allfiles_Ok = $somefiles_Ok && $error_count == 0;
    /* Prepare WPFileBase Plugin update url, if this option has been selected and only if at least one file has been successfully uploaded.
       Execution will happen only if accumulated $params_output_array["general"]['update_wpfilebase'] is not empty */
    if ($params["filebaselink"] == "true") {
        if ($somefiles_Ok) {
            $filebaseurl = site_url();
            if (substr($filebaseurl, -1, 1) == "/") {
                $filebaseurl = substr($filebaseurl, 0, strlen($filebaseurl) - 1);
            }
            /* if the following variable is not empty, then WPFileBase Plugin update must be executed
               and any admin messages must be suppressed */
            $params_output_array["general"]['update_wpfilebase'] = $filebaseurl;
        } else {
            $params_output_array["general"]['admin_messages']['wpfilebase'] = WFU_WARNING_WPFILEBASE_NOTUPDATED_NOFILES;
            $params_output_array["general"]['errors']['wpfilebase'] = "error";
        }
    }
    /* Prepare email notification parameters if email notification is enabled and only if at least one file has been successfully uploaded
       	if $method = "no-ajax" then send the email to the recipients 
       	if $method = "ajax" then return the notification parameters to the handler for further processing
       In case of ajax, execution will happen only if accumulated notify_only_filename_list is not empty */
    if ($params["notify"] == "true") {
        /* verify that there are recipients */
        $notifyrecipients = trim(preg_replace('/%useremail%/', $user_email, $params["notifyrecipients"]));
        if ($notifyrecipients != "") {
            if ($somefiles_Ok) {
                if ($method == 'no_ajax' && !$ignore_server_actions) {
                    $send_error = wfu_send_notification_email($user, $notify_only_filename_list, $notify_target_path_list, $notify_attachment_list, $userdata_fields, $params);
                    if ($send_error != "") {
                        $params_output_array["general"]['admin_messages']['notify'] = $send_error;
                        $params_output_array["general"]['errors']['notify'] = "error";
                    }
                } else {
                    /* if the following variable is not empty, then email notification must be sent
                       and any admin messages must be suppressed */
                    $params_output_array["general"]['notify_only_filename_list'] = $notify_only_filename_list;
                    $params_output_array["general"]['notify_target_path_list'] = $notify_target_path_list;
                    $params_output_array["general"]['notify_attachment_list'] = $notify_attachment_list;
                }
            } else {
                $params_output_array["general"]['admin_messages']['notify'] = WFU_WARNING_NOTIFY_NOTSENT_NOFILES;
                $params_output_array["general"]['errors']['notify'] = "error";
            }
        } else {
            $params_output_array["general"]['admin_messages']['notify'] = WFU_WARNING_NOTIFY_NOTSENT_NORECIPIENTS;
            $params_output_array["general"]['errors']['notify'] = "error";
        }
    }
    /* Prepare redirect link if redirection is enabled and only if all files have been successfully uploaded
       Execution will happen only if accumulated redirect_link is not empty and accumulated redirect errors are empty */
    if ($params["redirect"] == "true") {
        if ($params_output_array["general"]['redirect_link'] == "") {
            $params_output_array["general"]['admin_messages']['redirect'] = WFU_WARNING_REDIRECT_NOTEXECUTED_EMPTY;
            $params_output_array["general"]['errors']['redirect'] = "error";
        } elseif (!$allfiles_Ok) {
            $params_output_array["general"]['admin_messages']['redirect'] = WFU_WARNING_REDIRECT_NOTEXECUTED_FILESFAILED;
            $params_output_array["general"]['errors']['redirect'] = "error";
        }
    }
    /* suppress any admin messages if user is not administrator or adminmessages is not activated */
    if ($suppress_admin_messages) {
        $params_output_array["general"]['admin_messages']['wpfilebase'] = "";
        $params_output_array["general"]['admin_messages']['notify'] = "";
        $params_output_array["general"]['admin_messages']['redirect'] = "";
        $params_output_array["general"]['admin_messages']['other'] = "";
    }
    /* Calculate upload state from file results */
    if ($allfiles_Ok && $warning_count == 0) {
        $params_output_array["general"]['state'] = 4;
    } else {
        if ($allfiles_Ok) {
            $params_output_array["general"]['state'] = 5;
        } else {
            if ($somefiles_Ok) {
                $params_output_array["general"]['state'] = 6;
            } else {
                if (!$somefiles_Ok && $error_count > 0) {
                    $params_output_array["general"]['state'] = 7;
                } else {
                    $params_output_array["general"]['state'] = 8;
                }
            }
        }
    }
    /* construct safe output */
    $sout = $params_output_array["general"]['state'] . ";" . WFU_VAR("WFU_DEFAULTMESSAGECOLORS") . ";" . $files_count;
    for ($i = 0; $i < $files_count; $i++) {
        $sout .= ";" . wfu_plugin_encode_string($file_output['message_type']);
        $sout .= "," . wfu_plugin_encode_string($file_output['header']);
        $sout .= "," . wfu_plugin_encode_string($file_output['message']);
        $sout .= "," . wfu_plugin_encode_string($file_output['admin_messages']);
        $sout .= "," . $file_output['uploaded_file_props'];
    }
    $params_output_array["general"]['safe_output'] = $sout;
    return $params_output_array;
}
开发者ID:Cgorton48,项目名称:ssn790,代码行数:101,代码来源:wfu_processfiles.php


示例11: wfu_shortcode_composer

function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upload')
{
    global $wpdb;
    global $wp_roles;
    $siteurl = site_url();
    $components = wfu_component_definitions();
    if ($shortcode_tag == 'wordpress_file_upload') {
        $cats = wfu_category_definitions();
        $defs = wfu_attribute_definitions();
    } else {
        $cats = wfu_browser_category_definitions();
        $defs = wfu_browser_attribute_definitions();
    }
    $plugin_options = wfu_decode_plugin_options(get_option("wordpress_file_upload_options"));
    if ($data == "") {
        $shortcode = $plugin_options['shortcode'];
        $shortcode_full = '[' . $shortcode_tag . ' ' . $shortc 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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