本文整理汇总了PHP中gd_version函数的典型用法代码示例。如果您正苦于以下问题:PHP gd_version函数的具体用法?PHP gd_version怎么用?PHP gd_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gd_version函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FilledArc
function FilledArc(&$im, $CenterX, $CenterY, $DiameterX, $DiameterY, $Start, $End, $line_color, $fill_color = 'none')
{
if (gd_version() >= 2.0) {
if ($fill_color != 'none') {
// fill
ImageFilledArc($im, $CenterX, $CenterY, $DiameterX, $DiameterY, $Start, $End, $fill_color, IMG_ARC_PIE);
}
// outline
ImageFilledArc($im, $CenterX, $CenterY, $DiameterX, $DiameterY, $Start, $End, $line_color, IMG_ARC_EDGED | IMG_ARC_NOFILL | IMG_ARC_PIE);
} else {
// cbriou@orange-art.fr
// To draw the arc
ImageArc($im, $CenterX, $CenterY, $DiameterX, $DiameterY, $Start, $End, $line_color);
// To close the arc with 2 lines between the center and the 2 limits of the arc
$x = $CenterX + cos(deg2rad($Start)) * ($DiameterX / 2);
$y = $CenterY + sin(deg2rad($Start)) * ($DiameterY / 2);
ImageLine($im, $x, $y, $CenterX, $CenterY, $line_color);
$x = $CenterX + cos(deg2rad($End)) * ($DiameterX / 2);
$y = $CenterY + sin(deg2rad($End)) * ($DiameterY / 2);
ImageLine($im, $x, $y, $CenterX, $CenterY, $line_color);
if ($fill_color != 'none') {
if ($End - $Start > 0.5) {
// ImageFillToBorder() will flood the wrong parts of the image if the slice is too small
// thanks Jami Lowery <jami@ego-systems.com> for pointing out the problem
// To fill the arc, the starting point is a point in the middle of the closed space
$x = $CenterX + cos(deg2rad(($Start + $End) / 2)) * ($DiameterX / 4);
$y = $CenterY + sin(deg2rad(($Start + $End) / 2)) * ($DiameterY / 4);
ImageFillToBorder($im, $x, $y, $line_color, $fill_color);
}
}
}
}
示例2: welcome
public function welcome()
{
/* 系统信息 */
$conn = mysql_connect(C('DB_HOST'), C('DB_USER'), C('DB_PWD'));
$gd = gd_version();
$sys_info['os'] = PHP_OS;
$sys_info['ip'] = $_SERVER['SERVER_ADDR'];
$sys_info['web_server'] = $_SERVER['SERVER_SOFTWARE'];
$sys_info['php_ver'] = PHP_VERSION;
$sys_info['mysql_ver'] = mysql_get_server_info($conn);
$sys_info['zlib'] = function_exists('gzclose') ? L('yes') : L('no');
$sys_info['safe_mode'] = (boolean) ini_get('safe_mode') ? L('yes') : L('no');
$sys_info['safe_mode_gid'] = (boolean) ini_get('safe_mode_gid') ? L('yes') : L('no');
$sys_info['timezone'] = function_exists("date_default_timezone_get") ? date_default_timezone_get() : L('no_timezone');
$sys_info['socket'] = function_exists('fsockopen') ? L('yes') : L('no');
if ($gd == 0) {
$sys_info['gd'] = 'N/A';
} else {
if ($gd == 1) {
$sys_info['gd'] = 'GD1';
} else {
$sys_info['gd'] = 'GD2';
}
$sys_info['gd'] .= ' (';
/* 检查系统支持的图片类型 */
if ($gd && (imagetypes() & IMG_JPG) > 0) {
$sys_info['gd'] .= ' JPEG';
}
if ($gd && (imagetypes() & IMG_GIF) > 0) {
$sys_info['gd'] .= ' GIF';
}
if ($gd && (imagetypes() & IMG_PNG) > 0) {
$sys_info['gd'] .= ' PNG';
}
$sys_info['gd'] .= ')';
}
/* IP库版本 */
$sys_info['ip_version'] = ecs_geoip('255.255.255.0');
/* 允许上传的最大文件大小 */
$sys_info['max_filesize'] = ini_get('upload_max_filesize');
$this->assign('sys_info', $sys_info);
$this->assign('ecs_version', VERSION);
$this->assign('ecs_release', RELEASE);
$this->assign('ecs_charset', strtoupper(EC_CHARSET));
$this->assign('install_date', local_date(C('date_format'), C('install_date')));
// 检测是否授权
$data = array('appid' => ECTOUCH_AUTH_KEY);
$empower = $this->cloud->data($data)->act('get.license');
$this->assign('empower', $empower);
$this->display('welcome');
}
示例3: watermark_install
function watermark_install()
{
global $settingInfo;
//检查有无GD支持
$gdVersion = gd_version();
if ($gdVersion == "0") {
$ActionMessage = "你的服务器不支持GD,不能使用此插件!请联系你的服务器供应商!";
} else {
$arrPlugin['Name'] = "watermark";
//Plugin name
$arrPlugin['Desc'] = "水印";
//Plugin title
$arrPlugin['Type'] = "Func";
//Plugin type
$arrPlugin['Code'] = '';
//Plugin htmlcode
$arrPlugin['Path'] = "";
//Plugin Path
$arrPlugin['DefaultField'] = array("wm_position", "wm_image", "wm_text", "wm_font", "wm_color", "wm_transparence", "wm_width", "wm_height");
//Default Filed
$arrPlugin['DefaultValue'] = array("6", "plugins/watermark/watermark.png", $settingInfo['blogUrl'], "5", "#FF0000", "85", "200", "200");
//Default value
$ActionMessage = install_plugins($arrPlugin);
}
return $ActionMessage;
}
示例4: nfo_install
function nfo_install()
{
global $settingInfo;
//检查有无GD支持
$gdVersion = gd_version();
if ($gdVersion == "0") {
$ActionMessage = "你的服务器不支持GD,不能使用此插件!请联系你的服务器供应商!";
} else {
$arrPlugin['Name'] = "nfo";
//Plugin name
$arrPlugin['Desc'] = "NFO to Image";
//Plugin title
$arrPlugin['Type'] = "Func";
//Plugin type
$arrPlugin['Code'] = '';
//Plugin htmlcode
$arrPlugin['Path'] = "";
//Plugin Path
$arrPlugin['DefaultField'] = array("bgcolor", "txtcolor", "imgtype");
//Default Filed
$arrPlugin['DefaultValue'] = array("#FFFFFF", "#000000", "png");
//Default value
$ActionMessage = install_plugins($arrPlugin);
}
return $ActionMessage;
}
示例5: __construct
/**
* Constructor of class. Initializes the barebore graph.
*
* @return Graph
*/
public function __construct()
{
// Setup initial graph layout
// Check for GD >= 2, create base image
if (gd_version() >= 2) {
$this->im = imagecreatetruecolor($this->img_width, $this->img_height);
} else {
$this->im = imagecreate($this->img_width, $this->img_height);
}
// No GD support, die.
if (!$this->im) {
return false;
}
if (function_exists("imageantialias")) {
imageantialias($this->im, true);
}
// Fill the background
imagefill($this->im, 0, 0, $this->color(239, 239, 239));
// Create our internal working graph box
$inside_end_x = $this->inside_x + $this->inside_width;
$inside_end_y = $this->inside_y + $this->inside_height;
$this->image_create_rectangle($this->inside_x, $this->inside_y, $inside_end_x, $inside_end_y, 4, $this->color(254, 254, 254));
// Draw our three lines inside our internal working graph area
for ($i = 1; $i < 4; ++$i) {
$y_value = $this->inside_y + $this->inside_height / 4 * $i;
imageline($this->im, $this->inside_x, $y_value, $inside_end_x, $y_value, $this->color(185, 185, 185));
}
}
示例6: action_login
function action_login()
{
// 全局变量
// $user = $GLOBALS['user'];
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
if (intval($_CFG['captcha']) & CAPTCHA_ADMIN && gd_version() > 0) {
$smarty->assign('gd_version', gd_version());
$smarty->assign('random', mt_rand());
}
$smarty->display('login.htm');
}
示例7: smarty_function_member_info
/**
* 调用会员信息
*/
function smarty_function_member_info($params, $template)
{
$need_cache = $template->caching;
$template->caching = false;
if ($_SESSION['user_id'] > 0) {
$template->assign('user_info', get_user_info());
} else {
if (!empty($_COOKIE['ECS']['username'])) {
$template->assign('ecs_username', stripslashes($_COOKIE['ECS']['username']));
}
$captcha = intval($GLOBALS['_CFG']['captcha']);
if ($captcha & CAPTCHA_LOGIN && (!($captcha & CAPTCHA_LOGIN_FAIL) || $captcha & CAPTCHA_LOGIN_FAIL && $_SESSION['login_fail'] > 2) && gd_version() > 0) {
$template->assign('enabled_captcha', 1);
$template->assign('rand', mt_rand());
}
}
$output = $template->fetch('member_info.html');
$template->caching = $need_cache;
return $output;
}
示例8: register
public function register () {
global $ecs,$db,$_CFG;
require_once(ROOT_PATH . 'languages/' .$_CFG['lang']. '/user.php');
if (!isset($back_act) && isset($GLOBALS['_SERVER']['HTTP_REFERER']))
{
$back_act = strpos($GLOBALS['_SERVER']['HTTP_REFERER'], 'user.php') ? './index.php' : $GLOBALS['_SERVER']['HTTP_REFERER'];
}
/* 取出注册扩展字段 */
$sql = 'SELECT * FROM ' . $ecs->table('reg_fields') . ' WHERE type < 2 AND display = 1 ORDER BY dis_order, id';
$extend_info_list = $db->getAll($sql);
$captcha = array('enabled'=>0);
/* 验证码相关设置 */
if ((intval($_CFG['captcha']) & CAPTCHA_REGISTER) && gd_version() > 0)
{
$captcha['enabled'] = 1;
$captcha['path'] = 'captcha.php';
$captcha['param'] = 'is_login';
}
$result = array('extend_info_list'=>$extend_info_list,'passwd_questions'=>$_LANG['passwd_questions'],'captcha'=>$captcha);
jsonExit($result);
}
示例9: is_gd_version_min_20
function is_gd_version_min_20()
{
if (gd_version() >= 2) {
return "true";
} else {
return "false";
}
}
示例10: define
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: liuhui $
* $Id: captcha_manage.php 17063 2010-03-25 06:35:46Z liuhui $
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
/* 检查权限 */
admin_priv('shop_config');
/*------------------------------------------------------ */
//-- 验证码设置
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'main') {
if (gd_version() == 0) {
sys_msg($_LANG['captcha_note'], 1);
}
assign_query_info();
$captcha = intval($_CFG['captcha']);
$captcha_check = array();
if ($captcha & CAPTCHA_REGISTER) {
$captcha_check['register'] = 'checked="checked"';
}
if ($captcha & CAPTCHA_LOGIN) {
$captcha_check['login'] = 'checked="checked"';
}
if ($captcha & CAPTCHA_COMMENT) {
$captcha_check['comment'] = 'checked="checked"';
}
if ($captcha & CAPTCHA_ADMIN) {
示例11: action_check_answer
function action_check_answer()
{
// 获取全局变量
$user = $GLOBALS['user'];
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $_SESSION['user_id'];
$captcha = intval($_CFG['captcha']);
if ($captcha & CAPTCHA_LOGIN && (!($captcha & CAPTCHA_LOGIN_FAIL) || $captcha & CAPTCHA_LOGIN_FAIL && $_SESSION['login_fail'] > 2) && gd_version() > 0) {
if (empty($_POST['captcha'])) {
show_message($_LANG['invalid_captcha'], $_LANG['back_retry_answer'], 'user.php?act=qpassword_name', 'error');
}
/* 检查验证码 */
include_once 'includes/cls_captcha.php';
$validator = new captcha();
$validator->session_word = 'captcha_login';
if (!$validator->check_word($_POST['captcha'])) {
show_message($_LANG['invalid_captcha'], $_LANG['back_retry_answer'], 'user.php?act=qpassword_name', 'error');
}
}
if (empty($_POST['passwd_answer']) || $_POST['passwd_answer'] != $_SESSION['passwd_answer']) {
show_message($_LANG['wrong_passwd_answer'], $_LANG['back_retry_answer'], 'user.php?act=qpassword_name', 'info');
} else {
$_SESSION['user_id'] = $_SESSION['temp_user'];
$_SESSION['user_name'] = $_SESSION['temp_user_name'];
unset($_SESSION['temp_user']);
unset($_SESSION['temp_user_name']);
$smarty->assign('uid', $_SESSION['user_id']);
$smarty->assign('action', 'reset_password');
$smarty->display('user_passport.dwt');
}
}
示例12: stdClass
$cmt = new stdClass();
$cmt->id = !empty($_GET['id']) ? intval($_GET['id']) : 0;
$cmt->type = !empty($_GET['type']) ? intval($_GET['type']) : 0;
$cmt->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1;
}
if ($result['error'] == 0) {
$comments = assign_comment($cmt->id, $cmt->type, $cmt->page);
$smarty->assign('comment_type', $cmt->type);
$smarty->assign('id', $cmt->id);
$smarty->assign('username', $_SESSION['user_name']);
$smarty->assign('email', $_SESSION['email']);
$smarty->assign('comments', $comments['comments']);
$smarty->assign('comment_percent', $comments['comment_percent']);
$smarty->assign('pager', $comments['pager']);
/* 验证码相关设置 */
if (intval($_CFG['captcha']) & CAPTCHA_COMMENT && gd_version() > 0) {
$smarty->assign('enabled_captcha', 1);
$smarty->assign('rand', mt_rand());
}
$result['message'] = $_CFG['comment_check'] ? $_LANG['cmt_submit_wait'] : $_LANG['cmt_submit_done'];
$result['content'] = $smarty->fetch("library/comments_list.lbi");
}
echo $json->encode($result);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
* 添加评论内容
*
* @access public
* @param object $cmt
示例13: get_member_price_list
$user_rank_list[$k]['def_rank_start_num'] = $rank_goods_start_num[$k]['rank_goods_start_num'] ? 0 : $user_rank_list[$k]['rank_start_num'];
$user_rank_list[$k]['rank_start_num'] = $rank_goods_start_num[$k]['rank_goods_start_num'];
}
}
}
}
$smarty->assign('user_rank_list', $user_rank_list);
if (!$is_add) {
$smarty->assign('member_price_list', get_member_price_list($_REQUEST['goods_id']));
}
$smarty->assign('link_goods_list', $link_goods_list);
$smarty->assign('group_goods_list', $group_goods_list);
$smarty->assign('goods_article_list', $goods_article_list);
$smarty->assign('img_list', img_list($img_list));
$smarty->assign('goods_type_list', goods_type_list($goods['goods_type']));
$smarty->assign('gd', gd_version());
$smarty->assign('thumb_width', $_CFG['thumb_width']);
$smarty->assign('thumb_height', $_CFG['thumb_height']);
$smarty->assign('goods_attr_html', build_attr_html($goods['goods_type'], $goods['goods_id']));
$volume_price_list = '';
if (isset($_REQUEST['goods_id'])) {
$volume_price_list = get_volume_price_list($_REQUEST['goods_id']);
}
if (empty($volume_price_list)) {
$volume_price_list = array('0' => array('number' => '', 'price' => ''));
}
$smarty->assign('volume_price_list', $volume_price_list);
/* 显示商品信息页面 */
assign_query_info();
$smarty->display('goods_info.htm');
} elseif ($_REQUEST['act'] == 'insert' || $_REQUEST['act'] == 'update' || $_REQUEST['act'] == 'special_update') {
示例14: ifchecked
ifchecked($settings['sitemap'], 'sitemap');
ifchecked($settings['watermark'], 'watermark');
ifchecked($settings['wap_enable'], 'wap_enable');
ifchecked($settings['banip_enable'], 'banip_enable');
ifchecked($settings['spam_enable'], 'spam_enable');
ifchecked($settings['rss_enable'], 'rss_enable');
ifchecked($settings['use_html'], 'use_html');
ifchecked($settings['permalink'], 'permalink');
ifchecked($settings['jumpwww'], 'jumpwww');
ifchecked($settings['comment_email_reply'], 'comment_email_reply');
ifchecked($settings['seccode'], 'seccode');
ifchecked($settings['seccode_adulterate'], 'seccode_adulterate');
ifchecked($settings['seccode_ttf'], 'seccode_ttf');
ifchecked($settings['seccode_angle'], 'seccode_angle');
ifchecked($settings['seccode_color'], 'seccode_color');
ifchecked($settings['seccode_size'], 'seccode_size');
ifchecked($settings['seccode_shadow'], 'seccode_shadow');
ifchecked($settings['dateconvert'], 'dateconvert');
$waterpos = $tb_spam_level = array();
$settings['server_timezone'] < 0 ? ${'zone_0' . str_replace('.', '_', abs($settings['server_timezone']))} = 'checked' : (${'zone_' . str_replace('.', '_', $settings['server_timezone'])} = 'selected');
$waterpos[$settings['waterpos']] = 'checked';
$tb_spam_level[$settings['tb_spam_level']] = 'checked';
$avatar_level[$settings['avatar_level']] = 'checked';
$gd_version = gd_version();
$gd_version = $gd_version ? '服务器GD版本:' . $gd_version : '服务器不支持GD,因此该功能无法正常使用.';
if (in_array($action, array_flip($settingsmenu))) {
$subnav = $settingsmenu[$action];
}
$navlink_L = $subnav ? ' » <span>' . $subnav . '</span>' : '';
cpheader($subnav);
include template('configurate');
示例15: action_register
/**
* 注册会员的处理
*/
function action_register()
{
// 获取全局变量
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$err = $GLOBALS['err'];
include_once 'includes/cls_json.php';
$json = new JSON();
$res = array('err_msg' => '', 'result' => '');
/* 增加是否关闭注册 */
if ($_CFG['shop_reg_closed']) {
$smarty->assign('action', 'register');
$smarty->assign('shop_reg_closed', $_CFG['shop_reg_closed']);
$smarty->display('user_passport.dwt');
} else {
include_once ROOT_PATH . 'includes/lib_passport.php';
$username = isset($_POST['username']) ? trim($_POST['username']) : '';
$password = isset($_POST['password']) ? trim($_POST['password']) : '';
$email = isset($_POST['email']) ? trim($_POST['email']) : '';
$other['msn'] = isset($_POST['extend_field1']) ? $_POST['extend_field1'] : '';
$other['qq'] = isset($_POST['extend_field2']) ? $_POST['extend_field2'] : '';
$other['office_phone'] = isset($_POST['extend_field3']) ? $_POST['extend_field3'] : '';
$other['home_phone'] = isset($_POST['extend_field4']) ? $_POST['extend_field4'] : '';
$other['mobile_phone'] = isset($_POST['extend_field5']) ? $_POST['extend_field5'] : '';
$sel_question = empty($_POST['sel_question']) ? '' : compile_str($_POST['sel_question']);
$passwd_answer = isset($_POST['passwd_answer']) ? compile_str(trim($_POST['passwd_answer'])) : '';
// 注册类型:email、mobile
$register_type = isset($_POST['register_type']) ? trim($_POST['register_type']) : '';
$back_act = isset($_POST['back_act']) ? trim($_POST['back_act']) : '';
if (empty($_POST['agreement'])) {
$res['err_msg'] = $_LANG['passport_js']['agreement'];
$res['err_no'] = 1;
die($json->encode($res));
}
if (strlen($username) < 3) {
$res['err_msg'] = $_LANG['passport_js']['username_shorter'];
$res['err_no'] = 1;
die($json->encode($res));
}
if (strlen($password) < 6) {
$res['err_msg'] = $_LANG['passport_js']['password_shorter'];
$res['err_no'] = 1;
die($json->encode($res));
}
if (strpos($password, ' ') > 0) {
$res['err_msg'] = $_LANG['passwd_balnk'];
$res['err_no'] = 1;
die($json->encode($res));
}
/* 验证码检查 */
if (intval($_CFG['captcha']) & CAPTCHA_REGISTER && gd_version() > 0) {
if (empty($_POST['captcha'])) {
$res['err_msg'] = $_LANG['invalid_captcha'];
$res['err_no'] = 1;
die($json->encode($res));
}
/* 检查验证码 */
include_once 'includes/cls_captcha.php';
$validator = new captcha();
if (!$validator->check_word($_POST['captcha'])) {
$res['err_msg'] = $_LANG['invalid_captcha'];
$res['err_no'] = 1;
die($json->encode($res));
}
}
if (register($username, $password, $email, $other) !== false) {
/*把新注册用户的扩展信息插入数据库*/
$sql = 'SELECT id FROM ' . $ecs->table('reg_fields') . ' WHERE type = 0 AND display = 1 ORDER BY dis_order, id';
//读出所有自定义扩展字段的id
$fields_arr = $db->getAll($sql);
$extend_field_str = '';
//生成扩展字段的内容字符串
foreach ($fields_arr as $val) {
$extend_field_index = 'extend_field' . $val['id'];
if (!empty($_POST[$extend_field_index])) {
$temp_field_content = strlen($_POST[$extend_field_index]) > 100 ? mb_substr($_POST[$extend_field_index], 0, 99) : $_POST[$extend_field_index];
$extend_field_str .= " ('" . $_SESSION['user_id'] . "', '" . $val['id'] . "', '" . compile_str($temp_field_content) . "'),";
}
}
$extend_field_str = substr($extend_field_str, 0, -1);
if ($extend_field_str) {
$sql = 'INSERT INTO ' . $ecs->table('reg_extend_info') . ' (`user_id`, `reg_field_id`, `content`) VALUES' . $extend_field_str;
$db->query($sql);
}
/* 写入密码提示问题和答案 */
if (!empty($passwd_answer) && !empty($sel_question)) {
$sql = 'UPDATE ' . $ecs->table('users') . " SET `passwd_question`='{$sel_question}', `passwd_answer`='{$passwd_answer}' WHERE `user_id`='" . $_SESSION['user_id'] . "'";
$db->query($sql);
}
/* 判断是否需要自动发送注册邮件 */
if ($GLOBALS['_CFG']['member_email_validate'] && $GLOBALS['_CFG']['send_verify_email']) {
send_regiter_hash($_SESSION['user_id']);
}
$ucdata = empty($user->ucdata) ? "" : $user->ucdata;
//.........这里部分代码省略.........