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


PHP cls_image::check方法代码示例

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


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

示例1: mktime

 function set_form_params($str, $i)
 {
     global $search, $site_url, $engine_path, $r, $REMOTE_ADDR, $HTTP_POST_FILES, $HTTP_POST_VARS, $HTTP_GET_VARS, $id, $secpass, $lang, $auth, $er;
     $ndate = 0;
     $st = $str;
     if (count($HTTP_GET_VARS) > count($HTTP_POST_VARS)) {
         $HTTP_POST_VARS = $HTTP_GET_VARS;
     }
     if ($HTTP_POST_VARS['numrows']) {
         $mult = 1;
     }
     if (!$HTTP_POST_VARS['Time']) {
         $Time = mktime();
     }
     if (!$HTTP_POST_VARS['Date']) {
         $Date = mktime();
     }
     if (!$HTTP_POST_VARS['IP']) {
         $IP = $REMOTE_ADDR;
     }
     if ($this->act == "select") {
         $inner = $this->document->getElementsByTagName("header");
         $fields = $inner[0]->getElementsByTagName("item");
     } else {
         $inner = $this->document->getElementsByTagName("fields");
         $fields = $inner[0]->getElementsByTagName("field");
     }
     foreach ($fields as $field) {
         $item = $this->getTemplateControl($field);
         //$name=$field->getAttribute("name","no");
         $name = $item->name;
         if ($name == "IP") {
             ${$name} = $REMOTE_ADDR;
         }
         $items[$name] = $item;
         if ($item->default && !$HTTP_POST_VARS[$name]) {
             $HTTP_POST_VARS[$name] = $item->default;
         } elseif ($item->type == "stringlike") {
             $HTTP_POST_VARS[$name] = "%{$HTTP_POST_VARS[$name]}%";
         }
         if ($HTTP_POST_VARS[$name] == "%%") {
             $HTTP_POST_VARS[$name] = "%";
         }
         if ($mult) {
             $f['name'] = $HTTP_POST_FILES[$name]['name'][$i];
             $f['tmp_name'] = $HTTP_POST_FILES[$name]['tmp_name'][$i];
             $f['size'] = $HTTP_POST_FILES[$name]['size'][$i];
             $f['type'] = $HTTP_POST_FILES[$name]['type'][$i];
         } else {
             $f = $HTTP_POST_FILES[$name];
         }
         $type = $item->type;
         if (($type == "file" || $type == "image" || $type == "flag") && $f[name]) {
             $file = fopen($f['tmp_name'], "r");
             //print $f[name].$f['tmp_name'];
             //exit;
             if (!$file) {
                 $er = sysmessage(4) . "<br>";
             }
             $fname = $f['tmp_name'];
             $maxsize = $field->getAttribute("maxsize", '');
             $format = $field->getAttribute("format", '');
             if (!strstr($format, strtolower(substr($f['name'], strpos($f['name'], ".") + 1))) && $format) {
                 $er = sysmessage(5) . " .{$format}!<br>";
             }
             ${$name} = fread($file, filesize($fname));
             //обработка файлов--------------------
             if ($item->type == "file" && $f[name]) {
                 if (!$id) {
                     $q = select("select 1+max(" . $name . "ID) from " . $this->table);
                 } else {
                     $q[0] = $id;
                 }
                 $dir = "files/" . $q[0] . "." . substr($f['name'], 1 + strpos($f['name'], "."));
                 move_uploaded_file($fname, $engine_path . $dir);
                 ${$name} = $site_url . $dir;
                 //print $par_val;
                 //exit;
             }
         }
         if (($type == "flag" || $type == "image") && $f[name]) {
             $image = new cls_image($f);
             $image->maxsize = $field->getAttribute("maxsize", '');
             $image->mix = $field->getAttribute("mix", '');
             $image->mixpos = $field->getAttribute("mixpos", '');
             if ($width = $field->getAttribute("width", '')) {
                 $image->newWidth = $width;
                 $image->fix = "width";
             }
             if ($height = $field->getAttribute("height", '')) {
                 $image->newHeight = $height;
                 $image->fix = "height";
             }
             $image->check();
             ${$name} = $image->contents;
             $Type = $image->type;
             $ph[$name] = 1;
             $ph['Small'] = 1;
             if ($image->type != "gif") {
                 $Small = new cls_image($image->imageResize());
//.........这里部分代码省略.........
开发者ID:dapfru,项目名称:gladiators,代码行数:101,代码来源:cls_form_dinamo.php

示例2: elseif


//.........这里部分代码省略.........
                 }
             } else {
                 $image->maxsize = $field['maxsize'];
                 $image->maxwidth = $field['maxwidth'];
                 $image->maxheight = $field['maxheight'];
                 $image->mix = $field['mix'];
                 $image->mix2 = $field['mix2'];
                 if ($image->mix2) {
                     $image2 = new cls_image($image->imageMix($image->mix2));
                     $image->contents = $image2->contents;
                 }
                 if ($position = $field['position']) {
                     $image->position = $position;
                 }
                 if ($width = $field['width']) {
                     $image->newWidth = $width;
                     $image->fix = "width";
                 }
                 if ($height = $field['height']) {
                     $image->newHeight = $height;
                     $image->fix = "height";
                 }
                 if ($fix = $field['fix']) {
                     $image->fix = $fix;
                 }
             }
             if ($_POST['UploadedImage'] == 1) {
                 $file_name = $site_path . "/images/" . $this->table . "/" . strtolower($name) . "/0.jpg";
                 $file = fopen($file_name, "r");
                 $image->contents = fread($file, filesize($file_name));
                 fclose($file);
                 $image->type = "jpeg";
             } else {
                 $image->check();
             }
             ${$name} = $image->contents;
             $im_array[$im_count]['name'] = $item->name;
             $im_array[$im_count]['image'] = $image->contents;
             if (($width || $height) && $image->type == "gif") {
                 if ($this->mode == 1) {
                     if (!($bgcolor = $field->getAttribute("bgcolor", ''))) {
                         $bgcolor = "515E64";
                     } elseif (!($bgcolor = $field['bgcolor'])) {
                         $bgcolor = "515E64";
                     }
                 }
                 if ($width && $image->width > $width || $height && $image->height > $height) {
                     $image->gif2jpeg($bgcolor);
                 }
             }
             $Type = $image->type;
             $ph[$name] = 1;
             $ph['Small'] = 1;
             if ($image->type != "gif") {
                 $Small = new cls_image($image->imageResize());
                 unlink($engine_path . "tmp/" . $image->name);
                 $Small = $Small->contents;
             } else {
                 $Small = ${$name};
             }
             if ($_POST['UploadedImage'] == 1) {
                 $file_name = $site_path . "/images/" . $this->table . "/" . "small" . "/0.jpg";
                 $file = fopen($file_name, "r");
                 $Small = fread($file, filesize($file_name));
                 fclose($file);
                 $file_name = $site_path . "/images/" . $this->table . "/" . strtolower($name) . "/0.jpg";
开发者ID:dapfru,项目名称:gladiators,代码行数:67,代码来源:cls_form.php


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