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


PHP image::addlogo方法代码示例

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


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

示例1: elseif

    } elseif (file_exists(NV_ROOTDIR . '/' . $global_config['site_logo'])) {
        $upload_logo = NV_ROOTDIR . '/' . $global_config['site_logo'];
    } elseif (file_exists(NV_ROOTDIR . '/images/logo.png')) {
        $upload_logo = NV_ROOTDIR . '/images/logo.png';
    } else {
        die('ERROR#' . $lang_module['notlogo']);
    }
    $config_logo = array();
    $config_logo['x'] = $nv_Request->get_int('x', 'post', 0);
    $config_logo['y'] = $nv_Request->get_int('y', 'post', 0);
    $config_logo['w'] = $nv_Request->get_int('w', 'post', 0);
    $config_logo['h'] = $nv_Request->get_int('h', 'post', 0);
    if ($config_logo['w'] > 0 and $config_logo['h'] > 0) {
        require_once NV_ROOTDIR . '/includes/class/image.class.php';
        $createImage = new image(NV_ROOTDIR . '/' . $path . '/' . $file, NV_MAX_WIDTH, NV_MAX_HEIGHT);
        $createImage->addlogo($upload_logo, '', '', $config_logo);
        $createImage->save(NV_ROOTDIR . '/' . $path, $file);
        $createImage->close();
        if (isset($array_dirname[$path])) {
            if (preg_match('/^' . nv_preg_quote(NV_UPLOADS_DIR) . '\\/(([a-z0-9\\-\\_\\/]+\\/)*([a-z0-9\\-\\_\\.]+)(\\.(gif|jpg|jpeg|png)))$/i', $path . '/' . $file, $m)) {
                @nv_deletefile(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $m[1]);
            }
            $info = nv_getFileInfo($path, $file);
            $did = $array_dirname[$path];
            $db->query("UPDATE " . NV_UPLOAD_GLOBALTABLE . "_file SET filesize=" . $info['filesize'] . ", src='" . $info['src'] . "', srcwidth=" . $info['srcwidth'] . ", srcheight=" . $info['srcheight'] . ", sizes='" . $info['size'] . "', userid=" . $admin_info['userid'] . ", mtime=" . $info['mtime'] . " WHERE did = " . $did . " AND title = '" . $file . "'");
        }
        die('OK#' . basename($file));
    } else {
        die('ERROR#' . $lang_module['notlevel']);
    }
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:addlogo.php

示例2: ceil

         if (ceil($photo['width'] * $photo_config['autologosize3'] / 100) > $logo_size[0]) {
             $w = $logo_size[0];
         } else {
             $w = ceil($photo['width'] * $photo_config['autologosize3'] / 100);
         }
     }
     $h = ceil($w * $logo_size[1] / $logo_size[0]);
     $x = $photo['width'] - $w - 5;
     $y = $photo['height'] - $h - 5;
     $config_logo = array();
     $config_logo['x'] = $photo['width'] - $w - 5;
     $config_logo['y'] = $photo['height'] - $h - 5;
     $config_logo['w'] = $w;
     $config_logo['h'] = $h;
     $createImage = new image($newFilePath, NV_MAX_WIDTH, NV_MAX_HEIGHT);
     $createImage->addlogo(NV_ROOTDIR . '/' . $upload_logo, '', '', $config_logo);
     $createImage->save($folder_album, $basename);
 }
 $photo['file'] = substr($newFilePath, strlen(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/images/'));
 // Copy file thumb
 //$thum_folder  = floor( $data['album_id'] / 1000 );
 $thumbName = $fileName = substr($photo['thumb'], strlen(NV_BASE_SITEURL . NV_TEMP_DIR . '/'));
 $fileName2 = $fileName;
 $i = 1;
 while (file_exists(NV_ROOTDIR . '/' . $currentpaththumb . '/' . $fileName2)) {
     $fileName2 = preg_replace('/(.*)(\\.[a-zA-Z0-9]+)$/', '\\1_' . $i . '\\2', $fileName);
     ++$i;
 }
 $fileName = $fileName2;
 $filePath = NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $thumbName;
 $newFilePath = NV_ROOTDIR . '/' . $currentpaththumb . '/' . $fileName;
开发者ID:hpleduit,项目名称:module_photos,代码行数:31,代码来源:main.php


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