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

PHP ew_AppRoot函数代码示例

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

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



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

示例1: Page_Main

 function Page_Main()
 {
     global $conn;
     $GLOBALS["Page"] =& $this;
     //***$conn = ew_Connect();
     // Get fn / table name parameters
     $key = EW_RANDOM_KEY . session_id();
     $fn = @$_GET["fn"] != "" ? ew_StripSlashes($_GET["fn"]) : "";
     if ($fn != "" && EW_ENCRYPT_FILE_PATH) {
         $fn = ew_Decrypt($fn, $key);
     }
     $table = @$_GET["t"] != "" ? ew_StripSlashes($_GET["t"]) : "";
     if ($table != "" && EW_ENCRYPT_FILE_PATH) {
         $table = ew_Decrypt($table, $key);
     }
     // Global Page Loading event (in userfn*.php)
     //***Page_Loading();
     // Get resize parameters
     $resize = @$_GET["resize"] != "";
     $width = @$_GET["width"] != "" ? $_GET["width"] : 0;
     $height = @$_GET["height"] != "" ? $_GET["height"] : 0;
     if (@$_GET["width"] == "" && @$_GET["height"] == "") {
         $width = EW_THUMBNAIL_DEFAULT_WIDTH;
         $height = EW_THUMBNAIL_DEFAULT_HEIGHT;
     }
     // Resize image from physical file
     if ($fn != "") {
         $fn = str_replace("", "", $fn);
         $fn = ew_IncludeTrailingDelimiter(ew_AppRoot(), TRUE) . $fn;
         if (file_exists($fn) || @fopen($fn, "rb") !== FALSE) {
             // Allow remote file
             if (ob_get_length()) {
                 ob_end_clean();
             }
             $pathinfo = pathinfo($fn);
             $ext = strtolower(@$pathinfo["extension"]);
             $ct = ew_ContentType("", $fn);
             if ($ct != "") {
                 header("Content-type: " . $ct);
             }
             if (in_array($ext, explode(",", EW_IMAGE_ALLOWED_FILE_EXT))) {
                 $size = @getimagesize($fn);
                 if ($size) {
                     header("Content-type: {$size['mime']}");
                 }
                 if ($width > 0 || $height > 0) {
                     echo ew_ResizeFileToBinary($fn, $width, $height);
                 } else {
                     echo file_get_contents($fn);
                 }
             } elseif (in_array($ext, explode(",", EW_DOWNLOAD_ALLOWED_FILE_EXT))) {
                 echo file_get_contents($fn);
             }
         }
     }
     // Global Page Unloaded event (in userfn*.php)
     //***Page_Unloaded();
     // Close connection
     //***ew_CloseConn();
 }
开发者ID:NaurozAhmad,项目名称:G-Axis,代码行数:60,代码来源:ewfile12.php


示例2: ew_StripSlashes

include_once "ewcfg11.php";
include_once "adodb5/adodb.inc.php";
include_once "phpfn11.php";
// Get resize parameters
$resize = @$_GET["resize"] != "";
$width = @$_GET["width"] != "" ? $_GET["width"] : 0;
$height = @$_GET["height"] != "" ? $_GET["height"] : 0;
if (@$_GET["width"] == "" && @$_GET["height"] == "") {
    $width = EW_THUMBNAIL_DEFAULT_WIDTH;
    $height = EW_THUMBNAIL_DEFAULT_HEIGHT;
}
$quality = @$_GET["quality"] != "" ? $_GET["quality"] : EW_THUMBNAIL_DEFAULT_QUALITY;
// Resize image from physical file
if (@$_GET["fn"] != "") {
    $fn = ew_StripSlashes($_GET["fn"]);
    $fn = str_replace("", "", $fn);
    $fn = ew_IncludeTrailingDelimiter(ew_AppRoot(), TRUE) . $fn;
    if (file_exists($fn) || fopen($fn, "rb") !== FALSE) {
        // Allow remote file
        $pathinfo = pathinfo($fn);
        $ext = strtolower(@$pathinfo["extension"]);
        if (in_array($ext, explode(",", EW_IMAGE_ALLOWED_FILE_EXT))) {
            $size = @getimagesize($fn);
            if ($size) {
                header("Content-type: {$size['mime']}");
            }
            echo ew_ResizeFileToBinary($fn, $width, $height, $quality);
        }
    }
    exit;
}
开发者ID:erick-chali,项目名称:Ubicacion,代码行数:31,代码来源:ewbv11.php


示例3: ew_TmpFile

function ew_TmpFile(&$file)
{
    global $gTmpImages;
    if (file_exists($file)) {
        // Copy only
        //  	$f = tempnam(ew_TmpFolder(), "tmp");
        $folder = ew_AppRoot() . EW_UPLOAD_DEST_PATH;
        $f = tempnam($folder, "tmp");
        @unlink($f);
        $info = pathinfo($file);
        if ($info["extension"] != "") {
            $f .= "." . $info["extension"];
        }
        copy($file, $f);
        $tmpimage = basename($f);
        $gTmpImages[] = $tmpimage;
        return EW_UPLOAD_DEST_PATH . $tmpimage;
    } else {
        return "";
    }
}
开发者ID:Razinsky,项目名称:echaude-com,代码行数:21,代码来源:phpfn8.php


示例4: ew_DeleteTmpImages

function ew_DeleteTmpImages()
{
    global $gTmpImages;
    foreach ($gTmpImages as $tmpimage) {
        @unlink(ew_AppRoot() . EW_UPLOAD_DEST_PATH . $tmpimage);
    }
}
开发者ID:NaurozAhmad,项目名称:Senho,代码行数:7,代码来源:phpfn12.php


示例5: ew_StripSlashes

include_once "ewmysql9.php";
include_once "phpfn9.php";
// Get resize parameters
$resize = @$_GET["resize"] != "";
$width = @$_GET["width"] != "" ? $_GET["width"] : 0;
$height = @$_GET["height"] != "" ? $_GET["height"] : 0;
if (@$_GET["width"] == "" && @$_GET["height"] == "") {
    $width = EW_THUMBNAIL_DEFAULT_WIDTH;
    $height = EW_THUMBNAIL_DEFAULT_HEIGHT;
}
$quality = @$_GET["quality"] != "" ? $_GET["quality"] : EW_THUMBNAIL_DEFAULT_QUALITY;
// Resize image from physical file
if (@$_GET["fn"] != "") {
    $fn = ew_StripSlashes($_GET["fn"]);
    $fn = str_replace("", "", $fn);
    $fn = ew_PathCombine(ew_AppRoot(), $fn, TRUE);
    // P7
    if (file_exists($fn) || fopen($fn, "rb") !== FALSE) {
        // Allow remote file
        $pathinfo = pathinfo($fn);
        $ext = strtolower($pathinfo['extension']);
        if (in_array($ext, explode(',', EW_IMAGE_ALLOWED_FILE_EXT))) {
            $size = getimagesize($fn);
            if ($size) {
                header("Content-type: {$size['mime']}");
            }
            echo ew_ResizeFileToBinary($fn, $width, $height, $quality);
        }
    }
    exit;
} else {
开发者ID:huynt57,项目名称:bluebee-uet.com,代码行数:31,代码来源:ewbv9.php


示例6: ew_TmpFolder

function ew_TmpFolder()
{
    $tmpfolder = NULL;
    $folders = array();
    if (EW_IS_WINDOWS) {
        $folders[] = ew_ServerVar("TEMP");
        $folders[] = ew_ServerVar("TMP");
    } else {
        if (EW_UPLOAD_TMP_PATH != "") {
            $folders[] = ew_AppRoot() . str_replace("/", EW_PATH_DELIMITER, EW_UPLOAD_TMP_PATH);
        }
        $folders[] = '/tmp';
    }
    if (ini_get('upload_tmp_dir')) {
        $folders[] = ini_get('upload_tmp_dir');
    }
    foreach ($folders as $folder) {
        if (!$tmpfolder && is_dir($folder)) {
            $tmpfolder = $folder;
        }
    }
    //if ($tmpfolder) $tmpfolder = ew_IncludeTrailingDelimiter($tmpfolder, TRUE);
    return $tmpfolder;
}
开发者ID:priscillatellezcl,项目名称:inet-computing,代码行数:24,代码来源:phpfn7.php


示例7: ew_UploadPathEx

function ew_UploadPathEx($PhyPath, $DestPath)
{
    if ($PhyPath) {
        $Path = ew_AppRoot();
        $Path .= str_replace("/", EW_PATH_DELIMITER, $DestPath);
    } else {
        $Path = EW_ROOT_RELATIVE_PATH;
        $Path = str_replace("\\\\", "/", $Path);
        $Path = str_replace("\\", "/", $Path);
        $Path = ew_IncludeTrailingDelimiter($Path, FALSE) . $DestPath;
    }
    return ew_IncludeTrailingDelimiter($Path, $PhyPath);
}
开发者ID:BGCX261,项目名称:zhss-svn-to-git,代码行数:13,代码来源:phpfn50.php


示例8: ExportValueBy

 function ExportValueBy(&$fld, $col, $row)
 {
     $val = "";
     if ($fld->FldViewTag == "IMAGE") {
         // Image
         $imagefn = $fld->GetTempImage();
         if (!$fld->UploadMultiple || strpos($imagefn, ',') === FALSE) {
             $fn = ew_AppRoot() . $imagefn;
             if ($imagefn != "" && file_exists($fn) && !is_dir($fn)) {
                 $sheet = $this->phpexcel->getActiveSheet();
                 $objDrawing = new PHPExcel_Worksheet_Drawing();
                 $objDrawing->setWorksheet($sheet);
                 $objDrawing->setPath($fn);
                 $size = getimagesize($fn);
                 // Get image size
                 $letter = PHPExcel_Cell::stringFromColumnIndex($col);
                 if ($size[0] > 0) {
                     // Width
                     $sheet->getColumnDimension($letter)->setWidth($size[0] * 0.3);
                 }
                 // Set column width, adjust the multiplying factor if necessary
                 if ($size[1] > 0) {
                     // Height
                     $sheet->getRowDimension($row)->setRowHeight($size[1]);
                 }
                 // Set row height
                 $objDrawing->setCoordinates($letter . strval($row));
             }
         } else {
             $ar = explode(",", $imagefn);
             $totalW = 0;
             $maxH = 0;
             foreach ($ar as $imagefn) {
                 $fn = ew_AppRoot() . $imagefn;
                 if (!file_exists($fn) || is_dir($fn)) {
                     continue;
                 }
                 $sheet = $this->phpexcel->getActiveSheet();
                 $objDrawing = new PHPExcel_Worksheet_Drawing();
                 $objDrawing->setWorksheet($sheet);
                 $objDrawing->setPath($fn);
                 $size = getimagesize($fn);
                 // Get image size
                 $letter = PHPExcel_Cell::stringFromColumnIndex($col);
                 $objDrawing->setOffsetX($totalW);
                 $objDrawing->setCoordinates($letter . strval($row));
                 if ($size[0] > 0) {
                     // Width
                     $totalW += $size[0];
                 }
                 if ($size[1] > 0 && $size[1] > $maxH) {
                     // Height
                     $maxH = $size[1];
                 }
             }
             if ($totalW > 0) {
                 // Width
                 $sheet->getColumnDimension($letter)->setWidth($totalW * 0.3);
             }
             // Set column width, adjust the multiplying factor if necessary
             if ($maxH > 0) {
                 // Height
                 $sheet->getRowDimension($row)->setRowHeight($maxH);
             }
             // Set row height
         }
     } elseif (is_array($fld->HrefValue2)) {
         // Export custom view tag
         $ar = $fld->HrefValue2;
         $fn = is_array($ar) ? @$ar["exportfn"] : "";
         // Get export function name
         if (is_callable($fn)) {
             $imagefn = $fn($ar);
             if ($imagefn != "") {
                 $fn = ew_AppRoot() . $imagefn;
                 if ($imagefn != "" && file_exists($fn) && !is_dir($fn)) {
                     $sheet = $this->phpexcel->getActiveSheet();
                     $objDrawing = new PHPExcel_Worksheet_Drawing();
                     $objDrawing->setWorksheet($sheet);
                     $objDrawing->setPath($fn);
                     $size = getimagesize($fn);
                     // Get image size
                     $letter = PHPExcel_Cell::stringFromColumnIndex($col);
                     if ($size[0] > 0) {
                         // Width
                         $sheet->getColumnDimension($letter)->setWidth($size[0] * 0.3);
                     }
                     // Set column width, adjust the multiplying factor if necessary
                     if ($size[1] > 0) {
                         // Height
                         $sheet->getRowDimension($row)->setRowHeight($size[1]);
                     }
                     // Set row height
                     $objDrawing->setCoordinates($letter . strval($row));
                 }
             }
         } else {
             $val = ew_ConvertToUtf8($fld->ExportValue());
             $this->SetCellValueByColumnAndRow($col, $row, $val);
         }
//.........这里部分代码省略.........
开发者ID:erick-chali,项目名称:Ubicacion,代码行数:101,代码来源:phpfn11.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP ew_AppendClass函数代码示例发布时间:2022-05-15
下一篇:
PHP ew_AllowAddDeleteRow函数代码示例发布时间: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