function create_image() { include './lib/jpgraph/jpgraph.php'; include './lib/jpgraph/jpgraph_polar.php'; $graph = new PolarGraph(250, 250); $graph->SetScale('lin'); $graph->SetMargin(0, 1, 0, 1); $graph->axis->ShowAngleLabel(false); $graph->axis->HideTicks(); $graph->axis->HideLabels(); $graph->axis->HideLine(); $fonts = array(FF_ARIAL, FF_VERDANA, FF_TREBUCHE, FF_GEORGIA, FF_COMIC, FF_COURIER, FF_TIMES); $styles = array(FS_NORMAL, FS_BOLD, FS_ITALIC); $text = $this->generate_pass(6); $font = $fonts[rand(0, count($fonts) - 1)]; $style = $styles[rand(0, count($styles) - 1)]; if ($font == FF_COMIC && $style == FS_ITALIC) { $style = FS_NORMAL; } $txt = new Text($text); $txt->Pos(rand(10, 140), rand(10, 140)); $txt->SetFont($font, $style, rand(20, 26)); $txt->SetColor('black'); $txt->SetAngle(rand(-45, 45)); $graph->AddText($txt); $graph->Stroke('./register.png'); return array(md5("{$this->sets['db_pass']}{$this->sets['mostonlinetime']}{$text}"), './register.png'); }
<?php // content="text/plain; charset=utf-8" // A simple Polar graph, example 0 require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_polar.php'; $data = array(0, 1, 10, 2, 30, 25, 40, 60, 50, 110, 60, 160, 70, 210, 75, 230, 80, 260, 85, 270, 90, 280, 95, 270, 100, 260, 105, 230, 110, 210, 120, 160, 130, 110, 140, 60, 150, 25, 170, 2, 180, 1); $graph = new PolarGraph(250, 250); $graph->SetScale('lin'); $graph->SetMargin(35, 35, 25, 25); $graph->SetType(POLAR_180); $p = new PolarPlot($data); $p->SetFillColor('lightblue@0.5'); $graph->Add($p); $graph->Stroke();
function create_image() { include './lib/jpgraph/jpgraph.php'; include './lib/jpgraph/jpgraph_polar.php'; if (!function_exists('imagejpeg')) { JpGraphError::Raise("This PHP installation is not configured with JPEG support meaning that anti-robot registration cannnot be run at this current time. Please recompile PHP with GD and JPEG support to run JpGraph and that will allow anti-robot registration to fully function. (Function imagejpeg() does not exist)"); } $graph = new PolarGraph(250, 250); $graph->SetScale('lin'); $graph->SetMargin(0, 1, 0, 1); $graph->axis->ShowAngleLabel(false); $graph->axis->HideTicks(); $graph->axis->HideLabels(); $graph->axis->HideLine(); $fonts = array(FF_ARIAL, FF_VERDANA, FF_TREBUCHE, FF_GEORGIA, FF_COMIC, FF_COURIER, FF_TIMES); $styles = array(FS_NORMAL, FS_BOLD, FS_ITALIC); $text = $this->generate_pass(6); $font = $fonts[rand(0, count($fonts) - 1)]; $style = $styles[rand(0, count($styles) - 1)]; if ($font == FF_COMIC && $style == FS_ITALIC) { $style = FS_NORMAL; } $txt = new Text($text); $txt->Pos(rand(10, 140), rand(10, 140)); $txt->SetFont($font, $style, rand(20, 26)); $txt->SetColor('black'); $txt->SetAngle(rand(-45, 45)); $graph->AddText($txt); $graph->Stroke('./register.png'); return array(md5("{$this->sets['db_pass']}{$this->sets['mostonlinetime']}{$text}"), './register.png'); }