示例#1
0
文件: val_img.php 项目: robocon/iopr
//$targetPath="".WEB_PATH."";
//var $font = '/home/www/htdocs/capcha/monofont.ttf'; //╡├╟и╩═║ path р═з┴╥у╩ш╣╨д├╤║
$_SERVER['DOCUMENT_ROOT'] = dirname(dirname(__FILE__));
$targetPath = $_SERVER['DOCUMENT_ROOT'];
function generateCode($characters)
{
    $possible = '╝╗═╖┴┐╦б┤╩╟з╛├╣┬║┼└╢д╡ивк';
    //		$possible = _CAPTCHA_RAN;
    $code = '';
    $i = 0;
    while ($i < $characters) {
        $code .= substr($possible, mt_rand(0, strlen($possible) - 1), 1);
        $i++;
    }
    return $code;
}
$font = $targetPath . "/capcha/font/angsab.ttf";
$code = generateCode($_GET['characters']);
$im = imagecreate($_GET['width'], $_GET['height']);
$white = ImageColorAllocate($im, 255, 255, 255);
$black = ImageColorAllocate($im, 0, 0, 0);
$new_string = tis620_to_utf8($code);
imagefill($im, 0, 0, $black);
imageTTFText($im, 20, 0, 6, 18, $white, $font, $new_string);
if (ISO == 'utf-8') {
    $_SESSION["security_code"] = $new_string;
} else {
    $_SESSION["security_code"] = utf8_to_tis620($new_string);
}
imagepng($im);
imagedestroy($im);
示例#2
0
文件: news.php 项目: robocon/iopr
                                            $rmbnimg_arr = explode("\n", $rmbnimg);
                                            $rmbntopic = $arr['ran']['rm_topic'];
                                            $rmbntopic_arr = explode("\n", $rmbntopic);
                                            $rmbntext = $arr['ran']['rm_detail'];
                                            $rmbntext_arr = explode("\n", $rmbntext);
                                            $rmbnurl = $arr['ran']['rm_link'];
                                            $rmbnurl_arr = explode("\n", $rmbnurl);
                                            if (ISO == 'utf-8') {
                                                $rmbntopic = $arr['ran']['rm_topic'];
                                                $rmbntopic_arr = explode("\n", $rmbntopic);
                                                $rmbntext = $arr['ran']['rm_detail'];
                                                $rmbntext_arr = explode("\n", $rmbntext);
                                            } else {
                                                $rmbntopic = tis620_to_utf8($arr['ran']['rm_topic']);
                                                $rmbntopic_arr = explode("\n", $rmbntopic);
                                                $rmbntext = tis620_to_utf8($arr['ran']['rm_detail']);
                                                $rmbntext_arr = explode("\n", $rmbntext);
                                            }
                                            foreach ($rmbnimg_arr as $ib => $curr_isrc) {
                                                $xml_bns .= '
	<item>
		<path>' . trim($curr_isrc) . '</path>
		<title><![CDATA[<font color="#990000">' . trim($rmbntopic_arr[$ib]) . '</font>]]></title>
		<caption><![CDATA[<font color="#000033">' . trim($rmbntext_arr[$ib]) . '</font>]]></caption>
		
		<target>_blank</target>
		<link>' . trim($rmbnurl_arr[$ib]) . '</link>
		
		<bar_color>0xffffff</bar_color>
		<bar_transparency>40</bar_transparency>
		
示例#3
0
文件: readpoll.php 项目: robocon/iopr
<?php 
    $datas = "";
    $sel = "";
    for ($x = 0; $x <= $all; $x++) {
        if ($x == $all) {
            $datas .= $prc[$x];
            $sel .= $o[$x];
        } else {
            $datas .= $prc[$x] . "*";
            $sel .= $o[$x] . "*";
        }
    }
    if (ISO == 'utf-8') {
        $selx = $sel;
    } else {
        $selx = tis620_to_utf8($sel);
    }
    //echo $selx;
    ?>
<div align="left"><img src="modules/ajoxpoll/chartbig.php?data=<?php 
    echo $datas;
    ?>
&label=<?php 
    echo $selx;
    ?>
"></div><br />
<font color="#CC0000" size="3"><b>Total Votes : <?php 
    echo $total;
    ?>
</b></font></div>
<?php