Skip to content

Instantly share code, notes, and snippets.

@KrzaQ
Created February 20, 2017 22:39
Show Gist options
  • Save KrzaQ/4cb663fc517ae5f9787d4d90c1989364 to your computer and use it in GitHub Desktop.
Save KrzaQ/4cb663fc517ae5f9787d4d90c1989364 to your computer and use it in GitHub Desktop.
<?
class EyeFucker
{
public $version = '0.4.0.27 b';
public $Settings = array('bold', 'italic', 'strike', 'underline', 'fonttype', 'fontsize', 'coloring','style');
public $Text;
function Charmeleon($input,$nr)
{
switch($nr)
{
case 0: $tablica = array(0 => ':lol:', ':P', ':D', ':)', ':banana:', '^_^', 'B)', ':thumbsup:', ':rofl:'); break;
case 1: $tablica = array(0 => ':mad:', ':angry:',':fume:'); break;
}
$temp.="L";
srand(time());
$max = (rand()%20) + 50;
for ($i=0; $i < $max; $i++)
{
$temp.='O';
}
$temp.="L ".$input;
for ($i = 0; $i < 11; $i++)
{
srand( time() + ( 100 * $i ) );
$temp .= ' ' . $tablica[rand() % count($tablica)];
}
$temp = '[color=red][b] '.$temp.' [/b][/color]';
return $temp;
}
function GetColor() // zwraca HTMLowy kolor, string
{
$Wynik = 0;
switch($this->Settings['coloring'])
{
//default eyefucking
case 0:
{
$Mozliwosci = array(0x0000FF,0x00FF00,0xFF0000,0xFFFF00,0xFF00FF,0x00FFFF);
$Wynik = $Mozliwosci[rand()%sizeof($Mozliwosci)];
} break;
//random light
case 1:
{
$Wynik = ((rand()%153)+103)*0x10000 + ((rand()%153)+103)*0x100 + ((rand()%153)+103);
} break;
// random
case 2:
{
$Wynik = (rand()%0x100)*0x10000 + (rand()%0x100)*0x100 + (rand()%0x100);
} break;
// random dark
case 3:
{
$Wynik = (rand()%0xA0)*0x10000 + (rand()%0xA0)* 0x100 + (rand()%0xA0);
} break;
// d2jsp default skin background
case 4:
{
$Wynik = ((rand()%32)+0xE0)*0x10000 + ((rand()%16)+0xF0)*0x100 +((rand()%16)+0xF0);
} break;
default: $Wynik = 0;
}
$Wynik = dechex($Wynik);
for($i = 0; $i < 6-strlen($Wynik); $i++) $add .= '0';
return $add.$Wynik;
}
function Eyefuck($input)
{
$temp = $input;
if($this->Settings['fontsize'] == -1) $temp = '[size='.(rand()%23).']'.$temp.'[/size]';
if($this->Settings['coloring'] > -1) $temp = '[color=#'.$this->GetColor().']'.$temp.'[/color]';
return $temp;
}
function SoftFuck($input)
{
$in = array('a', 'A', 'b', 'B', 'e', 'E', 'g', 'G', 'i', 'I', 'o', 'O', 's', 'S', 't', 'T', 'z', 'Z');
$out =array('4', '4', '8', '8', '3', '3', '9', '9', '1', '1', '0', '0', '5', '5', '7', '7', '2', '2');
return str_replace($in,$out,$input);
}
function HardFuck($input)
{
$in = array('a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'g', 'G', 'h', 'H', 'i', 'I', 'k', 'K',
'm', 'M', 'n', 'N', 'o', 'O', 's', 'S', 't', 'T', 'u', 'U', 'w', 'W', 'x', 'X', 'z', 'Z');
$out =array('4', '4', '8', '8', '<', '<', '|)', '|)', '3', '3', '9', '9', '|-|', '|-|', '1', '1', '|<', '|<', '/\\/\\', '/\\/\\',
'|\\|', '|\\|', '0', '0', '5', '5', '7', '7', '|_|', '|_|', '\\/\\/', '\\/\\/', '><', '><', '2', '2');
return str_replace($in,$out,$input);
}
function ProcessPreparedText($input)
{
$len = strlen($input);
if(!$len) return '';
switch($this->Settings['style'])
{
case 0:
case 1:
case 2:
{
$costam = '';
for($i = 0; $i < $len; $i++)
{
if ($input[$i]!="\n" && $input[$i] != ' ' && $input[$i]!="\r")
{
$oneChar = '';
if (ord($input[$i]) >= 0xE0)
{
$oneChar = $input[$i].$input[$i+1].$input[$i+2];
$i+=2;
}
else if (ord($input[$i]) >= 0xC0)
{
$oneChar = $input[$i].$input[$i+1];
$i++;
}
else
{
$oneChar = $input[$i];
}
switch($this->Settings['style'])
{
case 0: $oneChar = $this->EyeFuck($oneChar); break;
case 1: $oneChar = $this->SoftFuck($oneChar); break;
case 2: $oneChar = $this->HardFuck($oneChar); break;
}
$costam .= $oneChar;
}
else
{
$costam .= $input[$i];
}
}
} break;
case 3: return $this->Charmeleon($input,0);
case 4: return $this->Charmeleon($input,1);
default:
{
//implementnac style, potem
}
}
if($this->Settings['bold']) $costam = '[b]'.$costam.'[/b]';
if($this->Settings['italic']) $costam = '[i]'.$costam.'[/i]';
if($this->Settings['strike']) $costam = '[s]'.$costam.'[/s]';
if($this->Settings['underline']) $costam = '[u]'.$costam.'[/u]';
if($this->Settings['fontsize'] > 1) $costam = '[size='.$this->Settings['fontsize'].']'.$costam.'[/size]';
switch($this->Settings['fonttype'])
{
case 1: $costam = '[FONT=Arial]'.$costam.'[/FONT]'; break;
case 2: $costam = '[FONT=Times New Roman]'.$costam.'[/FONT]'; break;
case 3: $costam = '[FONT=Courier]'.$costam.'[/FONT]'; break;
case 4: $costam = '[FONT=Impact]'.$costam.'[/FONT]'; break;
}
return $costam;
}
function ProcessText($input)
{
$a = 0;
$b = 0;
$i = 0;
while(($input[$i] == ' ' || $input[$i] == "\r" || $input[$i] == "\d" || $input[$i] == "\n") && $i < strlen($input))
{
$a++;
$i++;
}
if($i < strlen($input)-1)
{
$i = strlen($input)-1;
while(($input[$i] == ' ' || $input[$i] == "\r" || $input[$i] == "\d" || $input[$i] == "\n") && $i > 0)
{
$b++;
$i--;
}
}
//echo "a = $a; b = $b<br>";
return substr($input,0,$a).$this->ProcessPreparedText(substr($input,$a,strlen($input)-$b-$a)).substr($input,strlen($input)-$b,$b);
}
function GetRightPartsProcessed($input)
{
$BBCodes = array('youtube','img','url','quote','size','color','b','i','s','u');
$wynik = stripos($input,'[',$i);
if($wynik !== false)
{
$out = '';
$inCode = false;
$depth = 0;
$lastFound = 0;
$len = strlen($input);
for($i = 0; $i < $len; $i++)
{
$odleglosc = false;
if($depth)
{
if($inCode)
{
$Offset = stripos($input,'[/code]',$i);
if($Offset !== false) $odleglosc = $Offset;
}
else
{
foreach($BBCodes as $chuj)
{
$Offset = stripos($input,'[/'.$chuj.']',$i);
if($Offset !== false && ($odleglosc === false || $Offset < $odleglosc))
{
$odleglosc = $Offset;
}
}
}
}
if(!$inCode)
{
foreach($BBCodes as $chuj)
{
$Offset = stripos($input,'['.$chuj,$i);
if($Offset !== false && ($odleglosc === false || $Offset < $odleglosc))
{
$odleglosc = $Offset;
}
}
}
$Offset = stripos($input,'[code]',$i);
if($Offset !== false && ($odleglosc === false || $Offset < $odleglosc))
{
$inCode = true;
$odleglosc = $Offset;
}
if($odleglosc !== false)
{
if($input[$odleglosc+1] == '/')
{
if($inCode)
{
$guwno = stripos($input,'[/code]',$odleglosc);
//echo "\$inCode = $inCode; \$guwno = $guwno<br>";
if($guwno !== false)
{
$odleglosc = $guwno;
$inCode = false;
}
}
$odleglosc = stripos($input,']',$odleglosc);
//echo "depth-- $lastFound $i $odleglosc <br>";
//echo substr($input, $lastFound,$odleglosc-$lastFound+1)."<br>";
if($depth == 1)
{
$out .= substr($input, $lastFound,$odleglosc-$lastFound+1);
$lastFound = $odleglosc+1;
}
$depth--;
}
else
{
//echo "depth++ $lastFound $i $odleglosc <br>";
//echo substr($input, $lastFound,$odleglosc-$lastFound)."<br>";
if($depth == 0)
{
$out .= $this->ProcessText(substr($input, $lastFound,$odleglosc-$lastFound));
$lastFound = $odleglosc;
}
$depth++;
}
$i = $odleglosc;
}
else
{
//echo "no depth $lastFound,$i,$odleglosc,$len<br>";
//echo substr($input, $lastFound,$len-$lastFound)."<br>";
$out .= $this->ProcessText(substr($input, $lastFound,$len-$lastFound));
$i = $len;
}
//echo "\$i = $i<br>";
//$out .= '_';
}
return $out;
}
else return $this->ProcessText($input);
}
function Unescape($input)
{
$ret = '';
for($i = 0; $i < strlen($input); $i++)
{
if($input[$i] == '\\' && ($input[$i+1] == '"' || $input[$i+1] == '\\' || $input[$i+1] == '\''))
{
$ret .= $input[$i+1];
$i++;
}
else $ret .= $input[$i];
}
return $ret;
}
function parseinput()
{
if(strlen($_POST['dupa']))
{
$this->Settings['bold'] = $_POST['bold'];
$this->Settings['italic'] = $_POST['italic'];
$this->Settings['strike'] = $_POST['strike'];
$this->Settings['underline'] = $_POST['underline'];
$this->Settings['fonttype'] = $_POST['fonttype'];
$this->Settings['fontsize'] = $_POST['fontsize'];
$this->Settings['coloring'] = $_POST['coloring'];
$this->Settings['style'] = $_POST['style']; // not implemented atm
$input = $_POST['dupa'];
$this->Text = $this->Unescape($input);
$this->Text = $this->GetRightPartsProcessed($this->Text);
}
}
function UI()
{
session_start();
if(!isset($_SESSION['nostat']))
{
$_SESSION['nostat'] = true;
$showstat = true;
}
else $showstat = false;
require "../paypal.php";
header('Content-type: text/html; charset=UTF-8');
echo '<html>';
echo '<head>';
echo '<title>Eyefucker '.$this->version.' by KrzaQ</title>';
echo '<link rel="icon" href="fav0.png" type="image/x-icon">';
echo '<link href="http://ef.debil.eu/style.css" type="text/css" rel="stylesheet">';
echo '</head>';
echo '<body>';
echo
'<center><script type="text/javascript"><!--
google_ad_client = "ca-pub-3015457000805352";
/* ef-text */
google_ad_slot = "0557588775";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center><br>'.
'<center>'.
'<table width="75%" cellspacing="0" cellpadding="0">'.
'<tr><td colspan="2">'.
'<fieldset><legend>Eyefucker '.$this->version.' by KrzaQ</legend>'."\n".
'<form action="index.php" method="post">'."\n".
'<p><textarea name="dupa" wrap="virtual" style="width:100%; height:300px;" >'. // color: #333333; font-style: italic; ">'.
$this->Text.
'</textarea></p>'.
'</fieldset>'.
"\n";
echo
'</td></tr>'.
'<tr><td colspan="2">'."\n".
'<fieldset><legend>Settings</legend>'."\n".
'<table><tr><td>'."\n".
'<fieldset><legend>Font color</legend>'."\n".
'<input type="radio" name="coloring" value="0" checked="checked"> eyefucking 0.1'."<br>\n".
'<input type="radio" name="coloring" value="1"> random light '."<br>\n".
'<input type="radio" name="coloring" value="2"> random'."<br>\n".
'<input type="radio" name="coloring" value="3"> random dark'."<br>\n".
'<input type="radio" name="coloring" value="4"> d2jsp background like'."<br>\n".
'<input type="radio" name="coloring" value="-1"> none'."<br>\n".
'</fieldset></td><td>'.
'<fieldset><legend>Font type</legend>'."\n".
'<input type="radio" name="fonttype" value="0" checked="checked"> Verdana (default)'."<br>\n".
'<input type="radio" name="fonttype" value="1" > Arial'."<br>\n".
'<input type="radio" name="fonttype" value="3" > Courier'."<br>\n".
'<input type="radio" name="fonttype" value="4" > Impact'."<br>\n".
'<input type="radio" name="fonttype" value="2" > Times New Roman'."<br>\n".
'</fieldset></td><td>'.
'<fieldset><legend>Font size</legend>'."\n".
'<input type="radio" name="fontsize" value="1" checked="checked" > default'."<br>\n".
'<input type="radio" name="fontsize" value="3" > big'."<br>\n".
'<input type="radio" name="fontsize" value="11" > very big'."<br>\n".
'<input type="radio" name="fontsize" value="22" > huge'."<br>\n".
'<input type="radio" name="fontsize" value="-1" > random'."<br>\n".
'</fieldset></td><td>'.
'<fieldset><legend>Style</legend>'."\n".
'<input type="radio" name="style" value="0" checked="checked"> Normal'."<br>\n".
'<input type="radio" name="style" value="1" >S0ft L337'."<br>\n".
'<input type="radio" name="style" value="2" >|-|4R|) 1337'."<br>\n".
'<input type="radio" name="style" value="3" ><font color="red"><b>Charmeleon >:)</b></font> '."<br>\n".
'<input type="radio" name="style" value="4" ><font color="red"><b>Charmeleon >:(</b></font>'."<br>\n".
'<input disabled="disabled" type="radio" name="style" value="5" ><font color="green"><b>[GuMiS]</b></font> '."<br>\n".
'<input disabled="disabled" type="radio" name="style" value="6" ><font color="green"><b><s>[GuMiS] ver. 2.0</s></b></font>'."<br>\n".
'</fieldset></td><td>'.
'<fieldset><legend>Miscellaneous</legend>'."\n".
'<table width=5% cellspacing="0" cellpadding="0">'.
'<tr><td width=99%>'.
'bold:'.
'</td><td width=1%>'.
'<input type="checkbox" name="bold" value="1" checked="checked" >'."<br>\n".
'<tr><td width=99%>'.
'italic:'.
'</td><td width=1%>'.
'<input type="checkbox" name="italic" value="1" >'."<br>\n".
'<tr><td width=99%>'.
'underline:'.
'</td><td width=1%>'.
'<input type="checkbox" name="underline" value="1" >'."<br>\n".
'<tr><td width=99%>'.
'strike&nbsp;out:'.
'</td><td width=1%>'.
'<input type="checkbox" name="strike" value="1" >'."<br>\n".
'</td></tr></table>'.
'</fieldset>'.
'</td></tr></table>'.
'</fieldset>';
echo '<center>'."\n".
'<table><tr><td valign="top">'.
'<input type="submit" value="convert"></form>'.
'</td><td>'.
$paypalbutton.
'</td></tr></table>'.
'</center>'."\n";
echo
'</td>'.
'</tr>'.
'</table>'.
'</center>'.
'';
echo
'<center>'.
// $paypal.
'<script type="text/javascript"><!--
google_ad_client = "ca-pub-3015457000805352";
/* ef-imgandtext */
google_ad_slot = "5796024382";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>'.
"</center>";
if($showstat == true)
{
echo
'<center><a target=_top href="http://stat.4u.pl/?krzaq69"><img src="http://adstat.4u.pl/s4u.gif" border="0"></a>'.
'<script language="javascript" type="text/javascript">'.
'function s4upl() { return "&amp;r=er";}'.
'</script>'.
'<script language="JavaScript" type="text/javascript" src="http://adstat.4u.pl/s.js?krzaq69"></script>'.
'<script language="JavaScript" type="text/javascript">'.
's4uext=s4upl();'.
"document.write('<img src=\"http://stat.4u.pl/cgi-bin/s.cgi?i=krzaq69'+s4uext+'\" width=1 height1>')".
'</script>'.
'<noscript><img src="http://stat.4u.pl/cgi-bin/s.cgi?i=krzaq69&amp;r=ns" width="1" height="1"></noscript></center>';
}
echo "</center>"
;
echo "</body>";
echo "</html>";
}
function __construct()
{
$this->parseinput();
if(isset($_POST['api']))
{
echo $this->Text;
}
else
{
$this->UI();
}
}
}
$ef = new Eyefucker();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment