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


PHP securimage::show方法代码示例

本文整理汇总了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');
 }
开发者ID:sulicz,项目名称:JINC_J30,代码行数:28,代码来源:captcha.raw.php

示例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');
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:26,代码来源:ajax_helpers.php

示例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('');
 }
开发者ID:sdgdsffdsfff,项目名称:Typecho-Captcha,代码行数:48,代码来源:Action.php

示例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;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:21,代码来源:captcha.php

示例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');
}
开发者ID:jcmwc,项目名称:fleet,代码行数:23,代码来源:function_captcha.php

示例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');
开发者ID:FormHandler,项目名称:FormHandler,代码行数:10,代码来源:securimage_show.php

示例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');
开发者ID:jayfresh,项目名称:SweetSpot,代码行数:18,代码来源:securimage_show_captcha.php

示例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');
开发者ID:Ettore495,项目名称:Ettore-Work,代码行数:30,代码来源:securimage_show.php

示例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');
开发者ID:poisoned-apple,项目名称:8thWonderland,代码行数:31,代码来源:securimage_show_example.php

示例10: handleEvent

 public function handleEvent(__UIEvent &$event)
 {
     $img = new securimage();
     $img->show();
 }
开发者ID:laiello,项目名称:lion-framework,代码行数:5,代码来源:CaptchaComponent.class.php

示例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;
}
开发者ID:hscale,项目名称:webento,代码行数:31,代码来源:securimage_show.php

示例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);
开发者ID:haitao-wang,项目名称:TSpider,代码行数:30,代码来源:securimage_show.php

示例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');
开发者ID:rkern21,项目名称:videoeditor,代码行数:29,代码来源:securimage_show.php

示例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');
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:30,代码来源:securimage_show.php

示例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');
开发者ID:emelleme,项目名称:Drexel-Cab,代码行数:31,代码来源:securimage_show_low.php


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