本文整理汇总了PHP中securimage::show方法的典型用法代码示例。如果您正苦于以下问题:PHP securimage::show方法的具体用法?PHP securimage::show怎么用?PHP securimage::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类securimage
的用法示例。
在下文中一共展示了securimage::show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showCaptcha
public function showCaptcha()
{
include JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'securimage' . DIRECTORY_SEPARATOR . 'securimage.php';
$img = new securimage();
$mod_jinc = JRequest::getString('mod_jinc', 'false');
$mod_jinc = trim($mod_jinc);
if ($mod_jinc == 'true') {
$img->image_width = 125;
$img->image_height = 30;
$img->code_length = rand(4, 4);
$img->setSessionPrefix('mod_jinc');
} else {
$img->image_width = 250;
$img->image_height = 40;
$img->code_length = rand(5, 6);
}
$img->perturbation = 0.7;
$img->image_bg_color = new Securimage_Color("#ffffff");
$img->use_transparent_text = true;
$img->text_transparency_percentage = 45;
// 100 = completely transparent
$img->num_lines = 2;
$img->image_signature = '';
$img->text_color = new Securimage_Color("#333366");
$img->line_color = new Securimage_Color("#FFFFCC");
$img->show('');
// alternate use: $img->show('/path/to/background_image.jpg');
}
示例2: securimage
function security_captcha()
{
@ob_clean();
include 'captcha/securimage.php';
$img = new securimage();
$img->image_type = SI_IMAGE_PNG;
$img->text_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->num_lines = 5;
$img->line_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->text_transparency_percentage = 30;
$img->perturbation = 0.3;
//Change some settings
/*
$img->image_width = 275;
$img->image_height = 90;
$img->perturbation = 0.9; // 1.0 = high distortion, higher numbers = more distortion
$img->image_bg_color = new Securimage_Color(0x0, 0x99, 0xcc);
$img->text_color = new Securimage_Color(0xea, 0xea, 0xea);
$img->text_transparency_percentage = 65; // 100 = completely transparent
$img->num_lines = 8;
$img->line_color = new Securimage_Color(0x0, 0xa0, 0xcc);
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
*/
$img->show('');
// alternate use: $img->show('/path/to/background_image.jpg');
}
示例3: action
public function action()
{
/** 防止跨站 */
$referer = $this->request->getReferer();
if (empty($referer)) {
exit;
}
$refererPart = parse_url($referer);
$currentPart = parse_url(Helper::options()->siteUrl);
if ($refererPart['host'] != $currentPart['host'] || 0 !== strpos($refererPart['path'], $currentPart['path'])) {
exit;
}
require_once 'Captcha/securimage/securimage.php';
$img = new securimage();
$dir = dirname(__FILE__) . '/securimage/';
$options = Typecho_Widget::widget('Widget_Options');
$fontsArray = array('04b03.ttf', 'AHGBold.ttf', 'atkinsoutlinemedium-regular.ttf', 'decorative-stylisticblackout-regular.ttf', 'okrienhmk.ttf', 'ttstepha.ttf', 'vtckomixationhand.ttf');
$fontsKey = array_rand($fontsArray);
$fontsFile = $dir . 'fonts/' . $fontsArray[$fontsKey];
//验证码字体
$fontsFile = $dir . 'fonts/' . $options->plugin('Captcha')->ttf_file;
$img->ttf_file = $fontsFile;
//验证码背景
if ($options->plugin('Captcha')->is_background) {
$img->background_directory = $dir . '/backgrounds/';
}
//背景颜色
$img->image_bg_color = new Securimage_Color($options->plugin('Captcha')->image_bg_color);
//验证码颜色
$img->text_color = new Securimage_Color($options->plugin('Captcha')->text_color);
//自定义验证码
$img->use_wordlist = $options->plugin('Captcha')->use_wordlist;
$img->wordlist = explode("\n", $options->plugin('Captcha')->wordlist);
$img->wordlist_file = $dir . 'words/words.txt';
//干扰线颜色
$img->line_color = new Securimage_Color($options->plugin('Captcha')->line_color);
//干扰线、扭曲度
$img->num_lines = $options->plugin('Captcha')->num_lines;
$img->perturbation = $options->plugin('Captcha')->perturbation;
//签名内容、颜色、字体
$img->signature_color = new Securimage_Color($options->plugin('Captcha')->signature_color);
$img->image_signature = $options->plugin('Captcha')->image_signature;
$img->signature_font = $dir . 'fonts/' . $options->plugin('Captcha')->signature_font;
//高度宽度
$img->image_height = $options->plugin('Captcha')->image_height;
$img->image_width = $options->plugin('Captcha')->image_width;
$img->show('');
}
示例4: index
public function index($params)
{
$img = new securimage();
//Change some settings
$img->image_width = !empty($_GET['width']) ? (int) $_GET['width'] : self::CAPTCHA_WIDTH;
$img->image_height = !empty($_GET['height']) ? (int) $_GET['height'] : self::CAPTCHA_HEIGHT;
$img->perturbation = 0.45;
$img->image_bg_color = new Securimage_Color(0xf6, 0xf6, 0xf6);
$img->text_angle_minimum = -5;
$img->text_angle_maximum = 5;
$img->use_transparent_text = true;
$img->text_transparency_percentage = 30;
// 100 = completely transparent
$img->num_lines = 7;
$img->line_color = new Securimage_Color("#7B92AA");
$img->signature_color = new Securimage_Color("#7B92AA");
$img->text_color = new Securimage_Color("#7B92AA");
$img->use_wordlist = true;
$img->show();
exit;
}
示例5: captcha
function captcha($width = 280, $height = 100, $word = false)
{
$img = new securimage();
//Change some settings
$img->image_width = $width;
$img->image_height = $height;
$img->perturbation = 0.9;
$img->code_length = rand(5, 6);
$img->image_bg_color = new Securimage_Color("#000000");
$img->use_transparent_text = true;
$img->text_transparency_percentage = 25;
// 100 = completely transparent
$img->num_lines = 15;
$img->wordlist_file = $_SERVER["DOCUMENT_ROOT"] . __racineadminlib__ . "/securimage/words/words.txt";
$img->gd_font_file = $_SERVER["DOCUMENT_ROOT"] . __racineadminlib__ . "/securimage/gdfonts/automatic.gdf";
$img->ttf_file = $_SERVER["DOCUMENT_ROOT"] . __racineadminlib__ . "/securimage/AHGBold.ttf";
$img->use_wordlist = $word;
$img->image_signature = '';
$img->text_color = new Securimage_Color("#FFFFFF");
$img->line_color = new Securimage_Color("#FFFFFF");
$img->show('');
// alternate use: $img->show('/path/to/background_image.jpg');
}
示例6: isset
<?php
include 'securimage.php';
$session_id = isset($_GET['session_id']) ? $_GET['session_id'] : false;
$width = isset($_GET['width']) && (int) $_GET['width'] != 0 ? $_GET['width'] : null;
$height = isset($_GET['height']) && (int) $_GET['height'] != 0 ? $_GET['height'] : null;
$length = isset($_GET['length']) && (int) $_GET['length'] != 0 ? $_GET['length'] : null;
$img = new securimage($session_id);
$img->show($width, $height, $length);
// alternate use: $img->show('/path/to/background.jpg');
示例7: securimage
<?php
require_once 'securimage.php';
$img = new securimage();
// $img->image_width = 278;
$img->image_width = 250;
$img->image_height = 80;
// $img->ttf_file = 'AHGBold.ttf';
$img->perturbation = 0.85;
$img->image_bg_color = new Securimage_Color(0x0, 0x0, 0x0);
$img->text_color = new Securimage_Color(0xff, 0xff, 0xff);
$img->text_transparency_percentage = 10;
$img->use_transparent_text = true;
$img->text_angle_minimum = -10;
$img->text_angle_maximum = 10;
$img->num_lines = 0;
$img->line_color = new Securimage_Color(0xff, 0xaff, 0xff);
$img->show('backgrounds/bg6.png');
示例8: dirname
include_once dirname(__FILE__) . '/../../../../defines.php';
}
if (!defined('_JDEFINES')) {
define('JPATH_BASE', dirname(__FILE__) . '/../../../../');
require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_BASE . '/includes/framework.php';
/* To use Joomla's Database Class */
require_once JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'factory.php';
// Instantiate the application.
$app = JFactory::getApplication('site');
ob_end_clean();
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
include JPATH_SITE . DS . 'components' . DS . 'com_breezingforms' . DS . 'images' . DS . 'captcha' . DS . 'securimage.php';
$img = new securimage();
//Change some settings
$img->image_width = 230;
$img->image_height = 80;
$img->perturbation = 0.9;
$img->image_bg_color = new Securimage_Color("#6495ED");
$img->text_color = new Securimage_Color("#B0E0E6");
$img->line_color = new Securimage_Color("#B0E0E6");
$img->noise_color = new Securimage_Color("#B0E0E6");
$img->use_transparent_text = false;
$img->text_transparency_percentage = 60;
// 100 = completely transparent
$img->num_lines = 15;
$img->image_signature = '';
$img->use_wordlist = true;
$img->show(JPATH_SITE . DS . 'components' . DS . 'com_breezingforms' . DS . 'images' . DS . 'captcha' . DS . 'backgrounds' . DS . 'bg6.jpg');
示例9: securimage
*
* @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
* @link http://www.phpcaptcha.org/latest.zip Download Latest Version
* @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
*
* @copyright 2009 Drew Phillips
* @author Drew Phillips <drew@drew-phillips.com>
*
* @version 2.0.1 BETA (December 6th, 2009)
*/
include 'securimage.php';
$img = new securimage();
//Change some settings
$img->image_width = 250;
$img->image_height = 80;
$img->perturbation = 0.85;
$img->image_bg_color = new Securimage_Color('#f6f6f6');
$img->multi_text_color = array(new Securimage_Color('#3399ff'), new Securimage_Color('#3300cc'), new Securimage_Color('#3333cc'), new Securimage_Color('#6666ff'), new Securimage_Color('#99cccc'));
$img->use_multi_text = true;
$img->text_angle_minimum = -5;
$img->text_angle_maximum = 5;
$img->use_transparent_text = true;
$img->text_transparency_percentage = 30;
// 100 = completely transparent
$img->num_lines = 7;
$img->line_color = new Securimage_Color('#eaeaea');
$img->image_signature = 'phpcaptcha.org';
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->use_wordlist = true;
$img->show('backgrounds/bg3.jpg');
// alternate use: $img->show('/path/to/background_image.jpg');
示例10: handleEvent
public function handleEvent(__UIEvent &$event)
{
$img = new securimage();
$img->show();
}
示例11: array
$img->use_transparent_text = true;
$img->text_transparency_percentage = 20;
$img->num_lines = 3;
$img->perturbation = 0.6;
// 1.0 = high distortion, higher numbers = more distortion
$img->multi_text_color = array('#6666FF', '#660000', '#3333CC', '#993300', '#0060CC', '#339900', '#6633CC', '#330000', '#006666', '#CC3366');
if (isset($_GET['difficulty']) && $_GET['difficulty'] == 1) {
$img->perturbation = 0.5;
// 1.0 = high distortion, higher numbers = more distortion
$img->num_lines = 2;
$img->multi_text_color = array('#6666FF', '#660000', '#3333CC', '#993300', '#0060CC');
}
if (isset($_GET['difficulty']) && $_GET['difficulty'] == 2) {
$img->perturbation = 0.7;
// 1.0 = high distortion, higher numbers = more distortion
$img->num_lines = 6;
}
if (isset($_GET['no_trans']) && $_GET['no_trans'] == 1) {
$img->use_transparent_text = false;
}
$img->charset = 'ABCDEFHKLMNPRSTUVWYZ234578';
$img->ttf_file = getcwd() . '/ttffonts/ahg-bold.ttf';
// single font
$img->line_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = 'png';
$img->background_directory = getcwd() . '/backgrounds';
$img->ttf_font_directory = getcwd() . '/ttffonts';
$img->show('');
unset($img);
exit;
}
示例12: securimage
$code_length = 5;
break;
case 6:
$bg = 'backgrounds/yxm_bg_120-3.gif';
$ttf_file = 'AHGBold.ttf';
$captcha_type = Securimage::SI_CAPTCHA_MATHEMATIC;
break;
default:
$bg = 'backgrounds/yxm_bg_120-1.gif';
$captcha_type = Securimage::SI_CAPTCHA_STRING;
$ttf_file = 'AHGBold.ttf';
$code_length = 5;
break;
}
$img = new securimage();
$img->switch_type = $switch_type;
$img->ttf_file = $ttf_file;
$img->captcha_type = $captcha_type;
// show a simple math problem instead of text
$img->image_height = 120;
// width in pixels of the image
$img->image_width = 300;
// a good formula for image size
$img->code_length = $code_length;
$img->perturbation = 0.2;
// 1.0 = high distortion, higher numbers = more distortion
$img->num_lines = 0;
$img->text_color = new Securimage_Color("#000");
// captcha text color
$img->show($bg);
示例13: securimage
$img = new securimage();
//Change some settings
$img->image_width = 230;
$img->image_height = 80;
$img->perturbation = 0.75; // 1.0 = high distortion, higher numbers = more distortion
$img->image_bg_color = new Securimage_Color(0xe3, 0xda, 0xed); // e3daed
$img->text_color = new Securimage_Color(0xff, 0x00, 0x00);
$img->text_transparency_percentage = 15; // 100 = completely transparent
$img->num_lines = 8;
$img->code_length = 5;
$img->line_color = new Securimage_Color(0x80, 0xbf, 0xff);
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = SI_IMAGE_PNG;
/// set to true if no TTF support
$img->use_gd_font = false;
$img->gd_font_file = JPATH_SITE . '/components/com_breezingforms/images/captcha/gdfonts/bubblebath.gdf';
//////////////////
if($img->use_gd_font)
{
$img->text_color = '#ff0000';
}
$img->show(''); // alternate use: $img->show('/path/to/background_image.jpg');
示例14: rand
$img->image_height = 86;
$img->perturbation = 0.9; // 1.0 = high distortion, higher numbers = more distortion
$img->image_bg_color = new Securimage_Color(0x0, 0x00, 0x00);
$img->text_color = new Securimage_Color(0xc0, 0x10, 0x10);
$img->text_transparency_percentage = 65; // 100 = completely transparent
$img->num_lines = 15;
$img->line_color = new Securimage_Color(0x90, 0x10, 0x10);
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = SI_IMAGE_PNG;
$img->show(''); // alternate use: $img->show('/path/to/background_image.jpg');
*/
$img->image_width = 280;
$img->image_height = 45;
$img->perturbation = 0.0;
// 1.0 = high distortion, higher numbers = more distortion
$img->image_bg_color = new Securimage_Color(0x0, 0x0, 0x0);
$img->text_color = new Securimage_Color(0xc0, 0x10, 0x10);
$img->text_transparency_percentage = 65;
// 100 = completely transparent
$img->num_lines = 3;
$img->line_color = new Securimage_Color(0x80, 0x10, 0x10);
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = SI_IMAGE_PNG;
$img->charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789';
// set to true if no TTF support
$img->use_gd_font = true;
$img->gd_font_file = 'gdfonts/bubblebath.gdf';
$img->text_color = '#ff0000';
$img->show('images/captchaBack.png');
示例15: securimage
* @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
* @copyright 2009 Drew Phillips
* @author drew010 <drew@drew-phillips.com>
* @version 2.0 BETA (November 15, 2009)
* @package Securimage
*
*/
include 'securimage.php';
$img = new securimage();
//Change some settings
$img->code_length = 4;
$img->image_width = 175;
$img->image_height = 60;
$img->perturbation = 0.5;
// 1.0 = high distortion, higher numbers = more distortion
$img->charset = 'ABCDEFHKLMNPRSTUVWYZ234578';
//$img->charset = 'ABCDEFHKLMNPRSTUVWYZabcdefhkmnpstuvwyz234578';
$img->ttf_file = getcwd() . '/ttffonts/AHGBold.ttf';
// single font
//$img->ttf_font_directory = getcwd() . '/ttffonts'; // random fonts
//$img->ttf_file = $img->getFontFromDirectory(); // random fonts
$img->multi_text_color = array('#6666FF', '#660000', '#3333CC', '#993300', '#0060CC');
$img->use_multi_text = true;
$img->use_transparent_text = true;
$img->text_transparency_percentage = 20;
$img->num_lines = 2;
$img->line_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = 'png';
//$img->background_directory = getcwd() . '/backgrounds';
$img->show(getcwd() . '/backgrounds/asphalt.jpg');
// alternate use: $img->show(getcwd() . '/backgrounds/23.gif');