Inhouse Slideshow AlmaLinux Tutorial

Inhouse Slideshow AlmaLinux Tutorial

Inhouse Slideshow AlmaLinux Tutorial

Today we wanted to add so much more to our blog posting title. But, then, we also didn’t want to give the game away?! What a dilemma.

That blog posting title mentions …

  • AlmaLinux … as RJM Programming’s Apache/PHP/MySql web server “brand”, using …
  • PHP 8 … as distinct from the PHP 5’s of the CentOS web server days … and so we suppose we should expect issues like the dreaded …
  • Deprecation … of …
  • Zip … functionality … so sad seeing the early symptoms of this with …
  • Inhouse Slideshow presentations … (as last talked about with Inhouse Slideshow Backup Tidy Up Crontab Curl PHP Tutorial) deprecation warnings

Surprising to us, trying to logically walk though a solution, currently up at our AlmaLinux web server here the PHP …


function_exists

… approach we have used successfully recently did not work here. Anyway, deprecated or non-existant it doesn’t matter, we decided to resort to good ol’ PHP exec methodologies in a new “inhouse slideshow” (featuring in a changed example PHP inhouse slideshow creator web application) call …

<?php

include($_SERVER['DOCUMENT_ROOT'] . "/ziphelper.php");

?>

… containing …


<?php
// ziphelper.php
// RJM Programming
// February, 2025

$gzip_read_output=null;
$gzip_open_handle=null;
$gzip_entry_filename='';
$gzip_filename='';
$gzip_entry_len=0;
$gzip_number=0;
$gzip_log_text='';
if (strpos($_SERVER['REQUEST_URI'], 'index.') !== false) {
$hereis='' . dirname(__FILE__) . explode("index.", $_SERVER['REQUEST_URI'])[0];
} else if (basename($_SERVER['SCRIPT_FILENAME']) != '') {
$hereis=explode(basename($_SERVER['SCRIPT_FILENAME']), realpath($_SERVER['SCRIPT_FILENAME']))[0];
} else {
$hereis='' . dirname(__FILE__) . str_replace('//','/',explode("?", $_SERVER['REQUEST_URI'])[0] . '/');
}
$zipisis='' . $hereis . 'slideshow_0.zip';
$alreadythere=false;

if (file_exists($zipisis)) {
$items = glob($hereis . "*[-_][0-9]*of.[jJgGpP][pPiInN]*");
foreach ($items as $key => $val) {
$alreadythere=true;
}
}

if (!function_exists("zip_entry_read")) {
function zip_entry_read($zip_read_output, $zip_entry_len) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output, $gzip_entry_len;
return 'pork';
}
}

if (!function_exists("zip_entry_filesize")) {
function zip_entry_filesize($zip_read_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_entry_filename;
return 'pork';
}
}

if (!function_exists("zip_read")) {
function zip_read($zip_oben_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}

if (!function_exists("zip_open")) {
function zip_open($zip_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_filename;
$gzip_filename=$zip_filename;
$gzip_number=0;
$gzip_open_handle='pork';
return 'pork';
}
}

if (!function_exists("zip_entry_name")) {
function zip_entry_name($zip_read_output) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output;
return 'pork';
}
}

if (!function_exists("zip_entry_open")) {
function zip_entry_open($zip_open_handle, $zip_read_output, $inmode) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle, $gzip_read_output;
return 'pork';
}
}

if (!function_exists("zip_close")) {
function zip_close($zip_open_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}

if (file_exists($zipisis)) {
if (!$alreadythere) {
file_put_contents($hereis . 'please.wait', "cd " . $hereis . ' ; unzip ' . $zipisis);
sleep(2);
exec("cd " . $hereis . ' ; unzip ' . $zipisis);
sleep(2);
unlink($hereis . 'please.wait');
//exec("cd " . $hereis . ' ; rm -f please.wait');
//if (1 == 1) {
//header('Location: ' . explode('?',$_SERVER['REQUEST_URI'])[0] . '?rand=' . rand(0,674532));
//exit;
//} else {
//sleep(60);
//exec("cd " . $hereis . ' ; rm -f ' . $hereis . '*[-_][0-9]*of.[jJgGpP][pPiInN]*');
//}
//if (basename($_SERVER['SCRIPT_FILENAME']) == 'index.php') {
//sleep(60);
//exec("cd " . $hereis . ' ; rm -f ' . $hereis . '*[-_][0-9]*of.[jJgGpP][pPiInN]*');
//}
//sleep(9);
//echo '<html><body onload="location.href=' . "'" . explode("?", $_SERVER['REQUEST_URI'])[0] . '?rand=' . rand(0,5645342) . "';\"></body></html>";
//exit;
} //else if (basename($_SERVER['SCRIPT_FILENAME']) == 'index.php') {
//sleep(60);
//exec("cd " . $hereis . ' ; rm -f ' . $hereis . '*[-_][0-9]*of.[jJgGpP][pPiInN]*');
//}
}
?>

… as a first draft. We have much more to do trying to resurrect, if possible, some other inhouse PHP web applications we’ve based on the use of Zip in PHP. Pardon us, until tomorrow, while we have a little cry.


Previous relevant Inhouse Slideshow Backup Tidy Up Crontab Curl PHP Tutorial is shown below.

Inhouse Slideshow Backup Tidy Up Crontab Curl PHP Tutorial

Inhouse Slideshow Backup Tidy Up Crontab Curl PHP Tutorial

Crontab is that great scheduling tool that we make use of, a lot, on our RJM Programming Linux CentOS web server. But it’s not only …

  • the timing … of a procedure that is so good about crontab … it is, also, for us, it’s teaming with …
  • curl

… that means we can back up a “peer based” solution such as talked about with Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial (ie. done as a user is surfing the net with some PHP of ours) methodology should it fail. We think we have an occasionally failing one as far as the tidy up of zipped up inhouse slideshows goes. It could be to do with a search engine crawling operation, we have not found out for sure, but we’ve decided to write our own …

  • PHP … via …
  • crontab
  • curl

… based independent tidying up procedure we’ll run once an hour via crontab record …


*/53 * * * curl http://www.rjmprogramming.com.au/slideshow_zero.php

… arrangement. We realize the contents of this PHP procedure may bore some, but interest a few, and so here is what it amounted to …

<?php

// slideshow_zero.php
// Zip and Unzip Tidy Up
// RJM Programming
// Decemeber, 2022
set_time_limit(3600);

if (file_exists("slideshow_zero.txt")) {
unlink("slideshow_zero.txt");
}

if (file_exists("slideshow_zero.kkk")) {
unlink("slideshow_zero.kkk");
}

exec("find " . dirname(__FILE__) . DIRECTORY_SEPARATOR . " -name 'slideshow_0.zip' 2> /dev/null > " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txt");

$lines=file(dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txt");

$htmlis="<html><body><textarea>
</textarea></body></html>";

for ($i=0; $i<sizeof($lines); $i++) {
$lines[$i]=explode("\n", $lines[$i])[0];
if (file_exists(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) {
if (('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) == '38794') {
if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}
exec("unzip -l " . $lines[$i] . " | grep '.jpg' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | cut -f4 -d' ' | grep '-' > " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
if (file_exists("slideshow_zero.txx")) {
$sublines=file(dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
for ($j=0; $j<sizeof($sublines); $j++) {
$sublines[$j]=explode(" ", explode("\n", $sublines[$j])[0])[0];
$fis=explode("slideshow_0.zip", $lines[$i])[0] . $sublines[$j];
if (file_exists($fis)) {
$md=filemtime($fis);
if ($md) {
if ((time() - $md) > 1200) {
if (file_exists("slideshow_zero.kkk")) {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "rm -f " . $fis . "\n");
} else {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", "rm -f " . $fis . "\n");
}
}
}
}
}
}
} else if (1 == 3) {
if (file_exists("slideshow_zero.kkk")) {
file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
} else {
file_put_contents("slideshow_zero.kkk", "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
}
}
}
}

if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}

if (file_exists("slideshow_zero.txt")) {
unlink("slideshow_zero.txt");
}

if (file_exists("slideshow_zero.kkk")) {
unlink("slideshow_zero.kkk");
}

//echo $htmlis;
exit;

?>

… as that “ahhhhhhhh, what a relief” reliever of tension running the RJM Programming website. The subtext is, our inode limits are a concern!

We think another lesson here is that PHP can be a good alternative to scripting languages such as Korn Shell to create “operational” procedures, especially when you consider that curl means it can be like writing your “surfing the net” type of PHP (slideshow_zero.php) work.


Previous relevant Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial is shown below.

Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial

Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial

The thing about yesterday’s Inhouse Slideshow Backup Tidy Up Report Tutorial is that …

  • it creates useful report content … but …
  • it is information we do not want everyone to be able to see (easily, shall we say) … and in the sense that …
  • the report is stored away from RJM Programming’s “public_html” folder (ie. its Apache/PHP/MySql “Document Root”) is good … but even with today’s work …
  • hidden from everybody who does not have access to the RJM Programming’s web server … but …
  • the administrator of the RJM Programming’s web server (yoo hoo!) wants a mechanism to view the report that does not involve some “arcane procedure” each time to view it

… and so we decided that because …


the administrator of the RJM Programming's web server = the administrator of this blog

… we’d like to organize a system that latches onto that “security footing” and only show a “broom emoji button” (🧹 &#129529;) way to access the report when the administrator of this blog is logged in. We can do this by amending our Twenty Ten theme’s good ol’ header.php as per (where the “function mlater” you may recall from the days of WordPress Blog Email Post Collaboration Ajax Image Tutorial) …

<?php

$fns="36";

function doisr() {
global $fns;
$inmb="";
if (('' . get_current_user_id()) != '0' && ('' . get_current_user_id()) == '1') {
if (file_exists('/tmp/slideshow_cleanup.txt')) {
$fns="24";
$inmb="<a style=font-size:24px; title='Inhouse Slideshow Tidy Up Report' onclick=\"var iswo=window.open('','_blank','top=100,left=100,height=600,width=730'); iswo.document.write('<html><head><title>Inhouse Slideshow Tidy Up Report</title></head><body><pre>" . str_replace("\n","<br>",file_get_contents('/tmp/slideshow_cleanup.txt')) . "</pre></body></html>'); \">&#129529;</a> ";
}
}
return str_replace("'","' + String.fromCharCode(39) + '",$inmb);
}


?>

… PHP affects some (PHP writes) Javascript below …

<?php

function mlater() {
if (1 == 1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i)) {
if (dbihis == '') { dbihis=document.body.innerHTML; }
var xstih=document.getElementById('site-title').innerHTML;
if (xstih.indexOf("up" + "top") == -1) {
document.getElementById('site-title').innerHTML+='<?php echo doisr(); ?>' + '<a id="avs" style="text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" href=# onmouseover="getVisualSynopsis(event);" onmouseout="yehbut();" ontouchstart="getVisualSynopsis(event);" ontouchend="yehbut();" onclick=" uptop(); " title="... you can wait for the long hover functionality about Visual Synopsis (Slideshows)">&#127910;</a> <a style="cursor:pointer;text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" onclick="diffphpfix(this);" title="Code Difference Functional Links">&#128214;</a> <a style="cursor:pointer;text-decoration:none;font-size:36px;" onclick="popselid();" title="Filter Content via Div ID">&#10135;</a> <a style="cursor:pointer;text-decoration:none;visibility:hidden;font-size:<?php global $fns; echo $fns; ?>px;" title="Blog post contents reduced to summary" id="eds" onclick="pre_details_summary();">&#10134;</a>' + printscreen(0);
if (document.URL.indexOf("visualsynopsis=") != -1) document.getElementById('avs').click();
}
}
}

?>


Previous relevant Inhouse Slideshow Backup Tidy Up Report Tutorial is shown below.

Inhouse Slideshow Backup Tidy Up Report Tutorial

Inhouse Slideshow Backup Tidy Up Report Tutorial

Yesterday’s Inhouse Slideshow Backup Tidy Up Tutorial presented a …

  • non-automated
  • user instigated
  • snapshot

… Inhouse Slideshow “tidying up” PHP web application. This web application is like a …

  • procedure … that a …
  • system operator

… might be interested in using. But not many “system operators” would continue putting up with such a modus operandi. We can improve by …

  • allowing any of …
    1. surfing the net
    2. curl
    3. command line

    … modes of use … allowing …

  • crontab scheduling via …

    */49 * * * * ksh -c "curl HTTP://www.rjmprogramming.com.au/slideshow_cleanup.php?all=all"

    … to allow for a …
  • scheduled report available … and make sure we …
  • disallow overlapping execution runs

… with our changed slideshow_cleanup.php “Inhouse Slideshow” unzipped image “tidyer upperer“.


Previous relevant Inhouse Slideshow Backup Tidy Up Tutorial is shown below.

Inhouse Slideshow Backup Tidy Up Tutorial

Inhouse Slideshow Backup Tidy Up Tutorial

There are two aspects to diskspace maintainence up at the web server for RJM Programming.

  • df -k /
  • df -i /
# diskspace
# inode count

… and it is often that inode count we are concerned about, and looking out for ways to reduce the number of files we create on the web server.

The Inhouse Slideshow ways of Inhouse Slideshow Mobile Google Crawl Tutorial

  • use zip files to “scrunch up” a series of image files into the one zip file … for the vast majority of time … but when asked to, by a user …
  • unzip the image files when required by a user wanting to see them … and then …
  • tidy up, after some delay in time

… but we want to design a PHP way to independently tidy up as a backup mechanism. And we say, with PHP code, that if such files have been on the web server longer than ten minutes, this PHP callable slideshow_cleanup.php code …

<?php

// slideshow_cleanup.php
// RJM Programming
// May, 2022

$cdis=dirname(__FILE__) . DIRECTORY_SEPARATOR;
exec("cd " . $cdis . "; find . -name 'slideshow_0.zip' 2> /dev/null > /tmp/slideshow_cleanup.txt");


$lines = file('/tmp/slideshow_cleanup.txt');
date_default_timezone_set('Australia/Perth');

foreach ($lines as $line_num => $line) {
$ji=0;
if (substr($line,0,1) == '.') { $ji=2; }
$thisdir=explode('slideshow_0.zip', $line)[0];
$uzc=shell_exec("unzip -l " . $cdis . substr($line, $ji));
foreach (glob($thisdir . '*-[0-9]*of.[jJpPgG][pPnNiI]*') as $zipmember) {
$ij=0;
if (substr($zipmember,0,1) == '.') { $ij=2; }
$thisfile=$cdis . substr($zipmember, $ij);
if (strpos($uzc, (' ' . explode(DIRECTORY_SEPARATOR, substr($zipmember, $ij))[-1 + sizeof(explode(DIRECTORY_SEPARATOR, substr($zipmember, $ij)))]) ) !== false) {
if ((time() - filectime($thisfile)) > 600) { // more than 10 minutes old
unlink($thisfile); //echo "analyze " . $thisfile . " " . (time() - filectime($thisfile)) . ' seconds ago ' . "\n";
}
}
}
foreach (glob($thisdir . '*-[0-9]{[0-9]*}.[jJpPgG][pPnNiI]*') as $zipmember) {
$ij=0;
if (substr($zipmember,0,1) == '.') { $ij=2; }
$thisfile=$cdis . substr($zipmember, $ij);
if (strpos($uzc, (' ' . explode(DIRECTORY_SEPARATOR, substr($zipmember, $ij))[-1 + sizeof(explode(DIRECTORY_SEPARATOR, substr($zipmember, $ij)))]) ) !== false) {
if ((time() - filectime($thisfile)) > 600) {
unlink($thisfile); //echo "Analyze " . $thisfile . " " . (time() - filectime($thisfile)) . ' seconds ago ' . "\n";
}
}
}
}


?>

… should do its thaing!


Previous relevant Inhouse Slideshow Mobile Google Crawl Tutorial is shown below.

Inhouse Slideshow Mobile Google Crawl Tutorial

Inhouse Slideshow Mobile Google Crawl Tutorial

The recent Inhouse Slideshow Mobile Tutorial did not satisfy all the “mobile usability” tests performed by the “Google Crawl” algorithm, failing on “Content wider than screen”, and you can read some background to this with Google Crawl Viewport Geographicals Tutorial. And so we try some refinements here today, with an idea to control on mobile platforms the max-width CSS property of the document.body of a Inhouse Slideshow webpage, which made up the URLs failing this test at the Google Search Console.

We were reading this great and useful link, thanks, and decided to see whether this stopping of scrolling in X on mobile platform versions of the Inhouse Slideshow webpages gels better with Google Search Console “Google Crawl” Mobility Usability algorithms.

Yet again, deployment of these changes is similar to that last time, and the times before that, as per …

Unit testing completed, the deployment, again, matches those ideas of the recent PDF Slideshow and Form Creation Helper Slideshow Tutorial … in that …

Here are changes we’ll be testing up at Google …


<head>
<script type='text/javascript'>
// Other Javascript code here ...
//
//
// Of relevance today bold below ...

function blater() {
var tdsare=document.getElementsByTagName('td');
var rectg=tdsare[2].getBoundingClientRect(); //document.getElementById('i0').getBoundingClientRect();
tdsare[2].style.borderRight='2px solid white';
document.body.style.backgroundImage="URL('" + document.getElementById('i0').src + "')";
var rl=eval('' + rectg.left);
rl+=eval('' + rectg.width);
rl+=10;
document.body.style.backgroundPosition=" " + rl + "px " + Math.floor(rectg.top) + "px";
document.body.style.backgroundRepeat="no-repeat";
document.body.style.backgroundClip="content-box";
}



function zoom_maybe() {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//document.getElementById('rfs').innerHTML='<style> html { zoom: .5; } </style>';
document.getElementById('rfs').innerHTML='<style> html { zoom: 0.4; body { max-width: 100%; max-height: 80vh; } table { max-width: <?php if (strpos($_SERVER['QUERY_STRING'],'exif=') !== false) { echo "100"; } else { echo "95"; } ?>%; max-height: 80vh; margin: auto; overflow-x: hidden; } </style>';
}
}


function nwpdf(iithis) {
if (('' + iithis.src).length > 0) {
if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) {
window.open(iithis.src,'_blank');
}
}
}


function mytw() {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.body.style.width='' + (window.orientation == 0 ? Math.floor(eval(2.5 * window.screen.width)) : window.screen.height) + 'px';
document.getElementById('myt').style.width='100%'; //'' + (window.orientation == 0 ? window.screen.width : window.screen.height) + 'px';
}
}



window.setInterval(function(){havealook(1)},2000);
</script>
<style>
td { vertical-align:top; }
@media only screen and (max-width: 800px) {
body { max-width: 100%; max-height: 80vh; } table { max-width: <?php if (strpos($_SERVER['QUERY_STRING'],'exif=') !== false) { echo "100"; } else { echo "95"; } ?>%; max-height: 80vh; margin: auto; overflow-x: hidden; }
}

</style>
</head>
<body onload=" mytw(); zoom_maybe(); if (document.URL.indexOf('pdf=') != -1) { document.getElementById('selmode').value='PDF Slideshow'; if (document.getElementById('tdfirst')) { document.getElementById('s0').style.width=document.getElementById('tdfirst').style.width; document.getElementById('s0').style.height=document.getElementById('tdfirst').style.height; } } if (document.URL.indexOf('exif=') != -1) { document.getElementById('selmode').value='Exif Slideshow'; if (document.getElementById('tdfirst')) { document.getElementById('s0').style.width=document.getElementById('tdfirst').style.width; document.getElementById('s0').style.height=document.getElementById('tdfirst').style.height; } } document.title=document.title + ' ' + lastone; ol(); ">


Previous relevant Inhouse Slideshow Mobile Tutorial is shown below.

Inhouse Slideshow Mobile Tutorial

Inhouse Slideshow Mobile Tutorial

The recent PDF Slideshow and Form Creation Helper Slideshow Tutorial changes were made on a MacBook Pro laptop. Did it show that we have put off until today, to look at that functionality with mobile platforms?!

In a “going off to the right table row of cells” arrangement like this, what are some considerations that improve the user experience (of our inhouse slideshows) for mobile platform users?

  • turn the “@” link into an “emoji button” as per ➡ ( &#10145; )
  • for both mobile and non-mobile, we’ve decided …
    1. UTF-8 meta …
      <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>

    2. <style>
      td { vertical-align:top; }
      </style>
    3. change the h4 element to be h2 to help with legibility
  • for mobile, we’ve decided …
    1. viewport …
      <meta name=”viewport” content=”width=device-width, initial-scale=0.4, minimum-scale=0.1, maximum-scale=8, user-scalable=yes”>

    2. <style>
      html { zoom: .5; }
      </style>
    3. iOS (ie. iPad and iPhone) PDF iframe elements have known scrolling issues, which we decided to bypass by opening these PDF creations in a new webpage window

Deployment of these changes is similar to that last time, and the times before that, as per …

Unit testing completed, the deployment, again, matches those ideas of the recent PDF Slideshow and Form Creation Helper Slideshow Tutorial … in that …


Previous relevant PDF Slideshow and Form Creation Helper Slideshow Tutorial is shown below.

PDF Slideshow and Form Creation Helper Slideshow Tutorial

PDF Slideshow and Form Creation Helper Slideshow Tutorial

The first “integration cab” off the rank for yesterday’s PDF Slideshow and Form Creation Helper Primer Tutorial underlying usefulness is with our Inhouse Slideshow arrangements last talked about at Inhouse Slideshow Design Exif Order Tutorial. That generic PHP code now has three display dropdown options of …

  • Slideshow
  • Exif Slideshow … and the new, as of today’s work …
  • PDF Slideshow

… that little bit different in that a PDF Slideshow occupies just the one table cell (rather than the many horizontal cells of the other display modes) and the resultant embedded PDF data vertically scrolls when multiple image slides are involved.

This new option also adds onto this “Inhouse Slideshow” functionality the chance to download and keep a PDF representation of that slideshow to your local system. Perhaps this makes this be of interest to you?!

The changed form_creator.php‘s live run is what gets integrated into the “Inhouse Slideshow” “sisterhood”. We say “sisterhood” because this “Inhouse Slideshow” is designed as a single PHP codefile “hived off” to a lot of other web server folders as their default “index.php” web browser default webpage in a “peer to peer” feeling arrangement. Such an arrangement asks a bit of the deployment arrangements, and we’ve talked about this before (with underlying links pointing to today’s work, should you be interested) …

Unit testing completed, the deployment, again, matches those ideas of the recent Inhouse Slideshow Design Exif Zip Tutorial … in that …

But when we say “Unit testing completed” above, we need to fill you in on a Fpdf issue we came across during unit testing of our changes. We were getting a …


FPDF Error: Not a JPEG file

… Fpdf error message choosing the new “PDF Slideshow” option on some, but not all, “Inhouse Slideshow” address bar URLs. And so the online research began as per …

… almost getting us there to a solution (and as far as the last link goes “that was before we posted the suggestion below”). Then we took one of the error messages at its word …


FPDF error: Not a JPEG file: ../Mac/Linux_drutil-238of.jpg

… and independently looked into the issue via Linux (or macOS command line) file command …


# cd $HOME/public_html/Mac
# ls -l Linux_dr*
-rw-r--r-- 1 owner group 724353 Oct 29 08:00 Linux_drutil-238of.jpg
-rw-r--r-- 1 owner group 132707 Oct 29 08:00 Linux_drutil-239of.jpg
-rw-r--r-- 1 owner group 109595 Oct 29 08:00 Linux_drutil-240of.jpg
# file Linux_drutil-238of.jpg
Linux_drutil-238of.jpg: PNG image data, 1280 x 800, 8-bit/color RGBA, non-interlaced
# file Linux_drutil-239of.jpg
Linux_drutil-239of.jpg: JPEG image data, JFIF standard 1.01
#

… when the penny dropped (about our (macOS) Paintbrush slideshow slide creation habits)! We quote our entry into “php – FPDF error: Not a JPEG file: http://10.11.201.93:81/webdocc/uploaded/tes3.jpg – Stack Overflow” …

Have found that constructing slideshows with Paintbrush on a MacBook Pro for years have sometimes been saving what “file jpeg_filename.jpg” determines is a PNG, as a JPEG, which is not the end of the world as far as the browsers go rendering this. Within FPDF’s fpdf.php I fixed my own shortcomings that were resulting in “FPDF Error: Not a JPEG file” via the kludgy “if($a[2]==3) { return $this->_parsepng($file); }” additional codeline below …

function _parsejpg($file)
{
// Extract info from a JPEG file
$a = getimagesize($file);
if(!$a)
$this->Error(‘Missing or incorrect image file: ‘.$file);
if($a[2]==3) { return $this->_parsepng($file); }
if($a[2]!=2)
$this->Error(‘Not a JPEG file: ‘.’ ‘.$a[2].’ ‘.$file);
if(!isset($a[‘channels’]) || $a[‘channels’]==3)
$colspace = ‘DeviceRGB’;
elseif($a[‘channels’]==4)
$colspace = ‘DeviceCMYK’;
else
$colspace = ‘DeviceGray’;
$bpc = isset($a[‘bits’]) ? $a[‘bits’] : 8;
$data = file_get_contents($file);
return array(‘w’=>$a[0], ‘h’=>$a[1], ‘cs’=>$colspace, ‘bpc’=>$bpc, ‘f’=>’DCTDecode’, ‘data’=>$data);
}

… and this change to Fpdf’s fpdf.php fixed the issue in our case for a lot of our previously erroneous “PDF Slideshow” displays of “Inhouse Slideshows”.


Previous relevant PDF Slideshow and Form Creation Helper Primer Tutorial is shown below.

PDF Slideshow and Form Creation Helper Primer Tutorial

PDF Slideshow and Form Creation Helper Primer Tutorial

Our recent work involving the great Fpdf creator of PDF files when we presented Ajax FormData Object No Body PHP PDF Tutorial has got us starting on a new PDF (PHP) web application we are starting out thinking will help with …

  • online forms (probably via thinking in terms of Fpdf open source programmers like Rick van Buuren and Clément Lavoillotte‘s excellent HTML table rendering ideas) via HTML table intermediate user interactions … and …
  • slideshows

… but we will not be surprised if the project branches out into other ideas. We’ll see over time.

We hope you come along for the trip starting with a bit of a proof of concept form_creator.php‘s live run for you to try, where we allow you to enter (and be able to change) some HTML table code (if that’s what you end up with?!) in a pink HTML textarea element, and that will become PDF should you click the underlying HTML form’s yellow submit button.

Hope to see you for tomorrow’s PDF writing developments here.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in Animation, eLearning, Operating System, Tutorials | Tagged , , , , , , , , , , , , | Leave a comment

Python Cowsay API Cartoon Speech Media Tutorial

Python Cowsay API Cartoon Speech Media Tutorial

Python Cowsay API Cartoon Speech Media Tutorial

As soon as a web application talks about image slides, as we have been dealing with allowing for the creation of cartoons with our recent cowsay Python API / Command-line tool interfacing PHP web application, maybe as Louis Lumière did many years ago, it brings out media thoughts regarding “moving pictures”. We use, here, at our RJM Programming AlmaLinux web server, the great Open Source ffmpeg to help create such media, in today’s case …

  • video
  • animated GIF

… productions using those image slides created via the (again, Open Source) cowsay Python API / Command-line tool …

<?php

if (isset($_GET['getvideo'])) {
$lenv='1';
if (isset($_GET['len'])) {
$lenv=$_GET['len'];
}
if ($_GET['getvideo'] == '1' && $lenv == '0') {
echo "<html><body onload=\" if (parent.document.getElementById('divvideo')) { parent.document.getElementById('divvideo').innerHTML='<video id=myvideo controls><source id=mysource type=video/mp4 src=' + String.fromCharCode(39) + 'data:video/mp4;base64," . base64_encode(file_get_contents('/tmp/video' . server_remote_addr() . '.mp4')) . "' + String.fromCharCode(39) + '></source></video>'; } 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+='<br><br><p id=pvd>Video version below ... <a style=display:inline-block; href=#myh1>Back to top ...</a></p><br><div id=divvideo><video id=myvideo controls><source id=mysource type=video/mp4 src=' + String.fromCharCode(39) + 'data:video/mp4;base64," . base64_encode(file_get_contents('/tmp/video' . server_remote_addr() . '.mp4')) . "' + String.fromCharCode(39) + '></source></video></div>'; } setTimeout(function(){ parent.document.getElementById('pvd').scrollIntoView(); }, 2000); \"></body></html>";
} 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 "<html><body onload=\" if (parent.document.getElementById('divvideo')) { parent.document.getElementById('divvideo').innerHTML='<video id=myvideo controls><source id=mysource type=video/mp4 src=' + String.fromCharCode(39) + 'data:video/mp4;base64," . base64_encode(file_get_contents('/tmp/video' . server_remote_addr() . '.mp4')) . "' + String.fromCharCode(39) + '></source></video>'; } 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+='<br><br><p id=pvd>Video version below ... <a style=display:inline-block; href=#myh1>Back to top ...</a></p><br><div id=divvideo><video id=myvideo controls><source id=mysource type=video/mp4 src=' + String.fromCharCode(39) + 'data:video/mp4;base64," . base64_encode(file_get_contents('/tmp/video' . server_remote_addr() . '.mp4')) . "' + String.fromCharCode(39) + '></source></video></div>'; } setTimeout(function(){ parent.document.getElementById('pvd').scrollIntoView(); }, 2000); \"></body></html>";
}
exit;
} else if (isset($_GET['getagif'])) {
$lenv='1';
if (isset($_GET['len'])) {
$lenv=$_GET['len'];
}
if ($_GET['getvideo'] == '1' && $lenv == '0') {
echo "<html><body onload=\" if (parent.document.getElementById('mygif')) { parent.document.getElementById('mygif').src='data:image/gif;base64," . base64_encode(file_get_contents('/tmp/agif' . server_remote_addr() . '.gif')) . "'; } else { parent.document.getElementById('divmedia').innerHTML+='<br><br><p id=pag>Animated GIF version below ... <a style=display:inline-block; href=#myh1>Back to top ...</a></p><br><img id=mygif src=data:image/gif;base64," . base64_encode(file_get_contents('/tmp/agif' . server_remote_addr() . '.gif')) . "></img>'; } setTimeout(function(){ parent.document.getElementById('pag').scrollIntoView(); }, 2000); \"></body></html>";
} 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 "<html><body onload=\" if (parent.document.getElementById('mygif')) { parent.document.getElementById('mygif').src='data:image/gif;base64," . base64_encode(file_get_contents('/tmp/agif' . server_remote_addr() . '.gif')) . "'; } else { parent.document.getElementById('divmedia').innerHTML+='<br><br><p id=pag>Animated GIF version below ... <a style=display:inline-block; href=#myh1>Back to top ...</a></p><br><img id=mygif src=data:image/gif;base64," . base64_encode(file_get_contents('/tmp/agif' . server_remote_addr() . '.gif')) . "></img>'; } setTimeout(function(){ parent.document.getElementById('pag').scrollIntoView(); }, 2000); \"></body></html>";
}
exit;
}

?>

… as a new optional piece of additional functionality offered in our changed “fifth draft” (picking up from Python Cowsay API Cartoon Speech Content Tutorial‘s fourth draft, and further to yesterday’s Text to Image via ImageMagick Primer Tutorial) Cartoon creation and email sharing capable PHP web application you can also try below.


Previous relevant Text to Image via ImageMagick Primer Tutorial is shown below.

Text to Image via ImageMagick Primer Tutorial

Text to Image via ImageMagick Primer Tutorial

Why would a “Primer” tutorial point at a “well along the way” one? Well, a few reasons really …

Yes, the great ImageMagick (and we’re using it’s command line “convert” command here to make this happen) can convert text to images (ie. HTML img elements). Now, we’re not saying you always get perfect matches here, but it is akin to mere mortal dreamers think of as “intelligent scanning”. So, we wanted to have this sidetrack, and we will be resuming “normal transmission” shortly?!

We’ll leave you with some cowsay.php new relevant PHP code to ponder …

<?php

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<sizeof($fcs); $iuy++) {
if (strpos($selpop, '>' . explode("\n", $fcs[$iuy])[0] . '<') === false) {
$selpop.="\n selo.innerHTML+='<option value=' + String.fromCharCode(39) + '" . explode("\n", $fcs[$iuy])[0] . "' + String.fromCharCode(39) + '>" . explode("\n", $fcs[$iuy])[0] . "</option>'; \n";
}
}
if ($selpop != '') {
echo "<html><body onload=\" var selos=parent.document.getElementsByTagName('select'); if (eval('' + selos.length) > 0) { var selo=selos[eval(-1 + selos.length)]; " . $selpop . " selo.style.display='inline-block'; selo.style.backgroundColor='#f0f0f0'; } \"></body></html>";
}
}
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<sizeof($outs); $ivx++) {
$decis=explode(';', $outs[$ivx])[0];
if (str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$decis)))))))))) != '') {
if (substr(strtolower($decis),0,1) == 'x') {
$outsofar.="\\x{" . substr($decis,1) . "}";
} else {
$outsofar.="\\x{" . $decis . "}";
}
} else {
$outsofar.="\\x{" . dechex($decis) . "}";
}
$outsofar.=substr($outs[$ivx],strlen($decis . ';'));
}
} else if (strpos(str_replace('+',' ',urldecode($_POST['text'])), '&#') !== false) {
$outs=explode('&#', str_replace('+',' ',urldecode($_POST['text'])));
$outsofar=$outs[0];
for ($ivx=1; $ivx<sizeof($outs); $ivx++) {
$decis=explode(';', $outs[$ivx])[0];
if (str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$decis)))))))))) != '') {
if (substr(strtolower($decis),0,1) == 'x') {
$outsofar.="\\x{" . substr($decis,1) . "}";
} else {
$outsofar.="\\x{" . $decis . "}";
}
} else {
$outsofar.="\\x{" . dechex($decis) . "}";
}
$outsofar.=substr($outs[$ivx],strlen($decis . ';'));
}
}
$labbit=$emojilabbit;
$perlemoji="perl -e 'binmode(STDOUT, \":utf8\"); print \"" . str_replace("\n", "\x{000A}", $outsofar) . '";' . "' | ";
}
if (strpos(str_replace('+',' ',urldecode($_POST['text'])), "\\") !== false) {
if ($perlemoji == '') { $labbit='"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" '; }
file_put_contents('/tmp/imag.cmd', $perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec($perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec('chmod 777 ' . $slidename);
} else {
if ($perlemoji == '') { $labbit='"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt)' . '" '; }
file_put_contents('/tmp/imaG.cmd', $perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename . ' ; chmod 777 ' . $slidename);
exec($perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec('chmod 777 ' . $slidename);
}
if (isset($_POST['raw'])) {
header('Content-Type: image/' . $iex);
echo file_get_contents($slidename);
unlink($slidename);
unlink('/tmp/imagerequest_' . server_remote_addr() . '-0.txt');
exit;
} else {
echo "<html>
<body onload=\"
if (window.parent != window.self) {
var cnvs=parent.document.getElementsByTagName('canvas');
if (eval('' + cnvs.length) > 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='<img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img><style> * { margin:0 0 0 0; padding:0 0 0 0; } img { border-top: 8px solid " . $bcol . "; }</style>';
} else {
document.body.innerHTML+='<br><img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img>';
}
}
} else if (document.body.innerHTML == '') {
document.body.innerHTML='<img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img><style> * { margin:0 0 0 0; padding:0 0 0 0; } img { border-top: 8px solid " . $bcol . "; }</style>';
} else {
document.body.innerHTML+='<br><img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img>';
}
\"></body></html>";
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<sizeof($outs); $ivx++) {
$decis=explode(';', $outs[$ivx])[0];
if (str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$decis)))))))))) != '') {
if (substr(strtolower($decis),0,1) == 'x') {
$outsofar.="\\x{" . substr($decis,1) . "}";
} else {
$outsofar.="\\x{" . $decis . "}";
}
} else {
$outsofar.="\\x{" . dechex($decis) . "}";
}
$outsofar.=substr($outs[$ivx],strlen($decis . ';'));
}
} else if (strpos(str_replace('+',' ',urldecode($_GET['text'])), '&#') !== false) {
$outs=explode('&#', str_replace('+',' ',urldecode($_GET['text'])));
$outsofar=$outs[0];
for ($ivx=1; $ivx<sizeof($outs); $ivx++) {
$decis=explode(';', $outs[$ivx])[0];
if (str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$decis)))))))))) != '') {
if (substr(strtolower($decis),0,1) == 'x') {
$outsofar.="\\x{" . substr($decis,1) . "}";
} else {
$outsofar.="\\x{" . $decis . "}";
}
} else {
$outsofar.="\\x{" . dechex($decis) . "}";
}
$outsofar.=substr($outs[$ivx],strlen($decis . ';'));
}
}
$labbit=$emojilabbit;
$perlemoji="perl -e 'binmode(STDOUT, \":utf8\"); print \"" . str_replace("\n", "\x{000A}", $outsofar) . '";' . "' | ";
}
if (strpos(str_replace('+',' ',urldecode($_GET['text'])), "\\") !== false) {
if ($perlemoji == '') { $labbit='"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" '; }
//file_put_contents('/tmp/imag.cmd', '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 . ' ; chmod 777 ' . $slidename);
exec($perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec('chmod 777 ' . $slidename);
} else {
if ($perlemoji == '') { $labbit='"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt)' . '" '; }
exec($perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec('chmod 777 ' . $slidename);
}
if (isset($_GET['raw'])) {
header('Content-Type: image/' . $iex);
echo file_get_contents($slidename);
unlink($slidename);
unlink('/tmp/imagerequest_' . server_remote_addr() . '-0.txt');
exit;
} else {
echo "<html>
<body onload=\"
if (window.parent != window.self) {
var cnvs=parent.document.getElementsByTagName('canvas');
if (eval('' + cnvs.length) > 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='<img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img><style> * { margin:0 0 0 0; padding:0 0 0 0; } img { border-top: 8px solid " . $bcol . "; }</style>';
} else {
document.body.innerHTML+='<br><img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img>';
}
}
} else if (document.body.innerHTML == '') {
document.body.innerHTML='<img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img><style> * { margin:0 0 0 0; padding:0 0 0 0; } img { border-top: 8px solid " . $bcol . "; }</style>';
} else {
document.body.innerHTML+='<br><img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img>';
}
\"></body></html>";
unlink('/tmp/imagerequest_' . server_remote_addr() . '-0.txt');
try {
unlink($slidename);
} catch(Exception $esdw) { }
}
exit;
}

?>


Previous relevant Python Cowsay API Cartoon Speech Content Tutorial is shown below.

Python Cowsay API Cartoon Speech Content Tutorial

Python Cowsay API Cartoon Speech Content Tutorial

If you were to ask most people what is more onerous filling in online web forms on the way to making something happen …

  • we’re guessing, rather than saying button presses …
  • we’re guessing, they’re more likely to say typing out text …

… with it’s associated tabbing out to negotiate as well. But, supposing we could offer you a “speech to text” approach to performing “typing out text” in our latest cowsay Python API / Command-line tool interfacing PHP web application?

For some years now, we’ve interfaced to a …

  • non-mobile
  • Google Chrome
  • secure URL via https: protocol
  • allowing access to microphone

… means by which we normally access via a “top” hierarchy level call to our inhouse Google Speech to Text API interfacing web application helper.

Isn’t a popup window awkward here? Well, you might think so, but today, we discovered with the Google Chrome browser we used on macOS …

  • we initially call our inhouse Google Speech to Text API interfacing web application helper as a popup sitting in front of the cowsay interfacing parent window …
    <?php echo ”

    function anop() {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    topwo=window_open('https://www.google.com/intl/en/chrome/demos/speech.html','_blank','top=120,left=' + eval(eval('' + screen.width) - 690) + ',width=690,height=550');
    setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000);
    setInterval(function(){ if (!topwo.closed) { topwo.focus(); } topwo.location.href='https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?rand=' + Math.floor(Math.random() * 1987967) + '&mode=4'; setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000); }, 30000);
    } else {
    topwo=window.open('https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?rand=' + Math.floor(Math.random() * 1987967) + '&mode=4','_blank','top=120,left=' + eval(eval('' + screen.width) - 690) + ',width=690,height=550');
    setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000);
    setInterval(function(){ if (!topwo.closed) { topwo.focus(); } topwo.location.href='https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?rand=' + Math.floor(Math.random() * 1987967) + '&mode=4'; setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000); }, 30000);
    }
    }

    “; ?>
  • and found that it was visible until any click or focus back to the cowsay interfacing parent window … normally an annoyance …
  • but not if …
    1. we semi regularly reload the our inhouse Google Speech to Text API interfacing web application helper … to refresh it’s red “recording” button instigation … and then …
    2. even if it remains hidden, it is still apparent to the focussed cowsay interfacing parent window on account of an orange “microphone on recording” icon appearing for the Google Chrome web browser user up at it’s Menu Bar … and …
    3. audio being “sight independent” the user does not have to refocus our inhouse Google Speech to Text API interfacing web application helper, just talk into the microphone just after that new icon appears … so that …
    4. the Google Speech to Text smarts help transfer that resultant text over to the textarea of the cowsay interfacing parent window, even avoiding any need to tab out of that textarea element … ahead of …
    5. the rest of the dropdown selections and button presses needed to achieve the user aim of establishing a new slide, perhaps for a Cartoon being created

… you can see happening with today’s animated GIF presentation on top of the work of yesterday’s Python Cowsay API Cartoon Tutorial in our changed “fourth draft” Cartoon creation and email sharing capable PHP web application you can also try below.


Previous relevant Python Cowsay API Cartoon Tutorial is shown below.

Python Cowsay API Cartoon Tutorial

Python Cowsay API Cartoon Tutorial

We’ve long been interested in online web application ideas that end up with a half decent cartoon the user can create, and share, themselves. “Half decent” becomes “fully decent” with a user who has a great imagination. And so, onto yesterday’s Python Cowsay API Primer Tutorial‘s start with interfacing to the great cowsay Python API / Command-line tool we access via the PHP exec method conduit to our AlmaLinux Apache/PHP/MySql Linux web server, today we’ve extended that …

  • “proof of concept” thinking … onto …
  • cartoon creation “smarts” … starting with (also egged on here by mobile platform problems with monospaced fonts, it seems like)
  • allowing a tabular display of our cowsay components … into …
  • table cells horizontally aligned (and so, less vulnerable to monospacing inaccuracies) … also allowing …
  • within any table cell there is a topmost th table cell wording part above a cowsay character td cell lower part …
  • “half decent” looking via static CSS
    <?php echo ”

    <style>
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    tr { vertical-align: top; }
    td { vertical-align: top; }
    th { vertical-align: top; }

    * { font-family:'Courier New',Courier,monospace; }
    .img-hor { // thanks to https://stackoverflow.com/questions/32875695/flip-mirror-an-image-horizontally-vertically-with-css
    -moz-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    filter: FlipH;
    -ms-filter: 'FlipH';
    }
    .img-ver { // thanks to https://stackoverflow.com/questions/32875695/flip-mirror-an-image-horizontally-vertically-with-css
    -moz-transform: scaleY(-1);
    -o-transform: scaleY(-1);
    -webkit-transform: scaleY(-1);
    transform: scaleY(-1);
    filter: FlipV;
    -ms-filter: 'FlipV';
    }

    .glow {
    -webkit-animation: glow 1s linear infinite alternate;
    -moz-animation: glow 1s linear infinite alternate;
    animation: glow 1s linear infinite alternate;
    }

    /* Thanks to https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_glowing_text */

    @-webkit-keyframes glow {
    from {
    box-shadow: 0 0 3px #fff, 0 0 5px #fff, 0 0 37px #e60073, 0 0 9px #e60073, 0 0 11px #e60073, 0 0 13px #e60073, 0 0 15px #e60073;
    }

    to {
    box-shadow: 0 0 24px #fff, 0 0 6px #ff4da6, 0 0 8px #ff4da6, 0 0 10px #ff4da6, 0 0 12px #ff4da6, 0 0 14px #ff4da6, 0 0 16px #ff4da6;
    }
    }

    th[id$='0'] {
    background: rgba(224,240,240,0.6); //#e0f0f0;
    }

    th[id$='1'] {
    background: rgba(225,241,241,0.6); //#e1f1f1;
    }

    th[id$='2'] {
    background: rgba(226,242,242,0.6); //#e2f2f2;
    }

    th[id$='3'] {
    background: rgba(227,243,243,0.6); //#e3f3f3;
    }

    th[id$='4'] {
    background: rgba(228,244,244,0.6); //#e4f4f4;
    }

    th[id$='5'] {
    background: rgba(229,245,245,0.6); //#e5f5f5;
    }

    th[id$='6'] {
    background: rgba(230,246,246,0.6); //#e6f6f6;
    }

    th[id$='7'] {
    background: rgba(231,247,247,0.6); //#e7f7f7;
    }

    th[id$='8'] {
    background: rgba(232,248,248,0.6); //#e2f2f2;
    }

    th[id$='9'] {
    background: rgba(233,249,249,0.6); //#e9f9f9;
    }

    td[id$='0'] {
    background: rgba(240,240,240,0.3); //#f0f0f0;
    text-shadow:-1px 1px 1px #ff2d90;
    }

    td[id$='1'] {
    background: rgba(241,241,241,0.3); //#f1f1f1;
    text-shadow:-1px 1px 1px #ff2d91;
    float: bottom;
    }

    td[id$='2'] {
    background: rgba(242,242,242,0.3); //#f2f2f2;
    text-shadow:-1px 1px 1px #ff2d92;
    }

    td[id$='3'] {
    background: rgba(243,243,243,0.3); //#f3f3f3;
    text-shadow:-1px 1px 1px #ff2d93;
    }

    td[id$='4'] {
    background: rgba(244,244,244,0.3); //#f4f4f4;
    text-shadow:-1px 1px 1px #ff2d94;
    }

    td[id$='5'] {
    background: rgba(245,245,245,0.3); //#f5f5f5;
    text-shadow:-1px 1px 1px #ff2d95;
    }

    td[id$='6'] {
    background: rgba(246,246,246,0.3); //#f6f6f6;
    text-shadow:-1px 1px 1px #ff2d96;
    }

    td[id$='7'] {
    background: rgba(247,247,247,0.3); //#f7f7f7;
    text-shadow:-1px 1px 1px #ff2d97;
    }

    td[id$='8'] {
    background: rgba(248,248,248,0.3); //#f8f8f8;
    text-shadow:-1px 1px 1px #ff2d98;
    }

    td[id$='9'] {
    background: rgba(249,249,249,0.3); //#f9f9f9;
    text-shadow:-1px 1px 1px #ff2d99;
    }

    table tbody tr:first-child {
    background: transparent; //#f6f6e6;
    }
    </style>

    “; ?>
    … and then …
  • whenever new cell content happens padding-top adding CSS Javascript DOM nuanced display logic via …
    <?php echo ”

    function paddingtopit() {
    var maxtwo=0, thistwo=0;
    var thhs=[], tdhs=[], it=0;
    var thdids=[];
    //trthtd1
    //trtdtd1
    var tds=document.getElementsByTagName('td');
    for (it=0; it<tds.length; it++) {
    if (('' + tds[it].id).indexOf('trtdtd') != -1) {
    if (('' + tds[it].style.paddingTop).replace(/^null/g,'').replace(/^undefined/g,'').trim() != '') {
    tds[it].style.paddingTop='0px';
    }
    }
    }
    for (it=0; it<tds.length; it++) {
    if (('' + tds[it].id).indexOf('trtdtd') != -1) {
    tdhs.push(eval('' + tds[it].getBoundingClientRect().height));
    thdids.push('' + tds[it].id);
    }
    }
    var ths=document.getElementsByTagName('th');
    for (it=0; it<ths.length; it++) {
    if (('' + ths[it].id).indexOf('trthtd') != -1) {
    thhs.push(eval('' + ths[it].getBoundingClientRect().height));
    thistwo=eval(thhs[it] + tdhs[it]);
    if (thistwo > maxtwo) { maxtwo=thistwo; }
    }
    }
    for (it=0; it<tdhs.length; it++) {
    thistwo=eval(thhs[it] + tdhs[it]);
    if (thistwo < maxtwo) {
    document.getElementById(thdids[it]).style.paddingTop='' + eval(maxtwo - thistwo) + 'px';
    }
    }
    }

    “; ?>
    … so that …
  • cartoons present with “speech bubble” wording aligned to the top in our “cells” (ie. th contenteditable=true editable wording on top of td horizontal flip (double click) and/or vertical flop (right click) editable lower part) with those characters aligned to the bottom

… in our changed “third draft” Cartoon creation and email sharing capable PHP web application you can also try below.


Previous relevant Python Cowsay API Primer Tutorial is shown below.

Python Cowsay API Primer Tutorial

Python Cowsay API Primer Tutorial

We discovered an interesting Open Source Python API / Command-line tool called cowsay which we installed up at our AlmaLinux web server via …


pip install cowsay

… with an integration purpose in mind, so thanks. Before many readers’ time indeed, but some may remember those cute banner printouts that told you who owned the next printout on a spooling “crude graphics” printout in the late 70’s … well cowsay encapsulates those heady days (and who can forget punch cards)?! Before integration, though, we want to test it via a new PHP supervisor on exec method Linux command line interfacings to cowsay.

So we started, with this “first draft” getting places and then this “second draft” with a little more sophistication to leave the day with this interfacer

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in Animation, eLearning, Event-Driven Programming, Operating System, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Text to Image via ImageMagick Primer Tutorial

Text to Image via ImageMagick Primer Tutorial

Text to Image via ImageMagick Primer Tutorial

Why would a “Primer” tutorial point at a “well along the way” one? Well, a few reasons really …

Yes, the great ImageMagick (and we’re using it’s command line “convert” command here to make this happen) can convert text to images (ie. HTML img elements). Now, we’re not saying you always get perfect matches here, but it is akin to mere mortal dreamers think of as “intelligent scanning”. So, we wanted to have this sidetrack, and we will be resuming “normal transmission” shortly?!

We’ll leave you with some cowsay.php new relevant PHP code to ponder …

<?php

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<sizeof($fcs); $iuy++) {
if (strpos($selpop, '>' . explode("\n", $fcs[$iuy])[0] . '<') === false) {
$selpop.="\n selo.innerHTML+='<option value=' + String.fromCharCode(39) + '" . explode("\n", $fcs[$iuy])[0] . "' + String.fromCharCode(39) + '>" . explode("\n", $fcs[$iuy])[0] . "</option>'; \n";
}
}
if ($selpop != '') {
echo "<html><body onload=\" var selos=parent.document.getElementsByTagName('select'); if (eval('' + selos.length) > 0) { var selo=selos[eval(-1 + selos.length)]; " . $selpop . " selo.style.display='inline-block'; selo.style.backgroundColor='#f0f0f0'; } \"></body></html>";
}
}
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<sizeof($outs); $ivx++) {
$decis=explode(';', $outs[$ivx])[0];
if (str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$decis)))))))))) != '') {
if (substr(strtolower($decis),0,1) == 'x') {
$outsofar.="\\x{" . substr($decis,1) . "}";
} else {
$outsofar.="\\x{" . $decis . "}";
}
} else {
$outsofar.="\\x{" . dechex($decis) . "}";
}
$outsofar.=substr($outs[$ivx],strlen($decis . ';'));
}
} else if (strpos(str_replace('+',' ',urldecode($_POST['text'])), '&#') !== false) {
$outs=explode('&#', str_replace('+',' ',urldecode($_POST['text'])));
$outsofar=$outs[0];
for ($ivx=1; $ivx<sizeof($outs); $ivx++) {
$decis=explode(';', $outs[$ivx])[0];
if (str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$decis)))))))))) != '') {
if (substr(strtolower($decis),0,1) == 'x') {
$outsofar.="\\x{" . substr($decis,1) . "}";
} else {
$outsofar.="\\x{" . $decis . "}";
}
} else {
$outsofar.="\\x{" . dechex($decis) . "}";
}
$outsofar.=substr($outs[$ivx],strlen($decis . ';'));
}
}
$labbit=$emojilabbit;
$perlemoji="perl -e 'binmode(STDOUT, \":utf8\"); print \"" . str_replace("\n", "\x{000A}", $outsofar) . '";' . "' | ";
}
if (strpos(str_replace('+',' ',urldecode($_POST['text'])), "\\") !== false) {
if ($perlemoji == '') { $labbit='"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" '; }
file_put_contents('/tmp/imag.cmd', $perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec($perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec('chmod 777 ' . $slidename);
} else {
if ($perlemoji == '') { $labbit='"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt)' . '" '; }
file_put_contents('/tmp/imaG.cmd', $perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename . ' ; chmod 777 ' . $slidename);
exec($perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec('chmod 777 ' . $slidename);
}
if (isset($_POST['raw'])) {
header('Content-Type: image/' . $iex);
echo file_get_contents($slidename);
unlink($slidename);
unlink('/tmp/imagerequest_' . server_remote_addr() . '-0.txt');
exit;
} else {
echo "<html>
<body onload=\"
if (window.parent != window.self) {
var cnvs=parent.document.getElementsByTagName('canvas');
if (eval('' + cnvs.length) > 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='<img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img><style> * { margin:0 0 0 0; padding:0 0 0 0; } img { border-top: 8px solid " . $bcol . "; }</style>';
} else {
document.body.innerHTML+='<br><img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img>';
}
}
} else if (document.body.innerHTML == '') {
document.body.innerHTML='<img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img><style> * { margin:0 0 0 0; padding:0 0 0 0; } img { border-top: 8px solid " . $bcol . "; }</style>';
} else {
document.body.innerHTML+='<br><img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img>';
}
\"></body></html>";
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<sizeof($outs); $ivx++) {
$decis=explode(';', $outs[$ivx])[0];
if (str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$decis)))))))))) != '') {
if (substr(strtolower($decis),0,1) == 'x') {
$outsofar.="\\x{" . substr($decis,1) . "}";
} else {
$outsofar.="\\x{" . $decis . "}";
}
} else {
$outsofar.="\\x{" . dechex($decis) . "}";
}
$outsofar.=substr($outs[$ivx],strlen($decis . ';'));
}
} else if (strpos(str_replace('+',' ',urldecode($_GET['text'])), '&#') !== false) {
$outs=explode('&#', str_replace('+',' ',urldecode($_GET['text'])));
$outsofar=$outs[0];
for ($ivx=1; $ivx<sizeof($outs); $ivx++) {
$decis=explode(';', $outs[$ivx])[0];
if (str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$decis)))))))))) != '') {
if (substr(strtolower($decis),0,1) == 'x') {
$outsofar.="\\x{" . substr($decis,1) . "}";
} else {
$outsofar.="\\x{" . $decis . "}";
}
} else {
$outsofar.="\\x{" . dechex($decis) . "}";
}
$outsofar.=substr($outs[$ivx],strlen($decis . ';'));
}
}
$labbit=$emojilabbit;
$perlemoji="perl -e 'binmode(STDOUT, \":utf8\"); print \"" . str_replace("\n", "\x{000A}", $outsofar) . '";' . "' | ";
}
if (strpos(str_replace('+',' ',urldecode($_GET['text'])), "\\") !== false) {
if ($perlemoji == '') { $labbit='"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" '; }
//file_put_contents('/tmp/imag.cmd', '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 . ' ; chmod 777 ' . $slidename);
exec($perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec('chmod 777 ' . $slidename);
} else {
if ($perlemoji == '') { $labbit='"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt)' . '" '; }
exec($perlemoji . 'convert -background "' . $bcol . '" -fill "' . $fcol . '" -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:' . $labbit . ' ' . $slidename);
exec('chmod 777 ' . $slidename);
}
if (isset($_GET['raw'])) {
header('Content-Type: image/' . $iex);
echo file_get_contents($slidename);
unlink($slidename);
unlink('/tmp/imagerequest_' . server_remote_addr() . '-0.txt');
exit;
} else {
echo "<html>
<body onload=\"
if (window.parent != window.self) {
var cnvs=parent.document.getElementsByTagName('canvas');
if (eval('' + cnvs.length) > 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='<img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img><style> * { margin:0 0 0 0; padding:0 0 0 0; } img { border-top: 8px solid " . $bcol . "; }</style>';
} else {
document.body.innerHTML+='<br><img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img>';
}
}
} else if (document.body.innerHTML == '') {
document.body.innerHTML='<img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img><style> * { margin:0 0 0 0; padding:0 0 0 0; } img { border-top: 8px solid " . $bcol . "; }</style>';
} else {
document.body.innerHTML+='<br><img src=data:image/" . $iex . ";base64," . base64_encode(file_get_contents($slidename)) . "></img>';
}
\"></body></html>";
unlink('/tmp/imagerequest_' . server_remote_addr() . '-0.txt');
try {
unlink($slidename);
} catch(Exception $esdw) { }
}
exit;
}

?>


Previous relevant Python Cowsay API Cartoon Speech Content Tutorial is shown below.

Python Cowsay API Cartoon Speech Content Tutorial

Python Cowsay API Cartoon Speech Content Tutorial

If you were to ask most people what is more onerous filling in online web forms on the way to making something happen …

  • we’re guessing, rather than saying button presses …
  • we’re guessing, they’re more likely to say typing out text …

… with it’s associated tabbing out to negotiate as well. But, supposing we could offer you a “speech to text” approach to performing “typing out text” in our latest cowsay Python API / Command-line tool interfacing PHP web application?

For some years now, we’ve interfaced to a …

  • non-mobile
  • Google Chrome
  • secure URL via https: protocol
  • allowing access to microphone

… means by which we normally access via a “top” hierarchy level call to our inhouse Google Speech to Text API interfacing web application helper.

Isn’t a popup window awkward here? Well, you might think so, but today, we discovered with the Google Chrome browser we used on macOS …

  • we initially call our inhouse Google Speech to Text API interfacing web application helper as a popup sitting in front of the cowsay interfacing parent window …
    <?php echo ”

    function anop() {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    topwo=window_open('https://www.google.com/intl/en/chrome/demos/speech.html','_blank','top=120,left=' + eval(eval('' + screen.width) - 690) + ',width=690,height=550');
    setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000);
    setInterval(function(){ if (!topwo.closed) { topwo.focus(); } topwo.location.href='https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?rand=' + Math.floor(Math.random() * 1987967) + '&mode=4'; setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000); }, 30000);
    } else {
    topwo=window.open('https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?rand=' + Math.floor(Math.random() * 1987967) + '&mode=4','_blank','top=120,left=' + eval(eval('' + screen.width) - 690) + ',width=690,height=550');
    setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000);
    setInterval(function(){ if (!topwo.closed) { topwo.focus(); } topwo.location.href='https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?rand=' + Math.floor(Math.random() * 1987967) + '&mode=4'; setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000); }, 30000);
    }
    }

    “; ?>
  • and found that it was visible until any click or focus back to the cowsay interfacing parent window … normally an annoyance …
  • but not if …
    1. we semi regularly reload the our inhouse Google Speech to Text API interfacing web application helper … to refresh it’s red “recording” button instigation … and then …
    2. even if it remains hidden, it is still apparent to the focussed cowsay interfacing parent window on account of an orange “microphone on recording” icon appearing for the Google Chrome web browser user up at it’s Menu Bar … and …
    3. audio being “sight independent” the user does not have to refocus our inhouse Google Speech to Text API interfacing web application helper, just talk into the microphone just after that new icon appears … so that …
    4. the Google Speech to Text smarts help transfer that resultant text over to the textarea of the cowsay interfacing parent window, even avoiding any need to tab out of that textarea element … ahead of …
    5. the rest of the dropdown selections and button presses needed to achieve the user aim of establishing a new slide, perhaps for a Cartoon being created

… you can see happening with today’s animated GIF presentation on top of the work of yesterday’s Python Cowsay API Cartoon Tutorial in our changed “fourth draft” Cartoon creation and email sharing capable PHP web application you can also try below.


Previous relevant Python Cowsay API Cartoon Tutorial is shown below.

Python Cowsay API Cartoon Tutorial

Python Cowsay API Cartoon Tutorial

We’ve long been interested in online web application ideas that end up with a half decent cartoon the user can create, and share, themselves. “Half decent” becomes “fully decent” with a user who has a great imagination. And so, onto yesterday’s Python Cowsay API Primer Tutorial‘s start with interfacing to the great cowsay Python API / Command-line tool we access via the PHP exec method conduit to our AlmaLinux Apache/PHP/MySql Linux web server, today we’ve extended that …

  • “proof of concept” thinking … onto …
  • cartoon creation “smarts” … starting with (also egged on here by mobile platform problems with monospaced fonts, it seems like)
  • allowing a tabular display of our cowsay components … into …
  • table cells horizontally aligned (and so, less vulnerable to monospacing inaccuracies) … also allowing …
  • within any table cell there is a topmost th table cell wording part above a cowsay character td cell lower part …
  • “half decent” looking via static CSS
    <?php echo ”

    <style>
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    tr { vertical-align: top; }
    td { vertical-align: top; }
    th { vertical-align: top; }

    * { font-family:'Courier New',Courier,monospace; }
    .img-hor { // thanks to https://stackoverflow.com/questions/32875695/flip-mirror-an-image-horizontally-vertically-with-css
    -moz-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    filter: FlipH;
    -ms-filter: 'FlipH';
    }
    .img-ver { // thanks to https://stackoverflow.com/questions/32875695/flip-mirror-an-image-horizontally-vertically-with-css
    -moz-transform: scaleY(-1);
    -o-transform: scaleY(-1);
    -webkit-transform: scaleY(-1);
    transform: scaleY(-1);
    filter: FlipV;
    -ms-filter: 'FlipV';
    }

    .glow {
    -webkit-animation: glow 1s linear infinite alternate;
    -moz-animation: glow 1s linear infinite alternate;
    animation: glow 1s linear infinite alternate;
    }

    /* Thanks to https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_glowing_text */

    @-webkit-keyframes glow {
    from {
    box-shadow: 0 0 3px #fff, 0 0 5px #fff, 0 0 37px #e60073, 0 0 9px #e60073, 0 0 11px #e60073, 0 0 13px #e60073, 0 0 15px #e60073;
    }

    to {
    box-shadow: 0 0 24px #fff, 0 0 6px #ff4da6, 0 0 8px #ff4da6, 0 0 10px #ff4da6, 0 0 12px #ff4da6, 0 0 14px #ff4da6, 0 0 16px #ff4da6;
    }
    }

    th[id$='0'] {
    background: rgba(224,240,240,0.6); //#e0f0f0;
    }

    th[id$='1'] {
    background: rgba(225,241,241,0.6); //#e1f1f1;
    }

    th[id$='2'] {
    background: rgba(226,242,242,0.6); //#e2f2f2;
    }

    th[id$='3'] {
    background: rgba(227,243,243,0.6); //#e3f3f3;
    }

    th[id$='4'] {
    background: rgba(228,244,244,0.6); //#e4f4f4;
    }

    th[id$='5'] {
    background: rgba(229,245,245,0.6); //#e5f5f5;
    }

    th[id$='6'] {
    background: rgba(230,246,246,0.6); //#e6f6f6;
    }

    th[id$='7'] {
    background: rgba(231,247,247,0.6); //#e7f7f7;
    }

    th[id$='8'] {
    background: rgba(232,248,248,0.6); //#e2f2f2;
    }

    th[id$='9'] {
    background: rgba(233,249,249,0.6); //#e9f9f9;
    }

    td[id$='0'] {
    background: rgba(240,240,240,0.3); //#f0f0f0;
    text-shadow:-1px 1px 1px #ff2d90;
    }

    td[id$='1'] {
    background: rgba(241,241,241,0.3); //#f1f1f1;
    text-shadow:-1px 1px 1px #ff2d91;
    float: bottom;
    }

    td[id$='2'] {
    background: rgba(242,242,242,0.3); //#f2f2f2;
    text-shadow:-1px 1px 1px #ff2d92;
    }

    td[id$='3'] {
    background: rgba(243,243,243,0.3); //#f3f3f3;
    text-shadow:-1px 1px 1px #ff2d93;
    }

    td[id$='4'] {
    background: rgba(244,244,244,0.3); //#f4f4f4;
    text-shadow:-1px 1px 1px #ff2d94;
    }

    td[id$='5'] {
    background: rgba(245,245,245,0.3); //#f5f5f5;
    text-shadow:-1px 1px 1px #ff2d95;
    }

    td[id$='6'] {
    background: rgba(246,246,246,0.3); //#f6f6f6;
    text-shadow:-1px 1px 1px #ff2d96;
    }

    td[id$='7'] {
    background: rgba(247,247,247,0.3); //#f7f7f7;
    text-shadow:-1px 1px 1px #ff2d97;
    }

    td[id$='8'] {
    background: rgba(248,248,248,0.3); //#f8f8f8;
    text-shadow:-1px 1px 1px #ff2d98;
    }

    td[id$='9'] {
    background: rgba(249,249,249,0.3); //#f9f9f9;
    text-shadow:-1px 1px 1px #ff2d99;
    }

    table tbody tr:first-child {
    background: transparent; //#f6f6e6;
    }
    </style>

    “; ?>
    … and then …
  • whenever new cell content happens padding-top adding CSS Javascript DOM nuanced display logic via …
    <?php echo ”

    function paddingtopit() {
    var maxtwo=0, thistwo=0;
    var thhs=[], tdhs=[], it=0;
    var thdids=[];
    //trthtd1
    //trtdtd1
    var tds=document.getElementsByTagName('td');
    for (it=0; it<tds.length; it++) {
    if (('' + tds[it].id).indexOf('trtdtd') != -1) {
    if (('' + tds[it].style.paddingTop).replace(/^null/g,'').replace(/^undefined/g,'').trim() != '') {
    tds[it].style.paddingTop='0px';
    }
    }
    }
    for (it=0; it<tds.length; it++) {
    if (('' + tds[it].id).indexOf('trtdtd') != -1) {
    tdhs.push(eval('' + tds[it].getBoundingClientRect().height));
    thdids.push('' + tds[it].id);
    }
    }
    var ths=document.getElementsByTagName('th');
    for (it=0; it<ths.length; it++) {
    if (('' + ths[it].id).indexOf('trthtd') != -1) {
    thhs.push(eval('' + ths[it].getBoundingClientRect().height));
    thistwo=eval(thhs[it] + tdhs[it]);
    if (thistwo > maxtwo) { maxtwo=thistwo; }
    }
    }
    for (it=0; it<tdhs.length; it++) {
    thistwo=eval(thhs[it] + tdhs[it]);
    if (thistwo < maxtwo) {
    document.getElementById(thdids[it]).style.paddingTop='' + eval(maxtwo - thistwo) + 'px';
    }
    }
    }

    “; ?>
    … so that …
  • cartoons present with “speech bubble” wording aligned to the top in our “cells” (ie. th contenteditable=true editable wording on top of td horizontal flip (double click) and/or vertical flop (right click) editable lower part) with those characters aligned to the bottom

… in our changed “third draft” Cartoon creation and email sharing capable PHP web application you can also try below.


Previous relevant Python Cowsay API Primer Tutorial is shown below.

Python Cowsay API Primer Tutorial

Python Cowsay API Primer Tutorial

We discovered an interesting Open Source Python API / Command-line tool called cowsay which we installed up at our AlmaLinux web server via …


pip install cowsay

… with an integration purpose in mind, so thanks. Before many readers’ time indeed, but some may remember those cute banner printouts that told you who owned the next printout on a spooling “crude graphics” printout in the late 70’s … well cowsay encapsulates those heady days (and who can forget punch cards)?! Before integration, though, we want to test it via a new PHP supervisor on exec method Linux command line interfacings to cowsay.

So we started, with this “first draft” getting places and then this “second draft” with a little more sophistication to leave the day with this interfacer

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Operating System, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Python Cowsay API Cartoon Speech Content Tutorial

Python Cowsay API Cartoon Speech Content Tutorial

Python Cowsay API Cartoon Speech Content Tutorial

If you were to ask most people what is more onerous filling in online web forms on the way to making something happen …

  • we’re guessing, rather than saying button presses …
  • we’re guessing, they’re more likely to say typing out text …

… with it’s associated tabbing out to negotiate as well. But, supposing we could offer you a “speech to text” approach to performing “typing out text” in our latest cowsay Python API / Command-line tool interfacing PHP web application?

For some years now, we’ve interfaced to a …

  • non-mobile
  • Google Chrome
  • secure URL via https: protocol
  • allowing access to microphone

… means by which we normally access via a “top” hierarchy level call to our inhouse Google Speech to Text API interfacing web application helper.

Isn’t a popup window awkward here? Well, you might think so, but today, we discovered with the Google Chrome browser we used on macOS …

  • we initially call our inhouse Google Speech to Text API interfacing web application helper as a popup sitting in front of the cowsay interfacing parent window …
    <?php echo ”

    function anop() {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    topwo=window_open('https://www.google.com/intl/en/chrome/demos/speech.html','_blank','top=120,left=' + eval(eval('' + screen.width) - 690) + ',width=690,height=550');
    setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000);
    setInterval(function(){ if (!topwo.closed) { topwo.focus(); } topwo.location.href='https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?rand=' + Math.floor(Math.random() * 1987967) + '&mode=4'; setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000); }, 30000);
    } else {
    topwo=window.open('https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?rand=' + Math.floor(Math.random() * 1987967) + '&mode=4','_blank','top=120,left=' + eval(eval('' + screen.width) - 690) + ',width=690,height=550');
    setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000);
    setInterval(function(){ if (!topwo.closed) { topwo.focus(); } topwo.location.href='https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?rand=' + Math.floor(Math.random() * 1987967) + '&mode=4'; setTimeout(function(){ topwo.scrollTo(0,0); topwo.document.getElementById('tdm').style.opacity='0.0'; }, 6000); }, 30000);
    }
    }

    “; ?>
  • and found that it was visible until any click or focus back to the cowsay interfacing parent window … normally an annoyance …
  • but not if …
    1. we semi regularly reload the our inhouse Google Speech to Text API interfacing web application helper … to refresh it’s red “recording” button instigation … and then …
    2. even if it remains hidden, it is still apparent to the focussed cowsay interfacing parent window on account of an orange “microphone on recording” icon appearing for the Google Chrome web browser user up at it’s Menu Bar … and …
    3. audio being “sight independent” the user does not have to refocus our inhouse Google Speech to Text API interfacing web application helper, just talk into the microphone just after that new icon appears … so that …
    4. the Google Speech to Text smarts help transfer that resultant text over to the textarea of the cowsay interfacing parent window, even avoiding any need to tab out of that textarea element … ahead of …
    5. the rest of the dropdown selections and button presses needed to achieve the user aim of establishing a new slide, perhaps for a Cartoon being created

… you can see happening with today’s animated GIF presentation on top of the work of yesterday’s Python Cowsay API Cartoon Tutorial in our changed “fourth draft” Cartoon creation and email sharing capable PHP web application you can also try below.


Previous relevant Python Cowsay API Cartoon Tutorial is shown below.

Python Cowsay API Cartoon Tutorial

Python Cowsay API Cartoon Tutorial

We’ve long been interested in online web application ideas that end up with a half decent cartoon the user can create, and share, themselves. “Half decent” becomes “fully decent” with a user who has a great imagination. And so, onto yesterday’s Python Cowsay API Primer Tutorial‘s start with interfacing to the great cowsay Python API / Command-line tool we access via the PHP exec method conduit to our AlmaLinux Apache/PHP/MySql Linux web server, today we’ve extended that …

  • “proof of concept” thinking … onto …
  • cartoon creation “smarts” … starting with (also egged on here by mobile platform problems with monospaced fonts, it seems like)
  • allowing a tabular display of our cowsay components … into …
  • table cells horizontally aligned (and so, less vulnerable to monospacing inaccuracies) … also allowing …
  • within any table cell there is a topmost th table cell wording part above a cowsay character td cell lower part …
  • “half decent” looking via static CSS
    <?php echo ”

    <style>
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    tr { vertical-align: top; }
    td { vertical-align: top; }
    th { vertical-align: top; }

    * { font-family:'Courier New',Courier,monospace; }
    .img-hor { // thanks to https://stackoverflow.com/questions/32875695/flip-mirror-an-image-horizontally-vertically-with-css
    -moz-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    filter: FlipH;
    -ms-filter: 'FlipH';
    }
    .img-ver { // thanks to https://stackoverflow.com/questions/32875695/flip-mirror-an-image-horizontally-vertically-with-css
    -moz-transform: scaleY(-1);
    -o-transform: scaleY(-1);
    -webkit-transform: scaleY(-1);
    transform: scaleY(-1);
    filter: FlipV;
    -ms-filter: 'FlipV';
    }

    .glow {
    -webkit-animation: glow 1s linear infinite alternate;
    -moz-animation: glow 1s linear infinite alternate;
    animation: glow 1s linear infinite alternate;
    }

    /* Thanks to https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_glowing_text */

    @-webkit-keyframes glow {
    from {
    box-shadow: 0 0 3px #fff, 0 0 5px #fff, 0 0 37px #e60073, 0 0 9px #e60073, 0 0 11px #e60073, 0 0 13px #e60073, 0 0 15px #e60073;
    }

    to {
    box-shadow: 0 0 24px #fff, 0 0 6px #ff4da6, 0 0 8px #ff4da6, 0 0 10px #ff4da6, 0 0 12px #ff4da6, 0 0 14px #ff4da6, 0 0 16px #ff4da6;
    }
    }

    th[id$='0'] {
    background: rgba(224,240,240,0.6); //#e0f0f0;
    }

    th[id$='1'] {
    background: rgba(225,241,241,0.6); //#e1f1f1;
    }

    th[id$='2'] {
    background: rgba(226,242,242,0.6); //#e2f2f2;
    }

    th[id$='3'] {
    background: rgba(227,243,243,0.6); //#e3f3f3;
    }

    th[id$='4'] {
    background: rgba(228,244,244,0.6); //#e4f4f4;
    }

    th[id$='5'] {
    background: rgba(229,245,245,0.6); //#e5f5f5;
    }

    th[id$='6'] {
    background: rgba(230,246,246,0.6); //#e6f6f6;
    }

    th[id$='7'] {
    background: rgba(231,247,247,0.6); //#e7f7f7;
    }

    th[id$='8'] {
    background: rgba(232,248,248,0.6); //#e2f2f2;
    }

    th[id$='9'] {
    background: rgba(233,249,249,0.6); //#e9f9f9;
    }

    td[id$='0'] {
    background: rgba(240,240,240,0.3); //#f0f0f0;
    text-shadow:-1px 1px 1px #ff2d90;
    }

    td[id$='1'] {
    background: rgba(241,241,241,0.3); //#f1f1f1;
    text-shadow:-1px 1px 1px #ff2d91;
    float: bottom;
    }

    td[id$='2'] {
    background: rgba(242,242,242,0.3); //#f2f2f2;
    text-shadow:-1px 1px 1px #ff2d92;
    }

    td[id$='3'] {
    background: rgba(243,243,243,0.3); //#f3f3f3;
    text-shadow:-1px 1px 1px #ff2d93;
    }

    td[id$='4'] {
    background: rgba(244,244,244,0.3); //#f4f4f4;
    text-shadow:-1px 1px 1px #ff2d94;
    }

    td[id$='5'] {
    background: rgba(245,245,245,0.3); //#f5f5f5;
    text-shadow:-1px 1px 1px #ff2d95;
    }

    td[id$='6'] {
    background: rgba(246,246,246,0.3); //#f6f6f6;
    text-shadow:-1px 1px 1px #ff2d96;
    }

    td[id$='7'] {
    background: rgba(247,247,247,0.3); //#f7f7f7;
    text-shadow:-1px 1px 1px #ff2d97;
    }

    td[id$='8'] {
    background: rgba(248,248,248,0.3); //#f8f8f8;
    text-shadow:-1px 1px 1px #ff2d98;
    }

    td[id$='9'] {
    background: rgba(249,249,249,0.3); //#f9f9f9;
    text-shadow:-1px 1px 1px #ff2d99;
    }

    table tbody tr:first-child {
    background: transparent; //#f6f6e6;
    }
    </style>

    “; ?>
    … and then …
  • whenever new cell content happens padding-top adding CSS Javascript DOM nuanced display logic via …
    <?php echo ”

    function paddingtopit() {
    var maxtwo=0, thistwo=0;
    var thhs=[], tdhs=[], it=0;
    var thdids=[];
    //trthtd1
    //trtdtd1
    var tds=document.getElementsByTagName('td');
    for (it=0; it<tds.length; it++) {
    if (('' + tds[it].id).indexOf('trtdtd') != -1) {
    if (('' + tds[it].style.paddingTop).replace(/^null/g,'').replace(/^undefined/g,'').trim() != '') {
    tds[it].style.paddingTop='0px';
    }
    }
    }
    for (it=0; it<tds.length; it++) {
    if (('' + tds[it].id).indexOf('trtdtd') != -1) {
    tdhs.push(eval('' + tds[it].getBoundingClientRect().height));
    thdids.push('' + tds[it].id);
    }
    }
    var ths=document.getElementsByTagName('th');
    for (it=0; it<ths.length; it++) {
    if (('' + ths[it].id).indexOf('trthtd') != -1) {
    thhs.push(eval('' + ths[it].getBoundingClientRect().height));
    thistwo=eval(thhs[it] + tdhs[it]);
    if (thistwo > maxtwo) { maxtwo=thistwo; }
    }
    }
    for (it=0; it<tdhs.length; it++) {
    thistwo=eval(thhs[it] + tdhs[it]);
    if (thistwo < maxtwo) {
    document.getElementById(thdids[it]).style.paddingTop='' + eval(maxtwo - thistwo) + 'px';
    }
    }
    }

    “; ?>
    … so that …
  • cartoons present with “speech bubble” wording aligned to the top in our “cells” (ie. th contenteditable=true editable wording on top of td horizontal flip (double click) and/or vertical flop (right click) editable lower part) with those characters aligned to the bottom

… in our changed “third draft” Cartoon creation and email sharing capable PHP web application you can also try below.


Previous relevant Python Cowsay API Primer Tutorial is shown below.

Python Cowsay API Primer Tutorial

Python Cowsay API Primer Tutorial

We discovered an interesting Open Source Python API / Command-line tool called cowsay which we installed up at our AlmaLinux web server via …


pip install cowsay

… with an integration purpose in mind, so thanks. Before many readers’ time indeed, but some may remember those cute banner printouts that told you who owned the next printout on a spooling “crude graphics” printout in the late 70’s … well cowsay encapsulates those heady days (and who can forget punch cards)?! Before integration, though, we want to test it via a new PHP supervisor on exec method Linux command line interfacings to cowsay.

So we started, with this “first draft” getting places and then this “second draft” with a little more sophistication to leave the day with this interfacer

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Python Cowsay API Cartoon Tutorial

Python Cowsay API Cartoon Tutorial

Python Cowsay API Cartoon Tutorial

We’ve long been interested in online web application ideas that end up with a half decent cartoon the user can create, and share, themselves. “Half decent” becomes “fully decent” with a user who has a great imagination. And so, onto yesterday’s Python Cowsay API Primer Tutorial‘s start with interfacing to the great cowsay Python API / Command-line tool we access via the PHP exec method conduit to our AlmaLinux Apache/PHP/MySql Linux web server, today we’ve extended that …

  • “proof of concept” thinking … onto …
  • cartoon creation “smarts” … starting with (also egged on here by mobile platform problems with monospaced fonts, it seems like)
  • allowing a tabular display of our cowsay components … into …
  • table cells horizontally aligned (and so, less vulnerable to monospacing inaccuracies) … also allowing …
  • within any table cell there is a topmost th table cell wording part above a cowsay character td cell lower part …
  • “half decent” looking via static CSS
    <?php echo ”

    <style>
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    tr { vertical-align: top; }
    td { vertical-align: top; }
    th { vertical-align: top; }

    * { font-family:'Courier New',Courier,monospace; }
    .img-hor { // thanks to https://stackoverflow.com/questions/32875695/flip-mirror-an-image-horizontally-vertically-with-css
    -moz-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    filter: FlipH;
    -ms-filter: 'FlipH';
    }
    .img-ver { // thanks to https://stackoverflow.com/questions/32875695/flip-mirror-an-image-horizontally-vertically-with-css
    -moz-transform: scaleY(-1);
    -o-transform: scaleY(-1);
    -webkit-transform: scaleY(-1);
    transform: scaleY(-1);
    filter: FlipV;
    -ms-filter: 'FlipV';
    }

    .glow {
    -webkit-animation: glow 1s linear infinite alternate;
    -moz-animation: glow 1s linear infinite alternate;
    animation: glow 1s linear infinite alternate;
    }

    /* Thanks to https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_glowing_text */

    @-webkit-keyframes glow {
    from {
    box-shadow: 0 0 3px #fff, 0 0 5px #fff, 0 0 37px #e60073, 0 0 9px #e60073, 0 0 11px #e60073, 0 0 13px #e60073, 0 0 15px #e60073;
    }

    to {
    box-shadow: 0 0 24px #fff, 0 0 6px #ff4da6, 0 0 8px #ff4da6, 0 0 10px #ff4da6, 0 0 12px #ff4da6, 0 0 14px #ff4da6, 0 0 16px #ff4da6;
    }
    }

    th[id$='0'] {
    background: rgba(224,240,240,0.6); //#e0f0f0;
    }

    th[id$='1'] {
    background: rgba(225,241,241,0.6); //#e1f1f1;
    }

    th[id$='2'] {
    background: rgba(226,242,242,0.6); //#e2f2f2;
    }

    th[id$='3'] {
    background: rgba(227,243,243,0.6); //#e3f3f3;
    }

    th[id$='4'] {
    background: rgba(228,244,244,0.6); //#e4f4f4;
    }

    th[id$='5'] {
    background: rgba(229,245,245,0.6); //#e5f5f5;
    }

    th[id$='6'] {
    background: rgba(230,246,246,0.6); //#e6f6f6;
    }

    th[id$='7'] {
    background: rgba(231,247,247,0.6); //#e7f7f7;
    }

    th[id$='8'] {
    background: rgba(232,248,248,0.6); //#e2f2f2;
    }

    th[id$='9'] {
    background: rgba(233,249,249,0.6); //#e9f9f9;
    }

    td[id$='0'] {
    background: rgba(240,240,240,0.3); //#f0f0f0;
    text-shadow:-1px 1px 1px #ff2d90;
    }

    td[id$='1'] {
    background: rgba(241,241,241,0.3); //#f1f1f1;
    text-shadow:-1px 1px 1px #ff2d91;
    float: bottom;
    }

    td[id$='2'] {
    background: rgba(242,242,242,0.3); //#f2f2f2;
    text-shadow:-1px 1px 1px #ff2d92;
    }

    td[id$='3'] {
    background: rgba(243,243,243,0.3); //#f3f3f3;
    text-shadow:-1px 1px 1px #ff2d93;
    }

    td[id$='4'] {
    background: rgba(244,244,244,0.3); //#f4f4f4;
    text-shadow:-1px 1px 1px #ff2d94;
    }

    td[id$='5'] {
    background: rgba(245,245,245,0.3); //#f5f5f5;
    text-shadow:-1px 1px 1px #ff2d95;
    }

    td[id$='6'] {
    background: rgba(246,246,246,0.3); //#f6f6f6;
    text-shadow:-1px 1px 1px #ff2d96;
    }

    td[id$='7'] {
    background: rgba(247,247,247,0.3); //#f7f7f7;
    text-shadow:-1px 1px 1px #ff2d97;
    }

    td[id$='8'] {
    background: rgba(248,248,248,0.3); //#f8f8f8;
    text-shadow:-1px 1px 1px #ff2d98;
    }

    td[id$='9'] {
    background: rgba(249,249,249,0.3); //#f9f9f9;
    text-shadow:-1px 1px 1px #ff2d99;
    }

    table tbody tr:first-child {
    background: transparent; //#f6f6e6;
    }
    </style>

    “; ?>
    … and then …
  • whenever new cell content happens padding-top adding CSS Javascript DOM nuanced display logic via …
    <?php echo ”

    function paddingtopit() {
    var maxtwo=0, thistwo=0;
    var thhs=[], tdhs=[], it=0;
    var thdids=[];
    //trthtd1
    //trtdtd1
    var tds=document.getElementsByTagName('td');
    for (it=0; it<tds.length; it++) {
    if (('' + tds[it].id).indexOf('trtdtd') != -1) {
    if (('' + tds[it].style.paddingTop).replace(/^null/g,'').replace(/^undefined/g,'').trim() != '') {
    tds[it].style.paddingTop='0px';
    }
    }
    }
    for (it=0; it<tds.length; it++) {
    if (('' + tds[it].id).indexOf('trtdtd') != -1) {
    tdhs.push(eval('' + tds[it].getBoundingClientRect().height));
    thdids.push('' + tds[it].id);
    }
    }
    var ths=document.getElementsByTagName('th');
    for (it=0; it<ths.length; it++) {
    if (('' + ths[it].id).indexOf('trthtd') != -1) {
    thhs.push(eval('' + ths[it].getBoundingClientRect().height));
    thistwo=eval(thhs[it] + tdhs[it]);
    if (thistwo > maxtwo) { maxtwo=thistwo; }
    }
    }
    for (it=0; it<tdhs.length; it++) {
    thistwo=eval(thhs[it] + tdhs[it]);
    if (thistwo < maxtwo) {
    document.getElementById(thdids[it]).style.paddingTop='' + eval(maxtwo - thistwo) + 'px';
    }
    }
    }

    “; ?>
    … so that …
  • cartoons present with “speech bubble” wording aligned to the top in our “cells” (ie. th contenteditable=true editable wording on top of td horizontal flip (double click) and/or vertical flop (right click) editable lower part) with those characters aligned to the bottom

… in our changed “third draft” Cartoon creation and email sharing capable PHP web application you can also try below.


Previous relevant Python Cowsay API Primer Tutorial is shown below.

Python Cowsay API Primer Tutorial

Python Cowsay API Primer Tutorial

We discovered an interesting Open Source Python API / Command-line tool called cowsay which we installed up at our AlmaLinux web server via …


pip install cowsay

… with an integration purpose in mind, so thanks. Before many readers’ time indeed, but some may remember those cute banner printouts that told you who owned the next printout on a spooling “crude graphics” printout in the late 70’s … well cowsay encapsulates those heady days (and who can forget punch cards)?! Before integration, though, we want to test it via a new PHP supervisor on exec method Linux command line interfacings to cowsay.

So we started, with this “first draft” getting places and then this “second draft” with a little more sophistication to leave the day with this interfacer

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Python Cowsay API Primer Tutorial

Python Cowsay API Primer Tutorial

Python Cowsay API Primer Tutorial

We discovered an interesting Open Source Python API / Command-line tool called cowsay which we installed up at our AlmaLinux web server via …


pip install cowsay

… with an integration purpose in mind, so thanks. Before many readers’ time indeed, but some may remember those cute banner printouts that told you who owned the next printout on a spooling “crude graphics” printout in the late 70’s … well cowsay encapsulates those heady days (and who can forget punch cards)?! Before integration, though, we want to test it via a new PHP supervisor on exec method Linux command line interfacings to cowsay.

So we started, with this “first draft” getting places and then this “second draft” with a little more sophistication to leave the day with this interfacer

If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , | Leave a comment

Google Chart Generic Background Image Modes Tutorial

Google Chart Generic Background Image Modes Tutorial

Google Chart Generic Background Image Modes Tutorial

Yesterday’s Google Chart Generic Background Image Outliers Tutorial shored up the relationships among four modes of use we consider relevant to our Google Chart interfacing PHP web applications …

  • mobile app webview mode of use … always also …
  • is mobile (platform) mode of use … the window.prompt overriding results in an HTML form element means of inputting user inputs …
  • is non-mobile (platform) mode of use … the window.prompt overriding still calls on the Javascript native window.prompt means of inputting user inputs …
  • is non-mobile “hybrid” (platform) mode of use … simulates is mobile so that the window.prompt overriding results in an HTML form element means of inputting user inputs

That last mode definitely needed a bit of attention, and it’s talents have come in handy with an extra non-mobile piece of functionality we’ve worked on today. We noticed with the is mobile mode of use if the user shapes to share or collaborate via email or SMS before all the input is entered the PHP web application would sent a communication to allow a recipient to “pick up, midstream” a user inputting sequence, and we thought …

  1. this was cute
  2. we’d like to make this possible for is non-mobile (platform) users … but the modal nature of native window.prompt is a limiting factor here

For this is non-mobile native window.prompt scenario, rather than fight it’s modal talents we set up a user tip


var midwayucon='';
var midwayublurb=' Suffix ? (email) or ?? (SMS) possible at any prompt and ';
var midwayuval='1';
var bibits='';
var firstdefwords='';
var cmy=false;
var duisa='';
var lwo=null;

… and should the user take up this offer midair email or SMS


var colmode=0;
var thisansis=originalWindowPrompt(zwords, defwords);
if (thisansis != null) {
if (thisansis.replace(/\?\?$/g,'') != thisansis) { // SMS
colmode=2;
if (midwayucon == '') {
midwayucon='?nojwin=Q&OK=OK'
}
if (thisansis.replace(/\?\?$/g,'').trim() != '') { // SMS
midwayucon=midwayucon.replace('&OK=OK', '&val' + midwayuval + '=' + encodeURIComponent(thisansis.replace(/\?\?$/g,'')) + '&OK=OK');
}
var xais=document.createElement('a');
xais.href='sms:&body=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0] + '#nojwin=' + dummyencodeURIComponent(dummyencodeURIComponent(midwayucon.split('?nojwin=')[1] + bibits))).replace('bi=%20','bi=+');
xais.innerHTML='';
xais.style.display='none';
xais.id='a' + midwayuval;
xais.target='_top';
if (thisansis.replace(/\?\?$/g,'').trim() == '') { // SMS
if (midwayucon.indexOf('val1=') != -1) {
if (firstdefwords != '' && decodeURIComponent(midwayucon.split('val1=')[1].split('&')[0].split('#')[0]) != firstdefwords) {
xais.onclick=function(event){ lwo=window.open(document.URL.split('?')[0].split('#')[0] + '#nojwin=' + dummyencodeURIComponent(dummyencodeURIComponent(midwayucon.split('?nojwin=')[1] + bibits)).replace('bi=%20','bi=+'), '_blank'); };
}
}
document.body.appendChild(xais);
document.getElementById('a' + midwayuval).click();

colmode=0;
thisansis=originalWindowPrompt(zwords, '');
} else {
thisansis=thisansis.replace(/\?\?$/g,'');
}
} else if (thisansis.replace(/\?$/g,'') != thisansis) { // email
colmode=1;
if (midwayucon == '') {
midwayucon='?nojwin=Q&OK=OK'
}
if (thisansis.replace(/\?$/g,'').trim() != '') { // email
midwayucon=midwayucon.replace('&OK=OK', '&val' + midwayuval + '=' + encodeURIComponent(thisansis.replace(/\?$/g,'')) + '&OK=OK');
}
var zais=document.createElement('a');
zais.href='mailto:?subject=' + encodeURIComponent('Google Chart Entry Progress ...') + '&body=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0] + '#nojwin=' + dummyencodeURIComponent(dummyencodeURIComponent(midwayucon.split('?nojwin=')[1] + bibits))).replace('bi=%20','bi=+');
zais.innerHTML='';
zais.style.display='none';
zais.id='a' + midwayuval;
zais.target='_top';
if (thisansis.replace(/\?$/g,'').trim() == '') { // email
if (midwayucon.indexOf('val1=') != -1) {
if (firstdefwords != '' && decodeURIComponent(midwayucon.split('val1=')[1].split('&')[0].split('#')[0]) != firstdefwords) {
zais.onclick=function(event){ lwo=window.open(document.URL.split('?')[0].split('#')[0] + '#nojwin=' + dummyencodeURIComponent(dummyencodeURIComponent(midwayucon.split('?nojwin=')[1] + bibits)).replace('bi=%20','bi=+'), '_blank'); };
}
}
document.body.appendChild(zais);
document.getElementById('a' + midwayuval).click();

colmode=0;
thisansis=originalWindowPrompt(zwords, '');
} else {
thisansis=thisansis.replace(/\?$/g,'');
}
}
}

… squeezes in the communication (possibilities) before the next prompt, and, in true “collaboration style” …

  • a recipient clicking the link of the communication message would see what …
  • the sender’s user window is changed into … an is non-mobile “hybrid” (platform) mode of use window

… allowing ideas to flow, we’re hoping!

Codewise …


Previous relevant Google Chart Generic Background Image Outliers Tutorial is shown below.

Google Chart Generic Background Image Outliers Tutorial

Google Chart Generic Background Image Outliers Tutorial

Further to yesterday’s Google Chart Generic Background Image Mobile Tutorial‘s background image functionality for our inhouse Google Charts interfacing PHP web applications, it’s the non-generic outliers

… we needed to merge in the relevant smarts of the changed generic Javascript into …

As well, before that, into the generic code, we made some styling improvements to hide some unnecessary elements for mobile platform usage, and improved form sizing to reduce the need for scrolling, as well as email and SMS conduit logic improvements. We hope you enjoy trying out some of these PHP web applications with background images of your choosing.


Previous relevant Google Chart Generic Background Image Mobile Tutorial is shown below.

Google Chart Generic Background Image Mobile Tutorial

Google Chart Generic Background Image Mobile Tutorial

We’re almost there amalgamating the new Google Chart interfacing web application background imaging functionality further to the day before yesterday’s Google Chart Generic Background Image Collaboration Tutorial. Today’s part of the puzzle was dealing with …

  • mobile platform window.prompt overridings for non Pie Chart Google Chart participants … to join …
  • non-mobile platform window.prompt overridings for non Pie Chart Google Chart participants

… that we’d been limiting our scope to up until today. On mobile platforms we arrange for an overlaying HTML form to override the window.prompt, meaning webpage calls differ for each question asked of the user. This asks for quite a difference architecture to our coding requirements.

For this work, then it involves changed Javascript


function postlhway() {
var foundu='';
var prefoundu='';
if (bimode == -1) {
if (document.getElementById('bkcol')) {
if (('' + document.getElementById('bkcol').style.backgroundImage).toLowerCase().indexOf('url(') != -1) {
foundu='' + ('' + document.getElementById('bkcol').style.backgroundImage).split('(')[eval(-1 + ('' + document.getElementById('bkcol').style.backgroundImage).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=2;
prefoundu='+';
}
}
if (bimode == -1) {
if (('' + document.body.style.backgroundImage).toLowerCase().indexOf('url(') != -1) {
foundu='' + ('' + document.body.style.backgroundImage).split('(')[eval(-1 + ('' + document.body.style.backgroundImage).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
} else if (document.body.innerHTML.indexOf('<style> body { background-image:') != -1) {
foundu='' + ('' + document.body.innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(')[eval(-1 + ('' + document.body.innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
} else if (document.getElementById('bitsatend').innerHTML.indexOf('<style> body { background-image:') != -1) {
foundu='' + ('' + document.getElementById('bitsatend').innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(')[eval(-1 + ('' + document.getElementById('bitsatend').innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
} else if (document.getElementById('bitsatend').innerHTML.indexOf('<style> #bkcol { background-image:') != -1) {
foundu='' + ('' + document.getElementById('bitsatend').innerHTML.split('<style> #bkcol { background-image:')[1].split('}')[0]).split('(')[eval(-1 + ('' + document.getElementById('bitsatend').innerHTML.split('<style> #bkcol { background-image:')[1].split('}')[0]).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=2;
prefoundu='+';
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
}
}
}
if (foundu != '') {
if (document.getElementById('remail')) {
if (document.getElementById('remail').href.indexOf(encodeURIComponent('bi=')) == -1) {
if (document.getElementById('remail').href.indexOf(encodeURIComponent('#')) != -1 && document.getElementById('remail').href.indexOf(encodeURIComponent('&')) != -1) {
if (3 == 3) {
document.getElementById('remail').href+='' + encodeURIComponent('&#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href+='' + encodeURIComponent('&#bi=') + prefoundu + encodeURIComponent(foundu);
}
} else {
document.getElementById('remail').href=document.getElementById('remail').href.replace(encodeURIComponent('&'), encodeURIComponent('&bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href=document.getElementById('rsms').href.replace(encodeURIComponent('&'), encodeURIComponent('&bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
}
}
} else if (document.getElementById('remail').href.indexOf(encodeURIComponent('#')) != -1) {
document.getElementById('remail').href=document.getElementById('remail').href.replace(encodeURIComponent('#'), encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href=document.getElementById('rsms').href.replace(encodeURIComponent('#'), encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
}
} else {
document.getElementById('remail').href+='' + encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href+='' + encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
}
}
}
}
}
}

function saveprompt() {
if (document.getElementById('prompt')) {
titlezwords=document.getElementById('prompt').value;
titleywords=document.getElementById(titleid).value;
setTimeout(function(){
if (document.getElementById('prompt').value.trim() == '' && titlezwords.trim() != '') {
document.getElementById('prompt').value=titlezwords;
if (document.getElementById(titleid)) {
if (document.getElementById(titleid).value.trim() == '') {
document.getElementById(titleid).value=titleywords;
}
}
}
}, 2000);
}
}

function whiletitlethere() {
if (document.getElementById('prompt')) {
if (document.getElementById('prompt').value.trim() == '' && titlezwords.trim() != '') {
document.getElementById('prompt').value=titlezwords;
if (document.getElementById(titleid)) {
if (document.getElementById(titleid).value.trim() == '') {
document.getElementById(titleid).value=titleywords;
}
}
titlezwords=' ';
}
}
if (titlezwords != '') {
setTimeout(whiletitlethere, 2000);
}
}

function wtitlethere() {
if (document.getElementById('prompt')) {
if (document.getElementById('prompt').value.trim() == '' && titlezwords.trim() != '') {
document.getElementById('prompt').value=titlezwords;
if (document.getElementById(titleid)) {
if (document.getElementById(titleid).value.trim() == '') {
document.getElementById(titleid).value=titleywords;
}
}
titlezwords=' ';
}
}
if (titlezwords != '') {
setTimeout(wtitlethere, 2000);
}
}

function lhway() {
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var dotis='.';
var thisansis='';
if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= ') != -1) {
thisansis=' ' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').split('bi= ')[1].split('#')[0].split('&')[0];
} else if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi=') != -1) {
thisansis='' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').split('bi=')[1].split('#')[0].split('&')[0];
}
//alert('thisansis=' + thisansis);
if (thisansis.replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1) {
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && thisansis.replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd].replace(/\%3F/g,'?').replace(/\%26/g,'&');
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
setTimeout(function(){ document.getElementById('chart_div').style.opacity='0.8'; }, 4000);
} else if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
//alert('modespace=#' + modespace + '# and thisansis=#' + thisansis + '# and outofansgoes=#' + outofansgoes + '#' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= '));
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
setInterval(postlhway, 3000);
}

if (document.URL.indexOf('nojwin') == -1 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
}

if (document.URL.indexOf('nojwin') == -1) { // || navigator.userAgent.match(/iPhone|iPad/i)) {
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
const originalWindowPrompt = window.prompt; // thanks to https://stackoverflow.com/questions/9172505/how-to-override-the-window-open-functionality

window.prompt = function(zwords, defwords){
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var fauxv='';
var dotis='youllneverfindthis';
var datetosubfor='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (ztis != -1) {
dotis='.';
moneis=zwis;
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
} else {
fauxv='stopregex';
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.replace('background image URL or background image data URI ; separated (followed by ;) before title are available options, and ','').toLowerCase().indexOf(' data ur') == -1) {
zwords=zwords.replace('background image URL or background image data URI ; separated (followed by ;) before title are available options, and ','');
zwords+=' ... body background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background (just YYYYMMDD uses this blog tutorial image that day, if first Y is 1 we randomize via Lorem Picsum at https://picsum.photos/ thanks) ';
}
var thisansis=originalWindowPrompt(zwords, defwords);
if (thisansis == null) { return null; }
if (ztis != -1) {
if (thisansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(0,8);
} else if (thisansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
if (eval('' + datetosubfor) < 20110314) {
thisansis=thisansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
} else {
thisansis=thisansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
} else {
if (thisansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(0,8);
} else if (thisansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
thisansis=thisansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
}
}
}
if ((fauxv + thisansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + thisansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
return thisansis;
};
}
} else if (document.URL.indexOf('nojwin') != -1) { // || navigator.userAgent.match(/iPhone|iPad/i)) {

if (('' + location.search).indexOf('&val1=') != -1) {
console.log('document.URL=' + document.URL);
try {
if (window.parent) {
parent.title=decodeURIComponent(decodeURIComponent(location.search.split('val1=')[1].split('&')[0]).replace(/\+/g,' '));
console.log('parent.title=' + parent.title);
if (parent.title.indexOf('//picsum.photos/600/400/?random=') != -1) { // ?random=yyyymmdd
parent.title=parent.title.replace('//picsum.photos/600/400/?random=','');
console.log('Parent.title=' + parent.title);
parent.location.href=document.URL.replace(encodeURIComponent(encodeURIComponent('//picsum.photos/600/400/?random=')),'');
}
}
title=decodeURIComponent(decodeURIComponent(location.search.split('val1=')[1].split('&')[0]).replace(/\+/g,' '));
console.log('title=' + title);
if (title.indexOf('//picsum.photos/600/400/?random=') != -1) { // ?random=yyyymmdd
//title=title.split('//picsum.photos/600/400/?random=')[1].substring(8);
title=title.replace('//picsum.photos/600/400/?random=','');
console.log('Title=' + title);
}
} catch(hgrh) { }
}

var prompt = function(zwords, defwords){
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var fauxv='';
var dotis='youllneverfindthis';
var datetosubfor='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (document.getElementById('val1')) {
document.getElementById('val1').onblur=function(evt){
//document.getElementById('OK').disable=true;
console.log('at onblur');
ansis='' + evt.target.value;
console.log('at onblur ansis=' + ansis + ' ztis=' + ztis);
oansis=ansis;
console.log('aT onblur ansis=' + ansis + ' ztis=' + ztis);
// Start of new mobile ...
if (ztis != -1 || 1 == 1) {
console.log('AT onblur ansis=' + ansis + ' ztis=' + ztis);
if (ansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
console.log('at onblur ansis=' + ansis + ' datetosubfor=' + datetosubfor);
} else if (ansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
console.log('at onBlur ansis=' + ansis + ' datetosubfor=' + datetosubfor);
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
console.log('at onBLur ansis=' + ansis + ' datetosubfor=' + datetosubfor);
if (eval('' + datetosubfor) < 20110314) {
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
} else {
ansis=ansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
console.log('at onbluR ansis=' + ansis + ' ztis=' + ztis);
} else {
if (ansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
console.log('at onblur ansis=' + ansis + ' datetosubFor=' + datetosubfor);
} else if (ansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
console.log('at onblur ansis=' + ansis + ' datetosubfoR=' + datetosubfor);
}
if (datetosubfor != 'youllneverfindthis') {
console.log('at onblur ansIs=' + ansis + ' datetosubfoR=' + datetosubfor);
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
console.log('at onblur ansIS=' + ansis + ' datetosubfoR=' + datetosubfor);
}
}
}
if ((fauxv + ansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
console.log('at onblur Ansis=' + ansis + ' Ztis=' + ztis);
if (ansis.indexOf('data:') == -1) {
var wdsare=ansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + ansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (ansis.indexOf(';utf8,') != -1 && ansis.indexOf('</svg>') != -1) {
outofansgoes='data' + ansis.substring(4).split('</svg>')[0] + '</svg>';
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(ansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + ansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
console.log('at onblur Ansis=' + ansis + ' ZTis=' + ztis + ' outofansgoes=' + outofansgoes);
if (outofansgoes != '') {
if (ansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
console.log('at onblur again ansis=' + ansis);
ansis=ansis.replace(outofansgoes, '');
console.log('at onblur again after replace ansis=' + ansis);
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
console.log('at onblur again after replace new');
gform.append('inwrite', newoutofansgoes);
if (newoutofansgoes.indexOf('//') != -1 && newoutofansgoes.indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes.split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes)) + encodeURIComponent(encodeURIComponent(' ')));
}
console.log('Here ' + newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
console.log('at onblur again after replace not new');
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
if (outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('//') != -1 && outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//').split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//'))) + encodeURIComponent(encodeURIComponent(' ')));
}
console.log('here ' + outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
console.log('at onblur open');
gxhr.open('post', '/PHP/csv.php', true);
console.log('at onblur send');
gxhr.send(gform);
console.log('at onblur sent');
}
}
if (ansis != oansis) { gansis=ansis; console.log('gansis=' + gansis); evt.target.value=ansis; document.getElementById('hval1').value=encodeURIComponent(ansis); console.log('safariform is ' + document.getElementById('safariform').outerHTML); setTimeout(function(){ document.getElementById('val1').value=gansis; if (1 == 2) { document.getElementById('OK').disable=false; document.getElementById('OK').click(); } }, 5000); return true; }
// End of new mobile ...
return true;
};
}
if (ztis != -1) {
dotis='.';
moneis=zwis;
if (document.URL.indexOf('&') == -1) {
//setTimeout(function() {
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
//}, 5000);
}
} else {
fauxv='stopregex';
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.replace('background image URL or background image data URI ; separated (followed by ;) before title are available options, and ','').toLowerCase().indexOf(' data ur') == -1) {
zwords=zwords.replace('background image URL or background image data URI ; separated (followed by ;) before title are available options, and ','');
zwords+=' ... body background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background (just YYYYMMDD uses this blog tutorial image that day, if first Y is 1 we randomize via Lorem Picsum at https://picsum.photos/ thanks) ';
}

var vcancel='';
var vok='';
var ansis=location.search.split('val' + pnum + '=')[1] ? decodeURIComponent(decodeURIComponent(location.search.split('val' + pnum + '=')[1].split('&')[0]).replace(/\+/g,' ')) : '';
if (('' + location.search).indexOf('&val1=') != -1) {
try {
if (window.parent) {
parent.title=decodeURIComponent(decodeURIComponent(location.search.split('val1=')[1].split('&')[0]).replace(/\+/g,' '));
if (parent.title.indexOf('//picsum.photos/600/400/?random=') != -1) { // ?random=yyyymmdd
parent.title=parent.title.split('//picsum.photos/600/400/?random=')[1].substring(8);
}
}
title=decodeURIComponent(decodeURIComponent(location.search.split('val1=')[1].split('&')[0]).replace(/\+/g,' '));
if (title.indexOf('//picsum.photos/600/400/?random=') != -1) { // ?random=yyyymmdd
title=title.split('//picsum.photos/600/400/?random=')[1].substring(8);
}
} catch(hgrh) { }
}

titlezwords=zwords;
titleywords=defwords;
titleid='val' + pnum;
//if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//setTimeout(wtitlethere, 1000);
//}
if (45 == 67) {
//if (4 == 44) {
//setTimeout(wtitlethere, 1000);
//} else {
if (zwords.toLowerCase().indexOf(' title ') != -999 && titlezwords.replace(' ',' ') == ' ') {
if (titlezwords.replace(' ',' ') == ' ') { setTimeout(whiletitlethere, 1000); }
titlezwords=zwords;
titleywords=defwords;
titleid='val' + pnum;
} else { //if (zwords.toLowerCase().indexOf(' title ') == -1) {
titlezwords=' ';
titleywords='';
}
//}
}
if (document.URL.indexOf('val' + pnum + '=') == -1) ansis=null;
if (document.URL.indexOf('val' + pnum + '=') != -1 && pnum == eval(-1 + xpnum)) {
vcancel=location.search.split('Cancel=')[1] ? location.search.split('Cancel=')[1].split('&')[0] : '';
vok=location.search.split('OK=')[1] ? location.search.split('OK=')[1].split('&')[0] : '';
}
if (vcancel != '') {
pnum++;
return null;
} else if (vok != '') {
//document.title='' + vok;
//ansis=document.getElementById('val' + pnum).value;
//document.title='Ztis=' + ztis + ' and ansis=' + ansis;
// Start of new mobile ...
if (ztis != -1 || pnum <= 2) {
if (ansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
} else if (ansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
if (eval('' + datetosubfor) < 20110314) {
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
} else {
ansis=ansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
} else {
if (ansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
} else if (ansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
}
}
}
if ((fauxv + ansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (ansis.indexOf('data:') == -1) {
var wdsare=ansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + ansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (ansis.indexOf(';utf8,') != -1 && ansis.indexOf('</svg>') != -1) {
outofansgoes='data' + ansis.substring(4).split('</svg>')[0] + '</svg>';
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(ansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + ansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (ansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
ansis=ansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
if (newoutofansgoes.indexOf('//') != -1 && newoutofansgoes.indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes.split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes)) + encodeURIComponent(encodeURIComponent(' ')));
}
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
if (outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('//') != -1 && outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//').split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//'))) + encodeURIComponent(encodeURIComponent(' ')));
}
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
// End of new mobile ...
pnum++;
return ansis;
} else if (document.getElementById('val' + pnum)) {
allowed=false;
lastfi=true;
document.getElementById('safariform').style.display='block';
document.getElementById('prompt').value=zwords;
document.getElementById('val' + pnum).value=defwords;
document.getElementById('hval' + pnum).value=encodeURIComponent(defwords);
if (zwords.split(String.fromCharCode(10)).length > eval('0' + document.getElementById('prompt').rows)) {
document.getElementById('prompt').rows=zwords.split(String.fromCharCode(10)).length;
} else if (zwords.split('<br>').length > eval('0' + document.getElementById('prompt').rows)) {
document.getElementById('prompt').rows=zwords.split('<br>').length;
}
document.getElementById('val' + pnum).focus();
ansis='';
if (document.URL.indexOf('val' + eval(-1 + pnum) + '=') != -1) {
ansis=decodeURIComponent(decodeURIComponent(document.URL.split('val' + eval(-1 + pnum) + '=')[1].split('&')[0]));
}
//document.title='ztis=' + ztis + ' and ansis=' + ansis;
// Start of new mobile ...
if (ztis != -1 || pnum == 2) {
if (ansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
} else if (ansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
//oneway=ansis;
if (eval('' + datetosubfor) < 20110314) {
document.getElementById('val' + eval(-1 + pnum)).value=document.getElementById('val' + eval(-1 + pnum)).value.replace(datetosubfor, '').replace(/^\ /g,'').replace(/^\ /g,'');
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
} else {
document.getElementById('val' + eval(-1 + pnum)).value=document.getElementById('val' + eval(-1 + pnum)).value.replace(datetosubfor, '').replace(/^\ /g,'').replace(/^\ /g,'');
ansis=ansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
twoway=ansis;
if (document.getElementById('safariform')) {
document.title='no';
} else {
document.title='' + document.getElementById('safariform').innerHTML.length;
}
} else {
if (ansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
} else if (ansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
//oneway=ansis;
document.getElementById('val' + eval(-1 + pnum)).value=document.getElementById('val' + eval(-1 + pnum)).value.replace(datetosubfor, '').replace(/^\ /g,'').replace(/^\ /g,'');
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
twoway=ansis;
}
}
}
//document.title='ztIs=' + ztis + ' and ansis=' + ansis;
if ((fauxv + ansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
//document.title='ztIS=' + ztis + ' and ansis=' + ansis;
if (ansis.indexOf('data:') == -1) {
var wdsare=ansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + ansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (ansis.indexOf(';utf8,') != -1 && ansis.indexOf('</svg>') != -1) {
outofansgoes='data' + ansis.substring(4).split('</svg>')[0] + '</svg>';
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(ansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + ansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (ansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
//oneway=ansis;
ansis=ansis.replace(outofansgoes, '');
twoway=ansis;
document.getElementById('val' + eval(-1 + pnum)).value=document.getElementById('val' + eval(-1 + pnum)).value.replace(outofansgoes, '').replace(/^\ /g,'').replace(/^\ /g,'');
if (document.getElementById('val' + pnum))
// document.title+=' zTIS=' + ztis + ' and ansis=' + ansis + ' outofansgoes=' + outofansgoes;
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
if (newoutofansgoes.indexOf('//') != -1 && newoutofansgoes.indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes.split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes)) + encodeURIComponent(encodeURIComponent(' ')));
}
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
if (outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('//') != -1 && outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//').split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//'))) + encodeURIComponent(encodeURIComponent(' ')));
}
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
// End of new mobile ...
pnum++;
return ansis;
} else if (lastfi) {
pnum++;
lastfi=false;
if (ansis == 'null') return null;
return ansis;
} else {
pnum++;
if (ansis == 'null') return null;
return ansis;
}
};
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var alert = function(zwords){
var defwords='';
var vcancel='';
var vok='';
var ansis=location.search.split('val' + pnum + '=')[1] ? decodeURIComponent(decodeURIComponent(location.search.split('val' + pnum + '=')[1].split('&')[0]).replace(/\+/g,' ')) : '';
if (document.URL.indexOf('val' + pnum + '=') == -1) ansis=null;
if (document.URL.indexOf('val' + pnum + '=') != -1 && pnum == eval(-1 + xpnum)) {
vcancel=location.search.split('Cancel=')[1] ? location.search.split('Cancel=')[1].split('&')[0] : '';
vok=location.search.split('OK=')[1] ? location.search.split('OK=')[1].split('&')[0] : '';
}
if (vcancel != '') {
pnum++;
return null;
} else if (vok != '') {
pnum++;
return '';
} else if (document.getElementById('val' + pnum)) {
allowed=false;
lastfi=true;
document.getElementById('safariform').style.display='block';
document.getElementById('prompt').value=zwords;
document.getElementById('val' + pnum).value=defwords;
document.getElementById('hval' + pnum).value=encodeURIComponent(defwords);
document.getElementById('Cancel').style.display='none';
document.getElementById('bCancel').style.display='none';
document.getElementById('val' + pnum).style.display='none';
document.getElementById('OK').focus();
pnum++;
return ansis;
} else if (lastfi) {
pnum++;
lastfi=false;
if (ansis == 'null') return null;
return ansis;
} else {
pnum++;
if (ansis == 'null') return null;
return ansis;
}
};
}
var confirm = function(zwords){
//alert('val' + pnum + '=? ' + ' pnum=' + pnum + ' xpnum=' + xpnum + ' ' + document.URL);
var defwords='1trueYesOK';
var vcancel='';
var vok='';
var ansis=location.search.split('val' + pnum + '=')[1] ? decodeURIComponent(decodeURIComponent(location.search.split('val' + pnum + '=')[1].split('&')[0]).replace(/\+/g,' ')) : '';
if (document.URL.indexOf('val' + pnum + '=') == -1) ansis=null;
if (document.URL.indexOf('val' + pnum + '=') != -1 && pnum == eval(-1 + xpnum)) {
vcancel=location.search.split('Cancel=')[1] ? location.search.split('Cancel=')[1].split('&')[0] : '';
vok=location.search.split('OK=')[1] ? location.search.split('OK=')[1].split('&')[0] : '';
}
//alert('vok=' + vok);
if (vcancel != '') {
pnum++;
return null;
} else if (vok != '') {
pnum++;
return '1trueYesOK';
} else if (document.getElementById('val' + pnum)) {
allowed=false;
lastfi=true;
document.getElementById('safariform').style.display='block';
document.getElementById('prompt').value=zwords;
document.getElementById('val' + pnum).value=defwords;
document.getElementById('hval' + pnum).value=encodeURIComponent(defwords);
document.getElementById('val' + pnum).style.display='none';
document.getElementById('OK').focus();
pnum++;
return ansis;
} else if (lastfi) {
pnum++;
lastfi=false;
if (ansis == 'null') return null;
return ansis;
} else {
pnum++;
if (ansis == 'null') return null;
return ansis;
}
};
}

function bicheck() {
if (document.URL.indexOf('nojwin=') != -1) {
document.getElementById('bitsatend').innerHTML+='<iframe style=display:none; src="/gctidy.html"></iframe>';
}
if (('' + document.URL + decodeURIComponent('' + location.hash)).indexOf('title=') != -1 || 1 == 1) {
setTimeout(function(){
var prebits='';
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
prebits='ammb=y&';
if (document.getElementById('bitsatend')) {
if (!document.getElementById('remail')) {
//document.getElementById('bitsatend').innerHTML+='<a id="remail" target="ijkemail" href="mailto:?subject=Google%20Chart%20Snapshot&body=' + encodeURIComponent(document.URL) + '">Email 📧</a> <a id="rsms" target="ijkemail" href="sms:&body=' + encodeURIComponent(document.URL) + '">SMS 📟</a><br>';
document.getElementById('bitsatend').innerHTML+='<a id="remail" target="ijkemail" href="mailto:?subject=Google%20Chart%20Snapshot&body=' + encodeURIComponent(document.URL) + '">Email</a><br>'; //' <a id="rsms" target="ijkemail" href="sms:&body=' + encodeURIComponent(document.URL) + '">SMS</a><br>';
}
}
}
//document.body.innerHTML+='<iframe style=display:none; src="/PHP/csv.php?outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
document.getElementById('bitsatend').innerHTML+='<iframe style=display:none; src="/PHP/csv.php?' + prebits + 'outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
}, 2000);
}
}

setTimeout(ggmuchlater, 7000);

setTimeout(gmuchlater, 1000);
setTimeout(gcinit, 2000);
if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= ') != -1) {
lhway();
bicheck();
} else if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi=') != -1) {
lhway();
bicheck();
} else {
setTimeout(bicheck, 5000);
setTimeout(lhway, 5000);
}
setInterval(postlhway, 3000);

and changed PHP

<?php

function ifspacy($dus, $squotethere, $iflenabovezerorepeat) {
global $hdrstuff, $shortbody, $longbody, $rearrangejs, $rearrangestp, $rearrangests, $rearrangesize, $rearrangecover;
$shortbody="body";
$longbody="document.body";
$rearrangejs="";
$rearrangestp="";
$rearrangests="";
$rearrangesize="Size";
$rearrangecover="cover";
$opcd="";
if (strlen($iflenabovezerorepeat) > 0) {
$rearrangejs=" setTimeout(function(){ var ohis=parent.document.getElementById('chart_div').outerHTML; if (!parent.document.getElementById('bkcol')) { parent.document.body.innerHTML=parent.document.body.innerHTML.replace(ohis, '<div id=bkcol>' + ohis + '</div>'); } }, 2000); ";
$shortbody="#bkcol";
$longbody='document.getElementById("bkcol")';
$opcd=" #chart_div { opacity: 0.8; } ";
$rearrangestp=' setTimeout(function(){ if (!parent.document.getElementById("bkcol")) { var xohis=parent.document.getElementById("chart_div").outerHTML; parent.document.body.innerHTML=parent.document.body.innerHTML.replace(xohis, "<div id=bkcol>" + xohis.replace(" style=" + String.fromCharCode(34)," style=" + String.fromCharCode(34) + "opacity:0.8 !important;") + "</div>"); } ';
$rearrangests=' }, 3000); ';
$rearrangesize="Repeat";
$rearrangecover="repeat";
} else {
$opcd=" #chart_div { opacity: 0.8 !important; } ";
}

file_put_contents('xaz.xaz', $dus);
if (strpos(str_replace('~http','~data',str_replace('~//','~data',('~' . $dus))), '~data') !== false) {
if (strpos(('~' . $dus), '~http') !== false) {
$newdus=trim(str_replace('https:','',str_replace('http:','',$dus)));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos(('~' . $dus), '~//') !== false) {
$newdus=$dus;
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",trim($newdus)) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xza.xza', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",trim($newdus)) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzza.xzza', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos($dus, base64_encode(';utf8,')) !== false || strpos(('~' . $dus), '~data:') === false) {
$newdus='data' . base64_decode(substr($dus,4));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
}
} else if (strpos($dus, ' ') !== false) {
if (!$squotethere) {
return "'" . $dus . "'";
}
}
return $dus;
}

if (isset($_POST['inwrite'])) {
$prefixisin='';
if (isset($_POST['inmode'])) {
if (strlen($_POST['inmode']) > 0) {
$prefixisin=' ';
}
}
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['inurl'])) {
$exidea=str_replace('+', ' ', urldecode($_POST['inurl']));
}
if (file_exists('./bicollection.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection.txt') . $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
} else {
file_put_contents('./bicollection.txt', $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
}
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection_backup.txt', file_get_contents('./bicollection.txt'));
}
echo "<html><body></body></html>";
exit;
}

if (isset($_GET['outread']) && isset($_GET['cleanup'])) {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
exit;
} else if (isset($_POST['outread']) || isset($_GET['outread'])) {
$prefixis='';
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['outread'])) {
if (strlen($_POST['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_POST['outread']));
}
} else if (isset($_GET['outread'])) {
if (strlen($_GET['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_GET['outread']));
}
}
$secidea='';
if (file_exists('./bicollection.txt')) {
$filebicont=file_get_contents('./bicollection.txt');
$origf=$filebicont;
if (strpos($filebicont, csv_server_remote_addr() . ' --- ' . $exidea . ' ... ') !== false) {
$relbi=explode("\n", explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont)[-1 + sizeof(explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont))])[0];
if (strpos($filebicont, ' ' . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n") !== false) {
$prefixis=' ';
}
$filebicont=str_replace($prefixis . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n","",$filebicont);
if ($origf != $filebicont) {
file_put_contents('./bicollection_backup.txt', $filebicont);
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 10000); ";
} else if (file_exists('./bicollection_backup.txt')) {
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 9999); ";
}
if (strpos(('~' . $relbi), '~data') !== false) {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
}
} else {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), true, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " " . $rearrangests . " '><p> done </p></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . $ify . "')\"; " . $rearrangests . " '></body><p> yes </p></html>";
}
}
} else {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace('+',' ',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
}
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . str_replace('+',' ',urldecode($relbi)) . "')\"; " . $rearrangests . " '></body><p> yes again</p></html>";
}
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
exit;
}

?>

Cuteerer, huh?!


Previous relevant Google Chart Generic Background Image Collaboration Tutorial is shown below.

Google Chart Generic Background Image Context Tutorial

Google Chart Generic Background Image Collaboration Tutorial

We’ve fallen into an obsession with “c” words, and we apologize. Today’s “collaboration” came after yesterday’s Google Chart Generic Background Image Context Tutorial‘s “context” and before that “code”. What do we make of it?

Well?!


Thanks for the insights!

We are not robots here at RJM Programming, but believe it or not, having three acrostically identical tutorial titles in a row causes us more consternation than usual (Nala’s practically apoplectic), even beyond those butterflies in Brazil crossing the equator and affected by the Coriolis Effect. Anyway …

We have spent a day on email and SMS (conduit) sharing and collaboration means by which our non-mobile (only, so far) web users of the unaccounted for (after that Google Chart Pie Chart Background Image Tutorial inspiration from some time ago) Google Chart interfacing web applications can communicate. That work wasn’t as hard as we thought it would be, given the relief of location.hash hashtag URL methodologies whereby there is less worry about URL lengths regarding “a” link href “mailto:” and/or “sms:” sharing functionalities, so the mind must have wandered into the realms of …

What can an image “reference” (easily be)?

The usual suspects came to mind …

  • relative URL that ends with the extension of the image file … eg. /PHP/seven.jpg
  • absolute URL that ends with the extension of the image file … eg. https://www.rjmprogramming.com.au/PHP/six.jpg
  • data URI … base64 … eg. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAEX0lEQVQ4jUWUyW6cVRCFv7r3/kO3u912nNgZgESAAgGBCJgFgxhW7FkgxAbxMLwBEmIRITbsQAgxCEUiSIBAYIY4g1EmYjuDp457+Lv7n+4tFjbwAHVOnVPnlLz75ht67OhhZg/M0p6d5tD9C8SNBBs5XBJhI4uNLC4SREA0UI9yJr2c4e6QO+v3WF27w+rmNrv9Pm7hxDyHFg5yYGEOYxytuRY2SYiSCIwgRgBQIxgjEAKuZWg6R9S0SCS4qKLZElY3HC5tp7QPtmlMN7HOETUTXBJjrEGsAfgPFECsQbBIbDGJZUYgGE8ugQyPm+o0STtTuGZMnKZEjRjjLIgAirEOEQEBDQFBEFFEBWLFtVJmpENRl6hUuFanTRAlbTeZarcx0R6YNZagAdD/t5N9+QgCYAw2jrAhpjM3zaSY4OJGTDrVwEYOYw2qioigoviq5MqF31m9fg1V5fCx+zn11CLNVnufRhBrsVFE1Ihpthu4KDYYwz5YQIxFBG7duMZnH31IqHL6wwnGCLFd4pez3/DaG2/x4GNPgBhEZG/GGlxkMVFkiNMYay3Inqxed4eP33uf7Y0uu90xWkGolFAru7sZn5w5w921m3u+su8vinEO02hEWLN/ANnL2rkvv2an2yd4SCKLM0JVBsCgAYZZzrnPP0eDRzXgfaCuPHXwuEYjRgmIBlQVVLl8/hKI4fRzz3L6uWe5+PMvnHz6aa4uX+D4yYe5vXaLH86eoyoLjLF476l9oKo9pi5HWONRX8E+YznOef7Vl1h86QWurlwjbc+QpikPPfoIcZLS39pmMikp8pzae6q6oqgriqrGqS+xeLScoMYSVJlfOMTl5RXW1+5w5fJVnFGWf1/mxEMnWPppiclkTLM5RdJoUBYFZVlQ5DnZMMMV167gixKLoXXsKGqnOHnqOJ/+/CfZ+XUiZ0jTmFv5mAvf/YjEliQ2vPD8Ir6qqEcZkzt38cMRo5WruFvfL9FqpyRxQhj0qLOax5I2S08+Tu/lFiGUGOPormxwuyfMnjrGrJa88uIixeYWl776lmrzNjmw8vcG8sU7ixpHMXFsCUVg9tABjEvRgzP82j7AhbyiX5Qcv2+Bvy7dYGZ1k7efeQB/Y4PBqGBtdYvb3SFzLcfqToZc/OB1zYeBSpUwLBlvjZidmWaSB1yaYOfn6LqI/r0hyU6P+cRSlhXjbEI2zvnt7y79oqQ3qeg4g6vKjCIXehtDmi6m0UnxVnCRkPUHVNt9qkLJxgXOCYNOg34v48raPaamU2o89/KKsQ9sTSpc0JK7NwdcX8s43Ek5cnSOLC/Z2R6Rj0ra0w2W1/t0xyWn51uk2Ri1QtSO6OU5d7OSi72cQeWxKG7p/Dp//JXTy6C1Pcbc6DMpPRtjTxChEznWhwVZUCKrjCrPoPDczHLmnLBdBgZlRRWUEBR3ZKrme5TlrTGlV440Y1IrXM9qQGi6mkG5V6uza7tUIeCDElTZ1L26elX+fcH/ACJBPYTJ4X8tAAAAAElFTkSuQmCC

  • data URI … utf8 … svg+xml … eg. data:image/svg+xml;utf8,<svg xmlns=’http://www.w3.org/2000/svg’ width=’66’ height=’48’ viewport=’0 0 100 100′ style=’border-radius:15px;background-color:rgba(0,0,255,0.3);fill:black;font-family:Verdana;font-size:17px;’><text y=’80%’>Alt\\01f3d5</text></svg>

… but then, when at the other end of a navigation the receiver is a serverside language like PHP, that webpage can establish via it’s header function an image (Content Type) outputting modus operandi, like …

<?php

header('Content-Type: image/jpeg');

?>

… and output image data via URL calls that do not have to “end with the extension of any image file”. Our WordPress blog’s TwentyTen theme’s 404.php is capable of this with URLs such as …


https://www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=20221116&random=4575657

… and the other one we’ve had fun with in the past is the great random Lorem Picsum image creating resource accessible via URLs such as …


https://picsum.photos/600/400/

As you might imagine, we wanted to get these two ideas into the mix, especially as it was nagging away at us that the user interaction to make any of this work happen is asking a lot of the web user out there, but to involve more (potentially, later, mobile) users to get interested we can now


zwords+=' ... body background image data URIs, delimited by space or , or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background (just YYYYMMDD uses this blog tutorial image that day, if first Y is 1 we randomize via Lorem Picsum, thanks) ';

For today’s work, though it involves changed Javascript


function postlhway() {
var foundu='';
var prefoundu='';
if (bimode == -1) {
if (document.getElementById('bkcol')) {
if (('' + document.getElementById('bkcol').style.backgroundImage).toLowerCase().indexOf('url(') != -1) {
foundu='' + ('' + document.getElementById('bkcol').style.backgroundImage).split('(')[eval(-1 + ('' + document.getElementById('bkcol').style.backgroundImage).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=2;
prefoundu='+';
}
}
if (bimode == -1) {
if (('' + document.body.style.backgroundImage).toLowerCase().indexOf('url(') != -1) {
foundu='' + ('' + document.body.style.backgroundImage).split('(')[eval(-1 + ('' + document.body.style.backgroundImage).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
} else if (document.body.innerHTML.indexOf('<style> body { background-image:') != -1) {
foundu='' + ('' + document.body.innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(')[eval(-1 + ('' + document.body.innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
}
}
}
if (foundu != '') {
if (document.getElementById('remail')) {
if (document.getElementById('remail').href.indexOf(encodeURIComponent('bi=')) == -1) {
if (document.getElementById('remail').href.indexOf(encodeURIComponent('#')) != -1 && document.getElementById('remail').href.indexOf(encodeURIComponent('&')) != -1) {
if (3 == 3) {
document.getElementById('remail').href+='' + encodeURIComponent('&#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href+='' + encodeURIComponent('&#bi=') + prefoundu + encodeURIComponent(foundu);
}
} else {
document.getElementById('remail').href=document.getElementById('remail').href.replace(encodeURIComponent('&'), encodeURIComponent('&bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href=document.getElementById('rsms').href.replace(encodeURIComponent('&'), encodeURIComponent('&bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
}
}
} else if (document.getElementById('remail').href.indexOf(encodeURIComponent('#')) != -1) {
document.getElementById('remail').href=document.getElementById('remail').href.replace(encodeURIComponent('#'), encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href=document.getElementById('rsms').href.replace(encodeURIComponent('#'), encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
}
} else {
document.getElementById('remail').href+='' + encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href+='' + encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
}
}
}
}
}
}

function lhway() {
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var dotis='.';
var thisansis='';
if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= ') != -1) {
thisansis=' ' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').split('bi= ')[1].split('#')[0].split('&')[0];
} else if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi=') != -1) {
thisansis='' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').split('bi=')[1].split('#')[0].split('&')[0];
}
//alert('thisansis=' + thisansis);
if (thisansis.replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && thisansis.replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd].replace(/\%3F/g,'?').replace(/\%26/g,'&');
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
setTimeout(function(){ document.getElementById('chart_div').style.opacity='0.8'; }, 4000);
} else if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
//alert('modespace=#' + modespace + '# and thisansis=#' + thisansis + '# and outofansgoes=#' + outofansgoes + '#' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= '));
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
setInterval(postlhway, 3000);
}

if (document.URL.indexOf('nojwin') == -1) { // || navigator.userAgent.match(/iPhone|iPad/i)) {
const originalWindowPrompt = window.prompt; // thanks to https://stackoverflow.com/questions/9172505/how-to-override-the-window-open-functionality

window.prompt = function(zwords, defwords){
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var fauxv='';
var dotis='youllneverfindthis';
var datetosubfor='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (ztis != -1) {
dotis='.';
moneis=zwis;
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
} else {
fauxv='stopregex';
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.toLowerCase().indexOf(' data ur') == -1) {
zwords+=' ... body background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background (just YYYYMMDD uses this blog tutorial image that day, if first Y is 1 we randomize via Lorem Picsum, thanks) ';
}
var thisansis=originalWindowPrompt(zwords, defwords);
if (thisansis == null) { return null; }
if (ztis != -1) {
if (thisansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(0,8);
} else if (thisansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
if (eval('' + datetosubfor) < 20110314) {
thisansis=thisansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + Math.floor(Math.random() * 19896754));
} else {
thisansis=thisansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
} else {
if (thisansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(0,8);
} else if (thisansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
thisansis=thisansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + Math.floor(Math.random() * 19896754));
}
}
}
if ((fauxv + thisansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + thisansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
return thisansis;
};
}

function bicheck() {
if (('' + document.URL + decodeURIComponent('' + location.hash)).indexOf('title=') != -1 || 1 == 1) {
setTimeout(function(){
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
if (document.getElementById('bitsatend')) {
if (!document.getElementById('remail')) {
//document.getElementById('bitsatend').innerHTML+='<a id="remail" target="ijkemail" href="mailto:?subject=Google%20Chart%20Snapshot&body=' + encodeURIComponent(document.URL) + '">Email 📧</a> <a id="rsms" target="ijkemail" href="sms:&body=' + encodeURIComponent(document.URL) + '">SMS 📟</a><br>';
document.getElementById('bitsatend').innerHTML+='<a id="remail" target="ijkemail" href="mailto:?subject=Google%20Chart%20Snapshot&body=' + encodeURIComponent(document.URL) + '">Email</a><br>'; //' <a id="rsms" target="ijkemail" href="sms:&body=' + encodeURIComponent(document.URL) + '">SMS</a><br>';
}
}
}
document.body.innerHTML+='<iframe style=display:none; src="/PHP/csv.php?outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
}, 2000);
}
}

if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= ') != -1) {
lhway();
bicheck();
} else if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi=') != -1) {
lhway();
bicheck();
} else {
setTimeout(bicheck, 5000);
setTimeout(lhway, 5000);
}

and changed PHP

<?php

function ifspacy($dus, $squotethere, $iflenabovezerorepeat) {
global $hdrstuff, $shortbody, $longbody, $rearrangejs, $rearrangestp, $rearrangests, $rearrangesize, $rearrangecover;
$shortbody="body";
$longbody="document.body";
$rearrangejs="";
$rearrangestp="";
$rearrangests="";
$rearrangesize="Size";
$rearrangecover="cover";
$opcd="";
if (strlen($iflenabovezerorepeat) > 0) {
$rearrangejs=" setTimeout(function(){ var ohis=parent.document.getElementById('chart_div').outerHTML; if (!parent.document.getElementById('bkcol')) { parent.document.body.innerHTML=parent.document.body.innerHTML.replace(ohis, '<div id=bkcol>' + ohis + '</div>'); } }, 2000); ";
$shortbody="#bkcol";
$longbody='document.getElementById("bkcol")';
$opcd=" #chart_div { opacity: 0.8; } ";
$rearrangestp=' setTimeout(function(){ if (!parent.document.getElementById("bkcol")) { var xohis=parent.document.getElementById("chart_div").outerHTML; parent.document.body.innerHTML=parent.document.body.innerHTML.replace(xohis, "<div id=bkcol>" + xohis.replace(" style=" + String.fromCharCode(34)," style=" + String.fromCharCode(34) + "opacity:0.8 !important;") + "</div>"); } ';
$rearrangests=' }, 3000); ';
$rearrangesize="Repeat";
$rearrangecover="repeat";
} else {
$opcd=" #chart_div { opacity: 0.8 !important; } ";
}

file_put_contents('xaz.xaz', $dus);
if (strpos(str_replace('~http','~data',str_replace('~//','~data',('~' . $dus))), '~data') !== false) {
if (strpos(('~' . $dus), '~http') !== false) {
$newdus=trim(str_replace('https:','',str_replace('http:','',$dus)));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos(('~' . $dus), '~//') !== false) {
$newdus=$dus;
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",trim($newdus)) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xza.xza', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",trim($newdus)) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzza.xzza', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos($dus, base64_encode(';utf8,')) !== false || strpos(('~' . $dus), '~data:') === false) {
$newdus='data' . base64_decode(substr($dus,4));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
}
} else if (strpos($dus, ' ') !== false) {
if (!$squotethere) {
return "'" . $dus . "'";
}
}
return $dus;
}

if (isset($_POST['inwrite'])) {
$prefixisin='';
if (isset($_POST['inmode'])) {
if (strlen($_POST['inmode']) > 0) {
$prefixisin=' ';
}
}
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['inurl'])) {
$exidea=str_replace('+', ' ', urldecode($_POST['inurl']));
}
if (file_exists('./bicollection.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection.txt') . $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
} else {
file_put_contents('./bicollection.txt', $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
}
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection_backup.txt', file_get_contents('./bicollection.txt'));
}
echo "<html><body></body></html>";
exit;
}

if (isset($_GET['outread']) && isset($_GET['cleanup'])) {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
exit;
} else if (isset($_POST['outread']) || isset($_GET['outread'])) {
$prefixis='';
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['outread'])) {
if (strlen($_POST['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_POST['outread']));
}
} else if (isset($_GET['outread'])) {
if (strlen($_GET['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_GET['outread']));
}
}
$secidea='';
if (file_exists('./bicollection.txt')) {
$filebicont=file_get_contents('./bicollection.txt');
$origf=$filebicont;
if (strpos($filebicont, csv_server_remote_addr() . ' --- ' . $exidea . ' ... ') !== false) {
$relbi=explode("\n", explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont)[-1 + sizeof(explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont))])[0];
if (strpos($filebicont, ' ' . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n") !== false) {
$prefixis=' ';
}
$filebicont=str_replace($prefixis . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n","",$filebicont);
if ($origf != $filebicont) {
file_put_contents('./bicollection_backup.txt', $filebicont);
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 10000); ";
} else if (file_exists('./bicollection_backup.txt')) {
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 9999); ";
}
if (strpos(('~' . $relbi), '~data') !== false) {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
}
} else {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), true, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " " . $rearrangests . " '><p> done </p></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . $ify . "')\"; " . $rearrangests . " '></body><p> yes </p></html>";
}
}
} else {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace('+',' ',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
}
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . str_replace('+',' ',urldecode($relbi)) . "')\"; " . $rearrangests . " '></body><p> yes again</p></html>";
}
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
exit;
}

?>

Cuteer, huh?!


Previous relevant Google Chart Generic Background Image Context Tutorial is shown below.

Google Chart Generic Background Image Context Tutorial

Google Chart Generic Background Image Context Tutorial

Here, today, further to yesterday’s Google Chart Generic Background Image Code Tutorial, we are referring to …

  • context … or …
  • guise

again. Well it could be …

  • like when you buy a particular brand of something and then start seeing it everywhere … or …
  • because we like the word “againagain … or …
  • because whenever you revisit a piece of any code it doesn’t take long to appreciate where it could be improved … and we like this one … so …

… we’ll leave it at that. Actually, that last one makes sense, because we realized testing the workings of that Google Chart Pie Chart Background Image Tutorial inspiration for this current project extension, it had a great feature that hadn’t occurred to us yesterday (and we want to allow for) …

  • today, using the background imagery behind the Google Chart and have it be background-repeat:repeat; … the user makes happen by prefixing their background image information by a space character, whereas …
  • yesterday’s use of the background imagery behind the document body and have it be background-size:cover; is perfectly valid too

… making for a better end result set. But there’s more. We’ll be easing out the previous modus operandi in favour of this recent modus operandi over time, we’re thinking, but not before we have a day? looking into sharing functionality that might allow the user to share that Google Chart and its background image arrangements with an email recipient.

For today’s work, though it involves changed Javascript


const originalWindowPrompt = window.prompt; // thanks to https://stackoverflow.com/questions/9172505/how-to-override-the-window-open-functionality

window.prompt = function(zwords, defwords){
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var dotis='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (ztis != -1) {
dotis='.';
moneis=zwis;
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.toLowerCase().indexOf(' data ur') == -1) {
zwords+=' ... body background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background ';
}
var thisansis=originalWindowPrompt(zwords, defwords);
if (thisansis == null) { return null; }
if (thisansis.replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
return thisansis;
};
}

function bicheck() {
if (('' + document.URL + location.hash).indexOf('title=') != -1) {
document.body.innerHTML+='<iframe style=display:none; src="/PHP/csv.php?outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
}
}

setTimeout(bicheck, 5000);

and changed PHP

<?php

function ifspacy($dus, $squotethere, $iflenabovezerorepeat) {
global $hdrstuff, $shortbody, $longbody, $rearrangejs, $rearrangestp, $rearrangests, $rearrangesize, $rearrangecover;
$shortbody="body";
$longbody="document.body";
$rearrangejs="";
$rearrangestp="";
$rearrangests="";
$rearrangesize="Size";
$rearrangecover="cover";
$opcd="";
if (strlen($iflenabovezerorepeat) > 0) {
$rearrangejs=" setTimeout(function(){ var ohis=parent.document.getElementById('chart_div').outerHTML; if (!parent.document.getElementById('bkcol')) { parent.document.body.innerHTML=parent.document.body.innerHTML.replace(ohis, '<div id=bkcol>' + ohis + '</div>'); } }, 2000); ";
$shortbody="#bkcol";
$longbody='document.getElementById("bkcol")';
$opcd=" #chart_div { opacity: 0.8; } ";
$rearrangestp=' setTimeout(function(){ if (!parent.document.getElementById("bkcol")) { var xohis=parent.document.getElementById("chart_div").outerHTML; parent.document.body.innerHTML=parent.document.body.innerHTML.replace(xohis, "<div id=bkcol>" + xohis.replace(" style=" + String.fromCharCode(34)," style=" + String.fromCharCode(34) + "opacity:0.8 !important;") + "</div>"); } ';
$rearrangests=' }, 3000); ';
$rearrangesize="Repeat";
$rearrangecover="repeat";
}

if (strpos(str_replace('~http','~data',str_replace('~//','~data',('~' . $dus))), '~data') !== false) {
if (strpos(('~' . $dus), '~http') !== false) {
$newdus=trim(str_replace('https:','',str_replace('http:','',$dus)));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; " . $opcd . " } </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; " . $opcd . " } </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos(('~' . $dus), '~//') !== false) {
$newdus=trim($dus);
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; " . $opcd . " } </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xza.xza', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; " . $opcd . " } </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzza.xzza', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos($dus, base64_encode(';utf8,')) !== false || strpos(('~' . $dus), '~data:') === false) {
$newdus='data' . base64_decode(substr($dus,4));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; " . $opcd . " }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; " . $opcd . " }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
}
} else if (strpos($dus, ' ') !== false) {
if (!$squotethere) {
return "'" . $dus . "'";
}
}
return $dus;
}

if (isset($_POST['inwrite'])) {
$prefixisin='';
if (isset($_POST['inmode'])) {
if (strlen($_POST['inmode']) > 0) {
$prefixisin=' ';
}
}
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['inurl'])) {
$exidea=str_replace('+', ' ', urldecode($_POST['inurl']));
}
if (file_exists('./bicollection.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection.txt') . $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
} else {
file_put_contents('./bicollection.txt', $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
}
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection_backup.txt', file_get_contents('./bicollection.txt'));
}
echo "<html><body></body></html>";
exit;
}

if (isset($_GET['outread']) && isset($_GET['cleanup'])) {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
exit;
} else if (isset($_POST['outread']) || isset($_GET['outread'])) {
$prefixis='';
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['outread'])) {
if (strlen($_POST['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_POST['outread']));
}
} else if (isset($_GET['outread'])) {
if (strlen($_GET['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_GET['outread']));
}
}
$secidea='';
if (file_exists('./bicollection.txt')) {
$filebicont=file_get_contents('./bicollection.txt');
$origf=$filebicont;
if (strpos($filebicont, csv_server_remote_addr() . ' --- ' . $exidea . ' ... ') !== false) {
$relbi=explode("\n", explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont)[-1 + sizeof(explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont))])[0];
if (strpos($filebicont, ' ' . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n") !== false) {
$prefixis=' ';
}
$filebicont=str_replace($prefixis . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n","",$filebicont);
if ($origf != $filebicont) {
file_put_contents('./bicollection_backup.txt', $filebicont);
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 10000); ";
} else if (file_exists('./bicollection_backup.txt')) {
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 9999); ";
}
if (strpos(('~' . $relbi), '~data') !== false) {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
}
} else {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), true, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " " . $rearrangests . " '><p> done </p></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . $ify . "')\"; " . $rearrangests . " '></body><p> yes </p></html>";
}
}
} else {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace('+',' ',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
}
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . str_replace('+',' ',urldecode($relbi)) . "')\"; " . $rearrangests . " '></body><p> yes again</p></html>";
}
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
exit;
}

?>

Cuter, huh?!

Did you know?

Can an animated GIF set as the background image still be animated?

Yes. But please do not make it too boring. Can we suggest …

?


Previous relevant Google Chart Generic Background Image Code Tutorial is shown below.

Google Chart Generic Background Image Code Tutorial

Google Chart Generic Background Image Code Tutorial

We were interested in a URL we detected being accessed, via our cPanel Apache Status report linking us to Google Chart Pie Chart Background Image Tutorial. Investigating this Google Charts interfacing PHP code means by which to allow for the user specification of background images, in the case of a Pie Chart, we realized some interfacings had been coded for this functionality, but not others.

But don’t we …

  1. have an external Javascript gchartgen.js to turn to …
  2. and a require PHP csv.php we could lean on

? Yes, indeed, and we decided to …

  1. have an external Javascript gchartgen.js to turn to …
  2. and a require PHP csv.php we could lean on
  1. for non-mobile (so far) we could override the window.prompt and check and setup
  2. internal use only recording on user interest in a web server flat file

involving changed Javascript


const originalWindowPrompt = window.prompt; // thanks to https://stackoverflow.com/questions/9172505/how-to-override-the-window-open-functionality

window.prompt = function(zwords, defwords){
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var dotis='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (ztis != -1) {
dotis='.';
moneis=zwis;
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.toLowerCase().indexOf(' data ur') == -1) {
zwords+=' ... background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized ';
}
var thisansis=originalWindowPrompt(zwords, defwords);
if (thisansis == null) { return null; }
if (thisansis.replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
return thisansis;
};
}

function bicheck() {
if (('' + document.URL + location.hash).indexOf('title=') != -1) {
document.body.innerHTML+='<iframe style=display:none; src="/PHP/csv.php?outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
}
}

setTimeout(bicheck, 5000);

and changed PHP

<?php

function ifspacy($dus, $squotethere) {
global $hdrstuff;
if (strpos(str_replace('~http','~data',str_replace('~//','~data',('~' . $dus))), '~data') !== false) {
if (strpos(('~' . $dus), '~http') !== false) {
$newdus=str_replace('https:','',str_replace('http:','',$dus));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos(('~' . $dus), '~//') !== false) {
$newdus=$dus;
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos($dus, base64_encode(';utf8,')) !== false || strpos(('~' . $dus), '~data:') === false) {
$newdus='data' . base64_decode(substr($dus,4));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
}
} else if (strpos($dus, ' ') !== false) {
if (!$squotethere) {
return "'" . $dus . "'";
}
}
return $dus;
}

if (isset($_POST['inwrite'])) {
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['inurl'])) {
$exidea=str_replace('+', ' ', urldecode($_POST['inurl']));
}
if (file_exists('./bicollection.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection.txt') . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
} else {
file_put_contents('./bicollection.txt', csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
}
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection_backup.txt', file_get_contents('./bicollection.txt'));
}
echo "<html><body></body></html>";
exit;
}

if (isset($_GET['outread']) && isset($_GET['cleanup'])) {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
exit;
} else if (isset($_POST['outread']) || isset($_GET['outread'])) {
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['outread'])) {
if (strlen($_POST['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_POST['outread']));
}
} else if (isset($_GET['outread'])) {
if (strlen($_GET['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_GET['outread']));
}
}
$secidea='';
if (file_exists('./bicollection.txt')) {
$filebicont=file_get_contents('./bicollection.txt');
$origf=$filebicont;
if (strpos($filebicont, csv_server_remote_addr() . ' --- ' . $exidea . ' ... ') !== false) {
$relbi=explode("\n", explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont)[-1 + sizeof(explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont))])[0];
$filebicont=str_replace(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n","",$filebicont);
if ($origf != $filebicont) {
file_put_contents('./bicollection_backup.txt', $filebicont);
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 10000); ";
} else if (file_exists('./bicollection_backup.txt')) {
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 9999); ";
}
if (strpos(('~' . $relbi), '~data') !== false) {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), false);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' parent.document.body.style.backgroundSize=\"cover\"; " . $secidea . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' parent.document.body.style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(" . $ify . ")\"; parent.document.body.style.backgroundSize=\"cover\"; " . $secidea . " '></body></html>";
}
} else {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), true);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $secidea . " '><p> done </p></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $secidea . " ><p> parent.document.body.style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL('" . $ify . "')\"; </p></body></html>";
}
}
} else {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace('+',' ',urldecode($relbi)), false);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $secidea . " parent.document.body.style.backgroundSize=\"cover\"; '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $secidea . " parent.document.body.style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(" . $ify . ")\"; parent.document.body.style.backgroundSize=\"cover\"; '></body></html>";
}
} else {
echo "<html>" . $hdrstuff . "<body><p> parent.document.body.style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL('" . str_replace('+',' ',urldecode($relbi)) . "')\"; </p></body></html>";
}
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
exit;
}

?>

Cute, huh?!


Previous relevant Google Chart Pie Chart Background Image Tutorial is shown below.

Google Chart Pie Chart Background Image Tutorial

Google Chart Pie Chart Background Image Tutorial

We have another potential use for the clipboard, adding onto the recent Google Pie Chart via Clipboard Co-ordinates Tutorial data set usage, today. We allow the user to change the default white background to the Google Chart Pie Chart be tailored to be either …

  • image URL … or …
  • image data URI (most likely entered via the clipboard)

… as a prefixing option when they enter in the Title of their Pie Chart.

In order to achieve this, we were helped enormously by …

  • this very useful link, thanks … the crux of it being to get to put …

    backgroundColor: 'none'

    … into the Pie Chart options … and some previous help we got when we presented …
  • Column Intelligence Primer Tutorial‘s “Did you know?” section reference to incredibly useful link‘s advice on our …

    wish to apply opacity just to background image, but not the corresponding textual data (or other types) that is the primary content of that HTML element

You can see a video of some of the practicalities to usage on an iPad mobile app version in the YouTube video below …

Because data URIs are an option here, too, you will see in the code changes to pie_chart.php the need, now, to cater for the switch of HTML form navigation from …

  • method=GET (the default) … to …
  • method=POST (when the URL becomes too long)

… and that new bit of logic is slated home to the generic external Javascript we have set aside for Google Charts work called gchartgen.js which changed for this work, in this way.

Maybe you can see how to use this feature yourself, and if that is the case you can try this live run link.


Previous relevant Google Pie Chart via Clipboard Co-ordinates Tutorial is shown below.

Google Pie Chart via Clipboard Co-ordinates Tutorial

Google Pie Chart via Clipboard Co-ordinates Tutorial

Yesterday’s Google Map Chart via Clipboard Co-ordinates Tutorial was a good precursor to today’s work interfacing this time to the Google Chart Pie Chart.

With this work, we’ve started refining the clipboard “smarts” by looking for linefeeds … in Javascript thoughts …


String.fromCharCode(10)

… and as the data exits the Javascript prompt window on its way, before navigating back to the PHP itself, we can check for too many fields to the right of the data, and truncate the clipboard data, as necessary. Along the way, we may be able to reject any header records with this same approach. We can check for no numerical fields here. Business specific logic can be applied here too. With a Pie Chart, the original data, or the user, may be tempted to place “%” after the numerical data, and we can take the opportunity to weed these out. Also, with the character data, it may be delimited by a double quote (ie. within “”), and with this knowledge in mind, we may be able to weed out confusing additional commas that could confuse us with the clipboard comma separated value format of the data.

The lesson here, is to “validate early” and it could be good to “validate often” as well. Real data can be strange indeed.


function dlp(thisris) {
if (thisris != null) {
var commacount=thisris.toLowerCase().replace(/\<\/td\>/g,' , ').indexOf(',');
if (thisris.toLowerCase().replace('https:','http:').indexOf('http:') == 0) {
fti=true;
allowed=true;
datac=thisris;
} else if (commacount >= 0) {
var thatris=thisris.replace(/\ \"/g,String.fromCharCode(10) + '"').replace(/\<tr\>/g,'').replace(/\<\/td\>\<td\>/g,',').replace(/\<\/tr\>/g,String.fromCharCode(10)).replace(/\<\/td\>/g,',').replace(/\,\,/g,',').replace(/\,\,/g,',').replace(',' + String.fromCharCode(10),String.fromCharCode(10));
var zisok=true, fldq=thatris.split(',');
var pielines=thatris.split(String.fromCharCode(10));
if ((fldq[0].replace('"','').trim() + ' ').substring(0,1) < '0' || (fldq[0].replace('"','').trim() + ' ').substring(0,1) > '9') {
if ((fldq[eval(-1 + fldq.length)].replace('"','').trim() + ' ').substring(0,1) < '0' || (fldq[eval(-1 + fldq.length)].replace('"','').trim() + ' ').substring(0,1) > '9') {
zisok=false;
}
}
if (!zisok && pielines.length > 1) {
fldq=pielines[1].split(',');
zisok=true;
if ((fldq[0].replace('"','').trim() + ' ').substring(0,1) < '0' || (fldq[0].replace('"','').trim() + ' ').substring(0,1) > '9') {
if ((fldq[eval(-1 + fldq.length)].replace('"','').trim() + ' ').substring(0,1) < '0' || (fldq[eval(-1 + fldq.length)].replace('"','').trim() + ' ').substring(0,1) > '9') {
zisok=false;
}
}
}
if (zisok) {
while (thatris.indexOf(String.fromCharCode(10)) != -1) {
var inpies, pied='';
thatris='';
var sthatris='';
for (var ipie=0; ipie<pielines.length; ipie++) {
inpies=pielines[ipie].split(',');
if (inpies.length > 1) {
if ((inpies[0].trim() + " ").substring(0,1) == '"' && (inpies[1].trim() + " ").substring(0,1) == '"') {
sthatris=pied + inpies[0].trim().substring(1).split('"')[0].trim().replace('%','').replace(',','').replace(',','') + ',' + inpies[1].trim().substring(1).split('"')[0].trim().replace('%','').replace(',','').replace(',','');
} else if ((inpies[0].trim() + " ").substring(0,1) == '"') {
sthatris=pied + inpies[0].trim().substring(1).split('"')[0].trim().replace('%','').replace(',','').replace(',','') + ',' + inpies[1].trim().replace('%','').replace('"','');
} else if ((inpies[1].trim() + " ").substring(0,1) == '"') {
sthatris=pied + inpies[0].trim().replace('%','') + ',' + inpies[1].trim().substring(1).split('"')[0].trim().replace('%','').replace(',','').replace(',','');
} else {
sthatris=pied + inpies[0].trim().replace('%','') + ',' + inpies[1].trim().replace('%','').replace('"','');
}
inpies=sthatris.replace(pied,'').split(',');
if (((inpies[0].trim() + " ").substring(0,1) >= '0' && (inpies[0].trim() + " ").substring(0,1) <= '9') || ((inpies[1].trim() + " ").substring(0,1) >= '0' && (inpies[1].trim() + " ").substring(0,1) <= '9')) {
thatris+=sthatris;
pied=',';
}
}
}
}
thatris=thatris.replace(/\,\,/g,',');
fti=true;
allowed=true;
datac='http;' + thatris;
thisris='http;' + thatris;
}
}
}
return thisris;
}

Our PHP Google Chart Pie Chart interface is pie_chart.php changed this way for today’s work, that you can try yourself at this live run link.

Our PHP helper csv.php changed this way for today’s work.

If you want to recreate the conditions as shown in today’s tutorial picture

  1. copy the contents below …

  2. and paste into the 4th prompt (window’s text) box of the Google Charts Pie Chart interfacing live run link
  3. click OK button … P.S. On first prompt, appending &onclick=y to what you want as a Pie Chart title will work the Pie Chart’s select event logic we harness with this interfacing
  4. … or, if you are feeling lazy …
    https://www.rjmprogramming.com.au/PHP/PieChart/pie_chart.php?title=Country%20Populations&onclick=y&task=Country&desc=Populations&data=,%20[~https;China,1347000000,India,1241000000,United%20States,312000000,Indonesia,238000000,Brazil,197000000,Pakistan,177000000,Nigeria,162000000,Bangladesh,151000000,Russia,143000000,Japan,128000000,Mexico,115000000,Philippines,96000000,Vietnam,88000000,Ethiopia,87000000,Germany,81800000,Egypt,82600000,Iran,78000000,Turkey,74000000,Thailand,69500000,Congo,67800000,France,63300000,United%20Kingdom,62700000,Italy,60800000~,100]

Previous relevant Google Map Chart via Clipboard Co-ordinates Tutorial is shown below.

Google Map Chart via Clipboard Co-ordinates Tutorial

Google Map Chart via Clipboard Co-ordinates Tutorial

Yesterday’s Google Map Chart via URL Co-ordinates Tutorial added functionality directed towards a …

  • secondary data source, that you access … but today we are going to extend that functionality to support a …
  • primary data source that you enter a comma separated values list for the [place,lat,long] data sets (yourself, via the computer keyboard) … as well as a …
  • “subset” of a secondary data source, that you access, more than likely, using you computer device’s clipboard

The invention of the clipboard was a brilliant step. Before it, we were so beholden to programmers to get tailored work done, and though it’s sad that so many of you get on without us (cough, cough) … well … we were being overworked anyway … and there was that project to “make the morning breakfast coffee before you even know you wanted it” to get onto … finally.

Perhaps we all forget now what the clipboard has meant, for so many of us. It is the freedom of “copy and paste”, the individualism tool of content creation.

Yesterday’s functionality idea is a case in point. “Secondary data sources” are, by definition, out of your control, as to what the content of a web page is. Notice how, yesterday, we made some content that was (s)ftp transferred over to the rjmprogramming.com.au domain via … yes, you guessed it …

  1. me copying (off the mapbox.com website, thanks, as part of the contents of a webpage) … then …
  2. pasting that content into a csv text file on the MacBook Pro computer we’re using (locally) … and then …
  3. (s)ftp transferred over to rjmprogramming.com.au domain to represent a …
  4. URL usable within the functionality of our Google Chart Map Chart interface we host here as the PHP map.php‘s live run link

But there you are, an intelligent human, able to determine for yourself the data you are interested in (quite often not the entire contents of a webpage, as yesterday’s work is ideally asking for), so that being the case, the map.php modifications to PHP code we’ve made today, make it possible for (the much simpler) …

  1. me copying (off the mapbox.com website, thanks, as part of the contents of a webpage) … then …
  2. pasting that content within the functionality of our Google Chart Map Chart interface we host here as the PHP map.php‘s live run link

If you have the clipboard as your friend, your time around computers becomes so much more enjoyable, and flexible, and within your control. We, as programmers, need to think, on occasions, or encourage, on occasions, how the user is likely to use the clipboard, in conjunction with our applications. As you might surmise, that can be a pretty unpredictable “artform”.

Our PHP helper csv.php changed this way for today’s work.


Previous relevant Google Map Chart via URL Co-ordinates Tutorial is shown below.

Google Map Chart via URL Co-ordinates Tutorial

Google Map Chart via URL Co-ordinates Tutorial

The last blog posting referring to the Google Chart Map Chart interface we host here was with Emoji Name Search Map Chart Weather Tutorial, but today we are presenting a major functionality addition with implications for other Google Chart interfacing PHP codesets here. We are allowing the user at the second prompt to take the data from a URL data source containing CSV (comma separated values) place,latitude,longitude data or those three fields in an HTML table element contents perhaps.

We’ve added the ability to “map” (tee hee) …


HTTP://www.rjmprogramming.com.au/PHP/Map/map.php?title=Where%20We%20Are&onclick=y&label=['Lat',&value='Lon',%20'Name']&data=,%20[-33.90743410270099,151.17646964910696,~Parent1~]%20,%20[-33.907440603083124,151.1764659419197,~Parent2~]

… from a CSV data URL look with contents …


-33.907434102700991,151.17646964910696,Parent1
-33.907440603083124,151.17646594191973,Parent2

… that if placed at rjmprogramming.com.au’s Document Root and called parent.csv then a URL of …


HTTP://www.rjmprogramming.com.au/PHP/Map/map.php?title=Where%20We%20Are&onclick=y&label=['Lat',&value='Lon',%20'Name']&data=,%20[0.00000001,0.0000000,~HTTP://rjmprogramming.com.au/parent.csv~]

… could be a shortcut to that first URL same look. You can see another example using data from mapbox.com, thanks, show the scenario our tutorial picture illustrates.

The way this “mapping” (tee hee, tee hee) of URLs can happen is that the PHP supervisor map.php (changed this way and which you can try with this live run link) “includes” (ie. calls) …


include "../csv.php";

… a (now bigger, and more functional) csv.php (changed this way) does its best to handle a few looks to the CSV or tabular data, with code to allow for …

  • CSV data ordered place,latitude(decimal),longitude(decimal) or latitude(decimal),longitude(decimal),place or place,longitude(decimal),latitude(decimal) or longitude(decimal),latitude(decimal),place
  • CSV data ordered place,latitude(W/S/E/N_deg_min_secs),longitude(W/S/E/N_deg_min_secs) or latitude(W/S/E/N_deg_min_secs),longitude(W/S/E/N_deg_min_secs),place or place,longitude(W/S/E/N_deg_min_secs),latitude(W/S/E/N_deg_min_secs) or longitude(W/S/E/N_deg_min_secs),latitude(W/S/E/N_deg_min_secs),place
  • HTML tabular data ordered place,latitude(decimal),longitude(decimal) or latitude(decimal),longitude(decimal),place or place,longitude(decimal),latitude(decimal) or longitude(decimal),latitude(decimal),place
  • HTML tabular data ordered place,latitude(W/S/E/N_deg_min_secs),longitude(W/S/E/N_deg_min_secs) or latitude(W/S/E/N_deg_min_secs),longitude(W/S/E/N_deg_min_secs),place or place,longitude(W/S/E/N_deg_min_secs),latitude(W/S/E/N_deg_min_secs) or longitude(W/S/E/N_deg_min_secs),latitude(W/S/E/N_deg_min_secs),place

Previous relevant Emoji Name Search Map Chart Weather Tutorial is shown below.

Emoji Name Search Map Chart Weather Tutorial

Emoji Name Search Map Chart Weather Tutorial

If you’ve been studying the code of our hierarchy for our Emoji Flags of the World web application …

… am sure you’ll have noticed how bottom heavy it is on the “child” as far as functionality goes. What we like to call “the hard working duck syndrome”. Partly, that is because we see the Google Charts Map Chart interface we have as being a very useful “meeting point” with interfacing web applications tending towards the “where” of life.

Today’s job, extending yesterday’s Emoji Name Search Map Chart Tutorial is to add Map Chart interfacing to the great Weather Underground and its great API service for autocomplete name searches for weather (and hurricane) information … thanks.

The changes are again just to that “hard working duck” Map Chart interface “child” web application, as for yesterday’s work. We were very keen to do this, especially because …

  • Weather Underground database works most succinctly with Placename, Country identification pairs, better than for the …
  • Continent/Placename setup of (PHP) Timezones

… and so, while we are going to so much trouble scouring Timezone places for their associated Countries, it is a really good opportunity to slot in some Weather API interfacing to our Emoji World Flags web application, which is starting to be looking better and better as a trip planning aid.


Previous relevant Emoji Name Search Map Chart Tutorial is shown below.

Emoji Name Search Map Chart Tutorial

Emoji Name Search Map Chart Tutorial

We now have a three tier functionality hierarchy for our Emoji Flags of the World web application …

… all made so very possible when web applications sit in the same domain and you utilize the HTML iframe element.

We wanted to enhance its integration by …

  • adding in “locality pins” for all PHP Timezone places in the country of interest
  • involving Emoji flags in the Map Chart title (rather than as a pin) because Emojis, after all, are like textual data, not HTML (but can use HTML Entity representations in both)

To work the latter of these we called on recent experience with the “Fifth Beatle” discussion in Emoji Name Search Primer Tutorial

We got quite excited recently with Rainbow Games PHP Emoji Tutorial when we added a (fourth Beatle) emoji helper, called Emoji Terra, into the mix of tools to gather emoji information. Today, we’ve got a new Emoji Search web application that introduces a new (fifth Beatle(?)) emoji helper tool to add into the “how we see it” mix …

We found that Emoji Terra could be used in our map Chart interfacing PHP to look up the HTML Decimal Entity for a flag of a country via the URL pattern …


HTTP://www.emojiterra.com/flag-for-[CountryNameSpacesMakeMinusSignsLowerCase]

So even though Google Chart Map Charts do not allow HTML in their titles there is nothing stopping you putting in an HTML Entity Emoji coding.

As far as the former goes, we again called on the PHP DateTimeZone class to scrutinize the first Timezone in the Map Chart title, derive its ISO 2 letter Country Code, and look through the array list of (PHP) Timezones to garner latitude and longitude, time now, and GMT offset information necessary to improve the “where” and “when” aspects of our Google Chart Map Chart interfacing.


Previous relevant Emoji Name Search Timezone Tutorial is shown below.

Emoji Name Search Timezone Tutorial

Emoji Name Search Timezone Tutorial

Yesterday’s Emoji Name Search Map Tutorial was a step in the direction of “where” functionality, but because PHP teams up with the supervisory HTML “Emoji World Flags” web application, to make all this happen, there is the opportunity to add interest by adding a “when” aspect to how it works.

As we’ve said many times now, should you have access to PHP, you also have access to its DateTimeZone class where Timezones can be linked to ISO 2 letter Country Codes, useful as an integration point as of recent times when we introduced ISO 2 letter Country Codes to today’s (supervisory) live run‘s world_flags.html HTML and Javascript code.

But it is not HTML code that changes today. It is its PHP partner emoticon_keyboard_shortcuts.php changed in this way, that arranges that its call of Google Charts Map Chart passes across a new URL …


&ccode=[ISO 2 letter Country Code]

… argument that uses a new PHP function as below (arrays shortened for practicality purposes) …


<?php
function inctycodecheck($incd, $sofar) {
$nearname=["Africa/Abidjan","Africa/Accra", ... ]; // array of Timezone names
$retv="";
$retd="";
$otz = new DateTimeZone("UTC");
$jj=0;
$origin_dt = new DateTime("now", $otz);
for ($best1=0; $best1<sizeof($nearname); $best1++) {
try {
$tz = new DateTimeZone($nearname[$best1]);
$cloc = $tz->getLocation();
$ctrycode = $cloc['country_code'];
if (strtoupper($incd) == strtoupper($ctrycode)) {
$remote_dt = new DateTime("now", $tz);
$offset = ($tz->getOffset($remote_dt) - $otz->getOffset($origin_dt)) / 3600;
$newp=$retd . $nearname[$best1] . "/" . $remote_dt->format('Y-m-d_H:i:s') . " (GMT" . $offset . ")";
$huhs=explode(" (GMT" . $offset . ")", $retv);
if (sizeof($huhs) == 2) {
if (explode("/", $newp)[0] != explode("/", explode(",", $huhs[0])[-1 + sizeof(explode(",", $huhs[0]))])[0]) {
$huhs=explode("youwillneverfindthis", $retv);
}
}
if (($sofar + strlen(urlencode(($retv . $newp)))) < 950 && $jj < 10 && sizeof($huhs) == 1) {
$retv.=$newp;
$retd=",";
$jj++;
}
}
} catch (Exception $exc) { }
}
return $retv;
}
?>

… called later in the code with the new block of code as per …


<?php
$urlis=urldecode($_GET['gmc']); // URL to point at template Google Chart Map Chart call for Country of interest
if (strpos($urlis, ',,') !== false) {
$urlis=str_replace(",,", urlencode($latis . "," . $longis . ","), $urlis);
} else {
$urlis=str_replace(urlencode(",,"), urlencode($latis . "," . $longis . ","), $urlis);
}
if (isset($_GET['ccode'])) {
$urlis=str_replace("&onclick=", "%20" . urlencode(inctycodecheck(urldecode($_GET['ccode']), (strlen($urlis) + 3))) . "&onclick=", $urlis); // appends to the title argument
}

if (isset($_SERVER['HTTPS'])) {
if ($_SERVER['HTTPS'] == "on") {
header("Location: https:" . $urlis);
} else {
header("Location: http:" . $urlis);
}
} else {
header("Location: http:" . $urlis);
}
exit;
?>


Previous relevant Emoji Name Search Map Tutorial is shown below.

Emoji Name Search Map Tutorial

Emoji Name Search Map Tutorial

Yesterday’s posted data Emoji Name Search Posting Tutorial functionality opened the door to “where” web application (software) integration, because the wonderful Wikipedia has compiled Latitude,Longitude co-ordinate pairs for those countries, and that is our foot in the door to place an HTML a link under the Emoji flags, that points to our favourite “where” interfacing tool, the Google Charts Map Chart.

Because the Map Chart and Emoji Flag web application share the same domain we can keep this functionality on this same Emoji Flag webpage in an …

  • HTML iframe element name=gcmi id=gcmi initially invisible … “populated by” …
  • HTML a element target=gcmi href=[URL to Map Chart for Country of Interest] onclick=aoc();

    function aoc() {
    document.getElementById('gmci').style.width='450px';
    document.getElementById('gmci').style.height='450px';
    document.getElementById('gmci').style.display='inline-block';
    }

Another way to zoom around the world online!

You can try the Emoji Flags live run (with underlying world_flags.html changed this way) or the other Emoji functionalities that have this live run and/or its PHP source code emoticon_keyboard_shortcuts.php changed in this way to extend its software integration capabilities.


Previous relevant Emoji Name Search Posting Tutorial is shown below.

Emoji Name Search Posting Tutorial

Emoji Name Search Posting Tutorial

Yesterday’s Emoji Name Search Tailoring Tutorial was suitable for data sets of that smaller size able to be handled by the web server limit of URL length. But what if there are too many data items in your data set to be handled by PHP’s $_GET[] array URL ? and & delimited URLs? We, having PHP serverside code at our disposal, can turn to $_POST[] (HTML) method=POST form action=[here’sLookingAtYouKid] scenarios, to get around this issue. The unfortunate side effect of this is that the HTML mailto: a link (email client) method of sharing your Emoji web application relies on that $_GET[] approach, that is, unless you wrote a whole “bespoke” web application to help out, like we do today for our new Emoji “World Flags” web application with this live run, with this HTML and Javascript world_flags.html source code.

That new “supervisor” being a guinea pig idea into the $_POST[] thinking, we add some HTML form element input type=text additions to allow for, out of …

  • Emoji look class … and …
  • Wording next to Emoji … and …
  • URL of Wording’s link, be that substituted or appended

mapped values, optionally, off a newly offered HTML form element input type=text for this mapped comma or blank separated word list.

Perhaps, now, you “long data set thinkers” want to try the live run and/or its PHP source code emoticon_keyboard_shortcuts.php changed in this way to extend its data set size capabilities.


Previous relevant Emoji Name Search Tailoring Tutorial is shown below.

Emoji Name Search Tailoring Tutorial

Emoji Name Search Tailoring Tutorial

Information Technology is full of “buzz words”, and am sure you wince at some to all of them yourselves. That’s a bit why am using “Tailoring” rather than …

  • sharing
  • personalization

… to give you a slumberrest from having to look under struck throughdeleted wording to look for hidden “buzz words”terminology that makes your harehair sit upstand watchingon Bugs Bunnyend.

We think, perhaps, that emojis can be important for young “would be” programmers to launch into. Personally wonder how many “would be” programmers give the game up far too soon just because they don’t have those graphics skills, well, with emojis, a lot of that hard work, in miniature, has been done for you by some pretty creative people, so why not enjoy the fruits (chortle, in context, chortle) of their labour and start developing your own web applications to use them. Daily, their use is increasing, as are the sharing of access methods.

In today’s extension to the functionality started with yesterday’s Emoji Name Search Primer Tutorial we separate the Emoji Terra aspects to how it works and allow the user to …

  • supply an Emoji Word List of interest
  • perhaps supply a heading and subheading to describe the “concept” of that list
  • supply either a …
    1. URL prefix … or …
    2. URL with the ~ (tilde) character where you want, substituted, your emoji name

    … to be a navigation destination in that similar new window navigation we used to access Emoji Terra

  • presenting all this in an HTML form action=[here’sLookingAtYouKid] method=GET …
  • that method=GET opening the door to be able to offer an email client engine method to “share”email somebody the link to a screen that looks like the one you’re seeing

Of course, we’d like you to find some of your own such Emoji Display Dynamically Created Web Applications yourself, but to encourage, we, in the web application, today, identified two ideas, namely …

  • Fruit and Vegetables via Wikipedia at https://en.wikipedia.org/wiki/ as a prefix … and …
  • Astrology via Cafe Astrology at https://cafeastrology.com/~dailyhoroscope.html via ~ (tilde) character substitution

… each of which (and any you make will also) feature a link to the HTML mailto: a link out through the email client and to your recipient who can click the email link to “share”compare notes.

Perhaps, now, you want to try the live run and/or its PHP source code emoticon_keyboard_shortcuts.php changed in this way to extend its functionality, involving a reveal favourite of ours, the use of HTML(5)’s details (and summary) element.

You can also see this play out at WordPress 4.1.1’s Emoji Name Search Tailoring Tutorial.


Previous relevant Emoji Name Search Primer Tutorial is shown below.

Emoji Name Search Primer Tutorial

Emoji Name Search Primer Tutorial

We got quite excited recently with Rainbow Games PHP Emoji Tutorial when we added a (fourth Beatle) emoji helper, called Emoji Terra, into the mix of tools to gather emoji information. Today, we’ve got a new Emoji Search web application that introduces a new (fifth Beatle(?)) emoji helper tool to add into the “how we see it” mix below …

  • Emojipedia is good for looking up Emoji names or concepts in words
  • FileFormat Information is great for HTML Entity determinations for your less complex Emojis
  • Iemoji is great for HTML Entity determinations for Emojis of all complexities
  • Emoji Terra performs similar functionality as Iemoji but has a permalink organization more friendly to an “emoji search via emoji title” query, and that has suited our purposes today, and before, so, thanks a lot
  • Emoji CSS performs similar functionality to Emojipedia, but has a pictorial view of Emoji names as well, right from the word go, thanks

With these emoji tools in mind we wrote a new PHP web application combining those last two to show Emojis pictorially (with their short name) initially and allow the user to search for an Emoji (match) list via their HTML input type=text (textbox) entry, which results in …

  • the Emoji (match) list look (as an Emoji “display”) … and …
  • an HTML a link which is that Emoji’s short name … linking to …
  • an Emoji Terra webpage with more detail, including HTML Entity information if “short name” is unique, or one extra click away, if not

Maybe you need to try the live run and/or its PHP source code emoticon_keyboard_shortcuts.php to download, perhaps?


Previous relevant Rainbow Games PHP Emoji Tutorial is shown below.

Rainbow Games PHP Emoji Tutorial

Rainbow Games PHP Emoji Tutorial

In order to take that further genericization step onto the achievements of yesterday’s Rainbow Games Genericization Tutorial to get onto (the mathematics Induction principle inspired) …

  • prove for the first case
  • prove for the second case
  • prove for the nth case

… we had a choice of …

  • continue on (with) the HTML code creation of new “hardcoded” arrays (managed by Javascript eval abstractional approach) … or “bite the bullet” and …
  • try to work out a generic “emoji lookerer upperer” arrangement

Guess you can tell we opted for the latter, huh?! We started the investigation of this by examining our three favourite emoji informational websites, namely …

  1. Emojipedia
  2. FileFormat Information
  3. Iemoji

… and were a bit surprised that we could not quite swing a generic method to glean the information, so don’t know whether our new “player” is “Ringo Starr” or not, but can tell you this, “its beat is much better than its bite” … chortle, chortle

Emoji Terra performs similar functionality as Iemoji but has a permalink organization more friendly to an “emoji search via emoji title” query, and that suits our purposes today, so, thanks a lot. Without this query by “emoji title” possibility we’d have been forced to adopt more of those “hardcoded” arrays, which would have been alright, but this second approach opens the door to “sport” events in “The Rainbow Games” web application using emojis of the future (ie. they haven’t been invented yet).

How to work the interfacing to Emoji Terra?

This new PHP emoji_lookup.php treats the “prove for the nth case” sports as ones to …

  • look up the emoji information for (in the order “PHP Source File as the Database Source” then try file_get_contents of Emoji Terra lookup), and …
  • read the HTML partner source code live run‘s underlying HTML and Javascript and CSS emoji_walk_animation.htm (which changed in this way)
  • amend that HTML source to supplant the “Sprint” default sport for this new nominated sport … trying not to fall over laughing at some of the new sports we present (inspired by a visit to Emoji Terra search)
  • write out that amended HTML code as the web page (the beauty of a serverside language like PHP)

The more detailed specifics of the file_get_contents of Emoji Terra lookup above are …

  • build up a URL starting with HTTP://emojiterra.com/ … then …
  • in emojiland arrangements there are two genders (as our prefixes if you will) … woman- and man-
  • then add on a “middle” sport descriptor (eg. biking)
  • in emojiland emoticonland arrangements there are five descriptors (as our suffixes if you will) … -dark-skin-tone, -medium-dark-skin-tone, -medium-skin-tone, -medium-light-skin-tone, -light-skin-tone
  • for that set of 2x1x5=10 URLs glean what “HTML dec” (HTML Entity) information you can glean via the file_get_contents call of the Emoji Terra URLs described above (eg. Emoji: Woman Biking: Dark Skin Tone) … built into a Javascript array string to “plug into” the previously read HTML partner source code, and amended to output as the web page the user sees

Sports of the future in emojiland? Just ask for the equivalent of biking (above) off the user via a Javascript prompt window (on the proviso you read Conditional Alternative to Javascript Popup Windows in iOS Tutorial first please).


Previous relevant Rainbow Games Genericization Tutorial is shown below.

Rainbow Games Genericization Tutorial

Rainbow Games Genericization Tutorial

What would help genericize the recent Rainbow Games Double Transformation Tutorial “Rainbow Games” web application? How about introducing another sport?

Again, in honour of “onions of the 4th dimension” approaches, we mainly, turn to the power of Javascript’s eval methodology to achieve this abstracted feeling to our web application. Today, with this, we go two thirds of the way along the “Mathematical Induction” approach …

  • prove for the first case
  • prove for the second case
  • prove for the nth case

How does this use of Javascript eval manifest itself in this way?

  • there are two arrays that work with the “content” of our “Rainbow Games” sport(s) (well, at least, the first “sprint running” sport) called emoticons[] and choices[]
  • wherever we find references in the code to either of these two arrays we start to involve the global variable verbsuffix

    var verb='Sprint';
    var verbs=['Sprint','Row'];
    var anotherverb='run';
    var verbsuffix='';

    … in altered ways like …

    function plus(ih,ihep) {
    var outihep=ihep;
    if (eval("emoticons" + verbsuffix + "[" + ih + "]").indexOf('<p>') != -1) {
    outihep += ' (' + eval("emoticons" + verbsuffix + "[" + ih + "]").split('<p>')[1].split('<')[0] + ')';
    }
    return outihep;
    }

    … in that abstracted way … noting that sometimes you don’t need the “eval()” encasings …
  • and so, working through the code this way it just falls to the coder to define new members for all the arrays for all the new sports (ours is “rowing” today), some of those new arrays (like for rowing are emoticonsrowing[] and choicesrowing[]) to involve …
  • looking up emoji definitions from …
    1. Emojipedia
    2. FileFormat Information
    3. Iemoji

    … not forgetting to …

  • make sure the event logics work for multiple sport scenarios … but mostly they do by sticking to the principles above … especially for the …
  • new HTML select (dropdown) element allows the user to pick a sport

Remaining a work in progress, you can try out our live run link that has underlying HTML and Javascript and CSS emoji_walk_animation.htm, and which changed in this way regarding today’s genericization work. We hope it gives you food for thought.


Previous relevant Rainbow Games Double Transformation Tutorial is shown below.

Rainbow Games Double Transformation Tutorial

Rainbow Games Double Transformation Tutorial

We were on the “road to personalization” for the web application game we started with yesterday’s Rainbow Games Primer Tutorial when “an old chestnut” came up again. It’s happened before, the desire to “double transform” in CSS came about from our emoji …

🏃🏾‍♀️

… table cell mirroring styling as per …


<style>
* { overflow-x: visible; }

select { font-size: 36px; }

td.runner { width: 50px; word-wrap: break-word; font-size: 36px;
transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1);
} //

🏃🏾‍♀️

tr { max-height: 40px; }
</style>

… necessary to make our running emojis run from left to right (that, alas, also transformed any accompanying …

🏃🏾‍♀️

Florence

… name), was added to in this double transformational clause to prove what this wonderful web page advice had to say. In other words, a “double transform” CSS styling scenario like the one below …


<style>
* { overflow-x: visible; }

select { font-size: 36px; }

td.runner { width: 50px; word-wrap: break-word; font-size: 36px;
transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1);
}
tr { max-height: 40px; }

p {
display: block;
font-size: 12px;
-webkit-transform: matrix(-1, 0, 0, 1, 0, 0);
-moz-transform: matrix(-1, 0, 0, 1, 0, 0);
-o-transform: matrix(-1, 0, 0, 1, 0, 0);
transform: matrix(-1, 0, 0, 1, 0, 0);
}
//

🏃🏾‍♀️

Florence

</style>

… works as a “double transform” to first …

  • mirror (image) flip the table cell (td) emoji data … but us appending some “Runner Name” textual data underneath also, annoyingly, got flipped until …
  • within that (same) table cell (td) element and after the emoji data we append an HTML p(aragraph) element to both …
    1. introduce a new HTML element type into the (CSS styling) mix … and to …
    2. introduce a new CSS transformation type, the matrix … perhaps either or both new parts to the problem critical to its success when, believe me, lots of other approaches don’t work

… to personalize the “runners” and “users”, optionally, “into the game”, by allowing the “user” to name their “runners” and allow for a “runner energy” setting be a bit randomized, to add for some other interest “variety” to the game’s workings. So, still a work in progress that you can try out at our live run link that has underlying HTML and Javascript and CSS emoji_walk_animation.html, and which changed in this way regarding today’s work.


Previous relevant Rainbow Games Primer Tutorial is shown below.

Interesting Places Primer Tutorial

Rainbow Games Primer Tutorial

It’s been a while since we’ve written any conventional HTML and Javascript and CSS game. Today’s game uses the “emoticon” section of the Emoji character set, defaulting so far, to the “running woman” emoji featuring in Compound Emoji WordPress Usage Tutorial.

It’s the early days of our “Rainbow Games” web application, and we’re starting with the animation featuring horizontal hashtag navigation techniques for a running race start to our game. Where it finishes? Hard to say! Today, we’ve looked at “splits” and a finish line.

You can try out our burgeoning live run game concept link that has underlying HTML and Javascript and CSS emoji_walk_animation.html.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in Ajax, eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Google Chart Generic Background Image Outliers Tutorial

Google Chart Generic Background Image Outliers Tutorial

Google Chart Generic Background Image Outliers Tutorial

Further to yesterday’s Google Chart Generic Background Image Mobile Tutorial‘s background image functionality for our inhouse Google Charts interfacing PHP web applications, it’s the non-generic outliers

… we needed to merge in the relevant smarts of the changed generic Javascript into …

As well, before that, into the generic code, we made some styling improvements to hide some unnecessary elements for mobile platform usage, and improved form sizing to reduce the need for scrolling, as well as email and SMS conduit logic improvements. We hope you enjoy trying out some of these PHP web applications with background images of your choosing.


Previous relevant Google Chart Generic Background Image Mobile Tutorial is shown below.

Google Chart Generic Background Image Mobile Tutorial

Google Chart Generic Background Image Mobile Tutorial

We’re almost there amalgamating the new Google Chart interfacing web application background imaging functionality further to the day before yesterday’s Google Chart Generic Background Image Collaboration Tutorial. Today’s part of the puzzle was dealing with …

  • mobile platform window.prompt overridings for non Pie Chart Google Chart participants … to join …
  • non-mobile platform window.prompt overridings for non Pie Chart Google Chart participants

… that we’d been limiting our scope to up until today. On mobile platforms we arrange for an overlaying HTML form to override the window.prompt, meaning webpage calls differ for each question asked of the user. This asks for quite a difference architecture to our coding requirements.

For this work, then it involves changed Javascript


function postlhway() {
var foundu='';
var prefoundu='';
if (bimode == -1) {
if (document.getElementById('bkcol')) {
if (('' + document.getElementById('bkcol').style.backgroundImage).toLowerCase().indexOf('url(') != -1) {
foundu='' + ('' + document.getElementById('bkcol').style.backgroundImage).split('(')[eval(-1 + ('' + document.getElementById('bkcol').style.backgroundImage).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=2;
prefoundu='+';
}
}
if (bimode == -1) {
if (('' + document.body.style.backgroundImage).toLowerCase().indexOf('url(') != -1) {
foundu='' + ('' + document.body.style.backgroundImage).split('(')[eval(-1 + ('' + document.body.style.backgroundImage).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
} else if (document.body.innerHTML.indexOf('<style> body { background-image:') != -1) {
foundu='' + ('' + document.body.innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(')[eval(-1 + ('' + document.body.innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
} else if (document.getElementById('bitsatend').innerHTML.indexOf('<style> body { background-image:') != -1) {
foundu='' + ('' + document.getElementById('bitsatend').innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(')[eval(-1 + ('' + document.getElementById('bitsatend').innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
} else if (document.getElementById('bitsatend').innerHTML.indexOf('<style> #bkcol { background-image:') != -1) {
foundu='' + ('' + document.getElementById('bitsatend').innerHTML.split('<style> #bkcol { background-image:')[1].split('}')[0]).split('(')[eval(-1 + ('' + document.getElementById('bitsatend').innerHTML.split('<style> #bkcol { background-image:')[1].split('}')[0]).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=2;
prefoundu='+';
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
}
}
}
if (foundu != '') {
if (document.getElementById('remail')) {
if (document.getElementById('remail').href.indexOf(encodeURIComponent('bi=')) == -1) {
if (document.getElementById('remail').href.indexOf(encodeURIComponent('#')) != -1 && document.getElementById('remail').href.indexOf(encodeURIComponent('&')) != -1) {
if (3 == 3) {
document.getElementById('remail').href+='' + encodeURIComponent('&#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href+='' + encodeURIComponent('&#bi=') + prefoundu + encodeURIComponent(foundu);
}
} else {
document.getElementById('remail').href=document.getElementById('remail').href.replace(encodeURIComponent('&'), encodeURIComponent('&bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href=document.getElementById('rsms').href.replace(encodeURIComponent('&'), encodeURIComponent('&bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
}
}
} else if (document.getElementById('remail').href.indexOf(encodeURIComponent('#')) != -1) {
document.getElementById('remail').href=document.getElementById('remail').href.replace(encodeURIComponent('#'), encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href=document.getElementById('rsms').href.replace(encodeURIComponent('#'), encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
}
} else {
document.getElementById('remail').href+='' + encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href+='' + encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
}
}
}
}
}
}

function saveprompt() {
if (document.getElementById('prompt')) {
titlezwords=document.getElementById('prompt').value;
titleywords=document.getElementById(titleid).value;
setTimeout(function(){
if (document.getElementById('prompt').value.trim() == '' && titlezwords.trim() != '') {
document.getElementById('prompt').value=titlezwords;
if (document.getElementById(titleid)) {
if (document.getElementById(titleid).value.trim() == '') {
document.getElementById(titleid).value=titleywords;
}
}
}
}, 2000);
}
}

function whiletitlethere() {
if (document.getElementById('prompt')) {
if (document.getElementById('prompt').value.trim() == '' && titlezwords.trim() != '') {
document.getElementById('prompt').value=titlezwords;
if (document.getElementById(titleid)) {
if (document.getElementById(titleid).value.trim() == '') {
document.getElementById(titleid).value=titleywords;
}
}
titlezwords=' ';
}
}
if (titlezwords != '') {
setTimeout(whiletitlethere, 2000);
}
}

function wtitlethere() {
if (document.getElementById('prompt')) {
if (document.getElementById('prompt').value.trim() == '' && titlezwords.trim() != '') {
document.getElementById('prompt').value=titlezwords;
if (document.getElementById(titleid)) {
if (document.getElementById(titleid).value.trim() == '') {
document.getElementById(titleid).value=titleywords;
}
}
titlezwords=' ';
}
}
if (titlezwords != '') {
setTimeout(wtitlethere, 2000);
}
}

function lhway() {
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var dotis='.';
var thisansis='';
if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= ') != -1) {
thisansis=' ' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').split('bi= ')[1].split('#')[0].split('&')[0];
} else if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi=') != -1) {
thisansis='' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').split('bi=')[1].split('#')[0].split('&')[0];
}
//alert('thisansis=' + thisansis);
if (thisansis.replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1) {
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
} else {
setInterval(function(){
if (document.getElementById('iagc')) {
document.getElementById('iagc').style.width='1px';
document.getElementById('iagc').style.height='1px';
}
}, 2000);
}
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && thisansis.replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd].replace(/\%3F/g,'?').replace(/\%26/g,'&');
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
setTimeout(function(){ document.getElementById('chart_div').style.opacity='0.8'; }, 4000);
} else if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
//alert('modespace=#' + modespace + '# and thisansis=#' + thisansis + '# and outofansgoes=#' + outofansgoes + '#' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= '));
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
setInterval(postlhway, 3000);
}

if (document.URL.indexOf('nojwin') == -1 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
}

if (document.URL.indexOf('nojwin') == -1) { // || navigator.userAgent.match(/iPhone|iPad/i)) {
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
const originalWindowPrompt = window.prompt; // thanks to https://stackoverflow.com/questions/9172505/how-to-override-the-window-open-functionality

window.prompt = function(zwords, defwords){
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var fauxv='';
var dotis='youllneverfindthis';
var datetosubfor='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (ztis != -1) {
dotis='.';
moneis=zwis;
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
} else {
fauxv='stopregex';
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.replace('background image URL or background image data URI ; separated (followed by ;) before title are available options, and ','').toLowerCase().indexOf(' data ur') == -1) {
zwords=zwords.replace('background image URL or background image data URI ; separated (followed by ;) before title are available options, and ','');
zwords+=' ... body background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background (just YYYYMMDD uses this blog tutorial image that day, if first Y is 1 we randomize via Lorem Picsum at https://picsum.photos/ thanks) ';
}
var thisansis=originalWindowPrompt(zwords, defwords);
if (thisansis == null) { return null; }
if (ztis != -1) {
if (thisansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(0,8);
} else if (thisansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
if (eval('' + datetosubfor) < 20110314) {
thisansis=thisansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
} else {
thisansis=thisansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
} else {
if (thisansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(0,8);
} else if (thisansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
thisansis=thisansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
}
}
}
if ((fauxv + thisansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + thisansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
return thisansis;
};
}
} else if (document.URL.indexOf('nojwin') != -1) { // || navigator.userAgent.match(/iPhone|iPad/i)) {

if (('' + location.search).indexOf('&val1=') != -1) {
console.log('document.URL=' + document.URL);
try {
if (window.parent) {
parent.title=decodeURIComponent(decodeURIComponent(location.search.split('val1=')[1].split('&')[0]).replace(/\+/g,' '));
console.log('parent.title=' + parent.title);
if (parent.title.indexOf('//picsum.photos/600/400/?random=') != -1) { // ?random=yyyymmdd
parent.title=parent.title.replace('//picsum.photos/600/400/?random=','');
console.log('Parent.title=' + parent.title);
parent.location.href=document.URL.replace(encodeURIComponent(encodeURIComponent('//picsum.photos/600/400/?random=')),'');
}
}
title=decodeURIComponent(decodeURIComponent(location.search.split('val1=')[1].split('&')[0]).replace(/\+/g,' '));
console.log('title=' + title);
if (title.indexOf('//picsum.photos/600/400/?random=') != -1) { // ?random=yyyymmdd
//title=title.split('//picsum.photos/600/400/?random=')[1].substring(8);
title=title.replace('//picsum.photos/600/400/?random=','');
console.log('Title=' + title);
}
} catch(hgrh) { }
}

var prompt = function(zwords, defwords){
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var fauxv='';
var dotis='youllneverfindthis';
var datetosubfor='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (document.getElementById('val1')) {
document.getElementById('val1').onblur=function(evt){
//document.getElementById('OK').disable=true;
console.log('at onblur');
ansis='' + evt.target.value;
console.log('at onblur ansis=' + ansis + ' ztis=' + ztis);
oansis=ansis;
console.log('aT onblur ansis=' + ansis + ' ztis=' + ztis);
// Start of new mobile ...
if (ztis != -1 || 1 == 1) {
console.log('AT onblur ansis=' + ansis + ' ztis=' + ztis);
if (ansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
console.log('at onblur ansis=' + ansis + ' datetosubfor=' + datetosubfor);
} else if (ansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
console.log('at onBlur ansis=' + ansis + ' datetosubfor=' + datetosubfor);
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
console.log('at onBLur ansis=' + ansis + ' datetosubfor=' + datetosubfor);
if (eval('' + datetosubfor) < 20110314) {
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
} else {
ansis=ansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
console.log('at onbluR ansis=' + ansis + ' ztis=' + ztis);
} else {
if (ansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
console.log('at onblur ansis=' + ansis + ' datetosubFor=' + datetosubfor);
} else if (ansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
console.log('at onblur ansis=' + ansis + ' datetosubfoR=' + datetosubfor);
}
if (datetosubfor != 'youllneverfindthis') {
console.log('at onblur ansIs=' + ansis + ' datetosubfoR=' + datetosubfor);
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
console.log('at onblur ansIS=' + ansis + ' datetosubfoR=' + datetosubfor);
}
}
}
if ((fauxv + ansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
console.log('at onblur Ansis=' + ansis + ' Ztis=' + ztis);
if (ansis.indexOf('data:') == -1) {
var wdsare=ansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + ansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (ansis.indexOf(';utf8,') != -1 && ansis.indexOf('</svg>') != -1) {
outofansgoes='data' + ansis.substring(4).split('</svg>')[0] + '</svg>';
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(ansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + ansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
console.log('at onblur Ansis=' + ansis + ' ZTis=' + ztis + ' outofansgoes=' + outofansgoes);
if (outofansgoes != '') {
if (ansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
console.log('at onblur again ansis=' + ansis);
ansis=ansis.replace(outofansgoes, '');
console.log('at onblur again after replace ansis=' + ansis);
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
console.log('at onblur again after replace new');
gform.append('inwrite', newoutofansgoes);
if (newoutofansgoes.indexOf('//') != -1 && newoutofansgoes.indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes.split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes)) + encodeURIComponent(encodeURIComponent(' ')));
}
console.log('Here ' + newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
console.log('at onblur again after replace not new');
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
if (outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('//') != -1 && outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//').split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//'))) + encodeURIComponent(encodeURIComponent(' ')));
}
console.log('here ' + outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
console.log('at onblur open');
gxhr.open('post', '/PHP/csv.php', true);
console.log('at onblur send');
gxhr.send(gform);
console.log('at onblur sent');
}
}
if (ansis != oansis) { gansis=ansis; console.log('gansis=' + gansis); evt.target.value=ansis; document.getElementById('hval1').value=encodeURIComponent(ansis); console.log('safariform is ' + document.getElementById('safariform').outerHTML); setTimeout(function(){ document.getElementById('val1').value=gansis; if (1 == 2) { document.getElementById('OK').disable=false; document.getElementById('OK').click(); } }, 5000); return true; }
// End of new mobile ...
return true;
};
}
if (ztis != -1) {
dotis='.';
moneis=zwis;
if (document.URL.indexOf('&') == -1) {
//setTimeout(function() {
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
//}, 5000);
}
} else {
fauxv='stopregex';
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.replace('background image URL or background image data URI ; separated (followed by ;) before title are available options, and ','').toLowerCase().indexOf(' data ur') == -1) {
zwords=zwords.replace('background image URL or background image data URI ; separated (followed by ;) before title are available options, and ','');
zwords+=' ... body background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background (just YYYYMMDD uses this blog tutorial image that day, if first Y is 1 we randomize via Lorem Picsum at https://picsum.photos/ thanks) ';
}

var vcancel='';
var vok='';
var ansis=location.search.split('val' + pnum + '=')[1] ? decodeURIComponent(decodeURIComponent(location.search.split('val' + pnum + '=')[1].split('&')[0]).replace(/\+/g,' ')) : '';
if (('' + location.search).indexOf('&val1=') != -1) {
try {
if (window.parent) {
parent.title=decodeURIComponent(decodeURIComponent(location.search.split('val1=')[1].split('&')[0]).replace(/\+/g,' '));
if (parent.title.indexOf('//picsum.photos/600/400/?random=') != -1) { // ?random=yyyymmdd
parent.title=parent.title.split('//picsum.photos/600/400/?random=')[1].substring(8);
}
}
title=decodeURIComponent(decodeURIComponent(location.search.split('val1=')[1].split('&')[0]).replace(/\+/g,' '));
if (title.indexOf('//picsum.photos/600/400/?random=') != -1) { // ?random=yyyymmdd
title=title.split('//picsum.photos/600/400/?random=')[1].substring(8);
}
} catch(hgrh) { }
}

titlezwords=zwords;
titleywords=defwords;
titleid='val' + pnum;
//if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//setTimeout(wtitlethere, 1000);
//}
if (45 == 67) {
//if (4 == 44) {
//setTimeout(wtitlethere, 1000);
//} else {
if (zwords.toLowerCase().indexOf(' title ') != -999 && titlezwords.replace(' ',' ') == ' ') {
if (titlezwords.replace(' ',' ') == ' ') { setTimeout(whiletitlethere, 1000); }
titlezwords=zwords;
titleywords=defwords;
titleid='val' + pnum;
} else { //if (zwords.toLowerCase().indexOf(' title ') == -1) {
titlezwords=' ';
titleywords='';
}
//}
}
if (document.URL.indexOf('val' + pnum + '=') == -1) ansis=null;
if (document.URL.indexOf('val' + pnum + '=') != -1 && pnum == eval(-1 + xpnum)) {
vcancel=location.search.split('Cancel=')[1] ? location.search.split('Cancel=')[1].split('&')[0] : '';
vok=location.search.split('OK=')[1] ? location.search.split('OK=')[1].split('&')[0] : '';
}
if (vcancel != '') {
pnum++;
return null;
} else if (vok != '') {
//document.title='' + vok;
//ansis=document.getElementById('val' + pnum).value;
//document.title='Ztis=' + ztis + ' and ansis=' + ansis;
// Start of new mobile ...
if (ztis != -1 || pnum <= 2) {
if (ansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
} else if (ansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
if (eval('' + datetosubfor) < 20110314) {
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
} else {
ansis=ansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
} else {
if (ansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
} else if (ansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
}
}
}
if ((fauxv + ansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (ansis.indexOf('data:') == -1) {
var wdsare=ansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + ansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (ansis.indexOf(';utf8,') != -1 && ansis.indexOf('</svg>') != -1) {
outofansgoes='data' + ansis.substring(4).split('</svg>')[0] + '</svg>';
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(ansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + ansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (ansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
ansis=ansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
if (newoutofansgoes.indexOf('//') != -1 && newoutofansgoes.indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes.split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes)) + encodeURIComponent(encodeURIComponent(' ')));
}
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
if (outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('//') != -1 && outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//').split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//'))) + encodeURIComponent(encodeURIComponent(' ')));
}
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
// End of new mobile ...
pnum++;
return ansis;
} else if (document.getElementById('val' + pnum)) {
allowed=false;
lastfi=true;
document.getElementById('safariform').style.display='block';
document.getElementById('prompt').value=zwords;
document.getElementById('val' + pnum).value=defwords;
document.getElementById('hval' + pnum).value=encodeURIComponent(defwords);
if (zwords.split(String.fromCharCode(10)).length > eval('0' + document.getElementById('prompt').rows)) {
document.getElementById('prompt').rows=zwords.split(String.fromCharCode(10)).length;
} else if (zwords.split('<br>').length > eval('0' + document.getElementById('prompt').rows)) {
document.getElementById('prompt').rows=zwords.split('<br>').length;
}
document.getElementById('val' + pnum).focus();
ansis='';
if (document.URL.indexOf('val' + eval(-1 + pnum) + '=') != -1) {
ansis=decodeURIComponent(decodeURIComponent(document.URL.split('val' + eval(-1 + pnum) + '=')[1].split('&')[0]));
}
//document.title='ztis=' + ztis + ' and ansis=' + ansis;
// Start of new mobile ...
if (ztis != -1 || pnum == 2) {
if (ansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
} else if (ansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
//oneway=ansis;
if (eval('' + datetosubfor) < 20110314) {
document.getElementById('val' + eval(-1 + pnum)).value=document.getElementById('val' + eval(-1 + pnum)).value.replace(datetosubfor, '').replace(/^\ /g,'').replace(/^\ /g,'');
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
} else {
document.getElementById('val' + eval(-1 + pnum)).value=document.getElementById('val' + eval(-1 + pnum)).value.replace(datetosubfor, '').replace(/^\ /g,'').replace(/^\ /g,'');
ansis=ansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
twoway=ansis;
if (document.getElementById('safariform')) {
document.title='no';
} else {
document.title='' + document.getElementById('safariform').innerHTML.length;
}
} else {
if (ansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(0,8);
} else if (ansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != ansis) {
datetosubfor=ansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
//oneway=ansis;
document.getElementById('val' + eval(-1 + pnum)).value=document.getElementById('val' + eval(-1 + pnum)).value.replace(datetosubfor, '').replace(/^\ /g,'').replace(/^\ /g,'');
ansis=ansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + datetosubfor);
twoway=ansis;
}
}
}
//document.title='ztIs=' + ztis + ' and ansis=' + ansis;
if ((fauxv + ansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
//document.title='ztIS=' + ztis + ' and ansis=' + ansis;
if (ansis.indexOf('data:') == -1) {
var wdsare=ansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + ansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (ansis.indexOf(';utf8,') != -1 && ansis.indexOf('</svg>') != -1) {
outofansgoes='data' + ansis.substring(4).split('</svg>')[0] + '</svg>';
if (ansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(ansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + ansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (ansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
//oneway=ansis;
ansis=ansis.replace(outofansgoes, '');
twoway=ansis;
document.getElementById('val' + eval(-1 + pnum)).value=document.getElementById('val' + eval(-1 + pnum)).value.replace(outofansgoes, '').replace(/^\ /g,'').replace(/^\ /g,'');
if (document.getElementById('val' + pnum))
// document.title+=' zTIS=' + ztis + ' and ansis=' + ansis + ' outofansgoes=' + outofansgoes;
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
if (newoutofansgoes.indexOf('//') != -1 && newoutofansgoes.indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes.split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(newoutofansgoes)) + encodeURIComponent(encodeURIComponent(' ')));
}
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
if (outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('//') != -1 && outofansgoes.replace('https://', '//').replace('http://', '//').indexOf('=') != -1) {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//').split('=')[1].split('&')[0])) + encodeURIComponent(encodeURIComponent(' ')));
} else {
gform.append('insafarioh', '//' + document.URL.split('&')[0].split('//')[1] + '&val1=' + modespace.replace(' ',encodeURIComponent(encodeURIComponent(' '))) + encodeURIComponent(encodeURIComponent(outofansgoes.replace('https://', '//').replace('http://', '//'))) + encodeURIComponent(encodeURIComponent(' ')));
}
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
// End of new mobile ...
pnum++;
return ansis;
} else if (lastfi) {
pnum++;
lastfi=false;
if (ansis == 'null') return null;
return ansis;
} else {
pnum++;
if (ansis == 'null') return null;
return ansis;
}
};
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var alert = function(zwords){
var defwords='';
var vcancel='';
var vok='';
var ansis=location.search.split('val' + pnum + '=')[1] ? decodeURIComponent(decodeURIComponent(location.search.split('val' + pnum + '=')[1].split('&')[0]).replace(/\+/g,' ')) : '';
if (document.URL.indexOf('val' + pnum + '=') == -1) ansis=null;
if (document.URL.indexOf('val' + pnum + '=') != -1 && pnum == eval(-1 + xpnum)) {
vcancel=location.search.split('Cancel=')[1] ? location.search.split('Cancel=')[1].split('&')[0] : '';
vok=location.search.split('OK=')[1] ? location.search.split('OK=')[1].split('&')[0] : '';
}
if (vcancel != '') {
pnum++;
return null;
} else if (vok != '') {
pnum++;
return '';
} else if (document.getElementById('val' + pnum)) {
allowed=false;
lastfi=true;
document.getElementById('safariform').style.display='block';
document.getElementById('prompt').value=zwords;
document.getElementById('val' + pnum).value=defwords;
document.getElementById('hval' + pnum).value=encodeURIComponent(defwords);
document.getElementById('Cancel').style.display='none';
document.getElementById('bCancel').style.display='none';
document.getElementById('val' + pnum).style.display='none';
document.getElementById('OK').focus();
pnum++;
return ansis;
} else if (lastfi) {
pnum++;
lastfi=false;
if (ansis == 'null') return null;
return ansis;
} else {
pnum++;
if (ansis == 'null') return null;
return ansis;
}
};
}
var confirm = function(zwords){
//alert('val' + pnum + '=? ' + ' pnum=' + pnum + ' xpnum=' + xpnum + ' ' + document.URL);
var defwords='1trueYesOK';
var vcancel='';
var vok='';
var ansis=location.search.split('val' + pnum + '=')[1] ? decodeURIComponent(decodeURIComponent(location.search.split('val' + pnum + '=')[1].split('&')[0]).replace(/\+/g,' ')) : '';
if (document.URL.indexOf('val' + pnum + '=') == -1) ansis=null;
if (document.URL.indexOf('val' + pnum + '=') != -1 && pnum == eval(-1 + xpnum)) {
vcancel=location.search.split('Cancel=')[1] ? location.search.split('Cancel=')[1].split('&')[0] : '';
vok=location.search.split('OK=')[1] ? location.search.split('OK=')[1].split('&')[0] : '';
}
//alert('vok=' + vok);
if (vcancel != '') {
pnum++;
return null;
} else if (vok != '') {
pnum++;
return '1trueYesOK';
} else if (document.getElementById('val' + pnum)) {
allowed=false;
lastfi=true;
document.getElementById('safariform').style.display='block';
document.getElementById('prompt').value=zwords;
document.getElementById('val' + pnum).value=defwords;
document.getElementById('hval' + pnum).value=encodeURIComponent(defwords);
document.getElementById('val' + pnum).style.display='none';
document.getElementById('OK').focus();
pnum++;
return ansis;
} else if (lastfi) {
pnum++;
lastfi=false;
if (ansis == 'null') return null;
return ansis;
} else {
pnum++;
if (ansis == 'null') return null;
return ansis;
}
};
}

function bicheck() {
if (document.URL.indexOf('nojwin=') != -1) {
document.getElementById('bitsatend').innerHTML+='<iframe style=display:none; src="/gctidy.html"></iframe>';
}
if (('' + document.URL + decodeURIComponent('' + location.hash)).indexOf('title=') != -1 || 1 == 1) {
setTimeout(function(){
var prebits='';
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
prebits='ammb=y&';
if (document.getElementById('bitsatend')) {
if (!document.getElementById('remail')) {
//document.getElementById('bitsatend').innerHTML+='<a id="remail" target="ijkemail" href="mailto:?subject=Google%20Chart%20Snapshot&body=' + encodeURIComponent(document.URL) + '">Email 📧</a> <a id="rsms" target="ijkemail" href="sms:&body=' + encodeURIComponent(document.URL) + '">SMS 📟</a><br>';
document.getElementById('bitsatend').innerHTML+='<a id="remail" target="ijkemail" href="mailto:?subject=Google%20Chart%20Snapshot&body=' + encodeURIComponent(document.URL) + '">Email</a><br>'; //' <a id="rsms" target="ijkemail" href="sms:&body=' + encodeURIComponent(document.URL) + '">SMS</a><br>';
}
}
}
//document.body.innerHTML+='<iframe style=display:none; src="/PHP/csv.php?outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
document.getElementById('bitsatend').innerHTML+='<iframe style=display:none; src="/PHP/csv.php?' + prebits + 'outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
}, 2000);
}
}

setTimeout(ggmuchlater, 7000);

setTimeout(gmuchlater, 1000);
setTimeout(gcinit, 2000);
if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= ') != -1) {
lhway();
bicheck();
} else if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi=') != -1) {
lhway();
bicheck();
} else {
setTimeout(bicheck, 5000);
setTimeout(lhway, 5000);
}
setInterval(postlhway, 3000);

and changed PHP

<?php

function ifspacy($dus, $squotethere, $iflenabovezerorepeat) {
global $hdrstuff, $shortbody, $longbody, $rearrangejs, $rearrangestp, $rearrangests, $rearrangesize, $rearrangecover;
$shortbody="body";
$longbody="document.body";
$rearrangejs="";
$rearrangestp="";
$rearrangests="";
$rearrangesize="Size";
$rearrangecover="cover";
$opcd="";
if (strlen($iflenabovezerorepeat) > 0) {
$rearrangejs=" setTimeout(function(){ var ohis=parent.document.getElementById('chart_div').outerHTML; if (!parent.document.getElementById('bkcol')) { parent.document.body.innerHTML=parent.document.body.innerHTML.replace(ohis, '<div id=bkcol>' + ohis + '</div>'); } }, 2000); ";
$shortbody="#bkcol";
$longbody='document.getElementById("bkcol")';
$opcd=" #chart_div { opacity: 0.8; } ";
$rearrangestp=' setTimeout(function(){ if (!parent.document.getElementById("bkcol")) { var xohis=parent.document.getElementById("chart_div").outerHTML; parent.document.body.innerHTML=parent.document.body.innerHTML.replace(xohis, "<div id=bkcol>" + xohis.replace(" style=" + String.fromCharCode(34)," style=" + String.fromCharCode(34) + "opacity:0.8 !important;") + "</div>"); } ';
$rearrangests=' }, 3000); ';
$rearrangesize="Repeat";
$rearrangecover="repeat";
} else {
$opcd=" #chart_div { opacity: 0.8 !important; } ";
}

file_put_contents('xaz.xaz', $dus);
if (strpos(str_replace('~http','~data',str_replace('~//','~data',('~' . $dus))), '~data') !== false) {
if (strpos(('~' . $dus), '~http') !== false) {
$newdus=trim(str_replace('https:','',str_replace('http:','',$dus)));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos(('~' . $dus), '~//') !== false) {
$newdus=$dus;
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",trim($newdus)) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xza.xza', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",trim($newdus)) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzza.xzza', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos($dus, base64_encode(';utf8,')) !== false || strpos(('~' . $dus), '~data:') === false) {
$newdus='data' . base64_decode(substr($dus,4));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
}
} else if (strpos($dus, ' ') !== false) {
if (!$squotethere) {
return "'" . $dus . "'";
}
}
return $dus;
}

if (isset($_POST['inwrite'])) {
$prefixisin='';
if (isset($_POST['inmode'])) {
if (strlen($_POST['inmode']) > 0) {
$prefixisin=' ';
}
}
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['inurl'])) {
$exidea=str_replace('+', ' ', urldecode($_POST['inurl']));
}
if (file_exists('./bicollection.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection.txt') . $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
} else {
file_put_contents('./bicollection.txt', $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
}
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection_backup.txt', file_get_contents('./bicollection.txt'));
}
echo "<html><body></body></html>";
exit;
}

if (isset($_GET['outread']) && isset($_GET['cleanup'])) {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
exit;
} else if (isset($_POST['outread']) || isset($_GET['outread'])) {
$prefixis='';
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['outread'])) {
if (strlen($_POST['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_POST['outread']));
}
} else if (isset($_GET['outread'])) {
if (strlen($_GET['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_GET['outread']));
}
}
$secidea='';
if (file_exists('./bicollection.txt')) {
$filebicont=file_get_contents('./bicollection.txt');
$origf=$filebicont;
if (strpos($filebicont, csv_server_remote_addr() . ' --- ' . $exidea . ' ... ') !== false) {
$relbi=explode("\n", explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont)[-1 + sizeof(explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont))])[0];
if (strpos($filebicont, ' ' . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n") !== false) {
$prefixis=' ';
}
$filebicont=str_replace($prefixis . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n","",$filebicont);
if ($origf != $filebicont) {
file_put_contents('./bicollection_backup.txt', $filebicont);
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 10000); ";
} else if (file_exists('./bicollection_backup.txt')) {
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 9999); ";
}
if (strpos(('~' . $relbi), '~data') !== false) {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
}
} else {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), true, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " " . $rearrangests . " '><p> done </p></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . $ify . "')\"; " . $rearrangests . " '></body><p> yes </p></html>";
}
}
} else {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace('+',' ',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
}
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . str_replace('+',' ',urldecode($relbi)) . "')\"; " . $rearrangests . " '></body><p> yes again</p></html>";
}
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
exit;
}

?>

Cuteerer, huh?!


Previous relevant Google Chart Generic Background Image Collaboration Tutorial is shown below.

Google Chart Generic Background Image Context Tutorial

Google Chart Generic Background Image Collaboration Tutorial

We’ve fallen into an obsession with “c” words, and we apologize. Today’s “collaboration” came after yesterday’s Google Chart Generic Background Image Context Tutorial‘s “context” and before that “code”. What do we make of it?

Well?!


Thanks for the insights!

We are not robots here at RJM Programming, but believe it or not, having three acrostically identical tutorial titles in a row causes us more consternation than usual (Nala’s practically apoplectic), even beyond those butterflies in Brazil crossing the equator and affected by the Coriolis Effect. Anyway …

We have spent a day on email and SMS (conduit) sharing and collaboration means by which our non-mobile (only, so far) web users of the unaccounted for (after that Google Chart Pie Chart Background Image Tutorial inspiration from some time ago) Google Chart interfacing web applications can communicate. That work wasn’t as hard as we thought it would be, given the relief of location.hash hashtag URL methodologies whereby there is less worry about URL lengths regarding “a” link href “mailto:” and/or “sms:” sharing functionalities, so the mind must have wandered into the realms of …

What can an image “reference” (easily be)?

The usual suspects came to mind …

  • relative URL that ends with the extension of the image file … eg. /PHP/seven.jpg
  • absolute URL that ends with the extension of the image file … eg. https://www.rjmprogramming.com.au/PHP/six.jpg
  • data URI … base64 … eg. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAEX0lEQVQ4jUWUyW6cVRCFv7r3/kO3u912nNgZgESAAgGBCJgFgxhW7FkgxAbxMLwBEmIRITbsQAgxCEUiSIBAYIY4g1EmYjuDp457+Lv7n+4tFjbwAHVOnVPnlLz75ht67OhhZg/M0p6d5tD9C8SNBBs5XBJhI4uNLC4SREA0UI9yJr2c4e6QO+v3WF27w+rmNrv9Pm7hxDyHFg5yYGEOYxytuRY2SYiSCIwgRgBQIxgjEAKuZWg6R9S0SCS4qKLZElY3HC5tp7QPtmlMN7HOETUTXBJjrEGsAfgPFECsQbBIbDGJZUYgGE8ugQyPm+o0STtTuGZMnKZEjRjjLIgAirEOEQEBDQFBEFFEBWLFtVJmpENRl6hUuFanTRAlbTeZarcx0R6YNZagAdD/t5N9+QgCYAw2jrAhpjM3zaSY4OJGTDrVwEYOYw2qioigoviq5MqF31m9fg1V5fCx+zn11CLNVnufRhBrsVFE1Ihpthu4KDYYwz5YQIxFBG7duMZnH31IqHL6wwnGCLFd4pez3/DaG2/x4GNPgBhEZG/GGlxkMVFkiNMYay3Inqxed4eP33uf7Y0uu90xWkGolFAru7sZn5w5w921m3u+su8vinEO02hEWLN/ANnL2rkvv2an2yd4SCKLM0JVBsCgAYZZzrnPP0eDRzXgfaCuPHXwuEYjRgmIBlQVVLl8/hKI4fRzz3L6uWe5+PMvnHz6aa4uX+D4yYe5vXaLH86eoyoLjLF476l9oKo9pi5HWONRX8E+YznOef7Vl1h86QWurlwjbc+QpikPPfoIcZLS39pmMikp8pzae6q6oqgriqrGqS+xeLScoMYSVJlfOMTl5RXW1+5w5fJVnFGWf1/mxEMnWPppiclkTLM5RdJoUBYFZVlQ5DnZMMMV167gixKLoXXsKGqnOHnqOJ/+/CfZ+XUiZ0jTmFv5mAvf/YjEliQ2vPD8Ir6qqEcZkzt38cMRo5WruFvfL9FqpyRxQhj0qLOax5I2S08+Tu/lFiGUGOPormxwuyfMnjrGrJa88uIixeYWl776lmrzNjmw8vcG8sU7ixpHMXFsCUVg9tABjEvRgzP82j7AhbyiX5Qcv2+Bvy7dYGZ1k7efeQB/Y4PBqGBtdYvb3SFzLcfqToZc/OB1zYeBSpUwLBlvjZidmWaSB1yaYOfn6LqI/r0hyU6P+cRSlhXjbEI2zvnt7y79oqQ3qeg4g6vKjCIXehtDmi6m0UnxVnCRkPUHVNt9qkLJxgXOCYNOg34v48raPaamU2o89/KKsQ9sTSpc0JK7NwdcX8s43Ek5cnSOLC/Z2R6Rj0ra0w2W1/t0xyWn51uk2Ri1QtSO6OU5d7OSi72cQeWxKG7p/Dp//JXTy6C1Pcbc6DMpPRtjTxChEznWhwVZUCKrjCrPoPDczHLmnLBdBgZlRRWUEBR3ZKrme5TlrTGlV440Y1IrXM9qQGi6mkG5V6uza7tUIeCDElTZ1L26elX+fcH/ACJBPYTJ4X8tAAAAAElFTkSuQmCC

  • data URI … utf8 … svg+xml … eg. data:image/svg+xml;utf8,<svg xmlns=’http://www.w3.org/2000/svg’ width=’66’ height=’48’ viewport=’0 0 100 100′ style=’border-radius:15px;background-color:rgba(0,0,255,0.3);fill:black;font-family:Verdana;font-size:17px;’><text y=’80%’>Alt\\01f3d5</text></svg>

… but then, when at the other end of a navigation the receiver is a serverside language like PHP, that webpage can establish via it’s header function an image (Content Type) outputting modus operandi, like …

<?php

header('Content-Type: image/jpeg');

?>

… and output image data via URL calls that do not have to “end with the extension of any image file”. Our WordPress blog’s TwentyTen theme’s 404.php is capable of this with URLs such as …


https://www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=20221116&random=4575657

… and the other one we’ve had fun with in the past is the great random Lorem Picsum image creating resource accessible via URLs such as …


https://picsum.photos/600/400/

As you might imagine, we wanted to get these two ideas into the mix, especially as it was nagging away at us that the user interaction to make any of this work happen is asking a lot of the web user out there, but to involve more (potentially, later, mobile) users to get interested we can now


zwords+=' ... body background image data URIs, delimited by space or , or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background (just YYYYMMDD uses this blog tutorial image that day, if first Y is 1 we randomize via Lorem Picsum, thanks) ';

For today’s work, though it involves changed Javascript


function postlhway() {
var foundu='';
var prefoundu='';
if (bimode == -1) {
if (document.getElementById('bkcol')) {
if (('' + document.getElementById('bkcol').style.backgroundImage).toLowerCase().indexOf('url(') != -1) {
foundu='' + ('' + document.getElementById('bkcol').style.backgroundImage).split('(')[eval(-1 + ('' + document.getElementById('bkcol').style.backgroundImage).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=2;
prefoundu='+';
}
}
if (bimode == -1) {
if (('' + document.body.style.backgroundImage).toLowerCase().indexOf('url(') != -1) {
foundu='' + ('' + document.body.style.backgroundImage).split('(')[eval(-1 + ('' + document.body.style.backgroundImage).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
} else if (document.body.innerHTML.indexOf('<style> body { background-image:') != -1) {
foundu='' + ('' + document.body.innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(')[eval(-1 + ('' + document.body.innerHTML.split('<style> body { background-image:')[1].split('}')[0]).split('(').length)].split(')')[0].replace(/^\"/g,'').replace(/\"$/g,'').replace(/^\'/g,'').replace(/\'$/g,'');
bimode=1;
}
}
}
if (foundu != '') {
if (document.getElementById('remail')) {
if (document.getElementById('remail').href.indexOf(encodeURIComponent('bi=')) == -1) {
if (document.getElementById('remail').href.indexOf(encodeURIComponent('#')) != -1 && document.getElementById('remail').href.indexOf(encodeURIComponent('&')) != -1) {
if (3 == 3) {
document.getElementById('remail').href+='' + encodeURIComponent('&#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href+='' + encodeURIComponent('&#bi=') + prefoundu + encodeURIComponent(foundu);
}
} else {
document.getElementById('remail').href=document.getElementById('remail').href.replace(encodeURIComponent('&'), encodeURIComponent('&bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href=document.getElementById('rsms').href.replace(encodeURIComponent('&'), encodeURIComponent('&bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
}
}
} else if (document.getElementById('remail').href.indexOf(encodeURIComponent('#')) != -1) {
document.getElementById('remail').href=document.getElementById('remail').href.replace(encodeURIComponent('#'), encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href=document.getElementById('rsms').href.replace(encodeURIComponent('#'), encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')) + '&'));
}
} else {
document.getElementById('remail').href+='' + encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
if (document.getElementById('remail').href.indexOf('&body=') != -1) {
document.getElementById('rsms').href='sms:&body=' + (document.getElementById('remail').href.split('&body=')[1]);
} else {
document.getElementById('rsms').href+='' + encodeURIComponent('#bi=') + prefoundu + encodeURIComponent(foundu.replace('?',encodeURIComponent('?')).replace('?',encodeURIComponent('&')));
}
}
}
}
}
}

function lhway() {
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var dotis='.';
var thisansis='';
if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= ') != -1) {
thisansis=' ' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').split('bi= ')[1].split('#')[0].split('&')[0];
} else if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi=') != -1) {
thisansis='' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').split('bi=')[1].split('#')[0].split('&')[0];
}
//alert('thisansis=' + thisansis);
if (thisansis.replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && thisansis.replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd].replace(/\%3F/g,'?').replace(/\%26/g,'&');
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
setTimeout(function(){ document.getElementById('chart_div').style.opacity='0.8'; }, 4000);
} else if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
//alert('modespace=#' + modespace + '# and thisansis=#' + thisansis + '# and outofansgoes=#' + outofansgoes + '#' + (document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= '));
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
setInterval(postlhway, 3000);
}

if (document.URL.indexOf('nojwin') == -1) { // || navigator.userAgent.match(/iPhone|iPad/i)) {
const originalWindowPrompt = window.prompt; // thanks to https://stackoverflow.com/questions/9172505/how-to-override-the-window-open-functionality

window.prompt = function(zwords, defwords){
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var fauxv='';
var dotis='youllneverfindthis';
var datetosubfor='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (ztis != -1) {
dotis='.';
moneis=zwis;
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
} else {
fauxv='stopregex';
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.toLowerCase().indexOf(' data ur') == -1) {
zwords+=' ... body background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background (just YYYYMMDD uses this blog tutorial image that day, if first Y is 1 we randomize via Lorem Picsum, thanks) ';
}
var thisansis=originalWindowPrompt(zwords, defwords);
if (thisansis == null) { return null; }
if (ztis != -1) {
if (thisansis.replace(/^[2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(0,8);
} else if (thisansis.replace(/^\ [2-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
if (eval('' + datetosubfor) < 20110314) {
thisansis=thisansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + Math.floor(Math.random() * 19896754));
} else {
thisansis=thisansis.replace(datetosubfor, '//www.rjmprogramming.com.au/ITblog/500/500/?mustbedated=' + datetosubfor + '&random=' + Math.floor(Math.random() * 19896754));
}
} else {
if (thisansis.replace(/^[0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(0,8);
} else if (thisansis.replace(/^\ [0-1][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\ /g,'') != thisansis) {
datetosubfor=thisansis.substring(1).substring(0,8);
}
if (datetosubfor != 'youllneverfindthis') {
thisansis=thisansis.replace(datetosubfor, '//picsum.photos/600/400/?random=' + Math.floor(Math.random() * 19896754));
}
}
}
if ((fauxv + thisansis).replace(/^\ http/g,'data:').replace(/^http/g,'data:').replace(/^\ \/\//g,'data:').replace(/^\/\//g,'data:').replace('rjmprogramming.com.au/ITblog/0','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/2','data:').replace('rjmprogramming.com.au/ITblog/3','data:').replace('rjmprogramming.com.au/ITblog/4','data:').replace('rjmprogramming.com.au/ITblog/5','data:').replace('rjmprogramming.com.au/ITblog/6','data:').replace('rjmprogramming.com.au/ITblog/7','data:').replace('rjmprogramming.com.au/ITblog/8','data:').replace('rjmprogramming.com.au/ITblog/9','data:').replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && (fauxv + thisansis).replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') == -1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
} else {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split('; ')[0].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
return thisansis;
};
}

function bicheck() {
if (('' + document.URL + decodeURIComponent('' + location.hash)).indexOf('title=') != -1 || 1 == 1) {
setTimeout(function(){
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
if (document.getElementById('bitsatend')) {
if (!document.getElementById('remail')) {
//document.getElementById('bitsatend').innerHTML+='<a id="remail" target="ijkemail" href="mailto:?subject=Google%20Chart%20Snapshot&body=' + encodeURIComponent(document.URL) + '">Email 📧</a> <a id="rsms" target="ijkemail" href="sms:&body=' + encodeURIComponent(document.URL) + '">SMS 📟</a><br>';
document.getElementById('bitsatend').innerHTML+='<a id="remail" target="ijkemail" href="mailto:?subject=Google%20Chart%20Snapshot&body=' + encodeURIComponent(document.URL) + '">Email</a><br>'; //' <a id="rsms" target="ijkemail" href="sms:&body=' + encodeURIComponent(document.URL) + '">SMS</a><br>';
}
}
}
document.body.innerHTML+='<iframe style=display:none; src="/PHP/csv.php?outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
}, 2000);
}
}

if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi= ') != -1) {
lhway();
bicheck();
} else if ((document.URL + '#' + decodeURIComponent(('' + location.hash)) + '#').replace('bi=+', 'bi= ').indexOf('bi=') != -1) {
lhway();
bicheck();
} else {
setTimeout(bicheck, 5000);
setTimeout(lhway, 5000);
}

and changed PHP

<?php

function ifspacy($dus, $squotethere, $iflenabovezerorepeat) {
global $hdrstuff, $shortbody, $longbody, $rearrangejs, $rearrangestp, $rearrangests, $rearrangesize, $rearrangecover;
$shortbody="body";
$longbody="document.body";
$rearrangejs="";
$rearrangestp="";
$rearrangests="";
$rearrangesize="Size";
$rearrangecover="cover";
$opcd="";
if (strlen($iflenabovezerorepeat) > 0) {
$rearrangejs=" setTimeout(function(){ var ohis=parent.document.getElementById('chart_div').outerHTML; if (!parent.document.getElementById('bkcol')) { parent.document.body.innerHTML=parent.document.body.innerHTML.replace(ohis, '<div id=bkcol>' + ohis + '</div>'); } }, 2000); ";
$shortbody="#bkcol";
$longbody='document.getElementById("bkcol")';
$opcd=" #chart_div { opacity: 0.8; } ";
$rearrangestp=' setTimeout(function(){ if (!parent.document.getElementById("bkcol")) { var xohis=parent.document.getElementById("chart_div").outerHTML; parent.document.body.innerHTML=parent.document.body.innerHTML.replace(xohis, "<div id=bkcol>" + xohis.replace(" style=" + String.fromCharCode(34)," style=" + String.fromCharCode(34) + "opacity:0.8 !important;") + "</div>"); } ';
$rearrangests=' }, 3000); ';
$rearrangesize="Repeat";
$rearrangecover="repeat";
} else {
$opcd=" #chart_div { opacity: 0.8 !important; } ";
}

file_put_contents('xaz.xaz', $dus);
if (strpos(str_replace('~http','~data',str_replace('~//','~data',('~' . $dus))), '~data') !== false) {
if (strpos(('~' . $dus), '~http') !== false) {
$newdus=trim(str_replace('https:','',str_replace('http:','',$dus)));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos(('~' . $dus), '~//') !== false) {
$newdus=$dus;
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",trim($newdus)) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xza.xza', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",trim($newdus)) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzza.xzza', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos($dus, base64_encode(';utf8,')) !== false || strpos(('~' . $dus), '~data:') === false) {
$newdus='data' . base64_decode(substr($dus,4));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } " . $opcd . " </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
}
} else if (strpos($dus, ' ') !== false) {
if (!$squotethere) {
return "'" . $dus . "'";
}
}
return $dus;
}

if (isset($_POST['inwrite'])) {
$prefixisin='';
if (isset($_POST['inmode'])) {
if (strlen($_POST['inmode']) > 0) {
$prefixisin=' ';
}
}
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['inurl'])) {
$exidea=str_replace('+', ' ', urldecode($_POST['inurl']));
}
if (file_exists('./bicollection.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection.txt') . $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
} else {
file_put_contents('./bicollection.txt', $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
}
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection_backup.txt', file_get_contents('./bicollection.txt'));
}
echo "<html><body></body></html>";
exit;
}

if (isset($_GET['outread']) && isset($_GET['cleanup'])) {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
exit;
} else if (isset($_POST['outread']) || isset($_GET['outread'])) {
$prefixis='';
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['outread'])) {
if (strlen($_POST['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_POST['outread']));
}
} else if (isset($_GET['outread'])) {
if (strlen($_GET['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_GET['outread']));
}
}
$secidea='';
if (file_exists('./bicollection.txt')) {
$filebicont=file_get_contents('./bicollection.txt');
$origf=$filebicont;
if (strpos($filebicont, csv_server_remote_addr() . ' --- ' . $exidea . ' ... ') !== false) {
$relbi=explode("\n", explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont)[-1 + sizeof(explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont))])[0];
if (strpos($filebicont, ' ' . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n") !== false) {
$prefixis=' ';
}
$filebicont=str_replace($prefixis . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n","",$filebicont);
if ($origf != $filebicont) {
file_put_contents('./bicollection_backup.txt', $filebicont);
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 10000); ";
} else if (file_exists('./bicollection_backup.txt')) {
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 9999); ";
}
if (strpos(('~' . $relbi), '~data') !== false) {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
}
} else {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), true, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " " . $rearrangests . " '><p> done </p></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . $ify . "')\"; " . $rearrangests . " '></body><p> yes </p></html>";
}
}
} else {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace('+',' ',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
}
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . str_replace('+',' ',urldecode($relbi)) . "')\"; " . $rearrangests . " '></body><p> yes again</p></html>";
}
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
exit;
}

?>

Cuteer, huh?!


Previous relevant Google Chart Generic Background Image Context Tutorial is shown below.

Google Chart Generic Background Image Context Tutorial

Google Chart Generic Background Image Context Tutorial

Here, today, further to yesterday’s Google Chart Generic Background Image Code Tutorial, we are referring to …

  • context … or …
  • guise

again. Well it could be …

  • like when you buy a particular brand of something and then start seeing it everywhere … or …
  • because we like the word “againagain … or …
  • because whenever you revisit a piece of any code it doesn’t take long to appreciate where it could be improved … and we like this one … so …

… we’ll leave it at that. Actually, that last one makes sense, because we realized testing the workings of that Google Chart Pie Chart Background Image Tutorial inspiration for this current project extension, it had a great feature that hadn’t occurred to us yesterday (and we want to allow for) …

  • today, using the background imagery behind the Google Chart and have it be background-repeat:repeat; … the user makes happen by prefixing their background image information by a space character, whereas …
  • yesterday’s use of the background imagery behind the document body and have it be background-size:cover; is perfectly valid too

… making for a better end result set. But there’s more. We’ll be easing out the previous modus operandi in favour of this recent modus operandi over time, we’re thinking, but not before we have a day? looking into sharing functionality that might allow the user to share that Google Chart and its background image arrangements with an email recipient.

For today’s work, though it involves changed Javascript


const originalWindowPrompt = window.prompt; // thanks to https://stackoverflow.com/questions/9172505/how-to-override-the-window-open-functionality

window.prompt = function(zwords, defwords){
var modespace='';
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var dotis='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (ztis != -1) {
dotis='.';
moneis=zwis;
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.toLowerCase().indexOf(' data ur') == -1) {
zwords+=' ... body background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized, prefixed by a space to apply on repeat to chart background ';
}
var thisansis=originalWindowPrompt(zwords, defwords);
if (thisansis == null) { return null; }
if (thisansis.replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
if (thisansis.indexOf(' ' + outofansgoes) != -1) {
modespace=' ';
}
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
gform.append('inmode', modespace);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
return thisansis;
};
}

function bicheck() {
if (('' + document.URL + location.hash).indexOf('title=') != -1) {
document.body.innerHTML+='<iframe style=display:none; src="/PHP/csv.php?outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
}
}

setTimeout(bicheck, 5000);

and changed PHP

<?php

function ifspacy($dus, $squotethere, $iflenabovezerorepeat) {
global $hdrstuff, $shortbody, $longbody, $rearrangejs, $rearrangestp, $rearrangests, $rearrangesize, $rearrangecover;
$shortbody="body";
$longbody="document.body";
$rearrangejs="";
$rearrangestp="";
$rearrangests="";
$rearrangesize="Size";
$rearrangecover="cover";
$opcd="";
if (strlen($iflenabovezerorepeat) > 0) {
$rearrangejs=" setTimeout(function(){ var ohis=parent.document.getElementById('chart_div').outerHTML; if (!parent.document.getElementById('bkcol')) { parent.document.body.innerHTML=parent.document.body.innerHTML.replace(ohis, '<div id=bkcol>' + ohis + '</div>'); } }, 2000); ";
$shortbody="#bkcol";
$longbody='document.getElementById("bkcol")';
$opcd=" #chart_div { opacity: 0.8; } ";
$rearrangestp=' setTimeout(function(){ if (!parent.document.getElementById("bkcol")) { var xohis=parent.document.getElementById("chart_div").outerHTML; parent.document.body.innerHTML=parent.document.body.innerHTML.replace(xohis, "<div id=bkcol>" + xohis.replace(" style=" + String.fromCharCode(34)," style=" + String.fromCharCode(34) + "opacity:0.8 !important;") + "</div>"); } ';
$rearrangests=' }, 3000); ';
$rearrangesize="Repeat";
$rearrangecover="repeat";
}

if (strpos(str_replace('~http','~data',str_replace('~//','~data',('~' . $dus))), '~data') !== false) {
if (strpos(('~' . $dus), '~http') !== false) {
$newdus=trim(str_replace('https:','',str_replace('http:','',$dus)));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; " . $opcd . " } </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; " . $opcd . " } </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos(('~' . $dus), '~//') !== false) {
$newdus=trim($dus);
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; " . $opcd . " } </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xza.xza', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> " . $shortbody . " { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; " . $opcd . " } </style>\"; }, 4000); </scr" . "ipt></head>";
file_put_contents('xzza.xzza', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos($dus, base64_encode(';utf8,')) !== false || strpos(('~' . $dus), '~data:') === false) {
$newdus='data' . base64_decode(substr($dus,4));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; " . $opcd . " }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; " . $rearrangejs . " setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; " . $opcd . " }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
}
} else if (strpos($dus, ' ') !== false) {
if (!$squotethere) {
return "'" . $dus . "'";
}
}
return $dus;
}

if (isset($_POST['inwrite'])) {
$prefixisin='';
if (isset($_POST['inmode'])) {
if (strlen($_POST['inmode']) > 0) {
$prefixisin=' ';
}
}
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['inurl'])) {
$exidea=str_replace('+', ' ', urldecode($_POST['inurl']));
}
if (file_exists('./bicollection.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection.txt') . $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
} else {
file_put_contents('./bicollection.txt', $prefixisin . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
}
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection_backup.txt', file_get_contents('./bicollection.txt'));
}
echo "<html><body></body></html>";
exit;
}

if (isset($_GET['outread']) && isset($_GET['cleanup'])) {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
exit;
} else if (isset($_POST['outread']) || isset($_GET['outread'])) {
$prefixis='';
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['outread'])) {
if (strlen($_POST['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_POST['outread']));
}
} else if (isset($_GET['outread'])) {
if (strlen($_GET['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_GET['outread']));
}
}
$secidea='';
if (file_exists('./bicollection.txt')) {
$filebicont=file_get_contents('./bicollection.txt');
$origf=$filebicont;
if (strpos($filebicont, csv_server_remote_addr() . ' --- ' . $exidea . ' ... ') !== false) {
$relbi=explode("\n", explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont)[-1 + sizeof(explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont))])[0];
if (strpos($filebicont, ' ' . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n") !== false) {
$prefixis=' ';
}
$filebicont=str_replace($prefixis . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n","",$filebicont);
if ($origf != $filebicont) {
file_put_contents('./bicollection_backup.txt', $filebicont);
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 10000); ";
} else if (file_exists('./bicollection_backup.txt')) {
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 9999); ";
}
if (strpos(('~' . $relbi), '~data') !== false) {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $secidea . " " . $rearrangests . " '></body></html>";
}
} else {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), true, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " " . $rearrangests . " '><p> done </p></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . $ify . "')\"; " . $rearrangests . " '></body><p> yes </p></html>";
}
}
} else {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace('+',' ',urldecode($relbi)), false, $prefixis);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL(" . $ify . ")\"; parent." . $longbody . ".style.background" . $rearrangesize . "=\"" . $rearrangecover . "\"; " . $rearrangests . " '></body></html>";
}
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $rearrangestp . " " . $secidea . " parent." . $longbody . ".style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),URL('" . str_replace('+',' ',urldecode($relbi)) . "')\"; " . $rearrangests . " '></body><p> yes again</p></html>";
}
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
exit;
}

?>

Cuter, huh?!

Did you know?

Can an animated GIF set as the background image still be animated?

Yes. But please do not make it too boring. Can we suggest …

?


Previous relevant Google Chart Generic Background Image Code Tutorial is shown below.

Google Chart Generic Background Image Code Tutorial

Google Chart Generic Background Image Code Tutorial

We were interested in a URL we detected being accessed, via our cPanel Apache Status report linking us to Google Chart Pie Chart Background Image Tutorial. Investigating this Google Charts interfacing PHP code means by which to allow for the user specification of background images, in the case of a Pie Chart, we realized some interfacings had been coded for this functionality, but not others.

But don’t we …

  1. have an external Javascript gchartgen.js to turn to …
  2. and a require PHP csv.php we could lean on

? Yes, indeed, and we decided to …

  1. have an external Javascript gchartgen.js to turn to …
  2. and a require PHP csv.php we could lean on
  1. for non-mobile (so far) we could override the window.prompt and check and setup
  2. internal use only recording on user interest in a web server flat file

involving changed Javascript


const originalWindowPrompt = window.prompt; // thanks to https://stackoverflow.com/questions/9172505/how-to-override-the-window-open-functionality

window.prompt = function(zwords, defwords){
var outofansgoes='', newoutofansgoes='';
var moneis=-1, zgxhr=null;
var dotis='youllneverfindthis';
var zwis=eval('' + zwords.toLowerCase().indexOf(' data ur'));
var ztis=eval('' + zwords.toLowerCase().indexOf(' title '));
if (ztis != -1) {
dotis='.';
moneis=zwis;
zgxhr = new XMLHttpRequest();
zgxhr.open('post', '/PHP/csv.php?outread=y&cleanup=y', true);
zgxhr.send(null);
}
if (zwords.indexOf('Enter ') == 0 && zwords.toLowerCase().indexOf(' title ') != -1 && zwords.toLowerCase().indexOf(' data ur') == -1) {
zwords+=' ... background image data URIs, delimited by space or </svg>, or image URL plus space, will be recognized ';
}
var thisansis=originalWindowPrompt(zwords, defwords);
if (thisansis == null) { return null; }
if (thisansis.replace(dotis + 'jp','data:').replace(dotis + 'JP','data:').replace(dotis + 'png','data:').replace(dotis + 'GIF','data:').replace(dotis + 'gif','data:').replace(dotis + 'PNG','data:').replace(dotis + 'svg','data:').replace(dotis + 'SVG','data:').replace(dotis + 'bmp','data:').replace(dotis + 'BMP','data:').replace(dotis + 'tif','data:').replace(dotis + 'TIF','data:').indexOf('data:') != -1 && zwis == moneis) {
if (thisansis.indexOf('data:') == -1) {
var wdsare=thisansis.split(' ');
for (var iwd=0; iwd<wdsare.length; iwd++) {
if (eval('' + wdsare[iwd].length) >= 5) {
if (outofansgoes == '' && wdsare[iwd].slice(-5).indexOf('.') != -1 && wdsare[iwd].slice(-5).indexOf('.') <= 1) {
outofansgoes=wdsare[iwd];
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
}
}
}
} else if (thisansis.indexOf(';utf8,') != -1 && thisansis.indexOf('</svg>') != -1) {
outofansgoes='data' + thisansis.substring(4).split('</svg>')[0] + '</svg>';
if (thisansis.indexOf(outofansgoes + ' ') != -1) {
outofansgoes+=' ';
}
newoutofansgoes='data' + window.btoa(thisansis.substring(4).split('</svg>')[0] + '</svg>');
} else {
outofansgoes='data:' + thisansis.replace(';base64,',',base64,').replace(';utf8,',',utf8,').split('data:')[1].split(';')[0].split(' ')[0].replace(',base64,',';base64,').replace(',utf8,',';utf8,');
}
if (outofansgoes != '') {
thisansis=thisansis.replace(outofansgoes, '');
var gxhr = new XMLHttpRequest();
var gform=new FormData();
if (newoutofansgoes != '') {
gform.append('inwrite', newoutofansgoes);
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
} else {
gform.append('inwrite', outofansgoes.replace('https://', '//').replace('http://', '//'));
gform.append('inurl', document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]);
}
gxhr.open('post', '/PHP/csv.php', true);
gxhr.send(gform);
}
}
return thisansis;
};
}

function bicheck() {
if (('' + document.URL + location.hash).indexOf('title=') != -1) {
document.body.innerHTML+='<iframe style=display:none; src="/PHP/csv.php?outread=' + encodeURIComponent(document.URL.split('rjmprogramming.com.au')[eval(-1 + document.URL.split('rjmprogramming.com.au').length)].split('?')[0].split('#')[0]) + '"></iframe>';
}
}

setTimeout(bicheck, 5000);

and changed PHP

<?php

function ifspacy($dus, $squotethere) {
global $hdrstuff;
if (strpos(str_replace('~http','~data',str_replace('~//','~data',('~' . $dus))), '~data') !== false) {
if (strpos(('~' . $dus), '~http') !== false) {
$newdus=str_replace('https:','',str_replace('http:','',$dus));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos(('~' . $dus), '~//') !== false) {
$newdus=$dus;
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
} else if (strpos($dus, base64_encode(';utf8,')) !== false || strpos(('~' . $dus), '~data:') === false) {
$newdus='data' . base64_decode(substr($dus,4));
if (strpos($newdus, ' ') !== false) {
if (!$squotethere) {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xz.xz', $hdrstuff);
return ''; //'"'" . str_replace('"', "\\" . '"', $newdus) . "'";
} else {
$hdrstuff="<head><scr" . "ipt type=text/javascript> var newdus='" . str_replace("'", "' + String.fromCharCode(39) + '",$newdus) . "'; setTimeout(function(){ parent.document.body.innerHTML+=\"<style> body { background-image: linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(\" + String.fromCharCode(39) + newdus + String.fromCharCode(39) + \") !important; } </style>\"; }, 4000); </scr" . "ipt></head>";
//file_put_contents('xzz.xzz', $hdrstuff);
return ''; //'"" . str_replace('"', "\\" . '"', $newdus) . "";
}
} else {
$dus=$newdus;
}
}
} else if (strpos($dus, ' ') !== false) {
if (!$squotethere) {
return "'" . $dus . "'";
}
}
return $dus;
}

if (isset($_POST['inwrite'])) {
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['inurl'])) {
$exidea=str_replace('+', ' ', urldecode($_POST['inurl']));
}
if (file_exists('./bicollection.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection.txt') . csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
} else {
file_put_contents('./bicollection.txt', csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $_POST['inwrite'] . "\n");
}
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection_backup.txt', file_get_contents('./bicollection.txt'));
}
echo "<html><body></body></html>";
exit;
}

if (isset($_GET['outread']) && isset($_GET['cleanup'])) {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
exit;
} else if (isset($_POST['outread']) || isset($_GET['outread'])) {
$exidea=explode('#', explode('?', $_SERVER['REQUEST_URI'])[0])[0];
if (isset($_POST['outread'])) {
if (strlen($_POST['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_POST['outread']));
}
} else if (isset($_GET['outread'])) {
if (strlen($_GET['outread']) > 1) {
$exidea=str_replace('+', ' ', urldecode($_GET['outread']));
}
}
$secidea='';
if (file_exists('./bicollection.txt')) {
$filebicont=file_get_contents('./bicollection.txt');
$origf=$filebicont;
if (strpos($filebicont, csv_server_remote_addr() . ' --- ' . $exidea . ' ... ') !== false) {
$relbi=explode("\n", explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont)[-1 + sizeof(explode(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ', $filebicont))])[0];
$filebicont=str_replace(csv_server_remote_addr() . ' --- ' . $exidea . ' ... ' . $relbi . "\n","",$filebicont);
if ($origf != $filebicont) {
file_put_contents('./bicollection_backup.txt', $filebicont);
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 10000); ";
} else if (file_exists('./bicollection_backup.txt')) {
$secidea=" setTimeout(function(){ location.href=\"/PHP/csv.php?outread=y&cleanup=y\"; }, 9999); ";
}
if (strpos(('~' . $relbi), '~data') !== false) {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), false);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' parent.document.body.style.backgroundSize=\"cover\"; " . $secidea . " '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' parent.document.body.style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(" . $ify . ")\"; parent.document.body.style.backgroundSize=\"cover\"; " . $secidea . " '></body></html>";
}
} else {
$ify=ifspacy(str_replace(' ','+',urldecode($relbi)), true);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $secidea . " '><p> done </p></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $secidea . " ><p> parent.document.body.style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL('" . $ify . "')\"; </p></body></html>";
}
}
} else {
if (isset($_GET['outread'])) {
$ify=ifspacy(str_replace('+',' ',urldecode($relbi)), false);
if ($ify == '') {
echo "<html>" . $hdrstuff . "<body onload=' " . $secidea . " parent.document.body.style.backgroundSize=\"cover\"; '></body></html>";
} else {
echo "<html>" . $hdrstuff . "<body onload=' " . $secidea . " parent.document.body.style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL(" . $ify . ")\"; parent.document.body.style.backgroundSize=\"cover\"; '></body></html>";
}
} else {
echo "<html>" . $hdrstuff . "<body><p> parent.document.body.style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.5),rgba(255,255,255,0.5)),URL('" . str_replace('+',' ',urldecode($relbi)) . "')\"; </p></body></html>";
}
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
} else {
if (file_exists('./bicollection_backup.txt')) {
sleep(3);
if (file_exists('./bicollection_backup.txt')) {
file_put_contents('./bicollection.txt', file_get_contents('./bicollection_backup.txt'));
unlink('./bicollection_backup.txt');
}
}
echo "<html><body></body></html>";
}
exit;
}

?>

Cute, huh?!


Previous relevant Google Chart Pie Chart Background Image Tutorial is shown below.

Google Chart Pie Chart Background Image Tutorial

Google Chart Pie Chart Background Image Tutorial

We have another potential use for the clipboard, adding onto the recent Google Pie Chart via Clipboard Co-ordinates Tutorial data set usage, today. We allow the user to change the default white background to the Google Chart Pie Chart be tailored to be either …

  • image URL … or …
  • image data URI (most likely entered via the clipboard)

… as a prefixing option when they enter in the Title of their Pie Chart.

In order to achieve this, we were helped enormously by …

  • this very useful link, thanks … the crux of it being to get to put …

    backgroundColor: 'none'

    … into the Pie Chart options … and some previous help we got when we presented …
  • Column Intelligence Primer Tutorial‘s “Did you know?” section reference to incredibly useful link‘s advice on our …

    wish to apply opacity just to background image, but not the corresponding textual data (or other types) that is the primary content of that HTML element

You can see a video of some of the practicalities to usage on an iPad mobile app version in the YouTube video below …

Because data URIs are an option here, too, you will see in the code changes to pie_chart.php the need, now, to cater for the switch of HTML form navigation from …

  • method=GET (the default) … to …
  • method=POST (when the URL becomes too long)

… and that new bit of logic is slated home to the generic external Javascript we have set aside for Google Charts work called gchartgen.js which changed for this work, in this way.

Maybe you can see how to use this feature yourself, and if that is the case you can try this live run link.


Previous relevant Google Pie Chart via Clipboard Co-ordinates Tutorial is shown below.

Google Pie Chart via Clipboard Co-ordinates Tutorial

Google Pie Chart via Clipboard Co-ordinates Tutorial

Yesterday’s Google Map Chart via Clipboard Co-ordinates Tutorial was a good precursor to today’s work interfacing this time to the Google Chart Pie Chart.

With this work, we’ve started refining the clipboard “smarts” by looking for linefeeds … in Javascript thoughts …


String.fromCharCode(10)

… and as the data exits the Javascript prompt window on its way, before navigating back to the PHP itself, we can check for too many fields to the right of the data, and truncate the clipboard data, as necessary. Along the way, we may be able to reject any header records with this same approach. We can check for no numerical fields here. Business specific logic can be applied here too. With a Pie Chart, the original data, or the user, may be tempted to place “%” after the numerical data, and we can take the opportunity to weed these out. Also, with the character data, it may be delimited by a double quote (ie. within “”), and with this knowledge in mind, we may be able to weed out confusing additional commas that could confuse us with the clipboard comma separated value format of the data.

The lesson here, is to “validate early” and it could be good to “validate often” as well. Real data can be strange indeed.


function dlp(thisris) {
if (thisris != null) {
var commacount=thisris.toLowerCase().replace(/\<\/td\>/g,' , ').indexOf(',');
if (thisris.toLowerCase().replace('https:','http:').indexOf('http:') == 0) {
fti=true;
allowed=true;
datac=thisris;
} else if (commacount >= 0) {
var thatris=thisris.replace(/\ \"/g,String.fromCharCode(10) + '"').replace(/\<tr\>/g,'').replace(/\<\/td\>\<td\>/g,',').replace(/\<\/tr\>/g,String.fromCharCode(10)).replace(/\<\/td\>/g,',').replace(/\,\,/g,',').replace(/\,\,/g,',').replace(',' + String.fromCharCode(10),String.fromCharCode(10));
var zisok=true, fldq=thatris.split(',');
var pielines=thatris.split(String.fromCharCode(10));
if ((fldq[0].replace('"','').trim() + ' ').substring(0,1) < '0' || (fldq[0].replace('"','').trim() + ' ').substring(0,1) > '9') {
if ((fldq[eval(-1 + fldq.length)].replace('"','').trim() + ' ').substring(0,1) < '0' || (fldq[eval(-1 + fldq.length)].replace('"','').trim() + ' ').substring(0,1) > '9') {
zisok=false;
}
}
if (!zisok && pielines.length > 1) {
fldq=pielines[1].split(',');
zisok=true;
if ((fldq[0].replace('"','').trim() + ' ').substring(0,1) < '0' || (fldq[0].replace('"','').trim() + ' ').substring(0,1) > '9') {
if ((fldq[eval(-1 + fldq.length)].replace('"','').trim() + ' ').substring(0,1) < '0' || (fldq[eval(-1 + fldq.length)].replace('"','').trim() + ' ').substring(0,1) > '9') {
zisok=false;
}
}
}
if (zisok) {
while (thatris.indexOf(String.fromCharCode(10)) != -1) {
var inpies, pied='';
thatris='';
var sthatris='';
for (var ipie=0; ipie<pielines.length; ipie++) {
inpies=pielines[ipie].split(',');
if (inpies.length > 1) {
if ((inpies[0].trim() + " ").substring(0,1) == '"' && (inpies[1].trim() + " ").substring(0,1) == '"') {
sthatris=pied + inpies[0].trim().substring(1).split('"')[0].trim().replace('%','').replace(',','').replace(',','') + ',' + inpies[1].trim().substring(1).split('"')[0].trim().replace('%','').replace(',','').replace(',','');
} else if ((inpies[0].trim() + " ").substring(0,1) == '"') {
sthatris=pied + inpies[0].trim().substring(1).split('"')[0].trim().replace('%','').replace(',','').replace(',','') + ',' + inpies[1].trim().replace('%','').replace('"','');
} else if ((inpies[1].trim() + " ").substring(0,1) == '"') {
sthatris=pied + inpies[0].trim().replace('%','') + ',' + inpies[1].trim().substring(1).split('"')[0].trim().replace('%','').replace(',','').replace(',','');
} else {
sthatris=pied + inpies[0].trim().replace('%','') + ',' + inpies[1].trim().replace('%','').replace('"','');
}
inpies=sthatris.replace(pied,'').split(',');
if (((inpies[0].trim() + " ").substring(0,1) >= '0' && (inpies[0].trim() + " ").substring(0,1) <= '9') || ((inpies[1].trim() + " ").substring(0,1) >= '0' && (inpies[1].trim() + " ").substring(0,1) <= '9')) {
thatris+=sthatris;
pied=',';
}
}
}
}
thatris=thatris.replace(/\,\,/g,',');
fti=true;
allowed=true;
datac='http;' + thatris;
thisris='http;' + thatris;
}
}
}
return thisris;
}

Our PHP Google Chart Pie Chart interface is pie_chart.php changed this way for today’s work, that you can try yourself at this live run link.

Our PHP helper csv.php changed this way for today’s work.

If you want to recreate the conditions as shown in today’s tutorial picture

  1. copy the contents below …

  2. and paste into the 4th prompt (window’s text) box of the Google Charts Pie Chart interfacing live run link
  3. click OK button … P.S. On first prompt, appending &onclick=y to what you want as a Pie Chart title will work the Pie Chart’s select event logic we harness with this interfacing
  4. … or, if you are feeling lazy …
    https://www.rjmprogramming.com.au/PHP/PieChart/pie_chart.php?title=Country%20Populations&onclick=y&task=Country&desc=Populations&data=,%20[~https;China,1347000000,India,1241000000,United%20States,312000000,Indonesia,238000000,Brazil,197000000,Pakistan,177000000,Nigeria,162000000,Bangladesh,151000000,Russia,143000000,Japan,128000000,Mexico,115000000,Philippines,96000000,Vietnam,88000000,Ethiopia,87000000,Germany,81800000,Egypt,82600000,Iran,78000000,Turkey,74000000,Thailand,69500000,Congo,67800000,France,63300000,United%20Kingdom,62700000,Italy,60800000~,100]

Previous relevant Google Map Chart via Clipboard Co-ordinates Tutorial is shown below.

Google Map Chart via Clipboard Co-ordinates Tutorial

Google Map Chart via Clipboard Co-ordinates Tutorial

Yesterday’s Google Map Chart via URL Co-ordinates Tutorial added functionality directed towards a …

  • secondary data source, that you access … but today we are going to extend that functionality to support a …
  • primary data source that you enter a comma separated values list for the [place,lat,long] data sets (yourself, via the computer keyboard) … as well as a …
  • “subset” of a secondary data source, that you access, more than likely, using you computer device’s clipboard

The invention of the clipboard was a brilliant step. Before it, we were so beholden to programmers to get tailored work done, and though it’s sad that so many of you get on without us (cough, cough) … well … we were being overworked anyway … and there was that project to “make the morning breakfast coffee before you even know you wanted it” to get onto … finally.

Perhaps we all forget now what the clipboard has meant, for so many of us. It is the freedom of “copy and paste”, the individualism tool of content creation.

Yesterday’s functionality idea is a case in point. “Secondary data sources” are, by definition, out of your control, as to what the content of a web page is. Notice how, yesterday, we made some content that was (s)ftp transferred over to the rjmprogramming.com.au domain via … yes, you guessed it …

  1. me copying (off the mapbox.com website, thanks, as part of the contents of a webpage) … then …
  2. pasting that content into a csv text file on the MacBook Pro computer we’re using (locally) … and then …
  3. (s)ftp transferred over to rjmprogramming.com.au domain to represent a …
  4. URL usable within the functionality of our Google Chart Map Chart interface we host here as the PHP map.php‘s live run link

But there you are, an intelligent human, able to determine for yourself the data you are interested in (quite often not the entire contents of a webpage, as yesterday’s work is ideally asking for), so that being the case, the map.php modifications to PHP code we’ve made today, make it possible for (the much simpler) …

  1. me copying (off the mapbox.com website, thanks, as part of the contents of a webpage) … then …
  2. pasting that content within the functionality of our Google Chart Map Chart interface we host here as the PHP map.php‘s live run link

If you have the clipboard as your friend, your time around computers becomes so much more enjoyable, and flexible, and within your control. We, as programmers, need to think, on occasions, or encourage, on occasions, how the user is likely to use the clipboard, in conjunction with our applications. As you might surmise, that can be a pretty unpredictable “artform”.

Our PHP helper csv.php changed this way for today’s work.


Previous relevant Google Map Chart via URL Co-ordinates Tutorial is shown below.

Google Map Chart via URL Co-ordinates Tutorial

Google Map Chart via URL Co-ordinates Tutorial

The last blog posting referring to the Google Chart Map Chart interface we host here was with Emoji Name Search Map Chart Weather Tutorial, but today we are presenting a major functionality addition with implications for other Google Chart interfacing PHP codesets here. We are allowing the user at the second prompt to take the data from a URL data source containing CSV (comma separated values) place,latitude,longitude data or those three fields in an HTML table element contents perhaps.

We’ve added the ability to “map” (tee hee) …


HTTP://www.rjmprogramming.com.au/PHP/Map/map.php?title=Where%20We%20Are&onclick=y&label=['Lat',&value='Lon',%20'Name']&data=,%20[-33.90743410270099,151.17646964910696,~Parent1~]%20,%20[-33.907440603083124,151.1764659419197,~Parent2~]

… from a CSV data URL look with contents …


-33.907434102700991,151.17646964910696,Parent1
-33.907440603083124,151.17646594191973,Parent2

… that if placed at rjmprogramming.com.au’s Document Root and called parent.csv then a URL of …


HTTP://www.rjmprogramming.com.au/PHP/Map/map.php?title=Where%20We%20Are&onclick=y&label=['Lat',&value='Lon',%20'Name']&data=,%20[0.00000001,0.0000000,~HTTP://rjmprogramming.com.au/parent.csv~]

… could be a shortcut to that first URL same look. You can see another example using data from mapbox.com, thanks, show the scenario our tutorial picture illustrates.

The way this “mapping” (tee hee, tee hee) of URLs can happen is that the PHP supervisor map.php (changed this way and which you can try with this live run link) “includes” (ie. calls) …


include "../csv.php";

… a (now bigger, and more functional) csv.php (changed this way) does its best to handle a few looks to the CSV or tabular data, with code to allow for …

  • CSV data ordered place,latitude(decimal),longitude(decimal) or latitude(decimal),longitude(decimal),place or place,longitude(decimal),latitude(decimal) or longitude(decimal),latitude(decimal),place
  • CSV data ordered place,latitude(W/S/E/N_deg_min_secs),longitude(W/S/E/N_deg_min_secs) or latitude(W/S/E/N_deg_min_secs),longitude(W/S/E/N_deg_min_secs),place or place,longitude(W/S/E/N_deg_min_secs),latitude(W/S/E/N_deg_min_secs) or longitude(W/S/E/N_deg_min_secs),latitude(W/S/E/N_deg_min_secs),place
  • HTML tabular data ordered place,latitude(decimal),longitude(decimal) or latitude(decimal),longitude(decimal),place or place,longitude(decimal),latitude(decimal) or longitude(decimal),latitude(decimal),place
  • HTML tabular data ordered place,latitude(W/S/E/N_deg_min_secs),longitude(W/S/E/N_deg_min_secs) or latitude(W/S/E/N_deg_min_secs),longitude(W/S/E/N_deg_min_secs),place or place,longitude(W/S/E/N_deg_min_secs),latitude(W/S/E/N_deg_min_secs) or longitude(W/S/E/N_deg_min_secs),latitude(W/S/E/N_deg_min_secs),place

Previous relevant Emoji Name Search Map Chart Weather Tutorial is shown below.

Emoji Name Search Map Chart Weather Tutorial

Emoji Name Search Map Chart Weather Tutorial

If you’ve been studying the code of our hierarchy for our Emoji Flags of the World web application …

… am sure you’ll have noticed how bottom heavy it is on the “child” as far as functionality goes. What we like to call “the hard working duck syndrome”. Partly, that is because we see the Google Charts Map Chart interface we have as being a very useful “meeting point” with interfacing web applications tending towards the “where” of life.

Today’s job, extending yesterday’s Emoji Name Search Map Chart Tutorial is to add Map Chart interfacing to the great Weather Underground and its great API service for autocomplete name searches for weather (and hurricane) information … thanks.

The changes are again just to that “hard working duck” Map Chart interface “child” web application, as for yesterday’s work. We were very keen to do this, especially because …

  • Weather Underground database works most succinctly with Placename, Country identification pairs, better than for the …
  • Continent/Placename setup of (PHP) Timezones

… and so, while we are going to so much trouble scouring Timezone places for their associated Countries, it is a really good opportunity to slot in some Weather API interfacing to our Emoji World Flags web application, which is starting to be looking better and better as a trip planning aid.


Previous relevant Emoji Name Search Map Chart Tutorial is shown below.

Emoji Name Search Map Chart Tutorial

Emoji Name Search Map Chart Tutorial

We now have a three tier functionality hierarchy for our Emoji Flags of the World web application …

… all made so very possible when web applications sit in the same domain and you utilize the HTML iframe element.

We wanted to enhance its integration by …

  • adding in “locality pins” for all PHP Timezone places in the country of interest
  • involving Emoji flags in the Map Chart title (rather than as a pin) because Emojis, after all, are like textual data, not HTML (but can use HTML Entity representations in both)

To work the latter of these we called on recent experience with the “Fifth Beatle” discussion in Emoji Name Search Primer Tutorial

We got quite excited recently with Rainbow Games PHP Emoji Tutorial when we added a (fourth Beatle) emoji helper, called Emoji Terra, into the mix of tools to gather emoji information. Today, we’ve got a new Emoji Search web application that introduces a new (fifth Beatle(?)) emoji helper tool to add into the “how we see it” mix …

We found that Emoji Terra could be used in our map Chart interfacing PHP to look up the HTML Decimal Entity for a flag of a country via the URL pattern …


HTTP://www.emojiterra.com/flag-for-[CountryNameSpacesMakeMinusSignsLowerCase]

So even though Google Chart Map Charts do not allow HTML in their titles there is nothing stopping you putting in an HTML Entity Emoji coding.

As far as the former goes, we again called on the PHP DateTimeZone class to scrutinize the first Timezone in the Map Chart title, derive its ISO 2 letter Country Code, and look through the array list of (PHP) Timezones to garner latitude and longitude, time now, and GMT offset information necessary to improve the “where” and “when” aspects of our Google Chart Map Chart interfacing.


Previous relevant Emoji Name Search Timezone Tutorial is shown below.

Emoji Name Search Timezone Tutorial

Emoji Name Search Timezone Tutorial

Yesterday’s Emoji Name Search Map Tutorial was a step in the direction of “where” functionality, but because PHP teams up with the supervisory HTML “Emoji World Flags” web application, to make all this happen, there is the opportunity to add interest by adding a “when” aspect to how it works.

As we’ve said many times now, should you have access to PHP, you also have access to its DateTimeZone class where Timezones can be linked to ISO 2 letter Country Codes, useful as an integration point as of recent times when we introduced ISO 2 letter Country Codes to today’s (supervisory) live run‘s world_flags.html HTML and Javascript code.

But it is not HTML code that changes today. It is its PHP partner emoticon_keyboard_shortcuts.php changed in this way, that arranges that its call of Google Charts Map Chart passes across a new URL …


&ccode=[ISO 2 letter Country Code]

… argument that uses a new PHP function as below (arrays shortened for practicality purposes) …


<?php
function inctycodecheck($incd, $sofar) {
$nearname=["Africa/Abidjan","Africa/Accra", ... ]; // array of Timezone names
$retv="";
$retd="";
$otz = new DateTimeZone("UTC");
$jj=0;
$origin_dt = new DateTime("now", $otz);
for ($best1=0; $best1<sizeof($nearname); $best1++) {
try {
$tz = new DateTimeZone($nearname[$best1]);
$cloc = $tz->getLocation();
$ctrycode = $cloc['country_code'];
if (strtoupper($incd) == strtoupper($ctrycode)) {
$remote_dt = new DateTime("now", $tz);
$offset = ($tz->getOffset($remote_dt) - $otz->getOffset($origin_dt)) / 3600;
$newp=$retd . $nearname[$best1] . "/" . $remote_dt->format('Y-m-d_H:i:s') . " (GMT" . $offset . ")";
$huhs=explode(" (GMT" . $offset . ")", $retv);
if (sizeof($huhs) == 2) {
if (explode("/", $newp)[0] != explode("/", explode(",", $huhs[0])[-1 + sizeof(explode(",", $huhs[0]))])[0]) {
$huhs=explode("youwillneverfindthis", $retv);
}
}
if (($sofar + strlen(urlencode(($retv . $newp)))) < 950 && $jj < 10 && sizeof($huhs) == 1) {
$retv.=$newp;
$retd=",";
$jj++;
}
}
} catch (Exception $exc) { }
}
return $retv;
}
?>

… called later in the code with the new block of code as per …


<?php
$urlis=urldecode($_GET['gmc']); // URL to point at template Google Chart Map Chart call for Country of interest
if (strpos($urlis, ',,') !== false) {
$urlis=str_replace(",,", urlencode($latis . "," . $longis . ","), $urlis);
} else {
$urlis=str_replace(urlencode(",,"), urlencode($latis . "," . $longis . ","), $urlis);
}
if (isset($_GET['ccode'])) {
$urlis=str_replace("&onclick=", "%20" . urlencode(inctycodecheck(urldecode($_GET['ccode']), (strlen($urlis) + 3))) . "&onclick=", $urlis); // appends to the title argument
}

if (isset($_SERVER['HTTPS'])) {
if ($_SERVER['HTTPS'] == "on") {
header("Location: https:" . $urlis);
} else {
header("Location: http:" . $urlis);
}
} else {
header("Location: http:" . $urlis);
}
exit;
?>


Previous relevant Emoji Name Search Map Tutorial is shown below.

Emoji Name Search Map Tutorial

Emoji Name Search Map Tutorial

Yesterday’s posted data Emoji Name Search Posting Tutorial functionality opened the door to “where” web application (software) integration, because the wonderful Wikipedia has compiled Latitude,Longitude co-ordinate pairs for those countries, and that is our foot in the door to place an HTML a link under the Emoji flags, that points to our favourite “where” interfacing tool, the Google Charts Map Chart.

Because the Map Chart and Emoji Flag web application share the same domain we can keep this functionality on this same Emoji Flag webpage in an …

  • HTML iframe element name=gcmi id=gcmi initially invisible … “populated by” …
  • HTML a element target=gcmi href=[URL to Map Chart for Country of Interest] onclick=aoc();

    function aoc() {
    document.getElementById('gmci').style.width='450px';
    document.getElementById('gmci').style.height='450px';
    document.getElementById('gmci').style.display='inline-block';
    }

Another way to zoom around the world online!

You can try the Emoji Flags live run (with underlying world_flags.html changed this way) or the other Emoji functionalities that have this live run and/or its PHP source code emoticon_keyboard_shortcuts.php changed in this way to extend its software integration capabilities.


Previous relevant Emoji Name Search Posting Tutorial is shown below.

Emoji Name Search Posting Tutorial

Emoji Name Search Posting Tutorial

Yesterday’s Emoji Name Search Tailoring Tutorial was suitable for data sets of that smaller size able to be handled by the web server limit of URL length. But what if there are too many data items in your data set to be handled by PHP’s $_GET[] array URL ? and & delimited URLs? We, having PHP serverside code at our disposal, can turn to $_POST[] (HTML) method=POST form action=[here’sLookingAtYouKid] scenarios, to get around this issue. The unfortunate side effect of this is that the HTML mailto: a link (email client) method of sharing your Emoji web application relies on that $_GET[] approach, that is, unless you wrote a whole “bespoke” web application to help out, like we do today for our new Emoji “World Flags” web application with this live run, with this HTML and Javascript world_flags.html source code.

That new “supervisor” being a guinea pig idea into the $_POST[] thinking, we add some HTML form element input type=text additions to allow for, out of …

  • Emoji look class … and …
  • Wording next to Emoji … and …
  • URL of Wording’s link, be that substituted or appended

mapped values, optionally, off a newly offered HTML form element input type=text for this mapped comma or blank separated word list.

Perhaps, now, you “long data set thinkers” want to try the live run and/or its PHP source code emoticon_keyboard_shortcuts.php changed in this way to extend its data set size capabilities.


Previous relevant Emoji Name Search Tailoring Tutorial is shown below.

Emoji Name Search Tailoring Tutorial

Emoji Name Search Tailoring Tutorial

Information Technology is full of “buzz words”, and am sure you wince at some to all of them yourselves. That’s a bit why am using “Tailoring” rather than …

  • sharing
  • personalization

… to give you a slumberrest from having to look under struck throughdeleted wording to look for hidden “buzz words”terminology that makes your harehair sit upstand watchingon Bugs Bunnyend.

We think, perhaps, that emojis can be important for young “would be” programmers to launch into. Personally wonder how many “would be” programmers give the game up far too soon just because they don’t have those graphics skills, well, with emojis, a lot of that hard work, in miniature, has been done for you by some pretty creative people, so why not enjoy the fruits (chortle, in context, chortle) of their labour and start developing your own web applications to use them. Daily, their use is increasing, as are the sharing of access methods.

In today’s extension to the functionality started with yesterday’s Emoji Name Search Primer Tutorial we separate the Emoji Terra aspects to how it works and allow the user to …

  • supply an Emoji Word List of interest
  • perhaps supply a heading and subheading to describe the “concept” of that list
  • supply either a …
    1. URL prefix … or …
    2. URL with the ~ (tilde) character where you want, substituted, your emoji name

    … to be a navigation destination in that similar new window navigation we used to access Emoji Terra

  • presenting all this in an HTML form action=[here’sLookingAtYouKid] method=GET …
  • that method=GET opening the door to be able to offer an email client engine method to “share”email somebody the link to a screen that looks like the one you’re seeing

Of course, we’d like you to find some of your own such Emoji Display Dynamically Created Web Applications yourself, but to encourage, we, in the web application, today, identified two ideas, namely …

  • Fruit and Vegetables via Wikipedia at https://en.wikipedia.org/wiki/ as a prefix … and …
  • Astrology via Cafe Astrology at https://cafeastrology.com/~dailyhoroscope.html via ~ (tilde) character substitution

… each of which (and any you make will also) feature a link to the HTML mailto: a link out through the email client and to your recipient who can click the email link to “share”compare notes.

Perhaps, now, you want to try the live run and/or its PHP source code emoticon_keyboard_shortcuts.php changed in this way to extend its functionality, involving a reveal favourite of ours, the use of HTML(5)’s details (and summary) element.

You can also see this play out at WordPress 4.1.1’s Emoji Name Search Tailoring Tutorial.


Previous relevant Emoji Name Search Primer Tutorial is shown below.

Emoji Name Search Primer Tutorial

Emoji Name Search Primer Tutorial

We got quite excited recently with Rainbow Games PHP Emoji Tutorial when we added a (fourth Beatle) emoji helper, called Emoji Terra, into the mix of tools to gather emoji information. Today, we’ve got a new Emoji Search web application that introduces a new (fifth Beatle(?)) emoji helper tool to add into the “how we see it” mix below …

  • Emojipedia is good for looking up Emoji names or concepts in words
  • FileFormat Information is great for HTML Entity determinations for your less complex Emojis
  • Iemoji is great for HTML Entity determinations for Emojis of all complexities
  • Emoji Terra performs similar functionality as Iemoji but has a permalink organization more friendly to an “emoji search via emoji title” query, and that has suited our purposes today, and before, so, thanks a lot
  • Emoji CSS performs similar functionality to Emojipedia, but has a pictorial view of Emoji names as well, right from the word go, thanks

With these emoji tools in mind we wrote a new PHP web application combining those last two to show Emojis pictorially (with their short name) initially and allow the user to search for an Emoji (match) list via their HTML input type=text (textbox) entry, which results in …

  • the Emoji (match) list look (as an Emoji “display”) … and …
  • an HTML a link which is that Emoji’s short name … linking to …
  • an Emoji Terra webpage with more detail, including HTML Entity information if “short name” is unique, or one extra click away, if not

Maybe you need to try the live run and/or its PHP source code emoticon_keyboard_shortcuts.php to download, perhaps?


Previous relevant Rainbow Games PHP Emoji Tutorial is shown below.

Rainbow Games PHP Emoji Tutorial

Rainbow Games PHP Emoji Tutorial

In order to take that further genericization step onto the achievements of yesterday’s Rainbow Games Genericization Tutorial to get onto (the mathematics Induction principle inspired) …

  • prove for the first case
  • prove for the second case
  • prove for the nth case

… we had a choice of …

  • continue on (with) the HTML code creation of new “hardcoded” arrays (managed by Javascript eval abstractional approach) … or “bite the bullet” and …
  • try to work out a generic “emoji lookerer upperer” arrangement

Guess you can tell we opted for the latter, huh?! We started the investigation of this by examining our three favourite emoji informational websites, namely …

  1. Emojipedia
  2. FileFormat Information
  3. Iemoji

… and were a bit surprised that we could not quite swing a generic method to glean the information, so don’t know whether our new “player” is “Ringo Starr” or not, but can tell you this, “its beat is much better than its bite” … chortle, chortle

Emoji Terra performs similar functionality as Iemoji but has a permalink organization more friendly to an “emoji search via emoji title” query, and that suits our purposes today, so, thanks a lot. Without this query by “emoji title” possibility we’d have been forced to adopt more of those “hardcoded” arrays, which would have been alright, but this second approach opens the door to “sport” events in “The Rainbow Games” web application using emojis of the future (ie. they haven’t been invented yet).

How to work the interfacing to Emoji Terra?

This new PHP emoji_lookup.php treats the “prove for the nth case” sports as ones to …

  • look up the emoji information for (in the order “PHP Source File as the Database Source” then try file_get_contents of Emoji Terra lookup), and …
  • read the HTML partner source code live run‘s underlying HTML and Javascript and CSS emoji_walk_animation.htm (which changed in this way)
  • amend that HTML source to supplant the “Sprint” default sport for this new nominated sport … trying not to fall over laughing at some of the new sports we present (inspired by a visit to Emoji Terra search)
  • write out that amended HTML code as the web page (the beauty of a serverside language like PHP)

The more detailed specifics of the file_get_contents of Emoji Terra lookup above are …

  • build up a URL starting with HTTP://emojiterra.com/ … then …
  • in emojiland arrangements there are two genders (as our prefixes if you will) … woman- and man-
  • then add on a “middle” sport descriptor (eg. biking)
  • in emojiland emoticonland arrangements there are five descriptors (as our suffixes if you will) … -dark-skin-tone, -medium-dark-skin-tone, -medium-skin-tone, -medium-light-skin-tone, -light-skin-tone
  • for that set of 2x1x5=10 URLs glean what “HTML dec” (HTML Entity) information you can glean via the file_get_contents call of the Emoji Terra URLs described above (eg. Emoji: Woman Biking: Dark Skin Tone) … built into a Javascript array string to “plug into” the previously read HTML partner source code, and amended to output as the web page the user sees

Sports of the future in emojiland? Just ask for the equivalent of biking (above) off the user via a Javascript prompt window (on the proviso you read Conditional Alternative to Javascript Popup Windows in iOS Tutorial first please).


Previous relevant Rainbow Games Genericization Tutorial is shown below.

Rainbow Games Genericization Tutorial

Rainbow Games Genericization Tutorial

What would help genericize the recent Rainbow Games Double Transformation Tutorial “Rainbow Games” web application? How about introducing another sport?

Again, in honour of “onions of the 4th dimension” approaches, we mainly, turn to the power of Javascript’s eval methodology to achieve this abstracted feeling to our web application. Today, with this, we go two thirds of the way along the “Mathematical Induction” approach …

  • prove for the first case
  • prove for the second case
  • prove for the nth case

How does this use of Javascript eval manifest itself in this way?

  • there are two arrays that work with the “content” of our “Rainbow Games” sport(s) (well, at least, the first “sprint running” sport) called emoticons[] and choices[]
  • wherever we find references in the code to either of these two arrays we start to involve the global variable verbsuffix

    var verb='Sprint';
    var verbs=['Sprint','Row'];
    var anotherverb='run';
    var verbsuffix='';

    … in altered ways like …

    function plus(ih,ihep) {
    var outihep=ihep;
    if (eval("emoticons" + verbsuffix + "[" + ih + "]").indexOf('<p>') != -1) {
    outihep += ' (' + eval("emoticons" + verbsuffix + "[" + ih + "]").split('<p>')[1].split('<')[0] + ')';
    }
    return outihep;
    }

    … in that abstracted way … noting that sometimes you don’t need the “eval()” encasings …
  • and so, working through the code this way it just falls to the coder to define new members for all the arrays for all the new sports (ours is “rowing” today), some of those new arrays (like for rowing are emoticonsrowing[] and choicesrowing[]) to involve …
  • looking up emoji definitions from …
    1. Emojipedia
    2. FileFormat Information
    3. Iemoji

    … not forgetting to …

  • make sure the event logics work for multiple sport scenarios … but mostly they do by sticking to the principles above … especially for the …
  • new HTML select (dropdown) element allows the user to pick a sport

Remaining a work in progress, you can try out our live run link that has underlying HTML and Javascript and CSS emoji_walk_animation.htm, and which changed in this way regarding today’s genericization work. We hope it gives you food for thought.


Previous relevant Rainbow Games Double Transformation Tutorial is shown below.

Rainbow Games Double Transformation Tutorial

Rainbow Games Double Transformation Tutorial

We were on the “road to personalization” for the web application game we started with yesterday’s Rainbow Games Primer Tutorial when “an old chestnut” came up again. It’s happened before, the desire to “double transform” in CSS came about from our emoji …

🏃🏾‍♀️

… table cell mirroring styling as per …


<style>
* { overflow-x: visible; }

select { font-size: 36px; }

td.runner { width: 50px; word-wrap: break-word; font-size: 36px;
transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1);
} //

🏃🏾‍♀️

tr { max-height: 40px; }
</style>

… necessary to make our running emojis run from left to right (that, alas, also transformed any accompanying …

🏃🏾‍♀️

Florence

… name), was added to in this double transformational clause to prove what this wonderful web page advice had to say. In other words, a “double transform” CSS styling scenario like the one below …


<style>
* { overflow-x: visible; }

select { font-size: 36px; }

td.runner { width: 50px; word-wrap: break-word; font-size: 36px;
transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1);
}
tr { max-height: 40px; }

p {
display: block;
font-size: 12px;
-webkit-transform: matrix(-1, 0, 0, 1, 0, 0);
-moz-transform: matrix(-1, 0, 0, 1, 0, 0);
-o-transform: matrix(-1, 0, 0, 1, 0, 0);
transform: matrix(-1, 0, 0, 1, 0, 0);
}
//

🏃🏾‍♀️

Florence

</style>

… works as a “double transform” to first …

  • mirror (image) flip the table cell (td) emoji data … but us appending some “Runner Name” textual data underneath also, annoyingly, got flipped until …
  • within that (same) table cell (td) element and after the emoji data we append an HTML p(aragraph) element to both …
    1. introduce a new HTML element type into the (CSS styling) mix … and to …
    2. introduce a new CSS transformation type, the matrix … perhaps either or both new parts to the problem critical to its success when, believe me, lots of other approaches don’t work

… to personalize the “runners” and “users”, optionally, “into the game”, by allowing the “user” to name their “runners” and allow for a “runner energy” setting be a bit randomized, to add for some other interest “variety” to the game’s workings. So, still a work in progress that you can try out at our live run link that has underlying HTML and Javascript and CSS emoji_walk_animation.html, and which changed in this way regarding today’s work.


Previous relevant Rainbow Games Primer Tutorial is shown below.

Interesting Places Primer Tutorial

Rainbow Games Primer Tutorial

It’s been a while since we’ve written any conventional HTML and Javascript and CSS game. Today’s game uses the “emoticon” section of the Emoji character set, defaulting so far, to the “running woman” emoji featuring in Compound Emoji WordPress Usage Tutorial.

It’s the early days of our “Rainbow Games” web application, and we’re starting with the animation featuring horizontal hashtag navigation techniques for a running race start to our game. Where it finishes? Hard to say! Today, we’ve looked at “splits” and a finish line.

You can try out our burgeoning live run game concept link that has underlying HTML and Javascript and CSS emoji_walk_animation.html.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in Ajax, eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment