本文整理汇总了PHP中gd_version函数的典型用法代码示例。如果您正苦于以下问题:PHP gd_version函数的具体用法?PHP gd_version怎么用?PHP gd_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gd_version函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 {
// [email protected]
// 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 <[email protected]> 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);
}
}
}
}
开发者ID:Geraldofilho1993,项目名称:financ,代码行数:32,代码来源:phPie.php
示例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');
}
开发者ID:sayi21cn,项目名称:ecshopAndEctouch,代码行数:60,代码来源:IndexController.class.php
示例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;
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:26,代码来源:watermark.php
示例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;
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:26,代码来源:nfo.php
示例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));
}
}
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:33,代码来源:class_graph.php
示例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');
}
开发者ID:firsteam,项目名称:falcons,代码行数:18,代码来源:privilege.php
示例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;
}
开发者ID:highestgoodlikewater,项目名称:ecshoptk,代码行数:23,代码来源:function.member_info.php
示例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);
}
开发者ID:noikiy,项目名称:mdwp,代码行数:21,代码来源:user.action.php
示例9: is_gd_version_min_20
function is_gd_version_min_20()
{
if (gd_version() >= 2) {
return "true";
} else {
return "false";
}
}
开发者ID:jmp0207,项目名称:w3studiocms,代码行数:8,代码来源:tfu_helper.php
示例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) {
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:captcha_manage.php
示例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');
}
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:35,代码来源:user.php
示例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
开发者ID:ChanHarold,项目名称:ecshop,代码行数:31,代码来源:comment.php
示例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') {
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:goods.php
示例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');
开发者ID:BGCX261,项目名称:zjnewcitycode-svn-to-git,代码行数:31,代码来源:configurate.php
示例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;
//.........这里部分代码省略.........
开发者ID:firsteam,项目名称:falcons,代码行数:101,代码来源:register.php
示例16: insert_comments
/**
* 调用评论信息
*
* @access public
* @return string
*/
function insert_comments($arr)
{
$need_cache = ECTouch::view()->caching;
$need_compile = ECTouch::view()->force_compile;
ECTouch::view()->caching = false;
ECTouch::view()->force_compile = true;
/* 验证码相关设置 */
if (intval(C('captcha')) & CAPTCHA_COMMENT && gd_version() > 0) {
ECTouch::view()->assign('enabled_captcha', 1);
ECTouch::view()->assign('rand', mt_rand());
}
ECTouch::view()->assign('username', stripslashes($_SESSION['user_name']));
ECTouch::view()->assign('email', $_SESSION['email']);
ECTouch::view()->assign('comment_type', $arr['type']);
ECTouch::view()->assign('id', $arr['id']);
$comments = model('Comment')->get_comment_info($arr['id'], 0);
ECTouch::view()->assign('comments_info', $comments);
//全部评论
$cmt = model('Comment')->assign_comment($arr['id'], $arr['type']);
ECTouch::view()->assign('comment_list', $cmt['comments']);
ECTouch::view()->assign('pager', $cmt['pager']);
//好评
$cmt_fav = model('Comment')->assign_comment($arr['id'], $arr['type'], '1');
ECTouch::view()->assign('comment_fav', $cmt_fav['comments']);
ECTouch::view()->assign('pager_fav', $cmt_fav['pager']);
//中评
$cmt_med = model('Comment')->assign_comment($arr['id'], $arr['type'], '2');
ECTouch::view()->assign('comment_med', $cmt_med['comments']);
ECTouch::view()->assign('pager_med', $cmt_med['pager']);
//差评
$cmt_bad = model('Comment')->assign_comment($arr['id'], $arr['type'], '3');
ECTouch::view()->assign('comment_bad', $cmt_bad['comments']);
ECTouch::view()->assign('pager_bad', $cmt_bad['pager']);
$val = ECTouch::view()->fetch('library/comments_list.lbi');
ECTouch::view()->caching = $need_cache;
ECTouch::view()->force_compile = $need_compile;
return $val;
}
开发者ID:ChanHarold,项目名称:ecshop,代码行数:44,代码来源:insert.php
示例17: show_message
show_message($_LANG['signin_failed'], '', 'flow.php?step=login');
}
} elseif (!empty($_POST['act']) && $_POST['act'] == 'signup') {
//注册类型 by carson start
$enabled_sms = intval($_POST['enabled_sms']);
if ($enabled_sms) {
$username = $other['mobile_phone'] = isset($_POST['mobile']) ? trim($_POST['mobile']) : '';
$password = isset($_POST['password']) ? trim($_POST['password']) : '';
$email = $username . '@qq.com';
} else {
$username = isset($_POST['username']) ? trim($_POST['username']) : '';
$password = isset($_POST['password']) ? trim($_POST['password']) : '';
$email = isset($_POST['email']) ? trim($_POST['email']) : '';
}
//注册类型 by carson end
if (intval($_CFG['captcha']) & CAPTCHA_REGISTER && gd_version() > 0 && $enabled_sms <= 0) {
if (empty($_POST['captcha'])) {
show_message($_LANG['invalid_captcha']);
}
/* 检查验证码 */
include_once 'include/cls_captcha.php';
$validator = new captcha();
if (!$validator->check_word($_POST['captcha'])) {
show_message($_LANG['invalid_captcha']);
}
}
if (register($username, $password, $email)) {
/* 用户注册成功 */
ecs_header("Location: flow.php?step=consignee\n");
exit;
} else {
开发者ID:will0306,项目名称:bianli100,代码行数:31,代码来源:flow.php
示例18: action_register
/**
* 注册会员的处理
*/
function action_register()
{
// 获取全局变量
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
/* 增加是否关闭注册 */
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']))
// {
// show_message($_LANG['passport_js']['agreement']);
// }
// 注册类型不能为空
if (empty($register_type)) {
show_message($_LANG['passport_js']['msg_register_type_blank']);
}
// 用户名将自动生成
if (strlen($username) < 3) {
// show_message($_LANG['passport_js']['username_shorter']);
}
if (strlen($password) < 6) {
show_message($_LANG['passport_js']['password_shorter']);
}
if (strpos($password, ' ') > 0) {
show_message($_LANG['passwd_balnk']);
}
/* 验证码检查 */
if (intval($_CFG['captcha']) & CAPTCHA_REGISTER && gd_version() > 0) {
if (empty($_POST['captcha'])) {
show_message($_LANG['invalid_captcha'], $_LANG['sign_up'], 'register.php', 'error');
}
/* 检查验证码 */
include_once 'includes/cls_captcha.php';
$captcha = new captcha();
if (!$captcha->check_word(trim($_POST['captcha']))) {
show_message($_LANG['invalid_captcha'], $_LANG['sign_up'], 'register.php', 'error');
}
}
if ($register_type == "email") {
/* 邮箱验证码检查 */
require_once ROOT_PATH . 'includes/lib_validate_record.php';
if (empty($email)) {
show_message($_LANG['msg_email_blank'], $_LANG['sign_up'], 'register.php', 'error');
}
$record = get_validate_record($email);
$session_email = $_SESSION[VT_EMAIL_REGISTER];
$email_code = !empty($_POST['email_code']) ? trim($_POST['email_code']) : '';
if (empty($email_code)) {
show_message($_LANG['msg_email_code_blank'], $_LANG['sign_up'], 'register.php', 'error');
} else {
if ($session_email != $email) {
show_message($_LANG['email_changed'], $_LANG['sign_up'], 'register.php', 'error');
} else {
if ($email_code != $record['record_code']) {
show_message($_LANG['invalid_email_code'], $_LANG['sign_up'], 'register.php', 'error');
}
}
}
/* 邮箱注册时 */
$username = generate_username();
/* 邮箱注册 */
$result = register_by_email($username, $password, $email, $other);
if ($result) {
/* 删除注册的验证记录 */
remove_validate_record($email);
}
} else {
if ($register_type == "mobile") {
require_once ROOT_PATH . 'includes/lib_validate_record.php';
$mobile_phone = !empty($_POST['mobile_phone']) ? trim($_POST['mobile_phone']) : '';
$mobile_code = !empty($_POST['mobile_code']) ? trim($_POST['mobile_code']) : '';
$record = get_validate_record($mobile_phone);
$session_mobile_phone = $_SESSION[VT_MOBILE_REGISTER];
/* 手机验证码检查 */
if (empty($mobile_code)) {
show_message($_LANG['msg_mobile_phone_blank'], $_LANG['sign_up'], 'register.php', 'error');
} else {
//.........这里部分代码省略.........
开发者ID:seanguo166,项目名称:yinoos,代码行数:101,代码来源:register.php
示例19: define
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: liubo $
* $Id: message.php 17217 2011-01-19 06:29:08Z liubo $
*/
define('IN_ECTOUCH', true);
require dirname(__FILE__) . '/include/init.php';
if (empty($_CFG['message_board'])) {
show_message($_LANG['message_board_close']);
}
$action = isset($_REQUEST['act']) ? trim($_REQUEST['act']) : 'default';
if ($action == 'act_add_message') {
include_once ROOT_PATH . 'include/lib_clips.php';
/* 验证码防止灌水刷屏 */
if (intval($_CFG['captcha']) & CAPTCHA_MESSAGE && gd_version() > 0) {
include_once 'include/cls_captcha.php';
$validator = new captcha();
if (!$validator->check_word($_POST['captcha'])) {
show_message($_LANG['invalid_captcha']);
}
} else {
/* 没有验证码时,用时间来限制机器人发帖或恶意发评论 */
if (!isset($_SESSION['send_time'])) {
$_SESSION['send_time'] = 0;
}
$cur_time = gmtime();
if ($cur_time - $_SESSION['send_time'] < 30) {
show_message($_LANG['cmt_spam_warning']);
}
}
开发者ID:jinjing1989,项目名称:wei,代码行数:31,代码来源:message.php
示例20: handle_gallery_image
/**
* 保存某商品的相册图片
* @param int $goods_id
* @param array $image_files
* @param array $image_descs
* @return void
*/
function handle_gallery_image($goods_id, $image_files, $image_descs, $image_urls)
{
/* 是否处理缩略图 */
$proc_thumb = isset($GLOBALS['shop_id']) && $GLOBALS['shop_id'] > 0 ? false : true;
foreach ($image_descs as $key => $img_desc) {
/* 是否成功上传 */
$flag = false;
if (isset($image_files['error'])) {
if ($image_files['error'][$key] == 0) {
$flag = true;
}
} else {
if ($image_files['tmp_name'][$key] != 'none') {
$flag = true;
}
}
if ($flag) {
// 生成缩略图
if ($proc_thumb) {
$thumb_url = $GLOBALS['image']->make_thumb($image_files['tmp_name'][$key], $GLOBALS['_CFG']['thumb_width'], $GLOBALS['_CFG']['thumb_height']);
$thumb_url = is_string($thumb_url) ? $thumb_url : '';
}
$upload = array('name' => $image_files['name'][$key], 'type' => $image_files['type'][$key], 'tmp_name' => $image_files['tmp_name'][$key], 'size' => $image_files['size'][$key]);
if (isset($image_files['error'])) {
$upload['error'] = $image_files['error'][$key];
}
$img_original = $GLOBALS['image']->upload_image($upload);
if ($img_original === false) {
sys_msg($GLOBALS['image']->error_msg(), 1, array(), false);
}
$img_url = $img_original;
if (!$proc_thumb) {
$thumb_url = $img_original;
}
// 如果服务器支持GD 则添加水印
if ($proc_thumb && gd_version() > 0) {
$pos = strpos(basename($img_original), '.');
$newname = dirname($img_original) . '/' . $GLOBALS['image']->random_filename() . substr(basename($img_original), $pos);
copy('../' . $img_original, '../' . $newname);
$img_url = $newname;
$GLOBALS['image']->add_watermark('../' . $img_url, '', $GLOBALS['_CFG']['watermark'], $GLOBALS['_CFG']['watermark_place'], $GLOBALS['_CFG']['watermark_alpha']);
}
/* 重新格式化图片名称 */
$img_original = reformat_image_name('gallery', $goods_id, $img_original, 'source');
$img_url = reformat_image_name('gallery', $goods_id, $img_url, 'goods');
$thumb_url = reformat_image_name('gallery_thumb', $goods_id, $thumb_url, 'thumb');
$sql = "INSERT INTO " . $GLOBALS['ecs']->table('goods_gallery') . " (goods_id, img_url, img_desc, thumb_url, img_original) " . "VALUES ('{$goods_id}', '{$img_url}', '{$img_desc}', '{$thumb_url}', '{$img_original}')";
$GLOBALS['db']->query($sql);
/* 不保留商品原图的时候删除原图 */
if ($proc_thumb && !$GLOBALS['_CFG']['retain_original_img'] && !empty($img_original)) {
$GLOBALS['db']->query("UPDATE " . $GLOBALS['ecs']->table('goods_gallery') . " SET img_original='' WHERE `goods_id`='{$goods_id}'");
@unlink('../' . $img_original);
}
} elseif (!empty($image_urls[$key]) && $image_urls[$key] != $GLOBALS['_LANG']['img_file'
|
请发表评论