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


PHP UniteFunctionsWPRev::import_media_img方法代码示例

本文整理汇总了PHP中UniteFunctionsWPRev::import_media_img方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsWPRev::import_media_img方法的具体用法?PHP UniteFunctionsWPRev::import_media_img怎么用?PHP UniteFunctionsWPRev::import_media_img使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UniteFunctionsWPRev的用法示例。


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

示例1: rev_uploader

 private function rev_uploader()
 {
     $key = Tools::getValue('security_key');
     if (empty($key) || Tools::encrypt(GlobalsRevSlider::MODULE_NAME) != $key) {
         echo json_encode(array('error_on' => 1, 'error_details' => 'Security Error'));
         die;
     }
     $targetFolder = ABSPATH . '/uploads/';
     $randnum = rand(00, 9999999);
     $sds_time = time();
     $NewFileName = $randnum . '-' . $sds_time;
     //$verifyToken = md5('unique_salt' . $_POST['timestamp']);
     if (!empty($_FILES)) {
         $tempFile = $_FILES['Filedata']['tmp_name'];
         //$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
         $targetPath = $targetFolder;
         //$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
         // Validate the file type
         $fileTypes = array('jpg', 'jpeg', 'gif', 'png');
         // File extensions
         $fileParts = pathinfo($_FILES['Filedata']['name']);
         if (in_array($fileParts['extension'], $fileTypes)) {
             // $worked = UniteFunctionsWPRev::import_media_img($tempFile, $targetPath, $randnum.$_FILES['Filedata']['name']);
             $worked = UniteFunctionsWPRev::import_media_img($tempFile, $targetPath, $NewFileName . '.' . $fileParts['extension']);
             if (!empty($worked)) {
                 echo '1';
             }
         } else {
             echo '0';
         }
     }
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:32,代码来源:revolutionslider_ajax.php

示例2: RevSliderAdmin

require_once ABSPATH . "/revslider_admin.php";
$admin = new RevSliderAdmin(ABSPATH, false);
$key = Tools::getValue('security_key');
if (empty($key) || Tools::encrypt(GlobalsRevSlider::MODULE_NAME) != $key) {
    echo json_encode(array('error_on' => 1, 'error_details' => 'Security Error'));
    die;
}
// Define a destination
// $targetFolder = _PS_MODULE_DIR_.'revsliderprestashop/uploads'; // Relative to the root
$targetFolder = ABSPATH . '/uploads/';
$randnum = rand(00, 9999999);
//$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES)) {
    $tempFile = $_FILES['Filedata']['tmp_name'];
    //$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
    $targetPath = $targetFolder;
    //$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
    // Validate the file type
    $fileTypes = array('jpg', 'jpeg', 'gif', 'png');
    // File extensions
    $fileParts = pathinfo($_FILES['Filedata']['name']);
    if (in_array($fileParts['extension'], $fileTypes)) {
        $worked = UniteFunctionsWPRev::import_media_img($tempFile, $targetPath, $randnum . $_FILES['Filedata']['name']);
        if (!empty($worked)) {
            echo '1';
        }
    } else {
        echo 'Invalid file type.';
    }
    die;
}
开发者ID:quyip8818,项目名称:Mag,代码行数:31,代码来源:uploadify.php

示例3: rand

            $is_img = false;
        }
        if ($is_img) {
            /*revolution odl system*/
            $targetFolder = ABSPATH . '/uploads/';
            $randnum = rand(00, 9999999);
            $sds_time = time();
            $NewFileName = $randnum . '-' . $sds_time;
            $tempFile = $_FILES['file']['tmp_name'];
            $targetPath = $targetFolder;
            // Validate the file type
            $fileTypes = array('jpg', 'jpeg', 'gif', 'png');
            // File extensions
            $fileParts = pathinfo($_FILES['file']['name']);
            if (in_array($fileParts['extension'], $fileTypes)) {
                $worked = UniteFunctionsWPRev::import_media_img($tempFile, $targetPath, $NewFileName . '.' . $fileParts['extension']);
                if (!empty($worked)) {
                    echo '1';
                }
            } else {
                echo '0';
            }
        }
    } else {
        header('HTTP/1.1 406 file not permitted', true, 406);
        exit;
    }
} else {
    header('HTTP/1.1 405 Bad Request', true, 405);
    exit;
}
开发者ID:evgrishin,项目名称:se1614,代码行数:31,代码来源:upload.php


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