SetNumChars() public method

public SetNumChars ( $iNumChars )
示例#1
0
 function image()
 {
     $imagesPath = ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'PhpCaptcha' . DS . 'fonts' . DS;
     $aFonts = array($imagesPath . 'VeraBd.ttf', $imagesPath . 'VeraIt.ttf', $imagesPath . 'Vera.ttf');
     $oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60);
     $oVisualCaptcha->UseColour(true);
     //$oVisualCaptcha->SetOwnerText('Source: '.FULL_BASE_URL);
     $oVisualCaptcha->SetNumChars(6);
     $oVisualCaptcha->Create();
 }
示例#2
0
 function image()
 {
     $imagesPath = realpath(VENDORS . 'phpcaptcha') . '/fonts/';
     $aFonts = array($imagesPath . 'VeraBd.ttf', $imagesPath . 'VeraIt.ttf', $imagesPath . 'Vera.ttf');
     $oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60);
     $oVisualCaptcha->UseColour(true);
     //$oVisualCaptcha->SetOwnerText('Source: '.FULL_BASE_URL);
     $oVisualCaptcha->SetNumChars(6);
     $oVisualCaptcha->Create();
 }
示例#3
0
 function image()
 {
     $imagesPath = APP . 'vendors' . DS . 'phpcaptcha' . '/fonts/';
     $aFonts = array($imagesPath . 'VeraBd.ttf', $imagesPath . 'VeraIt.ttf', $imagesPath . 'Vera.ttf');
     $oVisualCaptcha = new PhpCaptcha($aFonts, 220, 60);
     $oVisualCaptcha->UseColour(true);
     $oVisualCaptcha->SetNumLines(false);
     $oVisualCaptcha->DisplayShadow(false);
     //$oVisualCaptcha->SetOwnerText('Source: '.FULL_BASE_URL);
     $oVisualCaptcha->SetNumChars(5);
     $oVisualCaptcha->Create();
 }
示例#4
0
 static function CaptchaCreate($size)
 {
     $v = new PhpCaptcha(null, 100, 50);
     $v->UseColour(true);
     $v->SetNumChars(4);
     $v->Create();
 }
示例#5
0
<?php

// ini_set('display_errors', 1);
define('MODX_API_MODE', true);
// initialize $modx
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/index.php';
define('CAPTCHA_SESSION_ID', $modx->getOption('modcaptcha.session_id', null, 'php_captcha'));
// include captcha class
require MODX_CORE_PATH . 'components/modcaptcha/php-captcha.inc.php';
$fonts = array('fonts/VeraBd.ttf', 'fonts/VeraIt.ttf', 'fonts/Vera.ttf');
$width = $modx->getOption('modcaptcha.width', null, 150);
$height = $modx->getOption('modcaptcha.height', null, 38);
$chars = $modx->getOption('modcaptcha.chars', null, 'a-z,A-Z,1-9');
$captcha = new PhpCaptcha($fonts, $width, $height);
$captcha->SetCharSet($chars);
$captcha->SetNumChars($modx->getOption('modcaptcha.num_chars', null, 5));
$captcha->SetNumLines($modx->getOption('modcaptcha.num_lines', null, 2));
$captcha->Create();
示例#6
0
            }
        }
        exit;
    }
    return;
}
if ($mode == 'captcha') {
    $verification_id = $_REQUEST['verification_id'];
    if (empty($verification_id)) {
        $verification_id = 'common';
    }
    $verification_settings = Settings::instance()->getValues('Image_verification');
    $fonts = array(Registry::get('config.dir.lib') . 'other/captcha/verdana.ttf');
    $c = new PhpCaptcha($verification_id, $fonts, $verification_settings['width'], $verification_settings['height']);
    // Set string length
    $c->SetNumChars($verification_settings['string_length']);
    // Set number of distortion lines
    $c->SetNumLines($verification_settings['lines_number']);
    // Set minimal font size
    $c->SetMinFontSize($verification_settings['min_font_size']);
    // Set maximal font size
    $c->SetMaxFontSize($verification_settings['max_font_size']);
    $c->SetGridColour($verification_settings['grid_color']);
    if ($verification_settings['char_shadow'] == 'Y') {
        $c->DisplayShadow(true);
    }
    if ($verification_settings['colour'] == 'Y') {
        $c->UseColour(true);
    }
    if ($verification_settings['string_type'] == 'digits') {
        $c->SetCharSet(array(2, 3, 4, 5, 6, 8, 9));
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Loquacity; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
include_once 'core/config.php';
if (defined(C_CAPTCHA_ENABLE) && C_CAPTCHA_ENABLE == 'true') {
    include_once 'core/3rdparty/captcha/php-captcha.inc.php';
    $fonts = 'core/3rdparty/captcha/fonts/';
    $aFonts = array($fonts . 'VeraBd.ttf', $fonts . 'VeraIt.ttf', $fonts . 'Vera.ttf');
    $captcha = new PhpCaptcha($aFonts, 200, 60);
    //Set user options
    $captcha->SetWidth(C_CAPTCHA_WIDTH);
    $captcha->SetHeight(C_CAPTCHA_HEIGHT);
    $captcha->SetNumChars(C_CAPTCHA_CHARACTERS);
    $captcha->SetNumLines(C_CAPTCHA_LINES);
    if (C_CAPTCHA_ENABLE_SHADOWS === 'true') {
        $captcha->DisplayShadow(true);
    }
    if (C_CAPTCHA_OWNER_TEXT === 'true') {
        $captcha->SetOwnerText(BLOGURL);
    }
    $captcha->SetCharSet(C_CAPTCHA_CHARACTER_SET);
    if (C_CAPTCHA_CASE_INSENSITIVE === 'true') {
        $captcha->CaseInsensitive(true);
    }
    //$captcha->SetEdith(C_CAPTCHA_WIDTH);
    $captcha->SetMinFontSize(C_CAPTCHA_MIN_FONT);
    $captcha->SetMaxFontSize(C_CAPTCHA_MAX_FONT);
    if (C_CAPTCHA_USE_COLOR === 'true') {
示例#8
0
<?php

require 'php-captcha.inc.php';
$aFonts = array('fonts/VeraBd.ttf', 'fonts/VeraIt.ttf', 'fonts/Vera.ttf');
$oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60);
$oVisualCaptcha->SetNumChars(4);
$oVisualCaptcha->CaseInsensitive(false);
$oVisualCaptcha->Create();
示例#9
0
<?php

////////////////////////////////////////////////////////////////////////////
//
// (c) phpChess Limited, 2004-2006, in association with Goliath Systems.
// All rights reserved. Please observe respective copyrights.
// phpChess - Chess at its best
// you can find us at http://www.phpchess.com.
//
////////////////////////////////////////////////////////////////////////////
require 'php-captcha.inc.php';
// define fonts
$aFonts = array('fonts/VeraBd.ttf');
// create new image
$oPhpCaptcha = new PhpCaptcha($aFonts, 150, 30);
$oPhpCaptcha->SetBackgroundImages('val.jpg');
$oPhpCaptcha->SetWidth(150);
$oPhpCaptcha->SetHeight(30);
$oPhpCaptcha->SetNumChars(5);
$oPhpCaptcha->SetMinFontSize(10);
$oPhpCaptcha->SetMinFontSize(12);
$oPhpCaptcha->UseColour(True);
$oPhpCaptcha->DisplayShadow(False);
$oPhpCaptcha->SetNumLines(250);
$oPhpCaptcha->Create();