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

PHP thumbnail函数代码示例

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

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



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

示例1: upload

/**
 * 图片上传
 * @param array $file 图片文件数组
 * @param int $maxSize 允许最大尺寸
 * @param array $allowExtension 允许上传图片的扩展名数组
 * @param int $is_thumbnail 是否生成缩略图
 * @param array $thumbnail_size 缩略图的尺寸和后缀(该参数和$is_thumbnail同时出现同时消失)
 * @return array
 */
function upload(array $file, $maxSize, array $allowExtension, $is_thumbnail = 0, array $thumbnail_size)
{
    $year = date("Y");
    $month = date("m");
    $day = date("d");
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . "/uploads/{$year}/{$month}/{$day}";
    if (!file_exists($targetPath)) {
        mkdir($targetPath, 0755, true);
    }
    if ($file['files']['size'][0] > $maxSize) {
        return array('status' => false, 'msg' => '图片文件过大,请选择另外的图片');
    } else {
        $fileParts = pathinfo($file['files']['name'][0]);
        $tempFile = $file['files']['tmp_name'][0];
        if (in_array(strtolower($fileParts['extension']), $allowExtension)) {
            $uploadFileName = generateTargetFileName($fileParts['extension']);
            $targetFile = rtrim($targetPath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $uploadFileName;
            move_uploaded_file($tempFile, $targetFile);
            if ($is_thumbnail) {
                foreach ($thumbnail_size as $v) {
                    thumbnail($targetFile, $v[0], $v[1], $v[2]);
                }
            }
            return array('status' => true, 'src' => 'http://' . $_SERVER['HTTP_HOST'] . "/uploads/{$year}/{$month}/{$day}/" . $uploadFileName, 'filename' => "/uploads/{$year}/{$month}/{$day}/" . $uploadFileName);
        } else {
            return array('status' => false, 'msg' => '不支持的图片格式');
        }
    }
}
开发者ID:leamiko,项目名称:interest,代码行数:38,代码来源:common.php


示例2: thumb_url

 function thumb_url($type = '', $filename = '', $thumb_width = 0, $thumb_height = 0, $is_create = false, $is_crop = true, $crop_mode = 'center', $is_sharpen = false, $um_value = '80/0.5/3', $create_animate_thumb = false)
 {
     if (empty($type) or empty($filename)) {
         $filename = 'noimage.gif';
         $thumb = thumbnail('', $filename, $thumb_width, $thumb_height, $is_create, $is_crop, $crop_mode, $is_sharpen, $um_value, $create_animate_thumb);
         return site_url($thumb);
     }
     $thumb = thumbnail($type, $filename, $thumb_width, $thumb_height, $is_create, $is_crop, $crop_mode, $is_sharpen, $um_value, $create_animate_thumb);
     return site_url($thumb);
 }
开发者ID:smboy86,项目名称:zzing,代码行数:10,代码来源:thumbnail_helper.php


示例3: images

function images($params)
{
    global $template_file;
    $template_file = '';
    $data = array();
    //
    $data['path'] = implode('/', $params);
    $files_path = STATIC_FILES_ROOT . $data['path'] . '/';
    if (!is_dir($files_path)) {
        mkdir($files_path, 0775, true);
    }
    //
    if (isset($_FILES['file']) && isset($_FILES['file']['tmp_name']) && $_FILES['file']['tmp_name'] != '') {
        include 'interfaces/image_magic.php';
        move_uploaded_file($_FILES['file']['tmp_name'], $files_path . $_FILES['file']['name']);
        $new_name = time() . '.jpg';
        $image = load_image($files_path . $_FILES['file']['name']);
        save_image($image, $files_path . $new_name, 'jpg');
        //
        $thumbnail = thumbnail($image, 160);
        save_image($thumbnail, $files_path . 'thumb_' . $new_name, 'jpg');
        //
        unlink($files_path . $_FILES['file']['name']);
        imagedestroy($image);
        imagedestroy($thumbnail);
    }
    //
    $data['files'] = array();
    if ($dh = opendir($files_path)) {
        while (($file = readdir($dh)) !== false) {
            if ($file == '.' || $file == '..' || is_dir($files_path . '/' . $file)) {
            } else {
                if (substr($file, 0, 6) == 'thumb_') {
                    $filemtime = filemtime($files_path . '/' . $file);
                    $type = strtolower(substr($file, strrpos($file, '.') + 1));
                    $file_size = filesize($files_path . '/' . $file);
                    $data['files'][] = array('type' => $type, 'file_size' => intval($file_size / 10.24) / 100, 'created_at' => $filemtime, 'thumb' => $file, 'name' => substr($file, 6));
                }
            }
        }
        closedir($dh);
    }
    return $data;
}
开发者ID:vishva8kumara,项目名称:tinyF-x2-,代码行数:44,代码来源:user.module.php


示例4:

    $this->date('c');
    ?>
" itemprop="datePublished"><?php 
    $this->date('Y-m-d');
    ?>
</time> | 
								<span class="glyphicon glyphicon-comment"></span><a href="<?php 
    $this->permalink();
    ?>
#comments"><?php 
    $this->commentsNum('没有评论', '1 条评论', '%d 条评论');
    ?>
</a>
							</dd>
							<dd	class="thumbnail"><img src="<?php 
    @thumbnail($this);
    ?>
" alt="<?php 
    $this->title();
    ?>
"></dd>
							<dd class="article_list_txt">
								<?php 
    @summary($this);
    ?>
							</dd>
						</dl>
					</article>
				<?php 
}
?>
开发者ID:happmaoo,项目名称:easylife,代码行数:31,代码来源:index.php


示例5: url

        ?>



            <li class="media">
            <div class="mw-ui-row-nodrop">
                <?php 
        if (!isset($show_fields) or $show_fields == false or in_array('thumbnail', $show_fields)) {
            ?>
                  <div class="mw-ui-col" style="width: 80px;">
                    <div class="mw-ui-col-container">
                        <a href="<?php 
            print $item['link'];
            ?>
" class="pull-left bgimg" style="background-image: url(<?php 
            print thumbnail($item['image'], $tn[0], $tn[1]);
            ?>
);"></a>
                    </div>
                  </div>
                <?php 
        }
        ?>
                <div class="mw-ui-col">
                    <div class="mw-ui-col-container">
                        <div class="media-body extra-wrap">
              <?php 
        if (!isset($show_fields) or $show_fields == false or in_array('title', $show_fields)) {
            ?>
               <a href="<?php 
            print $item['link'];
开发者ID:Staalkoper,项目名称:templates,代码行数:31,代码来源:sidebar.php


示例6: session_start

session_start();
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
ini_set('error_prepend_string', "<p class=text-error>");
ini_set('error_append_string', "</p>");
if (!isset($_SESSION["uid"])) {
    die("Oups");
}
include_once dirname(__FILE__) . "/ressources/class.templates.inc";
include_once dirname(__FILE__) . "/ressources/class.users.menus.inc";
include_once dirname(__FILE__) . "/ressources/class.miniadm.inc";
include_once dirname(__FILE__) . "/ressources/class.user.inc";
include_once dirname(__FILE__) . "/ressources/class.squid.youtube.inc";
if (isset($_GET["thumbnail"])) {
    thumbnail();
    exit;
}
if (!$_SESSION["AsWebStatisticsAdministrator"]) {
    die("oups");
}
if (isset($_GET["content"])) {
    content();
    exit;
}
if (isset($_GET["master-content"])) {
    master_content();
    exit;
}
if (isset($_GET["categories-list"])) {
    categories_list();
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:30,代码来源:miniadm.webstats.youtube.php


示例7: get_picture

    for ($i = 0; $i < sizeof($cart_items); $i++) {
        ?>
            <?php 
        $p = get_picture($cart_items[$i]['rel_id']);
        ?>
            <?php 
        if ($p != false) {
            ?>
            <span data-index="<?php 
            print $i;
            ?>
" class="bgimage mw-order-item-image mw-order-item-image-<?php 
            print $i;
            ?>
" style="width: 70px;height:70px;background-image:url(<?php 
            print thumbnail($p, 120, 120);
            ?>
);"></span>
            <?php 
        }
        ?>
            <?php 
    }
    ?>
          </div>
          <table class="mw-ui-table mw-ui-table-basic" cellspacing="0" cellpadding="0" width="100%" id="order-information-table">
            <thead>
              <tr>
                <th><?php 
    _e("Product Name");
    ?>
开发者ID:newaltcoin,项目名称:microweber,代码行数:31,代码来源:edit_order.php


示例8: mw

        ?>
" href="<?php 
        print mw()->url_manager->link_to_file($item);
        ?>
"  onclick="mw.url.windowHashParam('select-file', '<?php 
        print mw()->url_manager->link_to_file($item);
        ?>
'); return false;">
          <?php 
        $ext = strtolower(get_file_extension($item));
        ?>
          <?php 
        if ($ext == 'jpg' or $ext == 'png' or $ext == 'gif' or $ext == 'jpeg' or $ext == 'bmp') {
            ?>
          <img data-src="<?php 
            print thumbnail(mw()->url_manager->link_to_file($item), 48, 48);
            ?>
" class="image-item image-item-not-ready" />
          <?php 
        } else {
            ?>
          <span class="mw-fileico mw-fileico-<?php 
            print $ext;
            ?>
"><?php 
            print $ext;
            ?>
</span>
          <?php 
        }
        ?>
开发者ID:hyrmedia,项目名称:microweber,代码行数:31,代码来源:browser.php


示例9: get_view_thumbnail

function get_view_thumbnail($contents, $thumb_width = 0)
{
    global $board, $config;
    if (!$thumb_width) {
        $thumb_width = $board['bo_image_width'];
    }
    // $contents 중 img 태그 추출
    $matches = get_editor_image($contents, true);
    if (empty($matches)) {
        return $contents;
    }
    for ($i = 0; $i < count($matches[1]); $i++) {
        $img = $matches[1][$i];
        preg_match("/src=[\\'\"]?([^>\\'\"]+[^>\\'\"]+)/i", $img, $m);
        $src = $m[1];
        preg_match("/style=[\"\\']?([^\"\\'>]+)/i", $img, $m);
        $style = $m[1];
        preg_match("/width:\\s*(\\d+)px/", $style, $m);
        $width = $m[1];
        preg_match("/height:\\s*(\\d+)px/", $style, $m);
        $height = $m[1];
        preg_match("/alt=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        $alt = get_text($m[1]);
        // 이미지 path 구함
        $p = parse_url($src);
        if (strpos($p['path'], '/' . G5_DATA_DIR . '/') != 0) {
            $data_path = preg_replace('/^\\/.*\\/' . G5_DATA_DIR . '/', '/' . G5_DATA_DIR, $p['path']);
        } else {
            $data_path = $p['path'];
        }
        $srcfile = G5_PATH . $data_path;
        if (is_file($srcfile)) {
            $size = @getimagesize($srcfile);
            if (empty($size)) {
                continue;
            }
            // jpg 이면 exif 체크
            if ($size[2] == 2 && function_exists('exif_read_data')) {
                $degree = 0;
                $exif = @exif_read_data($srcfile);
                if (!empty($exif['Orientation'])) {
                    switch ($exif['Orientation']) {
                        case 8:
                            $degree = 90;
                            break;
                        case 3:
                            $degree = 180;
                            break;
                        case 6:
                            $degree = -90;
                            break;
                    }
                    // 세로사진의 경우 가로, 세로 값 바꿈
                    if ($degree == 90 || $degree == -90) {
                        $tmp = $size;
                        $size[0] = $tmp[1];
                        $size[1] = $tmp[0];
                    }
                }
            }
            // 원본 width가 thumb_width보다 작다면
            if ($size[0] <= $thumb_width) {
                continue;
            }
            // Animated GIF 체크
            $is_animated = false;
            if ($size[2] == 1) {
                $is_animated = is_animated_gif($srcfile);
            }
            // 썸네일 높이
            $thumb_height = round($thumb_width * $size[1] / $size[0]);
            $filename = basename($srcfile);
            $filepath = dirname($srcfile);
            // 썸네일 생성
            if (!$is_animated) {
                $thumb_file = thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, false);
            } else {
                $thumb_file = $filename;
            }
            if (!$thumb_file) {
                continue;
            }
            if ($width) {
                $thumb_tag = '<img src="' . G5_URL . str_replace($filename, $thumb_file, $data_path) . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"/>';
            } else {
                $thumb_tag = '<img src="' . G5_URL . str_replace($filename, $thumb_file, $data_path) . '" alt="' . $alt . '"/>';
            }
            // $img_tag에 editor 경로가 있으면 원본보기 링크 추가
            $img_tag = $matches[0][$i];
            if (strpos($img_tag, G5_DATA_DIR . '/' . G5_EDITOR_DIR) && preg_match("/\\.({$config['cf_image_extension']})\$/i", $filename)) {
                $imgurl = str_replace(G5_URL, "", $src);
                $thumb_tag = '<a href="' . G5_BBS_URL . '/view_image.php?fn=' . urlencode($imgurl) . '" target="_blank" class="view_image">' . $thumb_tag . '</a>';
            }
            $contents = str_replace($img_tag, $thumb_tag, $contents);
        }
    }
    return $contents;
}
开发者ID:kwon0281m,项目名称:gnuboard5,代码行数:98,代码来源:thumbnail.lib.php


示例10: getThumb

function getThumb($path, $filename, $regen = false)
{
    global $thumbnailPrefix;
    if (!permForPath($path, 'read')) {
        jsonStart();
        error('You do not have permission for this action.');
        return false;
    }
    $srcImagePath = $path . '/' . $filename;
    if (file_exists($srcImagePath)) {
        $file = explode('.', $filename);
        if (count($file) === 1) {
            // Handle no extension
            return false;
        }
        $extension = strtolower(array_pop($file));
        $filenameBase = implode('.', $file);
        $thumbPath = $path . '/' . $thumbnailPrefix . $filenameBase . '.' . $extension . '.jpg';
        if (!file_exists($thumbPath)) {
            thumbnail($path, $filename);
        }
        if ($regen) {
            return;
        }
        $thumb = file_get_contents($thumbPath);
        header("Content-type:image/jpeg");
        echo $thumb;
    } else {
        // FIXME: error condition
    }
}
开发者ID:kkappel,项目名称:relay,代码行数:31,代码来源:relay.php


示例11: filter_var

                            $strCategoria = filter_var($strTags[$xf], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
                            $strCategoria = urldecode($strTags[$xf]);
                            while (false !== ($file = readdir($handle))) {
                                $fechaRss = gmdate("D, d M Y H:i:s O", (int) filectime($file));
                                if (filemtime($file) !== FALSE) {
                                    $fechaRss = gmdate("D, d M Y H:i:s O", (int) filemtime($file));
                                }
                                $fecha = gmdate("<b>d-M-Y</b> G:i", (int) filectime($file));
                                if (filemtime($file) !== FALSE) {
                                    $fecha = gmdate("<b>d-M-Y</b> G:i", (int) filemtime($file));
                                }
                                $posVarTag = strrpos($file, "_T_");
                                if ($file != $w . ".xml" && $file != "cache" && $file != "." && $file != ".." && strtolower(substr($file, strrpos($file, '.') + 1)) == 'xml' && strlen($file) > 6 && strpos($strFilesT, utf8_encode($file) . ";", 0) === false && ($posVarTag === false || ($_SESSION['iduserx'] == $cnfAdm || $_SESSION['iduserx'] == $forumMod))) {
                                    //die($strCategoria);
                                    if (strpos(strtolower(utf8_encode($file)), $strCategoria, 0) !== false) {
                                        $thumbnail = thumbnail($file, $cnfHome, $cnfLogo, $cnfThumbnail);
                                        /*echo "<div class='boxForum2in'>";						*/
                                        echo '<a href="' . $cnfHome . $pathForumTotal . $auxBlog . $strLink . utf8_encode(basename($file, ".xml") . PHP_EOL) . $strLinkEnd . '"><div class="boxRelated">						
						<div class="hexagon75" style="background-image:url(' . $thumbnail . ');">
						<div class="hexTop75"></div>			
						<div class="hexBottom75"></div>
						</div>
						&nbsp;&nbsp;&nbsp;' . str_replace("-", " ", utf8_encode(basename($file, ".xml") . PHP_EOL)) . '
						</div></a>';
                                        /*                    echo "<a class='aFloatMessage'
                                        href='" . $cnfHome . $pathForumTotal . $auxBlog . $strLink . utf8_encode(basename($file, ".xml") . PHP_EOL) . $strLinkEnd . "'><div class='boxRelated'><h5 class='h5Left'>". str_replace("-", " ", utf8_encode(basename($file, ".xml") . PHP_EOL)) . " </h5>&nbsp;&nbsp;Última respuesta:&nbsp;&nbsp;<time class='entry-date' datetime='" . $fechaRss . "'>" . $fecha . "</time></div></a>";*/
                                        $xtag++;
                                        //echo $xtag.">".intval($cnfRelatedSubject)."<br>";
                                        if ($xtag > intval($cnfRelatedSubject)) {
                                            break 2;
                                        }
开发者ID:blitzhive,项目名称:blitzhive,代码行数:31,代码来源:cat.php


示例12: foreach

    ?>
    <div class="well mw-module-images">
        <div class=" mw-rotator mw-rotator-template-slider" id="<?php 
    print $id;
    ?>
">
            <div class=" mw-gallery-holder">
                <?php 
    foreach ($data as $item) {
        ?>
                    <div class=" mw-gallery-item mw-gallery-item-<?php 
        print $item['id'];
        ?>
">
                        <img src="<?php 
        print thumbnail($item['filename'], 700);
        ?>
" alt=""/>
                        <?php 
        if ($item['title'] != '') {
            ?>
<i class="mw-rotator-description"><i
                                class="mw-rotator-description-content"><?php 
            print $item['title'];
            ?>
</i></i><?php 
        }
        ?>
                    </div>
                <?php 
    }
开发者ID:hyrmedia,项目名称:microweber,代码行数:31,代码来源:slider.php


示例13: get_itemuselist_thumbnail

function get_itemuselist_thumbnail($it_id, $contents, $thumb_width, $thumb_height, $is_create = false, $is_crop = true, $crop_mode = 'center', $is_sharpen = true, $um_value = '80/0.5/3')
{
    global $g5, $config;
    $img = $filename = $alt = "";
    if ($contents) {
        $matches = get_editor_image($contents, false);
        for ($i = 0; $i < count($matches[1]); $i++) {
            // 이미지 path 구함
            $p = parse_url($matches[1][$i]);
            if (strpos($p['path'], '/' . G5_DATA_DIR . '/') != 0) {
                $data_path = preg_replace('/^\\/.*\\/' . G5_DATA_DIR . '/', '/' . G5_DATA_DIR, $p['path']);
            } else {
                $data_path = $p['path'];
            }
            $srcfile = G5_PATH . $data_path;
            if (preg_match("/\\.({$config['cf_image_extension']})\$/i", $srcfile) && is_file($srcfile)) {
                $size = @getimagesize($srcfile);
                if (empty($size)) {
                    continue;
                }
                $filename = basename($srcfile);
                $filepath = dirname($srcfile);
                preg_match("/alt=[\"\\']?([^\"\\']*)[\"\\']?/", $matches[0][$i], $malt);
                $alt = get_text($malt[1]);
                break;
            }
        }
        if ($filename) {
            $thumb = thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, $is_create, $is_crop, $crop_mode, $is_sharpen, $um_value);
            if ($thumb) {
                $src = G5_URL . str_replace($filename, $thumb, $data_path);
                $img = '<img src="' . $src . '" width="' . $thumb_width . '" height="' . $thumb_height . '" alt="' . $alt . '">';
            }
        }
    }
    if (!$img) {
        $img = get_it_image($it_id, $thumb_width, $thumb_height);
    }
    return $img;
}
开发者ID:peb317,项目名称:gbamn,代码行数:40,代码来源:shop.lib.php


示例14: isset

            ?>
" class="bgimage-fader">

      
      <span class="<?php 
            print isset($pictures[1]) ? 'multiple-thumbnails' : 'single-thumbnail';
            ?>
" style="background-image: url(<?php 
            print thumbnail($item['image'], $tn[0], $tn[1]);
            ?>
);"></span>
      <?php 
            if (isset($pictures[1])) {
                ?>
      <span style="background-image: url(<?php 
                print thumbnail($pictures[1]['filename'], $tn[0], $tn[1]);
                ?>
);"></span>

     <?php 
            }
            ?>

      </a>
      <?php 
        }
        ?>
      <div class="module-products-template-slider-item-container">
      <?php 
        if ($show_fields == false or in_array('title', $show_fields)) {
            ?>
开发者ID:Staalkoper,项目名称:templates,代码行数:31,代码来源:default.php


示例15: form_textarea

echo form_textarea('blog_blog', $locale['blog_0425'], $data['blog_blog'], $snippetSettings);
$extendedSettings = array();
if (!fusion_get_settings("tinymce_enabled")) {
    $extendedSettings = array("preview" => TRUE, "html" => TRUE, "autosize" => TRUE, "placeholder" => $locale['blog_0426b'], "form_name" => "inputform");
} else {
    $extendedSettings = array("type" => "tinymce", "tinymce" => "advanced");
}
echo form_textarea('blog_extended', $locale['blog_0426'], $data['blog_extended'], $extendedSettings);
echo "<div class='row'>\n";
echo "<div class='col-xs-12 col-sm-12 col-md-7 col-lg-8'>\n";
openside('');
if ($data['blog_image'] != "" && $data['blog_image_t1'] != "") {
    echo "<div class='row'>\n";
    echo "<div class='col-xs-12 col-sm-6'>\n";
    $image_thumb = get_blog_image_path($data['blog_image'], $data['blog_image_t1'], $data['blog_image_t2']);
    echo "<label>" . thumbnail($image_thumb, '100px');
    echo "<input type='checkbox' name='del_image' value='y' /> " . $locale['delete'] . "</label>\n";
    echo "</div>\n";
    echo "<div class='col-xs-12 col-sm-6'>\n";
    $alignOptions = array('pull-left' => $locale['left'], 'blog-img-center' => $locale['center'], 'pull-right' => $locale['right']);
    echo form_select('blog_ialign', $locale['blog_0442'], $data['blog_ialign'], array("options" => $alignOptions, "inline" => FALSE));
    echo "</div>\n</div>\n";
    echo "<input type='hidden' name='blog_image' value='" . $data['blog_image'] . "' />\n";
    echo "<input type='hidden' name='blog_image_t1' value='" . $data['blog_image_t1'] . "' />\n";
    echo "<input type='hidden' name='blog_image_t2' value='" . $data['blog_image_t2'] . "' />\n";
} else {
    $file_input_options = array('upload_path' => IMAGES_B, 'max_width' => $blog_settings['blog_photo_max_w'], 'max_height' => $blog_settings['blog_photo_max_h'], 'max_byte' => $blog_settings['blog_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $blog_settings['blog_thumb_w'], 'thumbnail_h' => $blog_settings['blog_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $blog_settings['blog_photo_w'], 'thumbnail2_h' => $blog_settings['blog_photo_h'], 'type' => 'image');
    echo form_fileinput("blog_image", $locale['blog_0439'], "", $file_input_options);
    echo "<div class='small m-b-10'>" . sprintf($locale['blog_0440'], parsebytesize($blog_settings['blog_photo_max_b'])) . "</div>\n";
    $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
    echo form_select('blog_ialign', $locale['blog_0442'], $data['blog_ialign'], array("options" => $alignOptions));
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:blog.php


示例16: get_picture

                            <span></span> </label>
        <span class="mw-icon-drag mw_admin_posts_sortable_handle"
              onmousedown="mw.manage_content_sort()"></span></div>
                    <div class="mw-ui-col manage-post-item-col-2">
                    


                        <?php 
            $pic = get_picture($item['id']);
            ?>
                        <?php 
            if ($pic == true) {
                ?>
                            <a class="manage-post-image"
                               style="background-image: url('<?php 
                print thumbnail($pic, 108);
                ?>
');"
                               onClick="mw.url.windowHashParam('action','editpage:<?php 
                print $item['id'];
                ?>
');return false;"></a>
                        <?php 
            } else {
                ?>
                            <a
                                class="manage-post-image manage-post-image-no-image <?php 
                if (isset($item['content_type'])) {
                    print ' manage-post-image-' . $item['content_type'];
                }
                if (isset($item['is_shop']) and $item['is_shop'] == 1) {
开发者ID:Git-Host,项目名称:microweber,代码行数:31,代码来源:manager.php


示例17: items_BeforeShow

function items_BeforeShow()
{
    //items_BeforeShow @4-10DCF469
    //Custom Code @7-2A29BDB7
    global $Tpl;
    global $itemvars;
    global $items;
    global $newvars;
    global $currency;
    global $emails1;
    global $joinJS;
    global $admingroup;
    global $editorCSS;
    global $PHP_SELF;
    if (CCGetFromGet("ItemNum", "") || CCGetFromGet("PreviewNum", "")) {
        $db = new clsDBNetConnect();
        $db->connect();
        $SQL = "SELECT * FROM items WHERE ItemNum=" . CCGetFromGet("ItemNum", "");
        if (CCGetFromGet("PreviewNum", "")) {
            $SQL = "SELECT * FROM items_preview WHERE ItemNum=" . CCGetFromGet("PreviewNum", "");
        }
        $db->query($SQL);
        $Result = $db->next_record();
        if ($Result) {
            $itemvars = array("ItemNum" => $db->f(ItemNum), "category" => $db->f(category), "user_id" => $db->f(user_id), "title" => $db->f(title), "status" => $db->f(status), "end_reason" => $db->f(end_reason), "started" => $db->f(started), "closes" => $db->f(closes), "image_preview" => $db->f(image_preview), "slide_show" => $db->f(slide_show), "counter" => $db->f(counter), "added_description" => $db->f("added_description"), "dateadded" => $db->f("dateadded"), "make_offer" => $db->f(make_offer), "image_one" => $db->f(image_one), "image_two" => $db->f(image_two), "image_three" => $db->f(image_three), "image_four" => $db->f(image_four), "image_five" => $db->f(image_five), "asking_price" => $db->f(asking_price), "quantity" => $db->f(quantity), "city_town" => $db->f(city_town), "state_province" => $db->f(state_province), "country" => $db->f("country"), "ship1" => $db->f("ship1"), "shipfee1" => $db->f("shipfee1"), "ship2" => $db->f("ship2"), "shipfee2" => $db->f("shipfee2"), "ship3" => $db->f("ship3"), "shipfee3" => $db->f("shipfee3"), "ship4" => $db->f("ship4"), "shipfee4" => $db->f("shipfee4"), "ship5" => $db->f("ship5"), "shipfee5" => $db->f("shipfee5"), "item_paypal" => $db->f("item_paypal"), "hits" => $db->f(hits));
            if (!CCGetUserID()) {
                $mustbe = "<table class=\"ct\" width=\"80%\" cellspacing=\"1\" cellpadding=\"1\">\n\n        <tr>\n\n          <td bgcolor=\"#ffffff\" align=\"middle\" valign=\"bottom\">\n            <form method=\"post\" action=\"login.php?ret_link=" . $_SERVER["REQUEST_URI"] . "&type=notLogged&ccsForm=Login\" name=\"Login\">\n\n              <font class=\"fhf\">Login To Ask A Question</font>\n\n              <table cellpadding=\"5\" cellspacing=\"1\" class=\"ft\">\n                <tr>\n\n                  <td></td>\n\n                </tr>\n\n                <tr>\n\n                  <td align=\"right\"><b>Username:</b>&nbsp;</td>\n\n                  <td align=\"left\"><input name=\"login\" value=\"\" maxlength=\"100\" class=\"input\">&nbsp;</td>\n\n                </tr>\n\n                <tr>\n\n                  <td align=\"right\"><b>Password:</b>&nbsp;</td>\n\n                  <td align=\"left\"><input type=\"password\" name=\"password\" value=\"\" maxlength=\"100\" class=\"input\">&nbsp;<a href=\"login.php\">Forgot Password</a></td>\n\n                </tr>\n\n                <tr>\n\n                  <td align=\"middle\" colspan=\"2\">\n\n                    <input name=\"DoLogin\" type=\"submit\" value=\"Login\" class=\"button\">&nbsp;</td>\n\n                </tr>\n\n                <tr>\n\n                   <td align=\"middle\" colspan=\"2\">\n\n                   New Users:&nbsp;<a href=\"register.php\">Register</a>\n\n                   </td>\n\n                </tr>\n\n              </table>\n\n            </form>\n\n           </td>\n\n        </tr>\n\n      </table>";
            }
            if (!CCGetUserID() && $itemvars["make_offer"] == 1) {
                $mustbeoffer = "<b>You must be logged in to make an offer</b>";
            }
            if (CCGetUserID() && $itemvars["status"] == 1 && $itemvars["item_paypal"] != "") {
                $Tpl->SetVar("item_paypal", "&nbsp;&nbsp;<a href=\"confirm.php?what=buynowPayPal&ItemNum=" . $itemvars["ItemNum"] . "\"><B>Buy Now</b></a>");
            }
            if (!CCGetUserID() && $itemvars["make_offer"] == 1 && $itemvars["status"] == 1 && $itemvars["item_paypal"] == "") {
                $Tpl->SetVar("makeoffer", "&nbsp;&nbsp;<a href=\"login.php?ret_link=ViewItem.php?ItemNum=" . $itemvars["ItemNum"] . "&type=notLogged\">Login to Make an Offer<a>");
                $Tpl->SetVar("item_paypal", "");
            }
            if (!CCGetUserID() && $itemvars["make_offer"] == 1 && $itemvars["status"] == 1 && $itemvars["item_paypal"] != "") {
                $Tpl->SetVar("makeoffer", "&nbsp;&nbsp;<a href=\"login.php?ret_link=ViewItem.php?ItemNum=" . $itemvars["ItemNum"] . "&type=notLogged\">Login to Buy this Item Or Make an Offer<a>");
                $Tpl->SetVar("item_paypal", "");
            }
            $Tpl->SetVar("NotLogged", $mustbe);
            $Tpl->SetVar("NotLogged2", $mustbeoffer);
            $ldb = new clsDBNetConnect();
            $ldb->connect();
            $ldb2 = new clsDBNetConnect();
            $ldb2->connect();
            $ldb3 = new clsDBNetConnect();
            $ldb3->connect();
            $ldb4 = new clsDBNetConnect();
            $ldb4->connect();
            $ldb5 = new clsDBNetConnect();
            $ldb5->connect();
            $ldb->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $itemvars["category"]);
            if ($ldb->next_record()) {
                $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb->f("cat_id") . "\">" . $ldb->f("name") . "</a>";
                $ldb2->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb->f("sub_cat_id"));
                if ($ldb2->next_record()) {
                    $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb2->f("cat_id") . "\">" . $ldb2->f("name") . "</a> > " . $newvars["catlist"];
                    $ldb3->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb2->f("sub_cat_id"));
                    if ($ldb3->next_record()) {
                        $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb3->f("cat_id") . "\">" . $ldb3->f("name") . "</a> > " . $newvars["catlist"];
                        $ldb4->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb3->f("sub_cat_id"));
                        if ($ldb4->next_record()) {
                            $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb4->f("cat_id") . "\">" . $ldb4->f("name") . "</a> > " . $newvars["catlist"];
                            $ldb5->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb4->f("sub_cat_id"));
                            if ($ldb5->next_record()) {
                                $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb5->f("cat_id") . "\">" . $ldb5->f("name") . "</a> > " . $newvars["catlist"];
                            }
                        }
                    }
                }
            }
            $newvars["category"] = CCDLookUP("name", "categories", "cat_id=" . $itemvars["category"], $db);
            $newvars["categoryid"] = CCDLookUP("sub_cat_id", "categories", "cat_id=" . $itemvars["category"], $db);
            $newvars["categoryparent"] = CCDLookUP("name", "categories", "cat_id=" . $newvars["categoryid"], $db);
            if ($newvars["categoryparent"]) {
                $newvars["categoryparent"] = "<a href=\"ViewCat.php?CatID=" . $newvars["categoryid"] . "\">" . $newvars["categoryparent"] . "</a> >> ";
            }
            $newvars["sellerid"] = $itemvars["user_id"];
            $newvars["seller"] = CCDLookUP("user_login", "users", "user_id=" . $itemvars["user_id"], $db);
            if ($itemvars["status"] == 1) {
                $newvars["status"] = "Open";
            }
            if ($itemvars["status"] == 2) {
                $newvars["status"] = "Closed";
            }
            if ($itemvars["status"] == 0) {
                $newvars["status"] = "This Item has not been started yet";
            }
            $newvars["preview_image"] = "<img src=\"images/blank.jpg\">";
            $newvars["cellbreaker2"] = "";
            $newvars["cellbreaker1"] = "</td><td class=\"data\">";
            //if(itemvars["image_preview"] == 1){
            if ($itemvars["image_five"] != "") {
                $newvars["preview_image"] = thumbnail($itemvars["image_five"], 225, 225, 0, 0);
                $newvars["cellbreaker2"] = "</td><td class=\"data\">";
                $newvars["cellbreaker1"] = "";
                $newvars["imageFive"] = "<tr><td align=\"center\"><img src=\"" . $itemvars["image_five"] . "\"></td></tr>";
//.........这里部分代码省略.........
开发者ID:4v4t4r,项目名称:CTF-LCC,代码行数:101,代码来源:ViewItem_events.php


示例18: import_tad_gallery

function import_tad_gallery($csn_menu = array(), $new_csn = "", $all = array(), $import = array())
{
    global $xoopsDB, $xoopsUser, $xoopsModuleConfig, $type_to_mime;
    krsort($csn_menu);
    foreach ($csn_menu as $cate_sn) {
        if (empty($cate_sn)) {
            continue;
        } else {
            $csn = $cate_sn;
            break;
        }
    }
    if (!empty($new_csn)) {
        $csn = add_tad_gallery_cate($csn, $new_csn);
    }
    $uid = $xoopsUser->getVar('uid');
    if (!empty($csn)) {
        $_SESSION['tad_gallery_csn'] = $csn;
    }
    //處理上傳的檔案
    $sort = 0;
    foreach ($all as $i => $source_file) {
        

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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