⚜ RBBD Shell Backdoor ⚜
Current Dir
:
D:
/
php
/
!!!
/
test_kniha
/
Home
Upload
Command
Config
Jumping
Symlink
Mass Deface
Bypass Disable Function
K-RDP 5H3LL
Adminer
Change Password cPanel
Zone-H
Current File : D:/php/!!!/test_kniha/divtcha.class.php
<? /**********************************************************************/ /* Třída DIVTCHA */ /**********************************************************************/ /** ********************************************************************/ /** BY HAWWWRAN */ /** www.quicky.cz */ /** '''DIVTCHA''' - Metoda, kdy je pro zobrazení kódu použito elementů */ /** DIV velikosti 1x1 px. Tuto metodu lze úspěšně kombinovat s */ /** jinými metodami, jako například logickou otázku a audio CAPTCHA. */ /** Díky tomu, že DIVTCHA není obrázkem, nelze jej snadno získat */ /** roboty. DIVTCHA lze snadno maskovat do textu a tak zamezit */ /** rozlišení v případě "vyfocení" obrazovky robotem. */ /** ********************************************************************/ /**********************************************************************/ /* Přispěvatelé: Peter Vágner (Konzultace podpory pro nevidomé) */ /**********************************************************************/ /** ********************************************************************* Licencováno pod licencí BSD (http://cs.wikipedia.org/wiki/BSD_licence) Copyright © 2009, Hawwwran.com. Všechna práva vyhrazena. Redistribuce a použití všech forem díla, v původním i upravovaném tvaru, jsou povoleny za následujících podmínek: - Šířený zdrojový kód musí obsahovat výše uvedenou informaci o copyrightu, tento seznam podmínek a níže uvedené zřeknutí se odpovědnosti. - Šířený tvar bez přístupných zdrojových kódů musí nést výše uvedenou informaci o copyrightu, tento seznam podmínek a níže uvedené zřeknutí se odpovědnosti ve své dokumentaci a/nebo dalších poskytovaných materiálech. - Ani jméno vlastníka práv, ani jména přispěvatelů nemohou být použita při podpoře nebo právních aktech souvisejících s produkty odvozenými z tohoto software bez výslovného písemného povolení. TENTO SOFTWARE JE POSKYTOVÁN DRŽITELEM LICENCE A JEHO PŘISPĚVATELI „JAK STOJÍ A LEŽÍ“ A JAKÉKOLIV VÝSLOVNÉ NEBO PŘEDPOKLÁDANÉ ZÁRUKY VČETNĚ, ALE NEJEN, PŘEDPOKLÁDANÝCH OBCHODNÍCH ZÁRUK A ZÁRUKY VHODNOSTI PRO JAKÝKOLIV ÚČEL JSOU POPŘENY. DRŽITEL, ANI PŘISPĚVATELÉ NEBUDOU V ŽÁDNÉM PŘÍPADĚ ODPOVĚDNI ZA JAKÉKOLIV PŘÍMÉ, NEPŘÍMÉ, NÁHODNÉ, ZVLÁŠTNÍ, PŘÍKLADNÉ NEBO VYPLÝVAJÍCÍ ŠKODY (VČETNĚ, ALE NEJEN, ŠKOD VZNIKLÝCH NARUŠENÍM DODÁVEK ZBOŽÍ NEBO SLUŽEB; ZTRÁTOU POUŽITELNOSTI, DAT NEBO ZISKŮ; NEBO PŘERUŠENÍM OBCHODNÍ ČINNOSTI) JAKKOLIV ZPŮSOBENÉ NA ZÁKLADĚ JAKÉKOLIV TEORIE O ZODPOVĚDNOSTI, AŤ UŽ PLYNOUCÍ Z JINÉHO SMLUVNÍHO VZTAHU, URČITÉ ZODPOVĚDNOSTI NEBO PŘEČINU (VČETNĚ NEDBALOSTI) NA JAKÉMKOLIV ZPŮSOBU POUŽITÍ TOHOTO SOFTWARE, I V PŘÍPADĚ, ŽE DRŽITEL PRÁV BYL UPOZORNĚN NA MOŽNOST TAKOVÝCH ŠKOD. ***********************************************************************/ /**********************************************************************/ /**********************************************************************/ /** * divtchaS * * @package divtcha * @author Michal Havránek (www.quicky.cz) * @copyright 2009 * @version 1.0 * @access public * * Tuto třídu využívá třída divtcha, není určena pro samostatné použití */ class divtchaS { public static $codes=array(); private static $firstcheck=false; /** * divtchaS::clear() * * Slouží vyčištění paměti kódů. * * @return boolean */ public static function clear() { $_SESSION['divtcha']=array(); } /** * divtchaS::expost() * * @param string $nazev_promenne * @param string $ex * @return mixed * * slouží k získání dat poslaných pomocí GET, nebo POST */ static function expost($nazev_promenne,$ex='') { $ret = ""; if (isset($_POST["$nazev_promenne"])) { $ret = $_POST["$nazev_promenne"]; } else { if (isset($_GET["$nazev_promenne"])) { $ret = $_GET["$nazev_promenne"]; } else { $ret = ""; } } if ($ret=='') {$ret=$ex;} return $ret; } /** * divtchaS::prepare() * * @param string $code * @return string * * Slouží k přípravě kódu ke kontrole */ private static function prepare($code) { $code=str_replace("\"","",$code); $code=strtolower($code); return $code; } /** * divtchaS::check() * * @return boolean * * Slouží ke kontrole kódů */ public static function check() { if (!isset($_SESSION['divtchaPokusu'])) {$_SESSION['divtchaPokusu']=0;} if (!self::$firstcheck) {$_SESSION['divtchaPokusu']++; } self::$firstcheck=true; $off=false; $check=false; if (isset($_SESSION['divtcha'])) { if (is_array($_SESSION['divtcha'])) { foreach($_SESSION['divtcha'] as $key=>$val) { $code=self::prepare(self::expost($key)); if (($val[0]==$code || $val[1]==$code) && $code!='') { $check=true; unset($_SESSION['divtcha'][$key]); $_SESSION['divtchaPokusu']=0; } if ($val=='off') { $off=true; } } if ($off) {$check=2;} return $check; } else { $_SESSION['divtcha']=array(); return false; } } else { $_SESSION['divtcha']=array(); return false; } } /** * divtchaS::hex2bin() * * @param string $hexdata * @return string * * Slouží k převodu hexadecimálního kódu na binární data */ static function hex2bin($hexdata) { for ($i=0;$i<strlen($hexdata);$i+=2) { $bindata.=chr(hexdec(substr($hexdata,$i,2))); } return $bindata; } } /** * divtcha * * @package divtcha * @author Michal Havránek * @copyright 2009 * @version 1.0 * @access public * * Slouží k zajištění veškerých operací kolem kódu k zabezpečení před spamem */ class divtcha { private $bw=false; private $code=''; private $codesource=''; private $style=''; private $bg='ffffff'; private $color='000000'; private $id=''; private $align=''; private $random=array(); private $codes=array(); private $elements=array(); private $count=4; private $ncount=4; private $security=0; private $imageFolder='dtimg'; private $font='font/arial.ttf'; private $fontSize=10; private $limit=false; private $try=3; private $block=60; private $blocking=false; private $codeText=''; private $alternativeQuestion=''; private $alternativeQuestionExport=''; private $alternativeAnswer=''; private $output=false; private $security5=array(); private $alternativeDatabase=array(); private $aid=''; /** * divtcha::__construct() * * @param integer $count - Počet písmen v kódu * @param integer $ncount - Počet čísel na konci kódu * @param bool $bw - Pouze čenobíle (dvoubarevně) * @param integer $security - Stupeň zabezpečení (0-4) * @param string $images - Adresář s obrázky, nebo soubor s ttf fontem * @param string $align - Zarovnání výsledného boxu s kódem (left,right,none) * @param string $bcolor - Barva pozadí (např. ffffff pro bílou) * @param string $color - Barva textu (např. 000000 pro černou) * @param integer $fontsize - Velikost písma (pouze pri použití kódu v textu, tedy zadání ttf fontu) * @return void */ public function __construct($count=4,$ncount=0,$bw=false,$security=0,$images='dtimg',$align='',$bcolor='ffffff',$color='000000',$fontsize=10) { if (substr_count($images,'.ttf')>0) { $this->setFont($images); $images="MASK"; } $this->setImageFolder($images); $this->setBackgroundColor($bcolor); $this->setColor($color); $this->setFontSize($fontsize); $this->setAlign($align); if (!isset($_SESSION['divtcha'])) {$_SESSION['divtcha']=array();} //$sc=uniqid('DIVTCHA'); //$ac=uniqid('DIVTCHA'); //$_SESSION['divtcha'][$sc]=''; //$this->id=$sc; //$this->aid=$ac; $this->set($count,$ncount,$bw,$security); } /** * divtcha::set() * * nastaví DIVTCHA a připraví vše potřebné. * * @param integer $count * @param integer $ncount * @param bool $bw * @param integer $security * @return void */ private function set($count,$ncount=0,$bw=false,$security=0) { $this->security=$security; $this->count=$count; $this->ncount=$ncount; if ($this->security>3) { $this->elements=$elements=array("span","em","strong","sub","sup","big","del"); } else { $this->elements=$elements=array("div"); } $this->setRandomParts(); $this->bw=$bw; $text=$this->getNewCode($this->count,$this->ncount); $this->codesource=$text; $this->codeText=$text; $_SESSION['divtcha'][$this->random['input']][1]=''; if ($this->security>4) { $this->fakeCodeText=$this->getNewCode($this->count,$this->ncount);; } } /** * divtcha::setAlternativeQuestions() * * Načte ze zadaného souboru databázi logických otázek. * Syntaxe je typu CSV, to znamená jedna otázka na řádek a otázka s odpovědí oddělené středníky * např. * Kolik hodin má den;24; * * @param string $soubor * @return void */ public function setAlternativeQuestions($soubor) { if (file_exists($soubor)) { $ex=array(); $data=file_get_contents($soubor); $data=explode(";\r\n",$data); foreach($data as $key=>$val) { $parts=explode(';',$val); $ex[count($ex)]['q']=$parts[0]; $ex[(count($ex)-1)]['a']=$parts[1]; } $this->alternativeDatabase=$ex; } else { echo "<b style=\"color:#ff0000\">SOUBOR S ALTERNATIVNÍMI OTÁZKAMI NEEXISTUJE</b>"; } } /** * divtcha::setImageFolder() * * nastavuje cestu k obrázkům písmen * * @param string $folder * @return void */ private function setImageFolder($folder) { $this->imageFolder=$folder; } /** * divtcha::setBackgroundColor() * * Nastaví barvu pozadí (zadávat v hexa) * * @param string $color * @return void */ public function setBackgroundColor($color) { $this->bg=$color; } /** * divtcha::setColor() * * Nastaví barvu textu (zadávat v hexa) * * @param string $color * @return void */ public function setColor($color) { $this->color=$color; } /** * divtcha::setAlign() * * Nastaví zarovnání boxu s kódem (left,right,none) * * @param string $align * @return void */ public function setAlign($align) { $this->align=$align; } /** * divtcha::setRandomParts() * * nastaví názvy tříd a id elementů v závislosti na úrovni zabezpečení * * @return void */ public function setRandomParts() { if ($this->security>0) { $this->random['boxName']=$this->getNewCode(2).'_'.$this->getNewCode(4); $this->random['input']=$this->getNewCode(2).'_'.$this->getNewCode(4); $this->random['handicap']=$this->getNewCode(3).'_'.$this->getNewCode(4); $this->random['handicapId']=$this->getNewCode(3).'_'.$this->getNewCode(4); $this->random['handicapIdBox']=$this->getNewCode(3).'_'.$this->getNewCode(4); $this->random['playFunction']=$this->getNewCode(3).'_'.$this->getNewCode(4); } else { $this->random['boxName']='box'; $this->random['input']='text'; $this->random['handicap']='handicap'; $this->random['handicapId']='handicapPlay'; $this->random['handicapIdBox']='handicapPlayBox'; $this->random['playFunction']='playSound'; } if ($this->security>2) { $this->random['xName']=$this->getNewCode(rand(1,2)); $this->random['yName']=$this->getNewCode(rand(1,2)); } else { $this->random['xName']='x'; $this->random['yName']='y'; } $this->random['blind']=$this->getNewCode(2).'_'.$this->getNewCode(4); } /** * divtcha::setLimit() * * Metoda umožňující nastavení blokování po určeném počtu pokusů ($try) na určený počet sekund ($block) * * @param integer $try * @param integer $block * @return void */ public function setLimit($try,$block) { $this->limit=true; $this->try=$try; $this->block=$block; if (!isset($_SESSION['divtchaPokusu'])) {$_SESSION['divtchaPokusu']=0;} if (!isset($_SESSION['divtchaBlocking'])) {$_SESSION['divtchaBlocking']=false;} if ($_SESSION['divtchaPokusu']>=$try) { $_SESSION['divtchaBlocking']=true; if (!isset($_SESSION['divtchaBlockingTime'])) {$_SESSION['divtchaBlockingTime']=time();} if (($_SESSION['divtchaBlockingTime']+$block)<time()) { $_SESSION['divtchaBlocking']=false; unset($_SESSION['divtchaBlockingTime']); $_SESSION['divtchaPokusu']=0; } else { $this->blocking=true; } } } /** * divtcha::getSecurity() * * Vrátí nastavení úrovně zabezpečení * * @return integer */ public function getSecurity() { return $this->security; } /** * divtcha::setFont() * * nastavuje font * * @param string $font * @return void */ private function setFont($font) { $this->font=$font; } /** * divtcha::setFontSize() * * nastavuje velikost fontu v případě použití kódu v textu * * @param integer $size * @return void */ private function setFontSize($size) { $this->fontSize=$size; } /** * divtcha::generate() * * Má za úkol vygenerovat potřebné kódy * * @return void */ private function generate() { if (!$this->output) { if ($this->blocking) { $this->codeText='VYPNUTO'; $this->codesource="off"; } $data=$this->text2div($this->codeText,$this->bg,$this->color); $this->code=$data['content']; $this->style=$data['style']; $this->output=true; } } /** * divtcha::generateAlternativeQuestion() * * Vygeneruje alternativní otázku * Z důvodu umožnění nasadit DIVTCHA bez nutnosti psát databázi otázek jsou čísla a doplňková slova (ovoce) napsaná přimo zde * * @return void */ private function generateAlternativeQuestion() { if (rand(0,1)==0 || count($this->alternativeDatabase)==0) { $mashups=array('jablko','hruška','banán','švestka','jablek','hrušek','banánů','švestek','jablka','hrušky','banány','švestky'); $numbers[0]=array('nula','jedna','dva','tři','čtyři','pět','šest','sedm','osm','devět'); $numbers[1]=array('nula','jednička','dvojka','trojka','čtyřka','pětka','šestka','sedmička','osmička','devítka'); $numbers[2]=array('nula','jeden','dva','tři','čtvery','patery','šestero','sedmero','osm','devatero'); $firstn=rand(0,(count($numbers)-1)); $secondn=rand(0,(count($numbers)-1)); $first=rand(0,9); $second=rand(0,9); $vy=$numbers[$firstn][$first]." ".$mashups[rand(0,(count($mashups)-1))]." plus ".$numbers[$secondn][$second]." ".$mashups[rand(0,(count($mashups)-1))]; $this->alternativeQuestion="Kolik je ".$vy."? (pouze číslo)"; $this->alternativeAnswer=$first+$second; } else { $qa['q']=''; while ($qa['q']=='') { $qa=$this->alternativeDatabase[rand(0,(count($this->alternativeDatabase)))]; $this->alternativeQuestion=$qa['q']; $this->alternativeAnswer=$qa['a']; } } } /** * divtcha::rgb2hex() * * Převede RGB barvu na hexadecimální reprezentaci * * @param integer $r * @param integer $g * @param integer $b * @return string */ private function rgb2hex($r,$g,$b) { return bin2hex(chr($r)).bin2hex(chr($g)).bin2hex(chr($b)); } /** * divtcha::getNewCode() * * Vytvoří kód jedinečný pro relaci. * Řidí se nastavením, které říká počet písmen a čísel v kódu. Čísla budou vždy za písmeny a písmena budou příjemně čitelná * * @param integer $count * @param integer $ncount * @return string */ private function getNewCode($count,$ncount=0) { $souhlasky=array('b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','x','z'); $samohlasky=array('a','e','i','u'); $generated=false; while($generated==false || in_array($text,divtchaS::$codes)) { $text=''; for($i=0; $i<$count; $i++) { if($i%2==0) {$text.=$samohlasky[rand(0,count($samohlasky)-1)];} else{$text.=$souhlasky[rand(0,count($souhlasky)-1)];} } for($i=0; $i<$ncount; $i++) { $text.=rand(1,9); } $generated=true; } divtchaS::$codes[]=$text; return $text; } /** * divtcha::char2div() * * Vytvoří elementy DIV, které budou tvořit zadané písmeno * * @param char $char * @param integer $left * @param string $bg * @param string $pbg * @return */ private function char2div($char,$left,$bg,$pbg) { $cesta=$this->getImageFolder().$char.'.jpg'; if (file_exists($cesta)) { $velikost = getimagesize($cesta); $obrazek = imagecreatefromjpeg($cesta); $ret = ""; for ($x = 0; $x < $velikost[0]; $x++) { for ($y = 0; $y < $velikost[1]; $y++) { if ($x < $velikost[0] && $y < $velikost[1]) { $pixel = imagecolorat($obrazek,$x,$y); $cols = imagecolorsforindex($obrazek,$pixel); $r = $cols['red']; $g = $cols['green']; $b = $cols['blue']; if ($this->bw) { $gray=($r+$g+$b)/3; if ($gray<=180) {$r=0;$g=0;$b=0;} else {$r=255;$g=255;$b=255;} } $color=$this->rgb2hex($r,$g,$b); $bgc=" style=\"background-color:#".$color."\""; if ($color!=$bg) { if ($color!=$pbg) { $style=$bgc; } else { $style=''; } $element=$this->elements[rand(0,count($this->elements)-1)]; if ($this->security>1) { $xw=bin2hex($x+$left); $yw=bin2hex($y); } else { $xw=($x+$left); $yw=$y; } $ret.="<$element class=\"".$this->random['xName']."".$xw." ".$this->random['yName']."".$yw."\"$style></$element>"; } } } } ImageDestroy($obrazek); $retx[0]=$ret; $retx[1]=$velikost[0]; $retx[2]=$velikost[1]; return $retx; } else { return ''; } } /** * divtcha::directText2div() * * Převede text do elementů DIV, které je budou tvořit a vizuálně budou zapadat do okolního textu * * @param string $text * @param string $bg * @param string $pbg * @return string */ private function directText2div($text,$bg,$pbg) { $velikostPisma=$this->fontSize; $metriky_koment=ImageTTFBBox($velikostPisma, 0, $this->font,$text); $metriky_first=ImageTTFBBox($velikostPisma, 0, $this->font,substr($text,$i,1)); $velikost[0]=$metriky_koment[2]+2; $velikost[1]=0; for($i=0; $i<strlen($text); $i++) { $metriky_koment=ImageTTFBBox($velikostPisma, 0, $this->font,substr($text,$i,1)); if ($metriky_koment[3]>$velikost[1]) {$velikost[1]=$metriky_koment[3];} } $velikost[1]+=$velikostPisma; $obrazek = imagecreatetruecolor($velikost[0],$velikost[1]); $user=ImageColorAllocate($obrazek, hexdec(substr($this->color,0,2)), hexdec(substr($this->color,2,2)), hexdec(substr($this->color,4,2))); $bila=ImageColorAllocate($obrazek, 255, 255, 255); $userbg=ImageColorAllocate($obrazek, hexdec(substr($this->bg,0,2)), hexdec(substr($this->bg,2,2)), hexdec(substr($this->bg,4,2))); ImageFilledRectangle($obrazek, 0, 0, $velikost[0],$velikost[1], $userbg); ImageTTFText($obrazek, $velikostPisma, 0, 0, $metriky_first[3]+$velikostPisma+1, $user, $this->font, $text); $ret = ""; for ($x = 0; $x < $velikost[0]; $x++) { for ($y = 0; $y < $velikost[1]; $y++) { if ($x < $velikost[0] && $y < $velikost[1]) { $pixel = imagecolorat($obrazek,$x,$y); $cols = imagecolorsforindex($obrazek,$pixel); $r = $cols['red']; $g = $cols['green']; $b = $cols['blue']; if ($this->bw) { $gray=($r+$g+$b)/3; if ($gray<=180) {$r=0;$g=0;$b=0;} else {$r=255;$g=255;$b=255;} } $color=$this->rgb2hex($r,$g,$b); $bgc=" style=\"background-color:#".$color."\""; if ($color!=$bg) { if ($color!=$pbg) { $style=$bgc; } else { $style=''; } $element=$this->elements[rand(0,count($this->elements)-1)]; if ($this->security>1) { $xw=bin2hex($x+$left); $yw=bin2hex($y); } else { $xw=($x+$left); $yw=$y; } $ret.="<$element class=\"".$this->random['xName']."".$xw." ".$this->random['yName']."".$yw."\"$style></$element>"; } } } } ImageDestroy($obrazek); $retx[0]=$ret; $retx[1]=$velikost[0]; $retx[2]=$velikost[1]; return $retx; } /** * divtcha::text2div() * * Převede text na elementz DIV, které ho budou tvořit. Využívá veškeré dostupné nastavení * * @param string $text * @param string $bg * @param string $pbg * @return string */ private function text2div($text,$bg,$pbg) { $text=strtolower($text); $ret=''; $left=0; $maxheight=0; $this->generateAlternativeQuestion(); $ddivtcha=rand(0,(strlen($text)-1)); if ($this->getImageFolder()!='MASK/') { for($i=0; $i<strlen($text); $i++) { $data=$this->char2div(substr($text,$i,1),$left,$bg,$pbg); $height=$data[2]; if ($maxheight<$height) {$maxheight=$height;} $left+=$data[1]; $ret.=$data[0]; } } else { $data=$this->directText2div($text,$bg,$pbg); $height=$data[2]; if ($maxheight<$height) {$maxheight=$height;} $left+=$data[1]; $ret.=$data[0]; } $classes=""; for($i=0; $i<$left; $i++) { if ($this->security>1){$x=bin2hex($i);}else{$x=$i;} $classes.=".".$this->random['xName']."".$x."{left:".$i."px;}"; } for($i=0; $i<$maxheight; $i++) { if ($this->security>1){$y=bin2hex($i);}else{$y=$i;} $classes.=".".$this->random['yName']."".$y."{top:".$i."px;}"; } $element=$this->elements[rand(0,count($this->elements)-1)]; $ret="<$element id=\"".$this->random['boxName']."\" style=\"width:".$left."px; height:".($maxheight)."px\">".$ret."</$element>"; $this->alternativeQuestionExport='<label for="'.$this->random['input'].'" id="'.$this->random['blind'].'">Alternativní dotaz pro nevidomé (text může být mírně nesmyslný) : '.$this->alternativeQuestion.'</label>'; if (($left+10)>$this->security5['codeWidth']) {$this->security5['codeWidth']=$left+10;} return array("content"=>$ret,"style"=>$classes); } /** * divtcha::getStyle() * * Připraví a vrátí styl a script potřebný pro zobrazení DIVTCHA kódu. Script je potřeba pouze pro přehrátí zvukového kódu pro nevidomé. * * $handicap určuje soubor, který bude použit jako pozadí pro tlačítko pro spuštění zvukové alternativy kódu pro nevidomé. * $audio určuje soubor audio.php zpracovávající audio výstup * * @param string $handicap * @param string $audio * @return string */ public function getStyle($handicap='handicap.gif',$audio='audio.php') { $prestyle=''; $this->generate(); if ($this->getImageFolder()=='MASK/') { $border="none"; } else { $border="#333 1px solid"; } if ($this->security>4) { $prestyle.="#".$this->random['inputTable']."{border:#333 1px solid;} #".$this->random['inputTable']." td{padding:5px; background-color:#eee;} #".$this->random['inputBoxBoxId']."{float: left;width:".$this->security5['codeWidth']."px;overflow:hidden;height:60px;} #".$this->random['inputBoxId']."{float: left;width:0px;overflow:hidden;height:".$this->security5['codeHeight']."px;display:block;} #".$this->random['inputBoxBoxId'].":hover #".$this->random['inputBoxId']."{width:".$this->security5['codeWidth']."px; margin-top:20px;} #".$this->random['inputId']."{width:".$this->security5['inputWidth']."px;height:20px;border:#333 1px solid;}"; } $prestyle.="#".$this->random['blind']." {position:absolute; top:-500px; left:-500px;} #".$this->random['handicap']."{width:20px; height:20px; margin:0px 2px 0px 2px; border:#333 1px solid; background-image:url('".$handicap."'); overflow:hidden; font-size:0px; padding-left:10px; background-position:50% 50%; cursor:pointer;}"; if ($this->align!='') {$align=' float:'.$this->align;} else {$align='';} $prestyle.="#".$this->random['boxName']."{display:block; border:$border;background-color:#".$this->bg.";position:relative;overflow:hidden;$align}#".$this->random['boxName']." ".join(",#".$this->random['boxName']." ",$this->elements)."{display:block;position:absolute;background-color:#".$this->color.";width:1px;height:1px;border:none;overflow:hidden;}.dchAbsolute{position:absolute;}"; $js="</style><script language=\"javascript\">function ".$this->random['playFunction']."(soundname,str){ var elm='<embed src=\"".$audio."?string='+str+'\" width=\"0\" height=\"0\" autostart=\"true\" name=\"\" id=\"\" enablejavascript=\"true\" type=\"audio/wav\"/>'; if (!document.getElementById(soundname)) {document.getElementById('".$this->random['handicapIdBox']."').innerHTML=elm;} else { var sound = document.getElementById(soundname);try{sound.Stop();sound.Rewind();}catch (e){}try{sound.DoPlay();}catch (e){sound.Play();} } }</script><style>"; return $prestyle.$this->style.$js; } /** * divtcha::getCode() * * Vrátí box s elementy DIV tvořící kód. Pro zobrazení je nutné také vložit styly (metoda getStyle()). * * @return string */ public function getCode() { $this->generate(); $_SESSION['divtcha'][$this->random['input']][0]=$this->codesource; return $this->code; } /** * divtcha::getInput() * * Vrací input type text, který se vkládá do formuláře pro vložení kódu * * @return string */ public function getInput() { $_SESSION['divtchaInputs'][]=$this->random['input']; return '<input type="text" name="'.$this->random['input'].'"/>'; } /** * divtcha::getAlternativeQuestion() * * vrací vygenerovanou logickou, nebo matematickou otázku * * @return string */ public function getAlternativeQuestion() { $_SESSION['divtcha'][$this->random['input']][1]=$this->alternativeAnswer; return $this->alternativeQuestionExport; } /** * divtcha::getAudio() * * Vrací tlačítko, které po kliknutí spustí hláskování kódu (pro nevidomé) * * @return string */ public function getAudio() { return '<input type="button" value="Klikněte pro přehrání kódu" onclick="'.$this->random['playFunction'].'(\''.$this->random['handicapId'].'\',\''.$this->random['input'].'\')" id="'.$this->random['handicap'].'" title="Poslouchejte a napište co slyšíte"><span id="'.$this->random['handicapIdBox'].'"></span>'; } /** * divtcha::getImageFolder() * * Vrací cestu k obrázkům písmen * * @return string */ public function getImageFolder() { return $this->imageFolder.'/'; } /** * divtcha::getCount() * * Vrátí nastavení počtu písmen v kódu * * @return integer */ public function getCount() { return $this->count; } /** * divtcha::getNCount() * * Vrátí nastavení počtu číslic v kódu * * @return integer */ public function getNCount() { return $this->ncount; } /** * divtcha::getBW() * * Vrátí true, pokud je nastaveno pouze dvojbarevné zobrazení * * @return bool */ public function getBW() { return $this->bw; } /** * divtcha::getFont() * * vrací nastavení názvu souboru s fontem * * @return string */ public function getFont() { return $this->font; } /** * divtcha::check() * * Kontroluje, zda byl kód zadán správně. Funguje samostatně a bez nutnosti nastavení. * Nezapomeňte, že se jedná o statickou metodu a volá se tedy divtcha::check(); * * @return bool */ public static function check() { return divtchaS::check(); } /** * divtcha::clear() * * Má za úkol vyčistit paměť kódů. * Používá se po kontrole kódů (pokud je jich více, tak po kontrole posledního) * Kód se po kontrole (v případě úspěšnosti) odstraní sám. Tato metoda tedy čistí pouze nepoužité kódy a pouze jednoho uživatele. * Není tedy přímo nutné její použití. * * @return void */ public static function clear() { divtchaS::clear(); } } ?>
Fighter Anas Private Shell V.1 -
Royal
Battler BD
Copyright © Fighter Anas