'; $maybenone='none'; $moreemojibuttons=''; if (1 == 1 || isset($_GET['debug'])) { $maybenone='block'; $moreemojibuttons=" Last Video📹 Last Animated GIF🖼"; } function server_remote_addr() { global $stfle; $rma = $_SERVER['REMOTE_ADDR']; $ua = strtolower((isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '')); // you can add different browsers with the same way .. if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua)) $rma = '000000'.$rma; elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua)) $rma = '00000'.$rma; elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua)) $rma = '0000'.$rma; elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua)) $rma = '000'.$rma; elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua)) $rma = '00'.$rma; elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua)) $rma = '0'.$rma; return str_replace(":", "_", $rma); } if (isset($_GET['fontlist'])) { $selpop=''; if (!file_exists('/tmp/imfl.txt')) { exec('convert -list font > /tmp/imfl.txt'); } $fcont=file_get_contents('/tmp/imfl.txt'); if (strpos($fcont, 'family: ') !== false) { $fcs=explode('family: ', $fcont); for ($iuy=1; $iuy' . explode("\n", $fcs[$iuy])[0] . '<') === false) { $selpop.="\n selo.innerHTML+=''; \n"; } } if ($selpop != '') { echo " 0) { var selo=selos[eval(-1 + selos.length)]; " . $selpop . " selo.style.display='inline-block'; selo.style.backgroundColor='#f0f0f0'; } \">"; } } exit; } else if (isset($_POST['text'])) { $perlemoji=''; $emojilabbit="@- "; // vs perl $iex='png'; $fnt='Courier'; $wdt='800'; $hgt='800'; $psiz='36'; $fcol='black'; $bcol='white'; if (isset($_POST['ext'])) { $iex=str_replace('+',' ',urldecode($_POST['ext'])); } if (isset($_POST['ffam'])) { $fnt=str_replace('+',' ',urldecode($_POST['ffam'])); } if (isset($_POST['width'])) { $pwdt=str_replace('+',' ',urldecode($_POST['width'])); } if (isset($_POST['height'])) { $hgt=str_replace('+',' ',urldecode($_POST['height'])); } if (isset($_POST['ptsize'])) { $psiz=str_replace('+',' ',urldecode($_POST['ptsize'])); } if (isset($_POST['fcol'])) { $fcol=str_replace('+',' ',urldecode($_POST['fcol'])); } if (isset($_POST['bcol'])) { $bcol=str_replace('+',' ',urldecode($_POST['bcol'])); } $slidename='/tmp/imagerequest_' . server_remote_addr() . '-0.' . $iex; file_put_contents('/tmp/imagerequest_' . server_remote_addr() . '-0.txt', str_replace('+',' ',urldecode($_POST['text']))); file_put_contents('/tmp/maybeemojisP.txt', htmlspecialchars(str_replace('+',' ',urldecode($_POST['text'])), ENT_COMPAT,'UTF-8', true)); // yes no &#129684; if (strpos(str_replace('+',' ',urldecode($_POST['text'])), '&#') !== false || strpos(str_replace('+',' ',urldecode($_POST['text'])), '&#') !== false) { // thanks to https://usage.imagemagick.org/text/#unicode $outsofar=''; // '\x{201C}Unicode \x{2018}\x{263A}\x{2019} Please\x{201D}' if (strpos(str_replace('+',' ',urldecode($_POST['text'])), '&#') !== false) { $outs=explode('&#', str_replace('+',' ',urldecode($_POST['text']))); $outsofar=$outs[0]; for ($ivx=1; $ivx 0) { var imgsis=new Image(); imgsis.onload=function(event){ var canvasis=cnvs[0]; var cntxis=canvasis.getContext('2d'); cntxis.drawImage(event.target, 0, 0); }; imgsis.src='data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "'; } else { var imgs=parent.document.getElementsByTagName('img'); if (eval('' + imgs.length) > 0) { imgs[0].src='data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "'; } else if (document.body.innerHTML == '') { document.body.innerHTML=''; } else { document.body.innerHTML+='
'; } } } else if (document.body.innerHTML == '') { document.body.innerHTML=''; } else { document.body.innerHTML+='
'; } \">"; unlink('/tmp/imagerequest_' . server_remote_addr() . '-0.txt'); try { unlink($slidename); } catch(Exception $esdw) { } } exit; } else if (isset($_GET['text'])) { $perlemoji=''; $emojilabbit="@- "; // vs perl $iex='png'; $fnt='Courier'; $wdt='800'; $hgt='800'; $psiz='36'; $fcol='black'; $bcol='white'; if (isset($_GET['ext'])) { $iex=str_replace('+',' ',urldecode($_GET['ext'])); } if (isset($_GET['ffam'])) { $fnt=str_replace('+',' ',urldecode($_GET['ffam'])); } if (isset($_GET['width'])) { $pwdt=str_replace('+',' ',urldecode($_GET['width'])); } if (isset($_GET['height'])) { $hgt=str_replace('+',' ',urldecode($_GET['height'])); } if (isset($_GET['ptsize'])) { $psiz=str_replace('+',' ',urldecode($_GET['ptsize'])); } if (isset($_GET['fcol'])) { $fcol=str_replace('+',' ',urldecode($_GET['fcol'])); } if (isset($_GET['bcol'])) { $bcol=str_replace('+',' ',urldecode($_GET['bcol'])); } $slidename='/tmp/imagerequest_' . server_remote_addr() . '-0.' . $iex; file_put_contents('/tmp/imagerequest_' . server_remote_addr() . '-0.txt', str_replace('+',' ',urldecode($_GET['text']))); file_put_contents('/tmp/maybeemojisG.txt', htmlspecialchars(str_replace('+',' ',urldecode($_GET['text'])), ENT_COMPAT,'UTF-8', true)); // yes no &#129684; if (strpos(str_replace('+',' ',urldecode($_GET['text'])), '&#') !== false || strpos(str_replace('+',' ',urldecode($_GET['text'])), '&#') !== false) { // thanks to https://usage.imagemagick.org/text/#unicode $outsofar=''; // '\x{201C}Unicode \x{2018}\x{263A}\x{2019} Please\x{201D}' if (strpos(str_replace('+',' ',urldecode($_GET['text'])), '&#') !== false) { $outs=explode('&#', str_replace('+',' ',urldecode($_GET['text']))); $outsofar=$outs[0]; for ($ivx=1; $ivx 0) { var imgsis=new Image(); imgsis.onload=function(event){ var canvasis=cnvs[0]; var cntxis=canvasis.getContext('2d'); cntxis.drawImage(event.target, 0, 0); }; imgsis.src='data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "'; } else { var imgs=parent.document.getElementsByTagName('img'); if (eval('' + imgs.length) > 0) { imgs[0].src='data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "'; } else if (document.body.innerHTML == '') { document.body.innerHTML=''; } else { document.body.innerHTML+='
'; } } } else if (document.body.innerHTML == '') { document.body.innerHTML=''; } else { document.body.innerHTML+='
'; } \">"; unlink('/tmp/imagerequest_' . server_remote_addr() . '-0.txt'); try { unlink($slidename); } catch(Exception $esdw) { } } exit; } else if (isset($_GET['getvideo'])) { $lenv='1'; if (isset($_GET['len'])) { $lenv=$_GET['len']; } if ($_GET['getvideo'] == '1' && $lenv == '0') { echo "'; } else if (parent.document.getElementById('mysource')) { parent.document.getElementById('mysource').src='data:video/mp4;base64," . base64_encode(file_get_contents('/tmp/video' . server_remote_addr() . '.mp4')) . "'; } else { parent.document.getElementById('divmedia').innerHTML+='

Video version below ... Back to top ...


'; } setTimeout(function(){ parent.document.getElementById('pvd').scrollIntoView(); }, 2000); \">"; } else { if (file_exists('/tmp/video' . server_remote_addr() . '.mp4')) { unlink('/tmp/video' . server_remote_addr() . '.mp4'); } exec('ffmpeg -framerate 2 -i /tmp/slide_' . server_remote_addr() . '-%03d.png -vcodec libx264 -crf 22 /tmp/video' . server_remote_addr() . '.mp4'); echo "'; } else if (parent.document.getElementById('mysource')) { parent.document.getElementById('mysource').src='data:video/mp4;base64," . base64_encode(file_get_contents('/tmp/video' . server_remote_addr() . '.mp4')) . "'; } else { parent.document.getElementById('divmedia').innerHTML+='

Video version below ... Back to top ...


'; } setTimeout(function(){ parent.document.getElementById('pvd').scrollIntoView(); }, 2000); \">"; } exit; } else if (isset($_GET['getagif'])) { $lenv='1'; if (isset($_GET['len'])) { $lenv=$_GET['len']; } if ($_GET['getvideo'] == '1' && $lenv == '0') { echo "'; } setTimeout(function(){ parent.document.getElementById('pag').scrollIntoView(); }, 2000); \">"; } else { if (file_exists('/tmp/agif' . server_remote_addr() . '.gif')) { unlink('/tmp/agif' . server_remote_addr() . '.gif'); } exec('ffmpeg -framerate 2 -i /tmp/slide_' . server_remote_addr() . '-%03d.png /tmp/agif' . server_remote_addr() . '.gif'); echo "'; } setTimeout(function(){ parent.document.getElementById('pag').scrollIntoView(); }, 2000); \">"; } exit; } else if (isset($_GET['inwords'])) { if (isset($_GET['curc'])) { if ($_GET['curc'] == '1') { foreach (glob('/tmp/slide_' . server_remote_addr() . '-*.png') as $ifil) { unlink($ifil); } } $slidename='/tmp/slide_' . server_remote_addr() . '-' . substr(('000' . $_GET['curc']),-3,3) . '.png'; if ($_GET['curc'] != '1') { $tabbit=" if (window.parent) { if (parent.document.getElementById('trtdtd" . $_GET['curc'] . "')) { parent.appendthenfill(); } } "; } else { $tabbit=''; } } else { $tabbit=''; } if (isset($_GET['chr'])) { $suff=' -c "' . str_replace('+',' ',urldecode($_GET['chr'])) . '" '; } if (!file_exists('/tmp/cowsay.wds')) { $serious=true; file_put_contents('/tmp/cowsay.wds', $_GET['inwords']); } else if (substr(file_get_contents('/tmp/cowsay.wds'),0,strlen($_GET['inwords'])) == $_GET['inwords']) { $serious=false; } else { $serious=true; file_put_contents('/tmp/cowsay.wds', $_POST['inwords']); } if (isset($_GET['and']) && file_exists('/tmp/cowsay.txt')) { if (isset($_GET['outdrawing'])) { file_put_contents('/tmp/cowsay.txt', str_replace('+',' ',urldecode($_GET['outdrawing']))); } if (file_exists('/tmp/cowsaytwo.txt')) { unlink('/tmp/cowsaytwo.txt'); } if (file_exists('/tmp/cowsaythree.txt')) { unlink('/tmp/cowsaythree.txt'); } if (file_exists('/tmp/cowsayzero.txt')) { unlink('/tmp/cowsayzero.txt'); } exec("awk '{print length}' /tmp/cowsay.txt |sort -nr|head -1 | sed 's/[^0-9]//g' > /tmp/cowsayzn.txt"); if (isset($_GET['maxl'])) { exec("cat /tmp/cowsay.txt | sed 's/ /:/g' | awk '{printf \"%-" . $_GET['maxl'] . "s\n\", $1}' | sed 's/:/ /g' > /tmp/cowsayzero.txt"); } else { exec("cat /tmp/cowsay.txt | sed 's/ /:/g' | awk '{printf \"%-`cat /tmp/cowsayzn.txt | sed 's/[^0-9]//g'`s\n\", $1}' | sed 's/:/ /g' > /tmp/cowsayzero.txt"); } exec("cat /tmp/cowsayzero.txt | head -1 | sed 's/[^\ ]/\ /g' > /tmp/cowsaynone.txt"); for ($i=0; $i<=100; $i++) { exec("cat /tmp/cowsaynone.txt >> /tmp/cowsayzero.txt"); } if ($serious) { $three='three'; exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_GET['inwords'])) . '" > /tmp/cowsaytwo.txt ; pr -m -t -w 500 /tmp/cowsayzero.txt /tmp/cowsaytwo.txt > /tmp/cowsaythree.txt'); // ; cp -f /tmp/cowsaythree.txt /tmp/cowsay.txt'); if ($slidename != '') { if (strpos(file_get_contents('/tmp/cowsaytwo.txt'), "\\") !== false) { //exec('convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/ \\\\/s// \\\\\\\\/g')" . '" ' . $slidename); exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename); } else { exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename); } } if ($tabbit != '') { $tabbit=str_replace('()', "('" . urlencode(file_get_contents('/tmp/cowsaytwo.txt')) . "')", $tabbit); } } else { exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_GET['inwords'])) . '" > /tmp/cowsaytwo.txt ; pr -m -t -w 500 /tmp/cowsayzero.txt /tmp/cowsaytwo.txt > /tmp/cowsaythree.txt'); if ($slidename != '') { if (strpos(file_get_contents('/tmp/cowsaytwo.txt'), "\\") !== false) { //exec('convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/ \\\\/s// \\\\\\\\/g')" . '" ' . $slidename); exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename); } else { exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename); } } if ($tabbit != '') { $tabbit=str_replace('()', "('" . urlencode(file_get_contents('/tmp/cowsaytwo.txt')) . "')", $tabbit); } } //if (file_exists('/tmp/cowsaytwo.txt')) { unlink('/tmp/cowsaytwo.txt'); } echo "Cow Says ... thanks to https://pypi.org/project/cowsay"; } else { exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_GET['inwords'])) . '" > /tmp/cowsay.txt'); if ($slidename != '') { if (strpos(file_get_contents('/tmp/cowsay.txt'), "\\") !== false) { exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename); } else { exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename); } } echo "Cow Says ... thanks to https://pypi.org/project/cowsay"; } exit; } else if (isset($_POST['inwords'])) { if (isset($_POST['curc'])) { if ($_POST['curc'] == '1') { foreach (glob('/tmp/slide_' . server_remote_addr() . '-*.png') as $ifil) { unlink($ifil); } } $slidename='/tmp/slide_' . server_remote_addr() . '-' . substr(('000' . $_POST['curc']),-3,3) . '.png'; if ($_POST['curc'] != '1') { $tabbit=" if (window.parent) { if (parent.document.getElementById('trtdtd" . $_POST['curc'] . "')) { parent.appendthenfill(); } } "; } else { $tabbit=''; } } else { $tabbit=''; } if (isset($_POST['chr'])) { $suff=' -c "' . str_replace('+',' ',urldecode($_POST['chr'])) . '" '; } if (!file_exists('/tmp/cowsay.wds')) { $serious=true; file_put_contents('/tmp/cowsay.wds', $_POST['inwords']); } else if (substr(file_get_contents('/tmp/cowsay.wds'),0,strlen($_POST['inwords'])) == $_POST['inwords']) { $serious=false; } else { $serious=true; file_put_contents('/tmp/cowsay.wds', $_POST['inwords']); } if (isset($_POST['and']) && file_exists('/tmp/cowsay.txt')) { if (isset($_POST['outdrawing'])) { file_put_contents('/tmp/cowsay.txt', str_replace('+',' ',urldecode($_POST['outdrawing']))); } if (file_exists('/tmp/cowsaytwo.txt')) { unlink('/tmp/cowsaytwo.txt'); } if (file_exists('/tmp/cowsaythree.txt')) { unlink('/tmp/cowsaythree.txt'); } if (file_exists('/tmp/cowsayzero.txt')) { unlink('/tmp/cowsayzero.txt'); } exec("awk '{print length}' /tmp/cowsay.txt |sort -nr|head -1 | sed 's/[^0-9]//g' > /tmp/cowsayzn.txt"); if (isset($_POST['maxl'])) { exec("cat /tmp/cowsay.txt | sed 's/ /:/g' | awk '{printf \"%-" . $_POST['maxl'] . "s\n\", $1}' | sed 's/:/ /g' > /tmp/cowsayzero.txt"); } else { exec("cat /tmp/cowsay.txt | sed 's/ /:/g' | awk '{printf \"%-`cat /tmp/cowsayzn.txt | sed 's/[^0-9]//g'`s\n\", $1}' | sed 's/:/ /g' > /tmp/cowsayzero.txt"); } exec("cat /tmp/cowsayzero.txt | head -1 | sed 's/[^\ ]/\ /g' > /tmp/cowsaynone.txt"); for ($i=0; $i<=100; $i++) { exec("cat /tmp/cowsaynone.txt >> /tmp/cowsayzero.txt"); } if ($serious) { $three='three'; exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_POST['inwords'])) . '" > /tmp/cowsaytwo.txt ; pr -m -t -w 500 /tmp/cowsayzero.txt /tmp/cowsaytwo.txt > /tmp/cowsaythree.txt'); // ; cp -f /tmp/cowsaythree.txt /tmp/cowsay.txt'); if ($slidename != '') { if (strpos(file_get_contents('/tmp/cowsaytwo.txt'), "\\") !== false) { //exec('convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/ \\\\/s// \\\\\\\\/g')" . '" ' . $slidename); exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename); } else { exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename); } } if ($tabbit != '') { $tabbit=str_replace('()', "('" . urlencode(file_get_contents('/tmp/cowsaytwo.txt')) . "')", $tabbit); } } else { exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_POST['inwords'])) . '" > /tmp/cowsaytwo.txt ; pr -m -t -w 500 /tmp/cowsayzero.txt /tmp/cowsaytwo.txt > /tmp/cowsaythree.txt'); if ($slidename != '') { if (strpos(file_get_contents('/tmp/cowsaytwo.txt'), "\\") !== false) { //exec('convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/ \\\\/s// \\\\\\\\/g')" . '" ' . $slidename); exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename); } else { exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename); } } if ($tabbit != '') { $tabbit=str_replace('()', "('" . urlencode(file_get_contents('/tmp/cowsaytwo.txt')) . "')", $tabbit); } } //if (file_exists('/tmp/cowsaytwo.txt')) { unlink('/tmp/cowsaytwo.txt'); } echo "Cow Says ... thanks to https://pypi.org/project/cowsay"; } else { exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_POST['inwords'])) . '" > /tmp/cowsay.txt'); if ($slidename != '') { if (strpos(file_get_contents('/tmp/cowsay.txt'), "\\") !== false) { exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename); } else { exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename); } } echo "Cow Says ... thanks to https://pypi.org/project/cowsay"; } exit; } echo "Cow Says ... thanks to https://pypi.org/project/cowsay

Cow Says ...

RJM Programming - February, 2025 - Cartoon💬    " . $moreemojibuttons . "

Thanks to https://pypi.org/project/cowsay/

\"\"  🗨 

  



" . $celltemplate . "
"; ?>