Walking Trip …

Walking Trip

Walking Trip

Offenbach's Suite ... Warts 'n All

Offenbach's Suite ... Warts 'n All

 📅  

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

Posted in Photography, Trips | Tagged , , | 34 Comments

Upgrade to iOS Diskspace Issue Tutorial

Upgrade to iOS Diskspace Issue Tutorial

Upgrade to iOS Diskspace Issue Tutorial

For those of us Apple iOS users not so keen on iCloud to store data, when it comes to iOS upgrades on your iPhone or iPad, it could be that you run into the issue (like us, twice now, on two different iOS devices), that no matter how many files you cull you cannot come in over the requirement for free disk space that the default iOS Upgrade workflow asks for.

End of story …

So sad

… unless …

If you have access to an Apple MacBook Air or MacBook Pro with some diskspace on it, and you have the necessary Apple white leadages, and you have a good power supply, and you are allowed to wrestle the Apple MacBook Air or MacBook Pro away from it’s gatekeeper/user/lord/lady/mná/fir (and please, if you are a male foreigner at a hurling match needing the loo, do not head for the ablution block labelled “mná” … that being said … if you are a female foreigner at a hurling match needing the loo, do not head for the ablution block labelled “fir”).

We will give you this useful link from Apple for formal guidance here, and/or you could view our experience with today’s tutorial animated GIF “stream of consciousness” iPad iOS Upgrade presentation.

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

Posted in eLearning, Hardware, Installers, iOS, Networking, Operating System, Software, Tutorials | Tagged , , , , , , , , , , , , , , , | Leave a comment

Image Not Found Onerror Event Workaround Tutorial

Image Not Found Onerror Event Workaround Tutorial

Image Not Found Onerror Event Workaround Tutorial

Yesterday’s HTML/Javascript Cockpit of Web Applications Feeling Lucky Tutorial has brought into focus, for us, those days when we were really wary of …

  • Linux web hosting web server’s …
  • inode count … whose limit towards which we used to get a bit too close for comfort (and as distinct from diskspace issues which were less critical but also needed attention)

… was it, a few years back now, when our CentOS web server inode count limit had us rethinking the idea that image slides of an animated presentation of some sort should all sit as individual files on the web server, and as a result we set up a system …

  • for new presentations to more use animated GIFs and/or videos and/or PDF … and for those older multi-image presentations …
  • zip them up during dormant times into a zip file and off the disk, and if called upon, unzip all for a short period of time until the next time they are called upon again

Nowadays, on the current crop of AlmaLinux web servers there are less stringent inode limits to worry about, but, nonetheless, we think the strategy above should still hold. But that means, occasionally, we run up against a tutorial image file not existing on the web server disk at a time of a user calling upon it.

And then we thought on this …

can an onerror event for an img element trap a 404 not found scenario … resulted in …

Yes, an onerror event handler for an element can be used to trap a 404 Not Found scenario [1, 2].
When the browser attempts to fetch the image source (src attribute) and the server responds with a 404 status code (or any other status indicating a failure to fetch or load the resource), the error event is fired on the element [1, 2].

… as the encouragement we needed to launch into today’s idea to …

  1. add an onerror event to all relevant tutorial images on our WordPress Blog via good ol’ TwentyTen theme’s header.php change
    <?php

    if (isset($post->post_content)) { // img contextmenu functionality and img onerror idea
    $post->post_content=str_replace('<i' . 'mg' . ' i' . 'd=', '<i' . 'mg' . ' tabindex=0 oncon' . 'textmenu=imgedit(event); ontou' . 'chend=imgedit(event); i' . 'd=', str_replace('<i' . 'mg' . ' s' . 'rc=', '<i' . 'mg' . ' tabindex=0 oncon' . 'textmenu=imgedit(event); ontou' . 'chend=imgedit(event); s' . 'rc=', str_replace('<i' . 'mg' . ' st' . 'yle="border', '<i' . 'mg' . ' tabindex=0 oncon' . 'textmenu=imgedit(event); ontou' . 'chend=imgedit(event); st' . 'yle="border', str_replace('<i' . 'mg' . ' st' . 'yle="float', '<i' . 'mg' . ' tabindex=0 oncon' . 'textmenu=imgedit(event); ontou' . 'chend=imgedit(event); st' . 'yle="float', str_replace('<i' . 'mg' . ' deco' . 'ding=', '<i' . 'mg' . ' tabindex=0 onconte' . 'xtmenu=imgedit(event); ontou' . 'chend=imgedit(event); deco' . 'ding=', $post->post_content)))));
    $thendel="";
    $checksrcs=explode(' Tutorial" src="', $post->post_content);
    for ($ich=1; $ich<sizeof($checksrcs); $ich++) {
    $urlim=explode('"', $checksrcs[$ich])[0];
    if (strpos($urlim, "//") !== false) {
    $urlim="//" . explode("//", $urlim)[1];
    }
    $urlim=str_replace("//www.rjmprogramming.com.au/", "../", $urlim);
    $smallurlim=$urlim;
    if (strpos($urlim, "/") !== false) {
    $smallurlim=explode("/", $urlim)[-1 + sizeof(explode("/", $urlim))];
    }
    //if (strpos($post->post_content, "Ansible ") !== false) { file_put_contents("013.013", $smallurlim); }
    if (!file_exists($urlim) && file_exists(str_replace($smallurlim, "slideshow_0.zip", $urlim))) {
    //if (strpos($post->post_content, "Ansible ") !== false) { file_put_contents("014.014", "unzip " . str_replace($smallurlim, "slideshow_0.zip", $urlim) . " -d " . str_replace($smallurlim, " " . $smallurlim, $urlim)); }
    exec("unzip " . str_replace($smallurlim, "slideshow_0.zip", $urlim) . " -d " . str_replace($smallurlim, " " . $smallurlim, $urlim));
    if ($thendel == "") {
    $thendel="sleep 5; rm -f " . $urlim . " > /dev/null 2> /dev/null ";
    } else {
    $thendel.="; sleep 10; rm -f " . $urlim . " > /dev/null 2> /dev/null ";
    }
    //if (strpos($post->post_content, "Ansible ") !== false) { file_put_contents("015.015", $thendel); }
    }
    }

    $p_one=' style="border: 1' . '5px solid pink';
    $p_two=' onerror="altunzipit(this,this.id,this.src);" style="border: 1' . '5px solid pink';
    $post->post_content=str_replace($p_one,$p_two,$post->post_content);

    if ($thendel != "") {
    //sleep(5);
    shell_exec("/usr/bin/nohup ksh -c \"" . $thendel . "\" > /dev/null 2> /dev/null &");
    }
    }

    ?>
    … and then later
    <?php echo ”

    var ifixn=0;

    function altunzipit(imgo, imgoid, imgosrc) {
    imgo.src='/hang_on_a_minute.jpg';
    document.getElementById('ifimgfix' + eval(ifixn % 5)).src='/look_to_unzip.php?parid=' + encodeURIComponent(imgoid) + '&parimgsrc=' + encodeURIComponent(imgosrc);
    ifixn++;
    }


    setTimeout(donow,2000);


    </script>

    </div><!-- #masthead -->
    </div><!-- #header -->

    <div id='hfloater'></div>
    <iframe style=display:none; srcdoc='<html><body></body></html>' id='ifimgfix0'></iframe>
    <iframe style=display:none; srcdoc='<html><body></body></html>' id='ifimgfix1'></iframe>
    <iframe style=display:none; srcdoc='<html><body></body></html>' id='ifimgfix2'></iframe>
    <iframe style=display:none; srcdoc='<html><body></body></html>' id='ifimgfix3'></iframe>
    <iframe style=display:none; srcdoc='<html><body></body></html>' id='ifimgfix4'></iframe>


    “; ?>
  2. create an interim “splash image” and upload into place …
  3. create the unzipping look_to_unzip.php PHP helper code that uses Linux command line accessing exec and shell_exec to work it …

    <?php
    // look_to_unzip.php
    // Look to fix WordPress Blog top content image Not Found (error 404) looking to see if slideshow_0.zip exists and can help
    // February, 2026

    $pimgid='';
    $pimgsrc='';
    $pimgunusrc='';
    $andbackagain='';
    $last_access_time=-1;
    if (isset($_GET['parimgsrc']) && isset($_GET['parid'])) {
    $pimgid=str_replace('+',' ',urldecode($_GET['parid']));
    $pimgsrc=str_replace('+',' ',urldecode($_GET['parimgsrc']));
    if (strpos($pimgsrc, 'rjmprogramming.com.au/') === false) {
    $pimgid='';
    $pimgsrc='';
    } else {
    $pimgunusrc=$_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . explode('rjmprogramming.com.au/', explode('#',explode('?',$pimgsrc)[0])[0])[1];
    if ($pimgid == '') {
    try {
    $last_access_time=fileatime($pimgunusrc);
    } catch (Exception $eonee) { }
    }
    if (file_exists($pimgunusrc)) {
    if ($pimgid == '') {
    $windiris=str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, realpath($pimgunusrc) . DIRECTORY_SEPARATOR);
    $winfnmis=basename($pimgunusrc);
    if ($last_access_time < 0) {
    $last_access_time=fileatime($pimgunusrc);
    }
    $seconds_since_access=(time() - $last_access_time);
    if ($seconds_since_access < 85) {
    if (file_exists($windiris . 'slideshow_0.zip')) { // might be in here
    $retv=shell_exec("unzip -l " . $windiris . "slideshow_0.zip " . $winfnmis);
    if (strpos($retv, $winfnmis) !== false) {
    unlink($pimgunusrc); // cache version should be enough to show
    if (!file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'img_not_found_on_wp.log')) {
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'img_not_found_on_wp.log', '');
    }
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'img_not_found_on_wp.log', file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'img_not_found_on_wp.log') . "\n" . $pimgsrc . " rezipped at " . date('l jS \of F Y h:i:s A') . "\n");
    }
    }
    }
    exit;
    } else {
    echo "<html><body onload=\" parent.document.getElementById('" . $pimgid . "').src='" . explode('#',explode('?',$pimgsrc)[0])[0] . "?rand=" . rand(0,564678) . "';\"></body></html>";
    $pimgid='';
    $pimgsrc='';
    }
    } else { // here we have the Not Found img issue
    $windiris=str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, realpath($pimgunusrc) . DIRECTORY_SEPARATOR);
    $winfnmis=basename($pimgunusrc);
    if (file_exists($windiris . 'slideshow_0.zip')) { // might be in here
    exec("unzip " . $windiris . "slideshow_0.zip " . $winfnmis . " -d " . $windiris);
    if (!file_exists($pimgunusrc)) {
    $pimgid='';
    $pimgsrc='';
    } else if ($pimgid != '') {
    if (!file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'img_not_found_on_wp.log')) {
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'img_not_found_on_wp.log', '');
    }
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'img_not_found_on_wp.log', file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'img_not_found_on_wp.log') . "\n" . $pimgsrc . " unzipped at " . date('l jS \of F Y h:i:s A') . "\n");
    $andbackagain=" setTimeout(function(){ location.href=document.URL.split('?')[0].split('#')[0] + '?parid=&parimgsrc=" . $_GET['parimgsrc'] . "'; }, 45000); ";
    }
    } else {
    $pimgid='';
    $pimgsrc='';
    }
    }
    }
    }
    if ($pimgid != '') {
    echo "<html><body onload=\" parent.document.getElementById('" . $pimgid . "').src='" . explode('#',explode('?',$pimgsrc)[0])[0] . "?rand=" . rand(0,564678) . "'; " . $andbackagain . "\"></body></html>";
    }
    ?>

As a result, we hope you see less “broken images”!


Previous relevant HTML/Javascript Cockpit of Web Applications Feeling Lucky Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Feeling Lucky Tutorial

HTML/Javascript Cockpit of Web Applications Feeling Lucky Tutorial

Further to yesterday’s HTML/Javascript Cockpit of Web Applications Dropdown Cells Tutorial

we’ve been restewing on cockpit_feel.html feeling lucky option in the light of yesterday’s cockpit_feel.html whole new cell content idea of blog posting dropdowns in multiple entry mode

… and, yes, a little more curry paste is required?! And doesn’t it hold up well the next day? But we digress …

We’ve come around to …

  1. not only including new “feeling lucky” logic where the web application selects nine random blog posting cell content iframes … but (and this is an advantage regarding a “revisited stewing” in “Paprika Place” perhaps)
  2. we worked out that the PHP web application helper featuring in the recent WordPress Blog Search Title and Posting Date Expressions Tutorial could fairly easily …
    <?php

    $firstnine=false;

    if (isset($_GET['otherpm'])) { // recall scenario
    $firstnine=true;
    $pmval=@file_get_contents("http://www.rjmprogramming.com.au/Welcome.html");
    $bits=explode("id='tuts'", $pmval);
    if (sizeof($bits) > 1) {
    $ssomeof=someof(explode('</select>', $bits[1])[0], str_replace('+',' ',urldecode($_GET['otherpm'])));
    if (1 == 1) {
    echo '<html><body onload="if (window.parent) { if (parent.document.getElementById(' . "'blogp'" . ')) { parent.document.getElementById(' . "'blogp'" . ').value=' . "'" . $ssomeof . "'" . '; } }' . '"><p id=res>' . $ssomeof . '</p></body></html>';
    } else {
    $allselbits="<select" . $onclick . "'if (this.value.trim().length > 0) { if (2 == 2 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { location.href=this.value; } else { document.getElementById(\"myi\").src=this.value; } } else { var huh=prompt(\"Tutorials regarding?\",\"" . urldecode($_GET['pm']) . "\"); if (huh != null) { if (huh != \"\") { if (huh.indexOf(\".\") == 0) { huh=String.fromCharCode(92) + huh; } location.href=\"http://www.rjmprogramming.com.au/itnewblog/match/\" + encodeURIComponent(huh); } } } ' size=1 id='tuts'" . $ssomeof . '</select><br><iframe name="myi" id="myi" style="width:100%;height:1400px;" src="//www.rjmprogramming.com.au/ITblog" title="Robert James Metcalfe Blog"></iframe>';
    echo '<!doctype html><html><head><title>Robert James Metcalfe Blog - Match Blog Title via RegExp</title></head><body>' . $allselbits . '</body></html>';
    }
    }
    exit;
    } else if (isset($_POST['otherpm'])) { // recall scenario
    $firstnine=true;
    $pmval=@file_get_contents("http://www.rjmprogramming.com.au/Welcome.html");
    $bits=explode("id='tuts'", $pmval);
    if (sizeof($bits) > 1) {
    $ssomeof=someof(explode('</select>', $bits[1])[0], str_replace('+',' ',urldecode($_POST['otherpm'])));
    if (1 == 1) {
    echo '<html><body onload="if (window.parent) { if (parent.document.getElementById(' . "'blogp'" . ')) { parent.document.getElementById(' . "'blogp'" . ').value=' . "'" . $ssomeof . "'" . '; } }' . '"><p id=res>' . $ssomeof . '</p></body></html>';
    } else {
    $allselbits="<select" . $onclick . "'if (this.value.trim().length > 0) { if (2 == 2 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { location.href=this.value; } else { document.getElementById(\"myi\").src=this.value; } } else { var huh=prompt(\"Tutorials regarding?\",\"" . urldecode($_POST['pm']) . "\"); if (huh != null) { if (huh != \"\") { if (huh.indexOf(\".\") == 0) { huh=String.fromCharCode(92) + huh; } location.href=\"http://www.rjmprogramming.com.au/itnewblog/match/\" + encodeURIComponent(huh); } } } ' size=1 id='tuts'" . $ssomeof . '</select><br><iframe name="myi" id="myi" style="width:100%;height:1400px;" src="//www.rjmprogramming.com.au/ITblog" title="Robert James Metcalfe Blog"></iframe>';
    echo '<!doctype html><html><head><title>Robert James Metcalfe Blog - Match Blog Title via RegExp</title></head><body>' . $allselbits . '</body></html>';
    }
    }
    exit;
    }

    ?>
    … be repurposed in a changed mapper.php so that the logic of that new “Post RE” WordPress Blog search textbox area checkbox could also help out here by supplying a comma separated list …

    … of WordPress Blog posting IDs it sends back up to our hosting Cockpit of Web Applications web application

… as today’s “value adding” proposition in our Cockpit Feel of web applications changed cockpit_feel.html


var sofarblogp=',';
var today=new Date();
var yyyy = today.getFullYear();
var feeling_lucky=false, doing_preg=false, minrange=20140101, maxrange=eval(eval(1 + yyyy) * 10000 + 101);
var pval=0, ourhuh='';


function setCookie(thisg, tn) { // thanks to JavaScript and Ajax by Tom Negrino and Dori Smith
if (nomore != 'y') {
var expireDate = new Date();
expireDate.setMonth(expireDate.getMonth()+6);
var huh='';
if (urls[eval(-1 + tn)] != "#nomore") {
//alert("urls[" + eval(-1 + tn) + "]=" + urls[eval(-1 + tn)]);
if (prefix != '') {
if (('' + tn) == '1') {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for just using dropdown multiple selections or OK to blank for no more now or to Feeling Lucky or some other posting criteria search string with same rules as Post RE blog checkbox (and which is not a URL)", urls[eval(-1 + tn)]);
if (huh == null || ('' + huh).toLowerCase() == 'feeling lucky' || ( ('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim() != '' && (('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim().indexOf(' ') != -1 || ('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim().indexOf('.') == -1))) {
if (('' + huh).toLowerCase() == 'feeling lucky') {
feeling_lucky=true;
huh=null;
} else if (huh != null) {
doing_preg=true;
ourhuh=huh;
setTimeout(function(){
document.getElementById('ifbppop').src='//www.rjmprogramming.com.au/itnewblog/match/mapper.php?otherpm=' + encodeURIComponent(ourhuh);
}, 2000);
huh=null;
}

cancelps=true;
nomore='y';
document.body.style.cursor='progress';
setInterval(function(){
if (amready) {
document.getElementById('dtbl').style.width='100%';
document.getElementById('dtbl').style.height='75%';
for (var ijh=0; ijh<mapping.length; ijh++) {
document.getElementById('td' + mapping[ijh]).style.width='33%';
document.getElementById('td' + mapping[ijh]).style.height='33%';
if (feeling_lucky) {
pval='';
while ((sofarblogp + ',').indexOf(',' + pval + ',') != -1 || pval == '') {
pval=eval('' + minrange) + Math.floor(Math.random() * eval(maxrange - minrange));
if (mapping[ijh] == '22') { pval=20260204; }
while (document.getElementById('dopt').innerHTML.indexOf('(' + pval + ')') == -1 || (sofarblogp + ',').indexOf(',' + pval + ',') != -1) {
pval=eval('' + minrange) + Math.floor(Math.random() * eval(maxrange - minrange));
}
if (sofarblogp != ',') { sofarblogp+=','; }
sofarblogp+='' + pval;
//alert('2:' + pval + ' ' + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=')[eval(-1 + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=').length)].split('&')[0].split('#')[0]);
pval=document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=')[eval(-1 + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=').length)].split('&')[0].split('#')[0];
}
if (sofarblogp != ',') { sofarblogp+=','; }
sofarblogp+='' + pval;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//setTimeout(function(){
document.getElementById('td' + mapping[ijh]).innerHTML='<iframe id=iftd' + mapping[ijh] + ' onload="if (this.src.indexOf(' + "'About_Us'" + ') != -1) { setTimeout(function(event){ document.getElementById(' + "'iftd' + '" + mapping[ijh] + "'" + ').src=document.getElementById(' + "'iftd' + '" + mapping[ijh] + "'" + ').getAttribute(' + "'data-src'" + '); }, ' + eval(eval(2 + ijh) * 12000) + '); }" data-src="//www.rjmprogramming.com.au/ITblog/?p=' + pval + '&openappin=30#content" src=/About_Us.html style=width:100%;height:100%;></iframe>';
//}, eval(eval('' + mapping[ijh]) * 1000));
} else {
document.getElementById('td' + mapping[ijh]).innerHTML='<iframe src="//www.rjmprogramming.com.au/ITblog/?p=' + pval + '&openappin=30#content" style=width:100%;height:100%;></iframe>';
}
} else {

document.getElementById('td' + mapping[ijh]).innerHTML+=document.getElementById('dopt').innerHTML.replace(' multiple', ' size=9 multiple').replace(' selected=', ' id=selfirstopt selected=');
}
}
if (!doing_preg) { document.body.style.cursor='pointer'; }
if (!feeling_lucky) { setInterval(blogpandtmonitor, 15000); }
amready=false;
}
}, 5000);
}
} else {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for no more now", urls[eval(-1 + tn)]);
}
} else {
if (('' + tn) == '1') {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for just using dropdown multiple selections or OK to blank for no more now or to Feeling Lucky or some other posting criteria search string with same rules as Post RE blog checkbox (and which is not a URL)", urls[eval(-1 + tn)]);
if (huh == null || ('' + huh).toLowerCase() == 'feeling lucky' || ( ('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim() != '' && (('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim().indexOf(' ') != -1 || ('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim().indexOf('.') == -1))) {
if (('' + huh).toLowerCase() == 'feeling lucky') {
feeling_lucky=true;
huh=null;
} else if (huh != null) {
doing_preg=true;
ourhuh=huh;
setTimeout(function(){
document.getElementById('ifbppop').src='//www.rjmprogramming.com.au/itnewblog/match/mapper.php?otherpm=' + encodeURIComponent(ourhuh);
}, 2000);
huh=null;
}

cancelps=true;
nomore='y';
document.body.style.cursor='progress';
setInterval(function(){
if (amready) {
document.getElementById('dtbl').style.width='100%';
document.getElementById('dtbl').style.height='75%';
for (var ijh=0; ijh<mapping.length; ijh++) {
document.getElementById('td' + mapping[ijh]).style.width='33%';
document.getElementById('td' + mapping[ijh]).style.height='33%';
if (feeling_lucky) {
pval='';
while ((sofarblogp + ',').indexOf(',' + pval + ',') != -1 || pval == '') {
pval=eval('' + minrange) + Math.floor(Math.random() * eval(maxrange - minrange));
if (mapping[ijh] == '22') { pval=20260204; }
while (document.getElementById('dopt').innerHTML.indexOf('(' + pval + ')') == -1 || (sofarblogp + ',').indexOf(',' + pval + ',') != -1) {
pval=eval('' + minrange) + Math.floor(Math.random() * eval(maxrange - minrange));
}
if (sofarblogp != ',') { sofarblogp+=','; }
sofarblogp+='' + pval;
//alert('2:' + pval + ' ' + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=')[eval(-1 + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=').length)].split('&')[0].split('#')[0]);
pval=document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=')[eval(-1 + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=').length)].split('&')[0].split('#')[0];
}
if (sofarblogp != ',') { sofarblogp+=','; }
sofarblogp+='' + pval;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//setTimeout(function(){
document.getElementById('td' + mapping[ijh]).innerHTML='<iframe id=iftd' + mapping[ijh] + ' onload="if (this.src.indexOf(' + "'About_Us'" + ') != -1) { setTimeout(function(event){ document.getElementById(' + "'iftd' + '" + mapping[ijh] + "'" + ').src=document.getElementById(' + "'iftd' + '" + mapping[ijh] + "'" + ').getAttribute(' + "'data-src'" + '); }, ' + eval(eval(2 + ijh) * 12000) + '); }" data-src="//www.rjmprogramming.com.au/ITblog/?p=' + pval + '&openappin=30#content" src=/About_Us.html style=width:100%;height:100%;></iframe>';
//}, eval(eval('' + mapping[ijh]) * 1000));
} else {
document.getElementById('td' + mapping[ijh]).innerHTML='<iframe src="//www.rjmprogramming.com.au/ITblog/?p=' + pval + '&openappin=30#content" style=width:100%;height:100%;></iframe>';
}
} else {

document.getElementById('td' + mapping[ijh]).innerHTML+=document.getElementById('dopt').innerHTML.replace(' multiple', ' size=9 multiple').replace(' selected=', ' id=selfirstopt selected=');
}
}
if (!doing_preg) { document.body.style.cursor='pointer'; }
if (!feeling_lucky) { setInterval(blogpandtmonitor, 15000); }
amready=false;
}
}, 5000);
}
} else {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for no more now", urls[eval(-1 + tn)]);
}
}
} else {
//alert("Urls[" + eval(-1 + tn) + "]=" + urls[eval(-1 + tn)]);
huh='#nomore';
}
prefix="";
if (huh == null) {
huh='';
nomore='y';
} else {
if (huh.indexOf("#iframe") != -1) {
goodmodeofshowofurl="iframe";
} else {
goodmodeofshowofurl="";
}
if (huh.indexOf("#form") != -1 && urls[0] != '') {
location.href='./cockpit_feel.html?form=y';
return;
}
document.cookie = thisg + "=" + huh.replace("#form","") + ";expires=" + expireDate.toGMTString();
if (huh.indexOf("#nomore") != -1) {
nomore='y';
fixstuff(tn);
}
if (huh.indexOf("#form") != -1) {
location.href='./cockpit_feel.html?form=y';
}
}
}
}

using the new HTML iframe …


<iframe id=ifbppop src='//www.rjmprogramming.com.au/About_Us.html' style='display:none;'></iframe>


Previous relevant HTML/Javascript Cockpit of Web Applications Dropdown Cells Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Dropdown Cells  Tutorial

HTML/Javascript Cockpit of Web Applications Dropdown Cells Tutorial

We had occasion to revisit the Cockpit of Web Applications web application mentioned in HTML/Javascript Cockpit of Web Applications Home Tutorial the other day, and made the “note to self” …

cockpit_feel.html feeling lucky option

Over a few days we stewed on this, and today, came up with a better idea, we think, that goes …

cockpit_feel.html whole new cell content idea of blog posting dropdowns in multiple entry mode

Not as snappy as the first thought, but doable, and we think the quickest methodology to glean up to 9 URLs of Cut to the Chase web application with relationships to postings of this blog, in that on our Landing Page overnight crontab/curl processing ensures it has an up to date list of Blog Posting data in a dropdown. To be frank, that is a great basis to move on from that, because this is “most of the move” to our eyes!

And so, to get this achieved relied on changes to two code sources, they being …

  1. header.php of the TwentyTen WordPress theme used at this blog, with a new document.body onload event spawned Javascript function …
    <?php echo ”

    function oain() {
    var oind=30000, divsarrr=[], dfnd=false;
    if (document.URL.indexOf('openappin=') != -1) {
    var coind=decodeURIComponent(document.URL.split('openappin=')[1].split('&')[0].split('#')[0]).trim();
    if (coind != '') {
    if (coind.substring(0,1) >= '0' && coind.substring(0,1) <= '9') {
    oind=Math.round(eval(eval('' + coind) * 1000));
    }
    }
    divsarrr=document.getElementsByTagName('div');
    for (var idc=0; idc<divsarrr.length; idc++) {
    if (('' + divsarrr[idc].className) == 'entry-content' && !dfnd) {
    if (divsarrr[idc].innerHTML.indexOf(' href="') != -1 && !dfnd) {
    dfnd=true;
    defappurl=divsarrr[idc].innerHTML.split(' href="')[1].split('"')[0].replace(/^http\:/g,'').replace(/^https\:/g,'').replace(/^\/\//g,document.URL.split(':')[0] + '://');
    document.getElementById('content').setAttribute('data-donetsry', '' + eval(30 + Math.max(700,eval('' + document.getElementById('content').getBoundingClientRect().top))));
    document.getElementById('content').setAttribute('data-donet', '' + document.getElementById('content').title);
    document.getElementById('content').title='Scroll down to stay reading this blog posting else within ' + eval(oind / 1000) + ' seconds from ' + ('' + new Date()) + ' we will navigate to ' + defappurl.replace(/^\/\//g,document.URL.split(':')[0] + '://') + ' ...';
    document.body.style.cursor='progress';
    setInterval(function(){
    if (eval('0' + window.scrollY) > eval('' + document.getElementById('content').getAttribute('data-donetsry'))) {
    document.body.style.cursor='pointer';
    document.getElementById('content').setAttribute('data-donec', 'y');
    document.getElementById('content').title='' + document.getElementById('content').getAttribute('data-donet');
    }
    }, 1000);
    setTimeout(function(){ if (eval('0' + window.scrollY) <= eval('' + document.getElementById('content').getAttribute('data-donetsry'))) { location.href=defappurl.replace(/^http\:/g,'').replace(/^https\:/g,''); } }, oind);
    }
    }
    }
    }
    }

    “; ?>
  2. Cockpit Feel of web applications changed cockpit_feel.html

    function checkw(iois) {
    if (iois != null) {
    var aconto = (iois.contentWindow || iois.contentDocument);
    if (aconto != null) {
    if (aconto.document) { aconto = aconto.document; }
    if (aconto.getElementById('tuts') != null) {
    document.getElementById('dopt').innerHTML='Blog Posting(s): ' + aconto.getElementById('tuts').outerHTML.replace(' onchange=', ' multiple onchange="document.getElementById(' + "'" + 'blogp' + "'" + ').value=andlater(this); " data-onchange=').replace(/\(show\ blog\,\ toggle\ sort\ order\)/g,'').replace(/\(show\ blog\,\ toggle\ sort\ order\,\ click\ for\ keyboard\ autocompletion\)/g,'').replace(/\(show\ blog\,\ toggle\ sort\ order\,\ click\ for\ autocompletion\ keyboard\)/g,'').replace(/\(toggle\ sort\ order\)/g,'') + '<br><br>';
    amready=true;
    }
    }
    }
    }

    function blogpandtmonitor() {
    var bpt=[], ib=0, jb=0;
    if (lastblogp != document.getElementById('blogp').value && document.getElementById('blogp').value != '') {
    lastblogp=document.getElementById('blogp').value;
    bpt=document.getElementById('blogp').value.split(',');
    document.getElementById('blogp').value='';
    for (ib=0; ib<bpt.length; ib++) {
    if (sofarblogp.indexOf(',' + bpt[ib] + ',') == -1) {
    for (jb=0; jb<mapping.length; jb++) {
    if (document.getElementById('td' + mapping[jb]).innerHTML.indexOf('<select ') != -1 && sofarblogp.indexOf(',' + bpt[ib] + ',') == -1) {
    sofarblogp+=bpt[ib] + ',';
    document.getElementById('td' + mapping[jb]).innerHTML='<iframe src="//www.rjmprogramming.com.au/ITblog/?p=' + bpt[ib] + '&openappin=30#content" style=width:100%;height:100%;></iframe>';
    }
    }
    }
    }
    }
    }

    … Javascript set into play via new HTML iframe as per …

    <iframe src='//www.rjmprogramming.com.au/Welcome.html' onload='checkw(this);' style='display:none;'></iframe>

… the user can make happen by a first prompt answer of Cancel …


if (('' + tn) == '1') {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for just using dropdown multiple selections or OK to blank for no more now", urls[eval(-1 + tn)]);
if (huh == null) {
cancelps=true;
nomore='y';
document.body.style.cursor='progress';
setInterval(function(){
if (amready) {
document.getElementById('dtbl').style.width='100%';
document.getElementById('dtbl').style.height='75%';
for (var ijh=0; ijh<mapping.length; ijh++) {
document.getElementById('td' + mapping[ijh]).style.width='33%';
document.getElementById('td' + mapping[ijh]).style.height='33%';
document.getElementById('td' + mapping[ijh]).innerHTML+=document.getElementById('dopt').innerHTML.replace(' multiple', ' size=9 multiple').replace(' selected=', ' id=selfirstopt selected=');
}
document.body.style.cursor='pointer';
setInterval(blogpandtmonitor, 15000);
amready=false;
}
}, 5000);
}
} else {

huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for no more now", urls[eval(-1 + tn)]);
}
}
// rest of "as it used to be code here" follows

… separated off from an OK answer of blank (or some other non-blank answer) still accessing the old workflow methodologies. A cute feature (well, you had to be there) of this might be, for some users, that scrolling in Y at the blog posting cell within 30 seconds means a user can stay reading the blog posting instead (of navigating to the relevant Cut to the Chase web application), regarding the relevant one of 3×3 table cells.


Previous relevant HTML/Javascript Cockpit of Web Applications Home Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Home Tutorial

HTML/Javascript Cockpit of Web Applications Home Tutorial

Yesterday ticked all the boxes with our Cockpit Feel web application to suggest that it is now an excellent candidate to be the designated Home Page for a web browser, as it could be the tailorable “web application central” as you enter the web browser for the first time. The Home Page of a web browser can have that important reminder functionality for how you communicate, or do your work and/or collaborate, or perform tasks, or monitor goings-on.

Yesterday’s work meant that you can send a …

  • web browser address bar URL with an established list of web applications you want to open … and/or …
  • cut down web browser address URL ( ie. just http://www.rjmprogramming.com.au/HTMLCSS/cockpit_feel.html ) … and let the cookies you have previously set, or not, determine what happens … thing about this is that Safari could have a different set of web applications to Internet Explorer to Firefox to Opera to Google Chrome etcetera etcetera etcetera

The thing is, we often put our favourite Search Engine URL as our web browser’s Home Page, and am not suggesting otherwise, except that these days there are so many shortcut or menu methods of getting to your favourite Search Engine that maybe what is better to put as your web browser Home Page is something more tailored to your actual use, and in any case, one of those web applications could be that favourite Search Engine, anyway.

Today’s tutorial picture URL, for example, is http://www.rjmprogramming.com.au/HTMLCSS/cockpit_feel.html?url1=http%3A%2F%2Fwww.rjmprogramming.com.au%2FPHP%2FSunAngle%2Fsun_angle_now_at.php%3Fdone%3Dy%26nowo%3Dy%26latd%3D-33%26latm%3D52%26lats%3D0%26longd%3D151%26longm%3D12%26longs%3D0%26from%3Dfrom%26country%3DAUSTRALIA%26place%3DSydney%23iframe&url2=http%3A%2F%2Fwww.rjmprogramming.com.au%2FPHP%2FMoonAngle%2Fmoon_angle_now_at.php%3Fdone%3Dy%26nowo%3Dy%26latd%3D-33%26latm%3D52%26lats%3D0%26longd%3D151%26longm%3D12%26longs%3D0%26from%3Dfrom%26country%3DAUSTRALIA%26place%3DSydney%23nomore%23iframe&url3=&url4=&url5=&url6=&url7=&url8=&url9= … representing a look at Sun Angle and Moon Angle for Sydney, Australia … and you can see that if you pick a web application from this www.rjmprogramming.com.au domain, you can use the suffix #iframe to say that the web application should “live” in an HTML iframe element.


Previous relevant HTML/Javascript Cockpit of Web Applications Form Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Form Tutorial

HTML/Javascript Cockpit of Web Applications Form Tutorial

Today’s Cockpit Feel web application adds functionality along with yesterday’s pre-existing …

  • Javascript DOM document.write() method nesting …
  • Javascript prompt() window method

… way that asks for input from the user in that old interactive desktop command line application feeling kind of way, an …

… method, the more usual web application way of asking for user input.

Most websites present interactive input in an HTML form for a few reasons (we can think of) …

  • everything that will be asked can be there on the webpage (so that you know what is coming)
  • HTML form elements can direct the web traffic from one web page to the next via HTML input type=’submit’ buttons teamed with HTML form action=[Url] arrangements
  • validation of this user entered data can be validated at the one place (via the HTML form onsubmit event we’ve talked about before), and the HTML5 input element type has several self-validating types (like type=’url’ that we make use of today)
  • huge amounts of user entered data can make use of the HTML form method=’POST’ as necessary, though today we use method=’GET’ for the amounts of data we have and in order to remain with client side programming (method=’POST’ needs server side programming intervention)
  • uploading of files is possible via HTML form element

The concept today remains simple …

  1. take the same 3×3 grid (to the beach this time, because yesterday they enjoyed the zoo so much (they’d like you to know))
  2. check for cookie data and $_GET[] parameters for any/all of the 3×3 and if found get (up to 9) URLs from this data, else document.write(prompt()) for the information interactively, storing good ideas in cookies for either of the two modes of display … that being …

… so that the next time the user runs the same web application, and they have not cleared their cookies out in the meantime, this same configuration of use, personalized to them and the web browser they’re using, will happen.

Again, regarding research and development we’d like to thank “JavaScript & Ajax” seventh edition by Tom Negrino and Dori Smith for the great code regarding cookies.

The HTML and Javascript source code you could call cockpit_feel.html (changed for HTML form functionality in this way) for which you can use this live run link. If you want to simulate the tutorial picture “Cockpit” today try this link. We hope some/all/grid-maintenance information helps today.


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


Previous relevant HTML/Javascript Cockpit of Web Applications Primer Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Primer Tutorial

HTML/Javascript Cockpit of Web Applications Primer Tutorial

Today’s web application continues our interest in …

  • Javascript DOM document.write() method nesting …
  • Javascript prompt() window method

… to give that old interactive desktop command line application feel that many of the “senior citizens” (should we diplomatically say) of the web world, may still secretly gravitate towards?!

Okay … who are the closet interactive desktop command line application lovers out there? … Come on … you know who you are?!

But we digress … so today, we have a web application a bit like a dashboard, a bit like a cockpit (we’ve called it) … though the looks aren’t as good at this stage. Nevertheless, maybe it has a feel of a widget to it as well, because today we only use HTML, making use of cookies to do away with the need for a serverside language like PHP, which could have done the job as well. But not everybody has PHP? Right …

… left …

Damn! Those pesky psychological tests!

The concept today is very simple …

  1. take a 3×3 grid (to the zoo would be nice)
  2. check for cookie data for any/all of the 3×3 and if found get (up to 9) URLs from this data, else document.write(prompt()) for the information interactively, storing good ideas in cookies for either of the two modes of display … that being …

… so that the next time the user runs the same web application, and they have not cleared their cookies out in the meantime, this same configuration of use, personalized to them and the web browser they’re using, will happen.

Regarding research and development we’d like to thank “JavaScript & Ajax” seventh edition by Tom Negrino and Dori Smith for the invaluable code regarding cookies, and an interesting sideline, which we ended up not perusing, but is active in your *._GETME file today, to show you what is possible comes from this useful website … thanks.

The (purely) HTML and Javascript source code you could call cockpit_feel.html for which you can use this live run link. If this helps then we’re happy.

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 eLearning, Event-Driven Programming, Operating System, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

HTML/Javascript Cockpit of Web Applications Feeling Lucky Tutorial

HTML/Javascript Cockpit of Web Applications Feeling Lucky Tutorial

HTML/Javascript Cockpit of Web Applications Feeling Lucky Tutorial

Further to yesterday’s HTML/Javascript Cockpit of Web Applications Dropdown Cells Tutorial

we’ve been restewing on cockpit_feel.html feeling lucky option in the light of yesterday’s cockpit_feel.html whole new cell content idea of blog posting dropdowns in multiple entry mode

… and, yes, a little more curry paste is required?! And doesn’t it hold up well the next day? But we digress …

We’ve come around to …

  1. not only including new “feeling lucky” logic where the web application selects nine random blog posting cell content iframes … but (and this is an advantage regarding a “revisited stewing” in “Paprika Place” perhaps)
  2. we worked out that the PHP web application helper featuring in the recent WordPress Blog Search Title and Posting Date Expressions Tutorial could fairly easily …
    <?php

    $firstnine=false;

    if (isset($_GET['otherpm'])) { // recall scenario
    $firstnine=true;
    $pmval=@file_get_contents("http://www.rjmprogramming.com.au/Welcome.html");
    $bits=explode("id='tuts'", $pmval);
    if (sizeof($bits) > 1) {
    $ssomeof=someof(explode('</select>', $bits[1])[0], str_replace('+',' ',urldecode($_GET['otherpm'])));
    if (1 == 1) {
    echo '<html><body onload="if (window.parent) { if (parent.document.getElementById(' . "'blogp'" . ')) { parent.document.getElementById(' . "'blogp'" . ').value=' . "'" . $ssomeof . "'" . '; } }' . '"><p id=res>' . $ssomeof . '</p></body></html>';
    } else {
    $allselbits="<select" . $onclick . "'if (this.value.trim().length > 0) { if (2 == 2 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { location.href=this.value; } else { document.getElementById(\"myi\").src=this.value; } } else { var huh=prompt(\"Tutorials regarding?\",\"" . urldecode($_GET['pm']) . "\"); if (huh != null) { if (huh != \"\") { if (huh.indexOf(\".\") == 0) { huh=String.fromCharCode(92) + huh; } location.href=\"http://www.rjmprogramming.com.au/itnewblog/match/\" + encodeURIComponent(huh); } } } ' size=1 id='tuts'" . $ssomeof . '</select><br><iframe name="myi" id="myi" style="width:100%;height:1400px;" src="//www.rjmprogramming.com.au/ITblog" title="Robert James Metcalfe Blog"></iframe>';
    echo '<!doctype html><html><head><title>Robert James Metcalfe Blog - Match Blog Title via RegExp</title></head><body>' . $allselbits . '</body></html>';
    }
    }
    exit;
    } else if (isset($_POST['otherpm'])) { // recall scenario
    $firstnine=true;
    $pmval=@file_get_contents("http://www.rjmprogramming.com.au/Welcome.html");
    $bits=explode("id='tuts'", $pmval);
    if (sizeof($bits) > 1) {
    $ssomeof=someof(explode('</select>', $bits[1])[0], str_replace('+',' ',urldecode($_POST['otherpm'])));
    if (1 == 1) {
    echo '<html><body onload="if (window.parent) { if (parent.document.getElementById(' . "'blogp'" . ')) { parent.document.getElementById(' . "'blogp'" . ').value=' . "'" . $ssomeof . "'" . '; } }' . '"><p id=res>' . $ssomeof . '</p></body></html>';
    } else {
    $allselbits="<select" . $onclick . "'if (this.value.trim().length > 0) { if (2 == 2 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { location.href=this.value; } else { document.getElementById(\"myi\").src=this.value; } } else { var huh=prompt(\"Tutorials regarding?\",\"" . urldecode($_POST['pm']) . "\"); if (huh != null) { if (huh != \"\") { if (huh.indexOf(\".\") == 0) { huh=String.fromCharCode(92) + huh; } location.href=\"http://www.rjmprogramming.com.au/itnewblog/match/\" + encodeURIComponent(huh); } } } ' size=1 id='tuts'" . $ssomeof . '</select><br><iframe name="myi" id="myi" style="width:100%;height:1400px;" src="//www.rjmprogramming.com.au/ITblog" title="Robert James Metcalfe Blog"></iframe>';
    echo '<!doctype html><html><head><title>Robert James Metcalfe Blog - Match Blog Title via RegExp</title></head><body>' . $allselbits . '</body></html>';
    }
    }
    exit;
    }

    ?>
    … be repurposed in a changed mapper.php so that the logic of that new “Post RE” WordPress Blog search textbox area checkbox could also help out here by supplying a comma separated list …

    … of WordPress Blog posting IDs it sends back up to our hosting Cockpit of Web Applications web application

… as today’s “value adding” proposition in our Cockpit Feel of web applications changed cockpit_feel.html


var sofarblogp=',';
var today=new Date();
var yyyy = today.getFullYear();
var feeling_lucky=false, doing_preg=false, minrange=20140101, maxrange=eval(eval(1 + yyyy) * 10000 + 101);
var pval=0, ourhuh='';


function setCookie(thisg, tn) { // thanks to JavaScript and Ajax by Tom Negrino and Dori Smith
if (nomore != 'y') {
var expireDate = new Date();
expireDate.setMonth(expireDate.getMonth()+6);
var huh='';
if (urls[eval(-1 + tn)] != "#nomore") {
//alert("urls[" + eval(-1 + tn) + "]=" + urls[eval(-1 + tn)]);
if (prefix != '') {
if (('' + tn) == '1') {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for just using dropdown multiple selections or OK to blank for no more now or to Feeling Lucky or some other posting criteria search string with same rules as Post RE blog checkbox (and which is not a URL)", urls[eval(-1 + tn)]);
if (huh == null || ('' + huh).toLowerCase() == 'feeling lucky' || ( ('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim() != '' && (('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim().indexOf(' ') != -1 || ('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim().indexOf('.') == -1))) {
if (('' + huh).toLowerCase() == 'feeling lucky') {
feeling_lucky=true;
huh=null;
} else if (huh != null) {
doing_preg=true;
ourhuh=huh;
setTimeout(function(){
document.getElementById('ifbppop').src='//www.rjmprogramming.com.au/itnewblog/match/mapper.php?otherpm=' + encodeURIComponent(ourhuh);
}, 2000);
huh=null;
}

cancelps=true;
nomore='y';
document.body.style.cursor='progress';
setInterval(function(){
if (amready) {
document.getElementById('dtbl').style.width='100%';
document.getElementById('dtbl').style.height='75%';
for (var ijh=0; ijh<mapping.length; ijh++) {
document.getElementById('td' + mapping[ijh]).style.width='33%';
document.getElementById('td' + mapping[ijh]).style.height='33%';
if (feeling_lucky) {
pval='';
while ((sofarblogp + ',').indexOf(',' + pval + ',') != -1 || pval == '') {
pval=eval('' + minrange) + Math.floor(Math.random() * eval(maxrange - minrange));
if (mapping[ijh] == '22') { pval=20260204; }
while (document.getElementById('dopt').innerHTML.indexOf('(' + pval + ')') == -1 || (sofarblogp + ',').indexOf(',' + pval + ',') != -1) {
pval=eval('' + minrange) + Math.floor(Math.random() * eval(maxrange - minrange));
}
if (sofarblogp != ',') { sofarblogp+=','; }
sofarblogp+='' + pval;
//alert('2:' + pval + ' ' + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=')[eval(-1 + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=').length)].split('&')[0].split('#')[0]);
pval=document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=')[eval(-1 + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=').length)].split('&')[0].split('#')[0];
}
if (sofarblogp != ',') { sofarblogp+=','; }
sofarblogp+='' + pval;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//setTimeout(function(){
document.getElementById('td' + mapping[ijh]).innerHTML='<iframe id=iftd' + mapping[ijh] + ' onload="if (this.src.indexOf(' + "'About_Us'" + ') != -1) { setTimeout(function(event){ document.getElementById(' + "'iftd' + '" + mapping[ijh] + "'" + ').src=document.getElementById(' + "'iftd' + '" + mapping[ijh] + "'" + ').getAttribute(' + "'data-src'" + '); }, ' + eval(eval(2 + ijh) * 12000) + '); }" data-src="//www.rjmprogramming.com.au/ITblog/?p=' + pval + '&openappin=30#content" src=/About_Us.html style=width:100%;height:100%;></iframe>';
//}, eval(eval('' + mapping[ijh]) * 1000));
} else {
document.getElementById('td' + mapping[ijh]).innerHTML='<iframe src="//www.rjmprogramming.com.au/ITblog/?p=' + pval + '&openappin=30#content" style=width:100%;height:100%;></iframe>';
}
} else {

document.getElementById('td' + mapping[ijh]).innerHTML+=document.getElementById('dopt').innerHTML.replace(' multiple', ' size=9 multiple').replace(' selected=', ' id=selfirstopt selected=');
}
}
if (!doing_preg) { document.body.style.cursor='pointer'; }
if (!feeling_lucky) { setInterval(blogpandtmonitor, 15000); }
amready=false;
}
}, 5000);
}
} else {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for no more now", urls[eval(-1 + tn)]);
}
} else {
if (('' + tn) == '1') {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for just using dropdown multiple selections or OK to blank for no more now or to Feeling Lucky or some other posting criteria search string with same rules as Post RE blog checkbox (and which is not a URL)", urls[eval(-1 + tn)]);
if (huh == null || ('' + huh).toLowerCase() == 'feeling lucky' || ( ('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim() != '' && (('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim().indexOf(' ') != -1 || ('' + huh).replace(/^null/g,'').replace(/^undefined/g,'').trim().indexOf('.') == -1))) {
if (('' + huh).toLowerCase() == 'feeling lucky') {
feeling_lucky=true;
huh=null;
} else if (huh != null) {
doing_preg=true;
ourhuh=huh;
setTimeout(function(){
document.getElementById('ifbppop').src='//www.rjmprogramming.com.au/itnewblog/match/mapper.php?otherpm=' + encodeURIComponent(ourhuh);
}, 2000);
huh=null;
}

cancelps=true;
nomore='y';
document.body.style.cursor='progress';
setInterval(function(){
if (amready) {
document.getElementById('dtbl').style.width='100%';
document.getElementById('dtbl').style.height='75%';
for (var ijh=0; ijh<mapping.length; ijh++) {
document.getElementById('td' + mapping[ijh]).style.width='33%';
document.getElementById('td' + mapping[ijh]).style.height='33%';
if (feeling_lucky) {
pval='';
while ((sofarblogp + ',').indexOf(',' + pval + ',') != -1 || pval == '') {
pval=eval('' + minrange) + Math.floor(Math.random() * eval(maxrange - minrange));
if (mapping[ijh] == '22') { pval=20260204; }
while (document.getElementById('dopt').innerHTML.indexOf('(' + pval + ')') == -1 || (sofarblogp + ',').indexOf(',' + pval + ',') != -1) {
pval=eval('' + minrange) + Math.floor(Math.random() * eval(maxrange - minrange));
}
if (sofarblogp != ',') { sofarblogp+=','; }
sofarblogp+='' + pval;
//alert('2:' + pval + ' ' + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=')[eval(-1 + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=').length)].split('&')[0].split('#')[0]);
pval=document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=')[eval(-1 + document.getElementById('dopt').innerHTML.split('(' + pval + ')')[0].split('?p=').length)].split('&')[0].split('#')[0];
}
if (sofarblogp != ',') { sofarblogp+=','; }
sofarblogp+='' + pval;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//setTimeout(function(){
document.getElementById('td' + mapping[ijh]).innerHTML='<iframe id=iftd' + mapping[ijh] + ' onload="if (this.src.indexOf(' + "'About_Us'" + ') != -1) { setTimeout(function(event){ document.getElementById(' + "'iftd' + '" + mapping[ijh] + "'" + ').src=document.getElementById(' + "'iftd' + '" + mapping[ijh] + "'" + ').getAttribute(' + "'data-src'" + '); }, ' + eval(eval(2 + ijh) * 12000) + '); }" data-src="//www.rjmprogramming.com.au/ITblog/?p=' + pval + '&openappin=30#content" src=/About_Us.html style=width:100%;height:100%;></iframe>';
//}, eval(eval('' + mapping[ijh]) * 1000));
} else {
document.getElementById('td' + mapping[ijh]).innerHTML='<iframe src="//www.rjmprogramming.com.au/ITblog/?p=' + pval + '&openappin=30#content" style=width:100%;height:100%;></iframe>';
}
} else {

document.getElementById('td' + mapping[ijh]).innerHTML+=document.getElementById('dopt').innerHTML.replace(' multiple', ' size=9 multiple').replace(' selected=', ' id=selfirstopt selected=');
}
}
if (!doing_preg) { document.body.style.cursor='pointer'; }
if (!feeling_lucky) { setInterval(blogpandtmonitor, 15000); }
amready=false;
}
}, 5000);
}
} else {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for no more now", urls[eval(-1 + tn)]);
}
}
} else {
//alert("Urls[" + eval(-1 + tn) + "]=" + urls[eval(-1 + tn)]);
huh='#nomore';
}
prefix="";
if (huh == null) {
huh='';
nomore='y';
} else {
if (huh.indexOf("#iframe") != -1) {
goodmodeofshowofurl="iframe";
} else {
goodmodeofshowofurl="";
}
if (huh.indexOf("#form") != -1 && urls[0] != '') {
location.href='./cockpit_feel.html?form=y';
return;
}
document.cookie = thisg + "=" + huh.replace("#form","") + ";expires=" + expireDate.toGMTString();
if (huh.indexOf("#nomore") != -1) {
nomore='y';
fixstuff(tn);
}
if (huh.indexOf("#form") != -1) {
location.href='./cockpit_feel.html?form=y';
}
}
}
}

using the new HTML iframe …


<iframe id=ifbppop src='//www.rjmprogramming.com.au/About_Us.html' style='display:none;'></iframe>


Previous relevant HTML/Javascript Cockpit of Web Applications Dropdown Cells Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Dropdown Cells  Tutorial

HTML/Javascript Cockpit of Web Applications Dropdown Cells Tutorial

We had occasion to revisit the Cockpit of Web Applications web application mentioned in HTML/Javascript Cockpit of Web Applications Home Tutorial the other day, and made the “note to self” …

cockpit_feel.html feeling lucky option

Over a few days we stewed on this, and today, came up with a better idea, we think, that goes …

cockpit_feel.html whole new cell content idea of blog posting dropdowns in multiple entry mode

Not as snappy as the first thought, but doable, and we think the quickest methodology to glean up to 9 URLs of Cut to the Chase web application with relationships to postings of this blog, in that on our Landing Page overnight crontab/curl processing ensures it has an up to date list of Blog Posting data in a dropdown. To be frank, that is a great basis to move on from that, because this is “most of the move” to our eyes!

And so, to get this achieved relied on changes to two code sources, they being …

  1. header.php of the TwentyTen WordPress theme used at this blog, with a new document.body onload event spawned Javascript function …
    <?php echo ”

    function oain() {
    var oind=30000, divsarrr=[], dfnd=false;
    if (document.URL.indexOf('openappin=') != -1) {
    var coind=decodeURIComponent(document.URL.split('openappin=')[1].split('&')[0].split('#')[0]).trim();
    if (coind != '') {
    if (coind.substring(0,1) >= '0' && coind.substring(0,1) <= '9') {
    oind=Math.round(eval(eval('' + coind) * 1000));
    }
    }
    divsarrr=document.getElementsByTagName('div');
    for (var idc=0; idc<divsarrr.length; idc++) {
    if (('' + divsarrr[idc].className) == 'entry-content' && !dfnd) {
    if (divsarrr[idc].innerHTML.indexOf(' href="') != -1 && !dfnd) {
    dfnd=true;
    defappurl=divsarrr[idc].innerHTML.split(' href="')[1].split('"')[0].replace(/^http\:/g,'').replace(/^https\:/g,'').replace(/^\/\//g,document.URL.split(':')[0] + '://');
    document.getElementById('content').setAttribute('data-donetsry', '' + eval(30 + Math.max(700,eval('' + document.getElementById('content').getBoundingClientRect().top))));
    document.getElementById('content').setAttribute('data-donet', '' + document.getElementById('content').title);
    document.getElementById('content').title='Scroll down to stay reading this blog posting else within ' + eval(oind / 1000) + ' seconds from ' + ('' + new Date()) + ' we will navigate to ' + defappurl.replace(/^\/\//g,document.URL.split(':')[0] + '://') + ' ...';
    document.body.style.cursor='progress';
    setInterval(function(){
    if (eval('0' + window.scrollY) > eval('' + document.getElementById('content').getAttribute('data-donetsry'))) {
    document.body.style.cursor='pointer';
    document.getElementById('content').setAttribute('data-donec', 'y');
    document.getElementById('content').title='' + document.getElementById('content').getAttribute('data-donet');
    }
    }, 1000);
    setTimeout(function(){ if (eval('0' + window.scrollY) <= eval('' + document.getElementById('content').getAttribute('data-donetsry'))) { location.href=defappurl.replace(/^http\:/g,'').replace(/^https\:/g,''); } }, oind);
    }
    }
    }
    }
    }

    “; ?>
  2. Cockpit Feel of web applications changed cockpit_feel.html

    function checkw(iois) {
    if (iois != null) {
    var aconto = (iois.contentWindow || iois.contentDocument);
    if (aconto != null) {
    if (aconto.document) { aconto = aconto.document; }
    if (aconto.getElementById('tuts') != null) {
    document.getElementById('dopt').innerHTML='Blog Posting(s): ' + aconto.getElementById('tuts').outerHTML.replace(' onchange=', ' multiple onchange="document.getElementById(' + "'" + 'blogp' + "'" + ').value=andlater(this); " data-onchange=').replace(/\(show\ blog\,\ toggle\ sort\ order\)/g,'').replace(/\(show\ blog\,\ toggle\ sort\ order\,\ click\ for\ keyboard\ autocompletion\)/g,'').replace(/\(show\ blog\,\ toggle\ sort\ order\,\ click\ for\ autocompletion\ keyboard\)/g,'').replace(/\(toggle\ sort\ order\)/g,'') + '<br><br>';
    amready=true;
    }
    }
    }
    }

    function blogpandtmonitor() {
    var bpt=[], ib=0, jb=0;
    if (lastblogp != document.getElementById('blogp').value && document.getElementById('blogp').value != '') {
    lastblogp=document.getElementById('blogp').value;
    bpt=document.getElementById('blogp').value.split(',');
    document.getElementById('blogp').value='';
    for (ib=0; ib<bpt.length; ib++) {
    if (sofarblogp.indexOf(',' + bpt[ib] + ',') == -1) {
    for (jb=0; jb<mapping.length; jb++) {
    if (document.getElementById('td' + mapping[jb]).innerHTML.indexOf('<select ') != -1 && sofarblogp.indexOf(',' + bpt[ib] + ',') == -1) {
    sofarblogp+=bpt[ib] + ',';
    document.getElementById('td' + mapping[jb]).innerHTML='<iframe src="//www.rjmprogramming.com.au/ITblog/?p=' + bpt[ib] + '&openappin=30#content" style=width:100%;height:100%;></iframe>';
    }
    }
    }
    }
    }
    }

    … Javascript set into play via new HTML iframe as per …

    <iframe src='//www.rjmprogramming.com.au/Welcome.html' onload='checkw(this);' style='display:none;'></iframe>

… the user can make happen by a first prompt answer of Cancel …


if (('' + tn) == '1') {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for just using dropdown multiple selections or OK to blank for no more now", urls[eval(-1 + tn)]);
if (huh == null) {
cancelps=true;
nomore='y';
document.body.style.cursor='progress';
setInterval(function(){
if (amready) {
document.getElementById('dtbl').style.width='100%';
document.getElementById('dtbl').style.height='75%';
for (var ijh=0; ijh<mapping.length; ijh++) {
document.getElementById('td' + mapping[ijh]).style.width='33%';
document.getElementById('td' + mapping[ijh]).style.height='33%';
document.getElementById('td' + mapping[ijh]).innerHTML+=document.getElementById('dopt').innerHTML.replace(' multiple', ' size=9 multiple').replace(' selected=', ' id=selfirstopt selected=');
}
document.body.style.cursor='pointer';
setInterval(blogpandtmonitor, 15000);
amready=false;
}
}, 5000);
}
} else {

huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for no more now", urls[eval(-1 + tn)]);
}
}
// rest of "as it used to be code here" follows

… separated off from an OK answer of blank (or some other non-blank answer) still accessing the old workflow methodologies. A cute feature (well, you had to be there) of this might be, for some users, that scrolling in Y at the blog posting cell within 30 seconds means a user can stay reading the blog posting instead (of navigating to the relevant Cut to the Chase web application), regarding the relevant one of 3×3 table cells.


Previous relevant HTML/Javascript Cockpit of Web Applications Home Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Home Tutorial

HTML/Javascript Cockpit of Web Applications Home Tutorial

Yesterday ticked all the boxes with our Cockpit Feel web application to suggest that it is now an excellent candidate to be the designated Home Page for a web browser, as it could be the tailorable “web application central” as you enter the web browser for the first time. The Home Page of a web browser can have that important reminder functionality for how you communicate, or do your work and/or collaborate, or perform tasks, or monitor goings-on.

Yesterday’s work meant that you can send a …

  • web browser address bar URL with an established list of web applications you want to open … and/or …
  • cut down web browser address URL ( ie. just http://www.rjmprogramming.com.au/HTMLCSS/cockpit_feel.html ) … and let the cookies you have previously set, or not, determine what happens … thing about this is that Safari could have a different set of web applications to Internet Explorer to Firefox to Opera to Google Chrome etcetera etcetera etcetera

The thing is, we often put our favourite Search Engine URL as our web browser’s Home Page, and am not suggesting otherwise, except that these days there are so many shortcut or menu methods of getting to your favourite Search Engine that maybe what is better to put as your web browser Home Page is something more tailored to your actual use, and in any case, one of those web applications could be that favourite Search Engine, anyway.

Today’s tutorial picture URL, for example, is http://www.rjmprogramming.com.au/HTMLCSS/cockpit_feel.html?url1=http%3A%2F%2Fwww.rjmprogramming.com.au%2FPHP%2FSunAngle%2Fsun_angle_now_at.php%3Fdone%3Dy%26nowo%3Dy%26latd%3D-33%26latm%3D52%26lats%3D0%26longd%3D151%26longm%3D12%26longs%3D0%26from%3Dfrom%26country%3DAUSTRALIA%26place%3DSydney%23iframe&url2=http%3A%2F%2Fwww.rjmprogramming.com.au%2FPHP%2FMoonAngle%2Fmoon_angle_now_at.php%3Fdone%3Dy%26nowo%3Dy%26latd%3D-33%26latm%3D52%26lats%3D0%26longd%3D151%26longm%3D12%26longs%3D0%26from%3Dfrom%26country%3DAUSTRALIA%26place%3DSydney%23nomore%23iframe&url3=&url4=&url5=&url6=&url7=&url8=&url9= … representing a look at Sun Angle and Moon Angle for Sydney, Australia … and you can see that if you pick a web application from this www.rjmprogramming.com.au domain, you can use the suffix #iframe to say that the web application should “live” in an HTML iframe element.


Previous relevant HTML/Javascript Cockpit of Web Applications Form Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Form Tutorial

HTML/Javascript Cockpit of Web Applications Form Tutorial

Today’s Cockpit Feel web application adds functionality along with yesterday’s pre-existing …

  • Javascript DOM document.write() method nesting …
  • Javascript prompt() window method

… way that asks for input from the user in that old interactive desktop command line application feeling kind of way, an …

… method, the more usual web application way of asking for user input.

Most websites present interactive input in an HTML form for a few reasons (we can think of) …

  • everything that will be asked can be there on the webpage (so that you know what is coming)
  • HTML form elements can direct the web traffic from one web page to the next via HTML input type=’submit’ buttons teamed with HTML form action=[Url] arrangements
  • validation of this user entered data can be validated at the one place (via the HTML form onsubmit event we’ve talked about before), and the HTML5 input element type has several self-validating types (like type=’url’ that we make use of today)
  • huge amounts of user entered data can make use of the HTML form method=’POST’ as necessary, though today we use method=’GET’ for the amounts of data we have and in order to remain with client side programming (method=’POST’ needs server side programming intervention)
  • uploading of files is possible via HTML form element

The concept today remains simple …

  1. take the same 3×3 grid (to the beach this time, because yesterday they enjoyed the zoo so much (they’d like you to know))
  2. check for cookie data and $_GET[] parameters for any/all of the 3×3 and if found get (up to 9) URLs from this data, else document.write(prompt()) for the information interactively, storing good ideas in cookies for either of the two modes of display … that being …

… so that the next time the user runs the same web application, and they have not cleared their cookies out in the meantime, this same configuration of use, personalized to them and the web browser they’re using, will happen.

Again, regarding research and development we’d like to thank “JavaScript & Ajax” seventh edition by Tom Negrino and Dori Smith for the great code regarding cookies.

The HTML and Javascript source code you could call cockpit_feel.html (changed for HTML form functionality in this way) for which you can use this live run link. If you want to simulate the tutorial picture “Cockpit” today try this link. We hope some/all/grid-maintenance information helps today.


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


Previous relevant HTML/Javascript Cockpit of Web Applications Primer Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Primer Tutorial

HTML/Javascript Cockpit of Web Applications Primer Tutorial

Today’s web application continues our interest in …

  • Javascript DOM document.write() method nesting …
  • Javascript prompt() window method

… to give that old interactive desktop command line application feel that many of the “senior citizens” (should we diplomatically say) of the web world, may still secretly gravitate towards?!

Okay … who are the closet interactive desktop command line application lovers out there? … Come on … you know who you are?!

But we digress … so today, we have a web application a bit like a dashboard, a bit like a cockpit (we’ve called it) … though the looks aren’t as good at this stage. Nevertheless, maybe it has a feel of a widget to it as well, because today we only use HTML, making use of cookies to do away with the need for a serverside language like PHP, which could have done the job as well. But not everybody has PHP? Right …

… left …

Damn! Those pesky psychological tests!

The concept today is very simple …

  1. take a 3×3 grid (to the zoo would be nice)
  2. check for cookie data for any/all of the 3×3 and if found get (up to 9) URLs from this data, else document.write(prompt()) for the information interactively, storing good ideas in cookies for either of the two modes of display … that being …

… so that the next time the user runs the same web application, and they have not cleared their cookies out in the meantime, this same configuration of use, personalized to them and the web browser they’re using, will happen.

Regarding research and development we’d like to thank “JavaScript & Ajax” seventh edition by Tom Negrino and Dori Smith for the invaluable code regarding cookies, and an interesting sideline, which we ended up not perusing, but is active in your *._GETME file today, to show you what is possible comes from this useful website … thanks.

The (purely) HTML and Javascript source code you could call cockpit_feel.html for which you can use this live run link. If this helps then we’re happy.

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 eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

HTML/Javascript Cockpit of Web Applications Dropdown Cells Tutorial

HTML/Javascript Cockpit of Web Applications Dropdown Cells  Tutorial

HTML/Javascript Cockpit of Web Applications Dropdown Cells Tutorial

We had occasion to revisit the Cockpit of Web Applications web application mentioned in HTML/Javascript Cockpit of Web Applications Home Tutorial the other day, and made the “note to self” …

cockpit_feel.html feeling lucky option

Over a few days we stewed on this, and today, came up with a better idea, we think, that goes …

cockpit_feel.html whole new cell content idea of blog posting dropdowns in multiple entry mode

Not as snappy as the first thought, but doable, and we think the quickest methodology to glean up to 9 URLs of Cut to the Chase web application with relationships to postings of this blog, in that on our Landing Page overnight crontab/curl processing ensures it has an up to date list of Blog Posting data in a dropdown. To be frank, that is a great basis to move on from that, because this is “most of the move” to our eyes!

And so, to get this achieved relied on changes to two code sources, they being …

  1. header.php of the TwentyTen WordPress theme used at this blog, with a new document.body onload event spawned Javascript function …
    <?php echo ”

    function oain() {
    var oind=30000, divsarrr=[], dfnd=false;
    if (document.URL.indexOf('openappin=') != -1) {
    var coind=decodeURIComponent(document.URL.split('openappin=')[1].split('&')[0].split('#')[0]).trim();
    if (coind != '') {
    if (coind.substring(0,1) >= '0' && coind.substring(0,1) <= '9') {
    oind=Math.round(eval(eval('' + coind) * 1000));
    }
    }
    divsarrr=document.getElementsByTagName('div');
    for (var idc=0; idc<divsarrr.length; idc++) {
    if (('' + divsarrr[idc].className) == 'entry-content' && !dfnd) {
    if (divsarrr[idc].innerHTML.indexOf(' href="') != -1 && !dfnd) {
    dfnd=true;
    defappurl=divsarrr[idc].innerHTML.split(' href="')[1].split('"')[0].replace(/^http\:/g,'').replace(/^https\:/g,'').replace(/^\/\//g,document.URL.split(':')[0] + '://');
    document.getElementById('content').setAttribute('data-donetsry', '' + eval(30 + Math.max(700,eval('' + document.getElementById('content').getBoundingClientRect().top))));
    document.getElementById('content').setAttribute('data-donet', '' + document.getElementById('content').title);
    document.getElementById('content').title='Scroll down to stay reading this blog posting else within ' + eval(oind / 1000) + ' seconds from ' + ('' + new Date()) + ' we will navigate to ' + defappurl.replace(/^\/\//g,document.URL.split(':')[0] + '://') + ' ...';
    document.body.style.cursor='progress';
    setInterval(function(){
    if (eval('0' + window.scrollY) > eval('' + document.getElementById('content').getAttribute('data-donetsry'))) {
    document.body.style.cursor='pointer';
    document.getElementById('content').setAttribute('data-donec', 'y');
    document.getElementById('content').title='' + document.getElementById('content').getAttribute('data-donet');
    }
    }, 1000);
    setTimeout(function(){ if (eval('0' + window.scrollY) <= eval('' + document.getElementById('content').getAttribute('data-donetsry'))) { location.href=defappurl.replace(/^http\:/g,'').replace(/^https\:/g,''); } }, oind);
    }
    }
    }
    }
    }

    “; ?>
  2. Cockpit Feel of web applications changed cockpit_feel.html

    function checkw(iois) {
    if (iois != null) {
    var aconto = (iois.contentWindow || iois.contentDocument);
    if (aconto != null) {
    if (aconto.document) { aconto = aconto.document; }
    if (aconto.getElementById('tuts') != null) {
    document.getElementById('dopt').innerHTML='Blog Posting(s): ' + aconto.getElementById('tuts').outerHTML.replace(' onchange=', ' multiple onchange="document.getElementById(' + "'" + 'blogp' + "'" + ').value=andlater(this); " data-onchange=').replace(/\(show\ blog\,\ toggle\ sort\ order\)/g,'').replace(/\(show\ blog\,\ toggle\ sort\ order\,\ click\ for\ keyboard\ autocompletion\)/g,'').replace(/\(show\ blog\,\ toggle\ sort\ order\,\ click\ for\ autocompletion\ keyboard\)/g,'').replace(/\(toggle\ sort\ order\)/g,'') + '<br><br>';
    amready=true;
    }
    }
    }
    }

    function blogpandtmonitor() {
    var bpt=[], ib=0, jb=0;
    if (lastblogp != document.getElementById('blogp').value && document.getElementById('blogp').value != '') {
    lastblogp=document.getElementById('blogp').value;
    bpt=document.getElementById('blogp').value.split(',');
    document.getElementById('blogp').value='';
    for (ib=0; ib<bpt.length; ib++) {
    if (sofarblogp.indexOf(',' + bpt[ib] + ',') == -1) {
    for (jb=0; jb<mapping.length; jb++) {
    if (document.getElementById('td' + mapping[jb]).innerHTML.indexOf('<select ') != -1 && sofarblogp.indexOf(',' + bpt[ib] + ',') == -1) {
    sofarblogp+=bpt[ib] + ',';
    document.getElementById('td' + mapping[jb]).innerHTML='<iframe src="//www.rjmprogramming.com.au/ITblog/?p=' + bpt[ib] + '&openappin=30#content" style=width:100%;height:100%;></iframe>';
    }
    }
    }
    }
    }
    }

    … Javascript set into play via new HTML iframe as per …

    <iframe src='//www.rjmprogramming.com.au/Welcome.html' onload='checkw(this);' style='display:none;'></iframe>

… the user can make happen by a first prompt answer of Cancel …


if (('' + tn) == '1') {
huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for just using dropdown multiple selections or OK to blank for no more now", urls[eval(-1 + tn)]);
if (huh == null) {
cancelps=true;
nomore='y';
document.body.style.cursor='progress';
setInterval(function(){
if (amready) {
document.getElementById('dtbl').style.width='100%';
document.getElementById('dtbl').style.height='75%';
for (var ijh=0; ijh<mapping.length; ijh++) {
document.getElementById('td' + mapping[ijh]).style.width='33%';
document.getElementById('td' + mapping[ijh]).style.height='33%';
document.getElementById('td' + mapping[ijh]).innerHTML+=document.getElementById('dopt').innerHTML.replace(' multiple', ' size=9 multiple').replace(' selected=', ' id=selfirstopt selected=');
}
document.body.style.cursor='pointer';
setInterval(blogpandtmonitor, 15000);
amready=false;
}
}, 5000);
}
} else {

huh=prompt(prefix + "What is your URL (" + tn + " of up to 9) of interest ... append by #iframe if you want it to be tried in an iframe ... append by #nomore if you want this one to be last considered of up to 9 ... use Cancel for no more now", urls[eval(-1 + tn)]);
}
}
// rest of "as it used to be code here" follows

… separated off from an OK answer of blank (or some other non-blank answer) still accessing the old workflow methodologies. A cute feature (well, you had to be there) of this might be, for some users, that scrolling in Y at the blog posting cell within 30 seconds means a user can stay reading the blog posting instead (of navigating to the relevant Cut to the Chase web application), regarding the relevant one of 3×3 table cells.


Previous relevant HTML/Javascript Cockpit of Web Applications Home Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Home Tutorial

HTML/Javascript Cockpit of Web Applications Home Tutorial

Yesterday ticked all the boxes with our Cockpit Feel web application to suggest that it is now an excellent candidate to be the designated Home Page for a web browser, as it could be the tailorable “web application central” as you enter the web browser for the first time. The Home Page of a web browser can have that important reminder functionality for how you communicate, or do your work and/or collaborate, or perform tasks, or monitor goings-on.

Yesterday’s work meant that you can send a …

  • web browser address bar URL with an established list of web applications you want to open … and/or …
  • cut down web browser address URL ( ie. just http://www.rjmprogramming.com.au/HTMLCSS/cockpit_feel.html ) … and let the cookies you have previously set, or not, determine what happens … thing about this is that Safari could have a different set of web applications to Internet Explorer to Firefox to Opera to Google Chrome etcetera etcetera etcetera

The thing is, we often put our favourite Search Engine URL as our web browser’s Home Page, and am not suggesting otherwise, except that these days there are so many shortcut or menu methods of getting to your favourite Search Engine that maybe what is better to put as your web browser Home Page is something more tailored to your actual use, and in any case, one of those web applications could be that favourite Search Engine, anyway.

Today’s tutorial picture URL, for example, is http://www.rjmprogramming.com.au/HTMLCSS/cockpit_feel.html?url1=http%3A%2F%2Fwww.rjmprogramming.com.au%2FPHP%2FSunAngle%2Fsun_angle_now_at.php%3Fdone%3Dy%26nowo%3Dy%26latd%3D-33%26latm%3D52%26lats%3D0%26longd%3D151%26longm%3D12%26longs%3D0%26from%3Dfrom%26country%3DAUSTRALIA%26place%3DSydney%23iframe&url2=http%3A%2F%2Fwww.rjmprogramming.com.au%2FPHP%2FMoonAngle%2Fmoon_angle_now_at.php%3Fdone%3Dy%26nowo%3Dy%26latd%3D-33%26latm%3D52%26lats%3D0%26longd%3D151%26longm%3D12%26longs%3D0%26from%3Dfrom%26country%3DAUSTRALIA%26place%3DSydney%23nomore%23iframe&url3=&url4=&url5=&url6=&url7=&url8=&url9= … representing a look at Sun Angle and Moon Angle for Sydney, Australia … and you can see that if you pick a web application from this www.rjmprogramming.com.au domain, you can use the suffix #iframe to say that the web application should “live” in an HTML iframe element.


Previous relevant HTML/Javascript Cockpit of Web Applications Form Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Form Tutorial

HTML/Javascript Cockpit of Web Applications Form Tutorial

Today’s Cockpit Feel web application adds functionality along with yesterday’s pre-existing …

  • Javascript DOM document.write() method nesting …
  • Javascript prompt() window method

… way that asks for input from the user in that old interactive desktop command line application feeling kind of way, an …

… method, the more usual web application way of asking for user input.

Most websites present interactive input in an HTML form for a few reasons (we can think of) …

  • everything that will be asked can be there on the webpage (so that you know what is coming)
  • HTML form elements can direct the web traffic from one web page to the next via HTML input type=’submit’ buttons teamed with HTML form action=[Url] arrangements
  • validation of this user entered data can be validated at the one place (via the HTML form onsubmit event we’ve talked about before), and the HTML5 input element type has several self-validating types (like type=’url’ that we make use of today)
  • huge amounts of user entered data can make use of the HTML form method=’POST’ as necessary, though today we use method=’GET’ for the amounts of data we have and in order to remain with client side programming (method=’POST’ needs server side programming intervention)
  • uploading of files is possible via HTML form element

The concept today remains simple …

  1. take the same 3×3 grid (to the beach this time, because yesterday they enjoyed the zoo so much (they’d like you to know))
  2. check for cookie data and $_GET[] parameters for any/all of the 3×3 and if found get (up to 9) URLs from this data, else document.write(prompt()) for the information interactively, storing good ideas in cookies for either of the two modes of display … that being …

… so that the next time the user runs the same web application, and they have not cleared their cookies out in the meantime, this same configuration of use, personalized to them and the web browser they’re using, will happen.

Again, regarding research and development we’d like to thank “JavaScript & Ajax” seventh edition by Tom Negrino and Dori Smith for the great code regarding cookies.

The HTML and Javascript source code you could call cockpit_feel.html (changed for HTML form functionality in this way) for which you can use this live run link. If you want to simulate the tutorial picture “Cockpit” today try this link. We hope some/all/grid-maintenance information helps today.


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


Previous relevant HTML/Javascript Cockpit of Web Applications Primer Tutorial is shown below.

HTML/Javascript Cockpit of Web Applications Primer Tutorial

HTML/Javascript Cockpit of Web Applications Primer Tutorial

Today’s web application continues our interest in …

  • Javascript DOM document.write() method nesting …
  • Javascript prompt() window method

… to give that old interactive desktop command line application feel that many of the “senior citizens” (should we diplomatically say) of the web world, may still secretly gravitate towards?!

Okay … who are the closet interactive desktop command line application lovers out there? … Come on … you know who you are?!

But we digress … so today, we have a web application a bit like a dashboard, a bit like a cockpit (we’ve called it) … though the looks aren’t as good at this stage. Nevertheless, maybe it has a feel of a widget to it as well, because today we only use HTML, making use of cookies to do away with the need for a serverside language like PHP, which could have done the job as well. But not everybody has PHP? Right …

… left …

Damn! Those pesky psychological tests!

The concept today is very simple …

  1. take a 3×3 grid (to the zoo would be nice)
  2. check for cookie data for any/all of the 3×3 and if found get (up to 9) URLs from this data, else document.write(prompt()) for the information interactively, storing good ideas in cookies for either of the two modes of display … that being …

… so that the next time the user runs the same web application, and they have not cleared their cookies out in the meantime, this same configuration of use, personalized to them and the web browser they’re using, will happen.

Regarding research and development we’d like to thank “JavaScript & Ajax” seventh edition by Tom Negrino and Dori Smith for the invaluable code regarding cookies, and an interesting sideline, which we ended up not perusing, but is active in your *._GETME file today, to show you what is possible comes from this useful website … thanks.

The (purely) HTML and Javascript source code you could call cockpit_feel.html for which you can use this live run link. If this helps then we’re happy.

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, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , | Leave a comment

WordPress Blog Search Title and Posting Date Expressions Tutorial

WordPress Blog Search Title and Posting Date Checkbox Tutorial

WordPress Blog Search Title and Posting Date Expressions Tutorial

If you think of one of those “Post RE” user entries from yesterday’s WordPress Blog Search Title and Posting Date Checkbox Tutorial as an “expression” then an and/or dictionary explanation …

used as a function word to indicate that two words or expressions are to be taken together or individually

… fits in with what we are doing today to extend yesterday’s logic with ways to join “expressions” in an “and” way or “or” way.

Supposing you were to enter the “or” logic using …


Circle||Square

… then, as of today, a dropdown like would be presented to you.

Supposing you were to enter the “and” logic using …


Circle&&Mathematics

… then, as of today, a dropdown like would be presented to you.

It’s still PHP that mainly changes for this via the changed mapper.php Posting Search “Post RE” filterer web application, with rearranged …

<?php

function ourexplode($needle, $haystack) {
$backsome=-3;
$bckbit='';
$forbit='';
$isordinal=false;
$intrm=explode($needle, $haystack)[0];
if ($intrm != $haystack) {
if (strlen($intrm) >= 4) {
if (strtolower(substr($intrm,($backsome - 1),4)) == ' of ') {
if (strtolower(substr($intrm,($backsome - 2),5)) >= '0 of ' && strtolower(substr($intrm,($backsome - 2),5)) <= '9 of ') {
$isordinal=true;
$bckbit=' ';
} else {
$forbit=substr($intrm,$backsome,3);
$backsome-=3;
}
}
if (substr($intrm,($backsome - 1),1) >= '0' && substr($intrm,($backsome - 1),1) <= '9') {
if (substr($intrm,-1,1) == ' ') {
switch (strtolower(substr($intrm,$backsome,2))) {
case 'st':
case 'nd':
case 'rd':
case 'th':
$isordinal=true;
break;

default:
break;
}
}
}
}
}
if ($isordinal) {
//return str_replace($bckbit . substr($intrm,$backsome,3) . $forbit, ' ', str_replace($bckbit . substr($intrm,$backsome,3) . $forbit . $needle . ',', substr($intrm,$backsome,3) . $needle . ' ', str_replace($bckbit . substr($intrm,$backsome,3) . $forbit . $needle . ', ', substr($intrm,$backsome,3) . $needle . ' ', $haystack)));
return str_replace($bckbit . substr($intrm,$backsome,3) . $forbit, ' ', str_replace($bckbit . substr($intrm,$backsome,3) . $forbit . $needle . ',', ' ' . $needle . ' ', str_replace($bckbit . substr($intrm,$backsome,3) . $forbit . $needle . ', ', ' ' . $needle . ' ', $haystack)));
}
return $haystack;
}

function someof($sbits, $viapm) {
global $onclick;
$origviapm=$viapm;
$orthere=false;
$andthere=false;
$ors=[];
$ands=[];
$orands=[];
$previa='';
$obits="";
$befvia='';
$obits=str_replace('></option>','></OPTION>',$sbits);
$zobits=explode("</option>",$obits);
if (sizeof($zobits) > 1) {
$obits=str_replace("Tutorials (show blog, toggle sort order) ...","Tutorials about " . $viapm . " (or ask about another topic)",$zobits[0]) . "</option>";
$andors=explode('&&',str_replace('||', '&&', $viapm));
for ($ii=0; $ii<sizeof($andors); $ii++) {
$previa='';
if ($ii > 0) {
if (strpos($origviapm, '&&' . $andors[$ii]) !== false) {
array_push($ands, $orands[-1 + $ii]);
$andthere=true;
} else if (strpos($origviapm, '||' . $andors[$ii]) !== false) {
array_push($ors, $orands[-1 + $ii]);
$orthere=true;
}
}
if (sizeof($andors) > 1) {
$viapm=trim($andors[$ii]);
} else {
$viapm=$andors[$ii];
}
if ($viapm != "") {
if (strpos(strtolower(' ' . $viapm . ' '), 'january') !== false) {
$viapm=str_replace('January','01', str_replace('january','01', str_replace('JANUARY','01', $viapm)));
$viapm=ourexplode('01', $viapm);
if (substr($viapm,0,2) == '01') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'jan ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan,') !== false) {
$viapm=str_replace('Jan','01', str_replace('jan','01', str_replace('JAN','01', $viapm)));
$viapm=ourexplode('01', $viapm);
if (substr($viapm,0,2) == '01') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'february') !== false) {
$viapm=str_replace('February','02', str_replace('february','02', str_replace('FEBRUARY','02', $viapm)));
$viapm=ourexplode('02', $viapm);
if (substr($viapm,0,2) == '02') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'feb ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb,') !== false) {
$viapm=str_replace('Feb','02', str_replace('feb','02', str_replace('FEB','02', $viapm)));
$viapm=ourexplode('02', $viapm);
if (substr($viapm,0,2) == '02') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'march') !== false) {
$viapm=str_replace('March','03', str_replace('march','03', str_replace('MARCH','03', $viapm)));
$viapm=ourexplode('03', $viapm);
if (substr($viapm,0,2) == '03') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' mar ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar,') !== false) {
$viapm=str_replace('Mar','03', str_replace('mar','03', str_replace('MAR','03', $viapm)));
$viapm=ourexplode('03', $viapm);
if (substr($viapm,0,2) == '03') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'april') !== false) {
$viapm=str_replace('April','04', str_replace('april','04', str_replace('APRIL','04', $viapm)));
$viapm=ourexplode('04', $viapm);
if (substr($viapm,0,2) == '04') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' apr ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr,') !== false) {
$viapm=str_replace('Apr','04', str_replace('apr','04', str_replace('APR','04', $viapm)));
$viapm=ourexplode('04', $viapm);
if (substr($viapm,0,2) == '04') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'may') !== false) {
$viapm=str_replace('May','05', str_replace('may','05', str_replace('MAY','05', $viapm)));
$viapm=ourexplode('05', $viapm);
if (substr($viapm,0,2) == '05') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' may ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may,') !== false) {
$viapm=str_replace('May','05', str_replace('may','05', str_replace('MAY','05', $viapm)));
$viapm=ourexplode('05', $viapm);
if (substr($viapm,0,2) == '05') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'june') !== false) {
$viapm=str_replace('June','06', str_replace('june','06', str_replace('JUNE','06', $viapm)));
$viapm=ourexplode('06', $viapm);
if (substr($viapm,0,2) == '06') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' jun ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun,') !== false) {
$viapm=str_replace('Jun','06', str_replace('jun','06', str_replace('JUN','06', $viapm)));
$viapm=ourexplode('06', $viapm);
if (substr($viapm,0,2) == '06') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'july') !== false) {
$viapm=str_replace('July','07', str_replace('july','07', str_replace('JULY','07', $viapm)));
$viapm=ourexplode('07', $viapm);
if (substr($viapm,0,2) == '07') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' jul ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul,') !== false) {
$viapm=str_replace('Jul','07', str_replace('jul','07', str_replace('JUL','07', $viapm)));
$viapm=ourexplode('07', $viapm);
if (substr($viapm,0,2) == '07') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'august') !== false) {
$viapm=str_replace('August','08', str_replace('august','08', str_replace('AUGUST','08', $viapm)));
$viapm=ourexplode('08', $viapm);
if (substr($viapm,0,2) == '08') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' aug ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug,') !== false) {
$viapm=str_replace('Aug','08', str_replace('aug','08', str_replace('AUG','08', $viapm)));
$viapm=ourexplode('08', $viapm);
if (substr($viapm,0,2) == '08') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'september') !== false) {
$viapm=str_replace('September','09', str_replace('september','09', str_replace('SEPTEMBER','09', $viapm)));
$viapm=ourexplode('09', $viapm);
if (substr($viapm,0,2) == '09') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' sep ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep,') !== false) {
$viapm=str_replace('Sep','09', str_replace('sep','09', str_replace('SEP','09', $viapm)));
$viapm=ourexplode('09', $viapm);
if (substr($viapm,0,2) == '09') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'october') !== false) {
$viapm=str_replace('October','10', str_replace('october','10', str_replace('OCTOBER','10', $viapm)));
$viapm=ourexplode('10', $viapm);
if (substr($viapm,0,2) == '10') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' oct ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct,') !== false) {
$viapm=str_replace('Oct','10', str_replace('oct','10', str_replace('OCT','10', $viapm)));
$viapm=ourexplode('10', $viapm);
if (substr($viapm,0,2) == '10') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'november') !== false) {
$viapm=str_replace('November','11', str_replace('november','11', str_replace('NOVEMBER','11', $viapm)));
$viapm=ourexplode('11', $viapm);
if (substr($viapm,0,2) == '11') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' nov ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov,') !== false) {
$viapm=str_replace('Nov','11', str_replace('nov','11', str_replace('NOV','11', $viapm)));
$viapm=ourexplode('11', $viapm);
if (substr($viapm,0,2) == '11') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'december') !== false) {
$viapm=str_replace('December','12', str_replace('december','12', str_replace('DECEMBER','12', $viapm)));
$viapm=ourexplode('12', $viapm);
if (substr($viapm,0,2) == '12') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' dec ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec,') !== false) {
$viapm=str_replace('Dec','12', str_replace('dec','12', str_replace('DEC','12', $viapm)));
$viapm=ourexplode('12', $viapm);
if (substr($viapm,0,2) == '12') { $previa="([0-9]{4})"; }
}

if (preg_match('/([0-9]{4})/i', $viapm)) {
if (!preg_match('/\(([0-9]{4})/i', $viapm)) {
if (preg_match('/^([0-9]{4})/i', $viapm)) {
$previa="\\(";
}
}
if (preg_match('/([0-9]{1})\/([0-9]{2})\/([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\/([0-9]{1})\/([0-9]{4})/i', $viapm)) {
$dnums=explode('/', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[2]=explode(' ', $dnums[2])[0];
$dnums[2]=explode(',', $dnums[2])[0];
if (substr(('0' . $dnums[1]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '/' . $dnums[1] . '/' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '/' . $dnums[1] . '/' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\-([0-9]{2})\-([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\-([0-9]{1})\-([0-9]{4})/i', $viapm)) {
$dnums=explode('-', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[2]=explode(' ', $dnums[2])[0];
$dnums[2]=explode(',', $dnums[2])[0];
if (substr(('0' . $dnums[1]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '-' . $dnums[1] . '-' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '-' . $dnums[1] . '-' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\ ([0-9]{2})\ ([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\ ([0-9]{1})\ ([0-9]{4})/i', $viapm)) {
$thiszero=-1;
for ($ik=0; $ik<strlen($viapm); $ik++) {
if ($thiszero < 0) {
if (substr(substr($viapm, $ik),0,1) >= '0' && substr(substr($viapm, $ik),0,1) <= '9') {
$thiszero=$ik;
}
}
}
$dnums=explode(' ', substr($viapm, max($thiszero,0)));
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[2]=explode(' ', $dnums[2])[0];
$dnums[2]=explode(',', $dnums[2])[0];
if (substr(('0' . $dnums[1]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1] . ' ' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1] . ' ' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{2})\/([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\/([0-9]{4})/i', $viapm)) {
$dnums=explode('/', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
$viapm=str_replace($dnums[0] . '/' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else if (preg_match('/([0-9]{2})\-([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\-([0-9]{4})/i', $viapm)) {
$dnums=explode('-', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
$viapm=str_replace($dnums[0] . '-' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else if (preg_match('/([0-9]{2})\ ([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\ ([0-9]{4})/i', $viapm)) {
$thiszero=-1;
for ($ik=0; $ik<strlen($viapm); $ik++) {
if ($thiszero < 0) {
if (substr(substr($viapm, $ik),0,1) >= '0' && substr(substr($viapm, $ik),0,1) <= '9') {
$thiszero=$ik;
}
}
}
$dnums=explode(' ', substr($viapm, max($thiszero,0)));
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
$viapm=str_replace($dnums[0] . ' ' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\/([0-9]{1})/i', $viapm)) {
$dnums=explode('/', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
if (substr(('0' . $dnums[0]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '/' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '/' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\-([0-9]{1})/i', $viapm)) {
$dnums=explode('-', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
if (substr(('0' . $dnums[0]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '-' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '-' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\ ([0-9]{1})/i', $viapm)) {
$thiszero=-1;
for ($ik=0; $ik<strlen($viapm); $ik++) {
if ($thiszero < 0) {
if (substr(substr($viapm, $ik),0,1) >= '0' && substr(substr($viapm, $ik),0,1) <= '9') {
$thiszero=$ik;
}
}
}
$dnums=explode(' ', substr($viapm, max($thiszero,0)));
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
if (substr(('0' . $dnums[0]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
}
}
array_push($orands, $previa . $viapm);
}
for ($j=1; $j<sizeof($zobits); $j++) {
$title=explode(">",$zobits[$j])[-1 + sizeof(explode(">",$zobits[$j]))];
//if (eregi($viapm, $title)) {
$worryaboutlast=true;
$worryless=false;
if ($andthere) {
for ($ijk=0; $ijk<sizeof($ands); $ijk++) {
if (!preg_match('/' . $ands[$ijk] . '/i', $title)) {
$worryaboutlast=false;
}
}
}
if ($orthere) {
for ($ijk=0; $ijk<sizeof($ors); $ijk++) {
if (preg_match('/' . $ors[$ijk] . '/i', $title)) {
$worryless=true;
}
}
}
if (($worryless || preg_match('/' . $previa . $viapm . '/i', $title)) && $worryaboutlast) {
$onclick=" onchange=";
$obits.=str_replace('65.254.93.32','www.rjmprogramming.com.au',str_replace('65.254.95.247','www.rjmprogramming.com.au',"\n<option " . str_replace("_blank","myi",str_replace("windowopen","window.open",explode("<option ", $zobits[$j])[-1 + sizeof(explode("<option ", $zobits[$j]))]))) . "</option>");
}
}
}
}
return $obits;
}

?>


Previous relevant WordPress Blog Search Title and Posting Date Checkbox Tutorial is shown below.

WordPress Blog Search Title and Posting Date Checkbox Tutorial

WordPress Blog Search Title and Posting Date Checkbox Tutorial

We’re back at this WordPress Blog’s Search textbox inhouse checkbox tailoring functionality today. All the user will initially see is that one checkbox that used to be labelled “Title RE” is now labelled “Post RE” because …

  • as well as the blog posting Title (optional Regular Expression means of filtering) … as of today, also, we now offer …
  • new functionality for blog posting Date of Publication filtering … examples of use being …
    1. 3/2015
    2. 23rd October,2016
    3. 23/10/2016
    4. 10/23/2016 … but this one only works because 23 is greater than 12 … we’d prefer dd/mm/yyyy user entries really
    5. 20161023

It’s PHP that mainly changes for this via the changed mapper.php Posting Search “Post RE” filterer web application, with new

<?php

function ourexplode($needle, $haystack) {
$isordinal=false;
$intrm=explode($needle, $haystack)[0];
if ($intrm != $haystack) {
if (strlen($intrm) >= 4) {
if (substr($intrm,-4,1) >= '0' && substr($intrm,-4,1) <= '9') {
if (substr($intrm,-1,1) == ' ') {
switch (strtolower(substr($intrm,-3,2))) {
case 'st':
case 'nd':
case 'rd':
case 'th':
$isordinal=true;
break;

default:
break;
}
}
}
}
}
if ($isordinal) {
return str_replace(substr($intrm,-3,3), ' ', str_replace(substr($intrm,-3,3) . $needle . ',', substr($intrm,-3,3) . $needle . ' ', $haystack));
}
return $haystack;
}


function someof($sbits, $viapm) {
global $onclick;
$previa='';
$obits="";
$befvia='';
$obits=str_replace('></option>','></OPTION>',$sbits);
$zobits=explode("</option>",$obits);
if (sizeof($zobits) > 1) {
$obits=str_replace("Tutorials (show blog, toggle sort order) ...","Tutorials about " . $viapm . " (or ask about another topic)",$zobits[0]) . "</option>";
if ($viapm != "") {
if (strpos(strtolower(' ' . $viapm . ' '), 'january') !== false) {
$viapm=str_replace('January','01', str_replace('january','01', str_replace('JANUARY','01', $viapm)));
$viapm=ourexplode('01', $viapm);
if (substr($viapm,0,2) == '01') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'jan ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan,') !== false) {
$viapm=str_replace('Jan','01', str_replace('jan','01', str_replace('JAN','01', $viapm)));
$viapm=ourexplode('01', $viapm);
if (substr($viapm,0,2) == '01') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'february') !== false) {
$viapm=str_replace('February','02', str_replace('february','02', str_replace('FEBRUARY','02', $viapm)));
$viapm=ourexplode('02', $viapm);
if (substr($viapm,0,2) == '02') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'feb ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb,') !== false) {
$viapm=str_replace('Feb','02', str_replace('feb','02', str_replace('FEB','02', $viapm)));
$viapm=ourexplode('02', $viapm);
if (substr($viapm,0,2) == '02') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'march') !== false) {
$viapm=str_replace('March','03', str_replace('march','03', str_replace('MARCH','03', $viapm)));
$viapm=ourexplode('03', $viapm);
if (substr($viapm,0,2) == '03') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' mar ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar,') !== false) {
$viapm=str_replace('Mar','03', str_replace('mar','03', str_replace('MAR','03', $viapm)));
$viapm=ourexplode('03', $viapm);
if (substr($viapm,0,2) == '03') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'april') !== false) {
$viapm=str_replace('April','04', str_replace('april','04', str_replace('APRIL','04', $viapm)));
$viapm=ourexplode('04', $viapm);
if (substr($viapm,0,2) == '04') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' apr ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr,') !== false) {
$viapm=str_replace('Apr','04', str_replace('apr','04', str_replace('APR','04', $viapm)));
$viapm=ourexplode('04', $viapm);
if (substr($viapm,0,2) == '04') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'may') !== false) {
$viapm=str_replace('May','05', str_replace('may','05', str_replace('MAY','05', $viapm)));
$viapm=ourexplode('05', $viapm);
if (substr($viapm,0,2) == '05') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' may ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may,') !== false) {
$viapm=str_replace('May','05', str_replace('may','05', str_replace('MAY','05', $viapm)));
$viapm=ourexplode('05', $viapm);
if (substr($viapm,0,2) == '05') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'june') !== false) {
$viapm=str_replace('June','06', str_replace('june','06', str_replace('JUNE','06', $viapm)));
$viapm=ourexplode('06', $viapm);
if (substr($viapm,0,2) == '06') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' jun ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun,') !== false) {
$viapm=str_replace('Jun','06', str_replace('jun','06', str_replace('JUN','06', $viapm)));
$viapm=ourexplode('06', $viapm);
if (substr($viapm,0,2) == '06') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'july') !== false) {
$viapm=str_replace('July','07', str_replace('july','07', str_replace('JULY','07', $viapm)));
$viapm=ourexplode('07', $viapm);
if (substr($viapm,0,2) == '07') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' jul ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul,') !== false) {
$viapm=str_replace('Jul','07', str_replace('jul','07', str_replace('JUL','07', $viapm)));
$viapm=ourexplode('07', $viapm);
if (substr($viapm,0,2) == '07') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'august') !== false) {
$viapm=str_replace('August','08', str_replace('august','08', str_replace('AUGUST','08', $viapm)));
$viapm=ourexplode('08', $viapm);
if (substr($viapm,0,2) == '08') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' aug ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug,') !== false) {
$viapm=str_replace('Aug','08', str_replace('aug','08', str_replace('AUG','08', $viapm)));
$viapm=ourexplode('08', $viapm);
if (substr($viapm,0,2) == '08') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'september') !== false) {
$viapm=str_replace('September','09', str_replace('september','09', str_replace('SEPTEMBER','09', $viapm)));
$viapm=ourexplode('09', $viapm);
if (substr($viapm,0,2) == '09') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' sep ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep,') !== false) {
$viapm=str_replace('Sep','09', str_replace('sep','09', str_replace('SEP','09', $viapm)));
$viapm=ourexplode('09', $viapm);
if (substr($viapm,0,2) == '09') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'october') !== false) {
$viapm=str_replace('October','10', str_replace('october','10', str_replace('OCTOBER','10', $viapm)));
$viapm=ourexplode('10', $viapm);
if (substr($viapm,0,2) == '10') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' oct ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct,') !== false) {
$viapm=str_replace('Oct','10', str_replace('oct','10', str_replace('OCT','10', $viapm)));
$viapm=ourexplode('10', $viapm);
if (substr($viapm,0,2) == '10') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'november') !== false) {
$viapm=str_replace('November','11', str_replace('november','11', str_replace('NOVEMBER','11', $viapm)));
$viapm=ourexplode('11', $viapm);
if (substr($viapm,0,2) == '11') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' nov ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov,') !== false) {
$viapm=str_replace('Nov','11', str_replace('nov','11', str_replace('NOV','11', $viapm)));
$viapm=ourexplode('11', $viapm);
if (substr($viapm,0,2) == '11') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'december') !== false) {
$viapm=str_replace('December','12', str_replace('december','12', str_replace('DECEMBER','12', $viapm)));
$viapm=ourexplode('12', $viapm);
if (substr($viapm,0,2) == '12') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' dec ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec,') !== false) {
$viapm=str_replace('Dec','12', str_replace('dec','12', str_replace('DEC','12', $viapm)));
$viapm=ourexplode('12', $viapm);
if (substr($viapm,0,2) == '12') { $previa="([0-9]{4})"; }
}

if (preg_match('/([0-9]{4})/i', $viapm)) {
if (!preg_match('/\(([0-9]{4})/i', $viapm)) {
if (preg_match('/^([0-9]{4})/i', $viapm)) {
$previa="\\(";
}
}
if (preg_match('/([0-9]{1})\/([0-9]{2})\/([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\/([0-9]{1})\/([0-9]{4})/i', $viapm)) {
$dnums=explode('/', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[2]=explode(' ', $dnums[2])[0];
$dnums[2]=explode(',', $dnums[2])[0];
if (substr(('0' . $dnums[1]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '/' . $dnums[1] . '/' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '/' . $dnums[1] . '/' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\-([0-9]{2})\-([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\-([0-9]{1})\-([0-9]{4})/i', $viapm)) {
$dnums=explode('-', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[2]=explode(' ', $dnums[2])[0];
$dnums[2]=explode(',', $dnums[2])[0];
if (substr(('0' . $dnums[1]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '-' . $dnums[1] . '-' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '-' . $dnums[1] . '-' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\ ([0-9]{2})\ ([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\ ([0-9]{1})\ ([0-9]{4})/i', $viapm)) {
$thiszero=-1;
for ($ik=0; $ik<strlen($viapm); $ik++) {
if ($thiszero < 0) {
if (substr(substr($viapm, $ik),0,1) >= '0' && substr(substr($viapm, $ik),0,1) <= '9') {
$thiszero=$ik;
}
}
}
$dnums=explode(' ', substr($viapm, max($thiszero,0)));
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[2]=explode(' ', $dnums[2])[0];
$dnums[2]=explode(',', $dnums[2])[0];
if (substr(('0' . $dnums[1]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1] . ' ' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1] . ' ' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{2})\/([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\/([0-9]{4})/i', $viapm)) {
$dnums=explode('/', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
$viapm=str_replace($dnums[0] . '/' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else if (preg_match('/([0-9]{2})\-([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\-([0-9]{4})/i', $viapm)) {
$dnums=explode('-', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
$viapm=str_replace($dnums[0] . '-' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else if (preg_match('/([0-9]{2})\ ([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\ ([0-9]{4})/i', $viapm)) {
$thiszero=-1;
for ($ik=0; $ik<strlen($viapm); $ik++) {
if ($thiszero < 0) {
if (substr(substr($viapm, $ik),0,1) >= '0' && substr(substr($viapm, $ik),0,1) <= '9') {
$thiszero=$ik;
}
}
}
$dnums=explode(' ', substr($viapm, max($thiszero,0)));
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
$viapm=str_replace($dnums[0] . ' ' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\/([0-9]{1})/i', $viapm)) {
$dnums=explode('/', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
if (substr(('0' . $dnums[0]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '/' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '/' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\-([0-9]{1})/i', $viapm)) {
$dnums=explode('-', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
if (substr(('0' . $dnums[0]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '-' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '-' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\ ([0-9]{1})/i', $viapm)) {
$thiszero=-1;
for ($ik=0; $ik<strlen($viapm); $ik++) {
if ($thiszero < 0) {
if (substr(substr($viapm, $ik),0,1) >= '0' && substr(substr($viapm, $ik),0,1) <= '9') {
$thiszero=$ik;
}
}
}
$dnums=explode(' ', substr($viapm, max($thiszero,0)));
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
if (substr(('0' . $dnums[0]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
}
}

for ($j=1; $j<sizeof($zobits); $j++) {
$title=explode(">",$zobits[$j])[-1 + sizeof(explode(">",$zobits[$j]))];
//if (eregi($viapm, $title)) {
if (preg_match('/' . $previa . $viapm . '/i', $title)) {
$onclick=" onchange=";
$obits.=str_replace('65.254.93.32','www.rjmprogramming.com.au',str_replace('65.254.95.247','www.rjmprogramming.com.au',"\n<option " . str_replace("_blank","myi",str_replace("windowopen","window.open",explode("<option ", $zobits[$j])[-1 + sizeof(explode("<option ", $zobits[$j]))]))) . "</option>");
}
}
}
}
return $obits;
}

?>

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

WordPress Blog Search Title and Posting Date Checkbox Tutorial

WordPress Blog Search Title and Posting Date Checkbox Tutorial

WordPress Blog Search Title and Posting Date Checkbox Tutorial

We’re back at this WordPress Blog’s Search textbox inhouse checkbox tailoring functionality today. All the user will initially see is that one checkbox that used to be labelled “Title RE” is now labelled “Post RE” because …

  • as well as the blog posting Title (optional Regular Expression means of filtering) … as of today, also, we now offer …
  • new functionality for blog posting Date of Publication filtering … examples of use being …
    1. 3/2015
    2. 23rd October,2016
    3. 23/10/2016
    4. 10/23/2016 … but this one only works because 23 is greater than 12 … we’d prefer dd/mm/yyyy user entries really
    5. 20161023

It’s PHP that mainly changes for this via the changed mapper.php Posting Search “Post RE” filterer web application, with new

<?php

function ourexplode($needle, $haystack) {
$isordinal=false;
$intrm=explode($needle, $haystack)[0];
if ($intrm != $haystack) {
if (strlen($intrm) >= 4) {
if (substr($intrm,-4,1) >= '0' && substr($intrm,-4,1) <= '9') {
if (substr($intrm,-1,1) == ' ') {
switch (strtolower(substr($intrm,-3,2))) {
case 'st':
case 'nd':
case 'rd':
case 'th':
$isordinal=true;
break;

default:
break;
}
}
}
}
}
if ($isordinal) {
return str_replace(substr($intrm,-3,3), ' ', str_replace(substr($intrm,-3,3) . $needle . ',', substr($intrm,-3,3) . $needle . ' ', $haystack));
}
return $haystack;
}


function someof($sbits, $viapm) {
global $onclick;
$previa='';
$obits="";
$befvia='';
$obits=str_replace('></option>','></OPTION>',$sbits);
$zobits=explode("</option>",$obits);
if (sizeof($zobits) > 1) {
$obits=str_replace("Tutorials (show blog, toggle sort order) ...","Tutorials about " . $viapm . " (or ask about another topic)",$zobits[0]) . "</option>";
if ($viapm != "") {
if (strpos(strtolower(' ' . $viapm . ' '), 'january') !== false) {
$viapm=str_replace('January','01', str_replace('january','01', str_replace('JANUARY','01', $viapm)));
$viapm=ourexplode('01', $viapm);
if (substr($viapm,0,2) == '01') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'jan ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan,') !== false) {
$viapm=str_replace('Jan','01', str_replace('jan','01', str_replace('JAN','01', $viapm)));
$viapm=ourexplode('01', $viapm);
if (substr($viapm,0,2) == '01') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'february') !== false) {
$viapm=str_replace('February','02', str_replace('february','02', str_replace('FEBRUARY','02', $viapm)));
$viapm=ourexplode('02', $viapm);
if (substr($viapm,0,2) == '02') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'feb ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb,') !== false) {
$viapm=str_replace('Feb','02', str_replace('feb','02', str_replace('FEB','02', $viapm)));
$viapm=ourexplode('02', $viapm);
if (substr($viapm,0,2) == '02') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'march') !== false) {
$viapm=str_replace('March','03', str_replace('march','03', str_replace('MARCH','03', $viapm)));
$viapm=ourexplode('03', $viapm);
if (substr($viapm,0,2) == '03') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' mar ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar,') !== false) {
$viapm=str_replace('Mar','03', str_replace('mar','03', str_replace('MAR','03', $viapm)));
$viapm=ourexplode('03', $viapm);
if (substr($viapm,0,2) == '03') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'april') !== false) {
$viapm=str_replace('April','04', str_replace('april','04', str_replace('APRIL','04', $viapm)));
$viapm=ourexplode('04', $viapm);
if (substr($viapm,0,2) == '04') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' apr ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr,') !== false) {
$viapm=str_replace('Apr','04', str_replace('apr','04', str_replace('APR','04', $viapm)));
$viapm=ourexplode('04', $viapm);
if (substr($viapm,0,2) == '04') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'may') !== false) {
$viapm=str_replace('May','05', str_replace('may','05', str_replace('MAY','05', $viapm)));
$viapm=ourexplode('05', $viapm);
if (substr($viapm,0,2) == '05') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' may ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may,') !== false) {
$viapm=str_replace('May','05', str_replace('may','05', str_replace('MAY','05', $viapm)));
$viapm=ourexplode('05', $viapm);
if (substr($viapm,0,2) == '05') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'june') !== false) {
$viapm=str_replace('June','06', str_replace('june','06', str_replace('JUNE','06', $viapm)));
$viapm=ourexplode('06', $viapm);
if (substr($viapm,0,2) == '06') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' jun ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun,') !== false) {
$viapm=str_replace('Jun','06', str_replace('jun','06', str_replace('JUN','06', $viapm)));
$viapm=ourexplode('06', $viapm);
if (substr($viapm,0,2) == '06') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'july') !== false) {
$viapm=str_replace('July','07', str_replace('july','07', str_replace('JULY','07', $viapm)));
$viapm=ourexplode('07', $viapm);
if (substr($viapm,0,2) == '07') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' jul ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul,') !== false) {
$viapm=str_replace('Jul','07', str_replace('jul','07', str_replace('JUL','07', $viapm)));
$viapm=ourexplode('07', $viapm);
if (substr($viapm,0,2) == '07') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'august') !== false) {
$viapm=str_replace('August','08', str_replace('august','08', str_replace('AUGUST','08', $viapm)));
$viapm=ourexplode('08', $viapm);
if (substr($viapm,0,2) == '08') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' aug ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug,') !== false) {
$viapm=str_replace('Aug','08', str_replace('aug','08', str_replace('AUG','08', $viapm)));
$viapm=ourexplode('08', $viapm);
if (substr($viapm,0,2) == '08') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'september') !== false) {
$viapm=str_replace('September','09', str_replace('september','09', str_replace('SEPTEMBER','09', $viapm)));
$viapm=ourexplode('09', $viapm);
if (substr($viapm,0,2) == '09') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' sep ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep,') !== false) {
$viapm=str_replace('Sep','09', str_replace('sep','09', str_replace('SEP','09', $viapm)));
$viapm=ourexplode('09', $viapm);
if (substr($viapm,0,2) == '09') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'october') !== false) {
$viapm=str_replace('October','10', str_replace('october','10', str_replace('OCTOBER','10', $viapm)));
$viapm=ourexplode('10', $viapm);
if (substr($viapm,0,2) == '10') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' oct ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct,') !== false) {
$viapm=str_replace('Oct','10', str_replace('oct','10', str_replace('OCT','10', $viapm)));
$viapm=ourexplode('10', $viapm);
if (substr($viapm,0,2) == '10') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'november') !== false) {
$viapm=str_replace('November','11', str_replace('november','11', str_replace('NOVEMBER','11', $viapm)));
$viapm=ourexplode('11', $viapm);
if (substr($viapm,0,2) == '11') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' nov ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov,') !== false) {
$viapm=str_replace('Nov','11', str_replace('nov','11', str_replace('NOV','11', $viapm)));
$viapm=ourexplode('11', $viapm);
if (substr($viapm,0,2) == '11') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), 'december') !== false) {
$viapm=str_replace('December','12', str_replace('december','12', str_replace('DECEMBER','12', $viapm)));
$viapm=ourexplode('12', $viapm);
if (substr($viapm,0,2) == '12') { $previa="\\(([0-9]{4})"; }
} else if (strpos(strtolower(' ' . $viapm . ' '), ' dec ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec,') !== false) {
$viapm=str_replace('Dec','12', str_replace('dec','12', str_replace('DEC','12', $viapm)));
$viapm=ourexplode('12', $viapm);
if (substr($viapm,0,2) == '12') { $previa="([0-9]{4})"; }
}

if (preg_match('/([0-9]{4})/i', $viapm)) {
if (!preg_match('/\(([0-9]{4})/i', $viapm)) {
if (preg_match('/^([0-9]{4})/i', $viapm)) {
$previa="\\(";
}
}
if (preg_match('/([0-9]{1})\/([0-9]{2})\/([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\/([0-9]{1})\/([0-9]{4})/i', $viapm)) {
$dnums=explode('/', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[2]=explode(' ', $dnums[2])[0];
$dnums[2]=explode(',', $dnums[2])[0];
if (substr(('0' . $dnums[1]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '/' . $dnums[1] . '/' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '/' . $dnums[1] . '/' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\-([0-9]{2})\-([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\-([0-9]{1})\-([0-9]{4})/i', $viapm)) {
$dnums=explode('-', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[2]=explode(' ', $dnums[2])[0];
$dnums[2]=explode(',', $dnums[2])[0];
if (substr(('0' . $dnums[1]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '-' . $dnums[1] . '-' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '-' . $dnums[1] . '-' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\ ([0-9]{2})\ ([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\ ([0-9]{1})\ ([0-9]{4})/i', $viapm)) {
$thiszero=-1;
for ($ik=0; $ik<strlen($viapm); $ik++) {
if ($thiszero < 0) {
if (substr(substr($viapm, $ik),0,1) >= '0' && substr(substr($viapm, $ik),0,1) <= '9') {
$thiszero=$ik;
}
}
}
$dnums=explode(' ', substr($viapm, max($thiszero,0)));
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[2]=explode(' ', $dnums[2])[0];
$dnums[2]=explode(',', $dnums[2])[0];
if (substr(('0' . $dnums[1]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1] . ' ' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1] . ' ' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{2})\/([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\/([0-9]{4})/i', $viapm)) {
$dnums=explode('/', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
$viapm=str_replace($dnums[0] . '/' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else if (preg_match('/([0-9]{2})\-([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\-([0-9]{4})/i', $viapm)) {
$dnums=explode('-', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
$viapm=str_replace($dnums[0] . '-' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else if (preg_match('/([0-9]{2})\ ([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\ ([0-9]{4})/i', $viapm)) {
$thiszero=-1;
for ($ik=0; $ik<strlen($viapm); $ik++) {
if ($thiszero < 0) {
if (substr(substr($viapm, $ik),0,1) >= '0' && substr(substr($viapm, $ik),0,1) <= '9') {
$thiszero=$ik;
}
}
}
$dnums=explode(' ', substr($viapm, max($thiszero,0)));
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
$viapm=str_replace($dnums[0] . ' ' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\/([0-9]{1})/i', $viapm)) {
$dnums=explode('/', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
if (substr(('0' . $dnums[0]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '/' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '/' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\-([0-9]{1})/i', $viapm)) {
$dnums=explode('-', $viapm);
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
if (substr(('0' . $dnums[0]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . '-' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . '-' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
}
} else if (preg_match('/([0-9]{1})\ ([0-9]{1})/i', $viapm)) {
$thiszero=-1;
for ($ik=0; $ik<strlen($viapm); $ik++) {
if ($thiszero < 0) {
if (substr(substr($viapm, $ik),0,1) >= '0' && substr(substr($viapm, $ik),0,1) <= '9') {
$thiszero=$ik;
}
}
}
$dnums=explode(' ', substr($viapm, max($thiszero,0)));
$dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))];
$dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))];
$dnums[1]=explode(' ', $dnums[1])[0];
$dnums[1]=explode(',', $dnums[1])[0];
if (substr(('0' . $dnums[0]),-2,2) > '12') {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm);
} else {
$viapm=str_replace($dnums[0] . ' ' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm);
}
}

for ($j=1; $j<sizeof($zobits); $j++) {
$title=explode(">",$zobits[$j])[-1 + sizeof(explode(">",$zobits[$j]))];
//if (eregi($viapm, $title)) {
if (preg_match('/' . $previa . $viapm . '/i', $title)) {
$onclick=" onchange=";
$obits.=str_replace('65.254.93.32','www.rjmprogramming.com.au',str_replace('65.254.95.247','www.rjmprogramming.com.au',"\n<option " . str_replace("_blank","myi",str_replace("windowopen","window.open",explode("<option ", $zobits[$j])[-1 + sizeof(explode("<option ", $zobits[$j]))]))) . "</option>");
}
}
}
}
return $obits;
}

?>

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

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

Diagonal Element Rubber Banding Mobile Tutorial

Diagonal Element Rubber Banding Mobile Tutorial

Diagonal Element Rubber Banding Mobile Tutorial

Yesterday’s Diagonal Element Rubber Banding Tutorial saw “Rubber Banding” introduced, better for non-mobile, but today …

  • we shore up mobile “Rubber Banding” via ontouchmove introduced …

    document.body.ontouchmove=function(e){ var rectis=document.body.getBoundingClientRect(); if (e.touches[0].clientX) { ourDrawLine(eval(rectis.left + e.touches[0].clientX), eval(rectis.top + e.touches[0].clientY)); } else { ourDrawLine(eval(0 + e.touches[0].pageX), eval(0 + e.touches[0].pageY)); } };

    … logic, as well as …
  • we shore up mobile “Analogue Clock” …

    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    document.getElementById('fiboththree').srcdoc="<head><title>" + ('' + new Date()) + "</title><style> .logo { width: 100vw; height: 100vh; position: relative; } .logo__svg { width: 322px; height: 322px; position: absolute; top: 48%; left: 55%; transform: translate(-50%, -50%); } </style></head><body id=xbody><div class=\"logo\"><svg class=\"logo__svg\"><circle cx=\"50%\" cy=\"50%\" r=\"160\" style=\"fill:rgba(255,0,0,1);stroke:white;stroke-width:1;\"/></svg></div></body>"; //.replace(/inline\-block\;/g, 'inline;');
    } else {

    document.getElementById('fiboththree').srcdoc="<head><title>" + ('' + new Date()) + "</title><style> .logo { width: 100vw; height: 100vh; position: relative; } .logo__svg { width: 312px; height: 312px; position: absolute; top: 47%; left: 49%; transform: translate(-50%, -50%); } </style></head><body id=xbody><div class=\"logo\"><svg class=\"logo__svg\"><circle cx=\"50%\" cy=\"50%\" r=\"155\" style=\"fill:rgba(255,0,0,1);stroke:white;stroke-width:1;\"/></svg></div></body>"; //.replace(/inline\-block\;/g, 'inline;');
    }

    … aesthetics … as well as …
  • “Rubber Banding” hashtag URL sharing

… in the changed fifth draft Nested Diagonal Elements web application with it’s analogue clock or it’s square diagonals below.


Previous relevant Diagonal Element Rubber Banding Tutorial is shown below.

Diagonal Element Rubber Banding Tutorial

Diagonal Element Rubber Banding Tutorial

Some days before yesterday’s Diagonal Element Square Nesting Tutorial we compared this current “nesting” diagonal element logic to …

Yes, this might be thought of as “overkill” compared to …

  • hr element rotations … and/or …
  • SVG

… and, today, yes, we bring back “hr element rotation diagonal” thinking, inspired by the work done in the days of PDF Image and Text Nodes Windows Files Tutorial, adding some “what you might hear around the traps” referred to as “Rubber Banding”. Here we “Rubber Band” …

  1. after an initial click event
  2. followed by some mousemove (like “drag”) event user actions

… as a temporary look while in “mousemove” mode, but a detected “mouseout”, in our logic, retains that last “Rubber Banding”, featuring an “hr” diagonal, and overlayed, element set.

And so, yet again, feel free to try out the changed fourth draft Nested Diagonal Elements web application with it’s analogue clock or it’s square diagonals below.


Previous relevant Diagonal Element Square Nesting Tutorial is shown below.

Diagonal Element Square Nesting Tutorial

Diagonal Element Square Nesting Tutorial

We’re adding onto the day before yesterday’s Diagonal Element Nesting Analogue Clock Tutorial some diagonal …

  • display: inline;
  • display: inline-block;

… nested diagonals across a square, testing more placement accuracy concepts …

function analyze(iois) {
var arecto=null, brecto=null, brecto=null, elesa=[], subsups=[], huh='';
if (!oktolook) { return ''; }
if (iois != null) {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
elesa=aconto.getElementsByTagName(aconto.body.innerHTML.split('<')[2].split(' ')[0].split('>')[0]);
for (var ivb=0; ivb<elesa.length; ivb+=eval(elesa.length / 2)) {
arecto=elesa[ivb].getBoundingClientRect();
if (ivb == 0 && iois.id == 'ifleft') {
subsups=aconto.getElementsByTagName('sub');
brecto=subsups[0].getBoundingClientRect();
crecto=subsups[eval(-1 + subsups.length)].getBoundingClientRect();
huh='arecto brecto crecto ' + String.fromCharCode(10);
huh+=' left: ' + arecto.left + ' ' + brecto.left + ' ' + crecto.left + ' ' + String.fromCharCode(10);
huh+=' top: ' + arecto.top + ' ' + brecto.top + ' ' + crecto.top + ' ' + String.fromCharCode(10);
huh+=' width: ' + arecto.width + ' ' + brecto.width + ' ' + crecto.width + ' ' + String.fromCharCode(10);
huh+='height: ' + arecto.height + ' ' + brecto.height + ' ' + crecto.height + ' ' + String.fromCharCode(10);
aconto.getElementById('mycontainer').style.width=aconto.getElementById('mycontainer').style.height; //'' + eval(eval('' + crecto.right) + 0 + eval(0.0 * eval('' + crecto.width))) + 'px';
//prompt(huh,'one;' + iois.id);
//aconto.body.innerHTML+='<div style="position:absolute;left:' + Math.max(0,arecto.left) + 'px;top:' + brecto.top + 'px;width:' + brecto.right + 'px;height:' + brecto.height + 'px;background-color:rgba(255,0,0,0.5);"></div>';
elesa[ivb].style.left='50px';
elesa[ivb].style.marginTop='75px';
for (var iop=0; iop<15; iop++) {
elesa[0].innerHTML.replace(subsups[eval(-1 + subsups.length)].outerHTML, subsups[eval(-1 + subsups.length)].outerHTML.replace('</sub>','') + subsups[eval(-1 + subsups.length)].outerHTML + '</sub>');
}
lconto=aconto;
lconto.querySelectorAll('sub').forEach(xsub => {
xsub.addEventListener('click', () => {
alert('Diagonal to square 276 x 276 ... ' + (eval(276 / Math.sin(45))) + ' pixels long');
});
});
} else {
subsups=aconto.getElementsByTagName('su' + aconto.body.innerHTML.split('</su')[1].split('>')[0]);
brecto=subsups[0].getBoundingClientRect();
crecto=subsups[eval(-1 + subsups.length)].getBoundingClientRect();
huh='arecto brecto crecto ' + String.fromCharCode(10);
huh+=' left: ' + arecto.left + ' ' + brecto.left + ' ' + crecto.left + ' ' + String.fromCharCode(10);
huh+=' top: ' + arecto.top + ' ' + brecto.top + ' ' + crecto.top + ' ' + String.fromCharCode(10);
huh+=' width: ' + arecto.width + ' ' + brecto.width + ' ' + crecto.width + ' ' + String.fromCharCode(10);
huh+='height: ' + arecto.height + ' ' + brecto.height + ' ' + crecto.height + ' ' + String.fromCharCode(10);
if (iois.id == 'ifright') {
elesa[ivb].style.left='50px';
subsups=aconto.getElementsByTagName('su' + aconto.body.innerHTML.split('</su')[1].split('>')[0]);
brecto=subsups[0].getBoundingClientRect();
crecto=subsups[eval(-1 + subsups.length)].getBoundingClientRect();
//prompt(huh,'two;' + iois.id);
}
aconto.getElementById('mycontainer').style.width=aconto.getElementById('mycontainer').style.height; //'' + eval(eval('' + crecto.right) + 0 + eval(0.0 * eval('' + crecto.width))) + 'px';
//aconto.body.innerHTML+='<div style="position:absolute;left:' + Math.max(0,arecto.left) + 'px;bottom:' + arecto.bottom + 'px;width:' + brecto.right + 'px;height:' + brecto.height + 'px;background-color:rgba(0,255,0,0.5);"></div>';
if (iois.id == 'ifright') {
oktolook=false;
var xtdcrect=null;
if (document.getElementById('ifleft')) {
xtdcrect=document.getElementById('ifleft').getBoundingClientRect();
} else {
xtdcrect=document.getElementById('tdcontainer').getBoundingClientRect();
}
iois.style.top='' + xtdcrect.top + 'px';
iois.style.left='' + xtdcrect.left + 'px';
elesa=aconto.getElementsByTagName(aconto.body.innerHTML.split('<')[2].split(' ')[0].split('>')[0]);
subsups=aconto.getElementsByTagName('su' + aconto.body.innerHTML.split('</su')[1].split('>')[0]);
arecto=elesa[ivb].getBoundingClientRect();
brecto=subsups[0].getBoundingClientRect();
crecto=subsups[eval(-1 + subsups.length)].getBoundingClientRect();
//aconto.getElementById('mycontainer').style.width='' + eval(eval('' + crecto.right) + 0 + eval(0.0 * eval('' + crecto.width))) + 'px';
for (var iozp=0; iozp<15; iozp++) {
elesa[0].innerHTML.replace(subsups[eval(-1 + subsups.length)].outerHTML, subsups[eval(-1 + subsups.length)].outerHTML.replace('</sup>','') + subsups[eval(-1 + subsups.length)].outerHTML + '</sup>');
}
huh='arecto brecto crecto ' + String.fromCharCode(10);
huh+=' left: ' + arecto.left + ' ' + brecto.left + ' ' + crecto.left + ' ' + String.fromCharCode(10);
huh+=' top: ' + arecto.top + ' ' + brecto.top + ' ' + crecto.top + ' ' + String.fromCharCode(10);
huh+=' x: ' + arecto.x + ' ' + brecto.x + ' ' + crecto.x + ' ' + String.fromCharCode(10);
huh+=' y: ' + arecto.y + ' ' + brecto.y + ' ' + crecto.y + ' ' + String.fromCharCode(10);
huh+=' width: ' + arecto.width + ' ' + brecto.width + ' ' + crecto.width + ' ' + String.fromCharCode(10);
huh+='height: ' + arecto.height + ' ' + brecto.height + ' ' + crecto.height + ' ' + String.fromCharCode(10);
//prompt(huh,'tWo;' + iois.id);
aconto.getElementById('xbr').style.position='absolute';
aconto.getElementById('xbr').style.left='33px';
aconto.getElementById('xbr').style.top='40px';
aconto.getElementById('xbr').style.width='276px';
aconto.getElementById('xbr').style.height='276px';
aconto.getElementById('xbr').style.backgroundColor='orange';
aconto.getElementById('xbr').title='Square 276 x 276';
rconto=aconto;
rconto.querySelectorAll('sup').forEach(xsub => {
xsub.addEventListener('click', () => {
alert('Diagonal to square 276 x 276 ... ' + (eval(276 / Math.sin(45))) + ' pixels long');
});
});
//subsups[eval(-1 + subsups.length)].title='Diagonal to square 276 x 276 ... ' + (eval(276 / Math.sin(45))) + ' pixels long';
//setTimeout(function(){ document.getElementById('precon').style.display='table-cell'; }, 3000);
enableScroll();
}
}
}
}
}
}

if (iois.id == 'ifright' && 5 == 7) {
var xtdcrect=parent.document.getElementById('ifleft').getBoundingClientRect();
iois.style.top='' + xrectcrect.top + 'px';
iois.style.left='' + xrectcrect.left + 'px';
}
}

function jccheck() {
if (document.URL.indexOf('justclock=') != -1) {
setTimeout(function() { document.getElementById('fibothone').scrollIntoView(); }, 15000);
}
if (document.URL.indexOf('justsquare=') != -1) {
setTimeout(function() { document.getElementById('prerrow').scrollIntoView(); }, 15000);
}


setTimeout(function(){
if (document.getElementById('taecll0001') && document.getElementById('taecll0002')) {
//alert(document.getElementById('taecll0001').value.replace(' style="',' style="margin-left:40px;'));
document.getElementById('mycontainer').innerHTML=document.getElementById('taecll0001').value.replace(' style="',' style="margin-left:40px;').replace(/rotate\(8/g, 'rotate(0').replace(/rotate\(\-8/g, 'rotate(0').replace(' id="', ' id=tl class="') + document.getElementById('taecll0002').value.replace(/rotate\(8/g, 'rotate(0').replace(/rotate\(\-8/g, 'rotate(0').replace(' id="', ' id=br class="');
var rectbr=document.getElementById('br').getBoundingClientRect();
document.getElementById('mycontainer').style.width='' + eval(0.70710678118 * eval(0.70710678118 * Math.sqrt((Math.abs(rectbr.width) * Math.abs(rectbr.width)) + (Math.abs(rectbr.height) * Math.abs(rectbr.height))))) + 'px';
document.getElementById('mycontainer').style.height='' + eval(0.70710678118 * eval(0.70710678118 * Math.sqrt((Math.abs(rectbr.width) * Math.abs(rectbr.width)) + (Math.abs(rectbr.height) * Math.abs(rectbr.height))))) + 'px';
sd=document.getElementById('taecll0001').value.replace(' style="',' style="margin-left:40px;').replace('margin-top:-256px;','').replace(/rotate\(8/g, 'rotate(0').replace(' id="', ' id=tl class="rotated-text-tl-to-br ');
sd=sd +'</div>' + document.getElementById('taecll0001').value.replace(' style="margin-left:40px;',' style="').replace('margin-top:-256px;','').replace(/rotate\(8/g, 'rotate(0').replace(' id="', ' id=xtl class="rotated-text-tl-to-br ').replace(/\ id\=\"/g, ' id="x').replace(/\ class\=\"/g, ' class="x').replace(' style="', ' style="padding-top:20px;opacity:0.2;color:transparent;');
sdtwo=document.getElementById('taecll0002').value.replace('margin-top:-256px;','').replace(/rotate\(8/g, 'rotate(0').replace(/rotate\(\-8/g, 'rotate(0').replace(/rotate\(\-8/g, 'rotate(0').replace(' id="', ' id=br class="rotated-text-bl-to-tr ');
sdtwo=sdtwo + '</div>' + document.getElementById('taecll0002').value.replace('margin-top:-256px;','').replace(/rotate\(8/g, 'rotate(0').replace(/rotate\(\-8/g, 'rotate(0').replace(/rotate\(\-8/g, 'rotate(0').replace(' id="', ' id=xbr class="rotated-text-bl-to-tr ').replace(/\ id\=\"/g, ' id="x').replace(/\ class\=\"/g, ' class="x').replace('color:blue;','').replace(' style="', ' style="margin-top:-256px;opacity:0.3;color:transparent;'); // used to be -520
setTimeout(function(){
var tdcrect=document.getElementById('tdcontainer').getBoundingClientRect();
document.getElementById('tdcontainer').innerHTML='<iframe frameborder=0 id=ifleft onload="analyze(this);" style=opacity:0.6;width:100%;height:100%;background-color:white; srcdoc="<style>' + document.getElementById('mystyle').innerHTML.replace('background-color: silver;',' ').replace(/\"/g,"'").replace('800px', '' + document.getElementById('mycontainer').style.width + '').replace('800px', '' + document.getElementById('mycontainer').style.height + '') + '</style>' + document.getElementById('mycontainer').outerHTML.split('>')[0].replace(' style="',' style="background-color:white;').replace(/\"/g,"'") + '>' + sd.replace(/\"/g,"'") + '</div>'.replace('</div>','') + '"></iframe>' + '<iframe frameborder=0 id=ifright onload="analyze(this);" style="position:absolute;top:' + tdcrect.top + 'px;left:' + tdcrect.left + 'px;opacity:0.6;width:100%;height:100%;background-color:white;" srcdoc="<style>' + document.getElementById('mystyle').innerHTML.replace('background-color: silver;',' ').replace(/\"/g,"'").replace('800px', '' + document.getElementById('mycontainer').style.width + '').replace('800px', '' + document.getElementById('mycontainer').style.height + '') + '</style>' + document.getElementById('mycontainer').outerHTML.split('>')[0].replace(' style="',' style="background-color:white;').replace(/\"/g,"'") + '>' + sdtwo.replace(/\"/g,"'").replace('margin-top:-256px;','').replace('margin-top:-256px;','') + '</div>'.replace('</div>','') + '"></iframe>';
//document.getElementById('rrow0001').innerHTML='<td id=tdcontainer colspan=2 style=text-align:center;><iframe frameborder=0 id=ifleft onload="analyze(this);" style=opacity:0.6;width:100%;height:100%;background-color:white; srcdoc="<style>' + document.getElementById('mystyle').innerHTML.replace('background-color: silver;',' ').replace(/\"/g,"'").replace('800px', '' + document.getElementById('mycontainer').style.width + '').replace('800px', '' + document.getElementById('mycontainer').style.height + '') + '</style>' + document.getElementById('mycontainer').outerHTML.split('>')[0].replace(' style="',' style="background-color:white;').replace(/\"/g,"'") + '>' + sd.replace(/\"/g,"'") + '</div>'.replace('</div>','') + '"></iframe>' + '<iframe frameborder=0 id=ifright onload="analyze(this);" style="position:absolute;top:' + tdcrect.top + 'px;left:' + tdcrect.left + 'px;opacity:0.6;width:100%;height:100%;background-color:white;" srcdoc="<style>' + document.getElementById('mystyle').innerHTML.replace('background-color: silver;',' ').replace(/\"/g,"'").replace('800px', '' + document.getElementById('mycontainer').style.width + '').replace('800px', '' + document.getElementById('mycontainer').style.height + '') + '</style>' + document.getElementById('mycontainer').outerHTML.split('>')[0].replace(' style="',' style="background-color:white;').replace(/\"/g,"'") + '>' + sdtwo.replace(/\"/g,"'").replace('margin-top:-256px;','').replace('margin-top:-256px;','') + '</div>'.replace('</div>','') + '"></iframe></td>';
}, 2000);
}
}, 2000);
}

Yet again, feel free to try out the changed third draft Nested Diagonal Elements web application with it’s analogue clock or it’s square diagonals below.


Previous relevant Diagonal Element Nesting Tutorial is shown below.

Diagonal Element Nesting Tutorial

Diagonal Element Nesting Tutorial

A variation on yesterday’s Nesting Primer Tutorial, as well as being inspired by that work is today’s …

  1. diagonal element … via …
  2. nested …
    • display: inline;
    • display: inline-block;

    • sub topleft to bottomright diagonal componentry element look
    • sup bottomleft to topright diagonal componentry element look

    … we noticed working (ie. achieving nested “diagonality“) yesterday

… functionality. Yes, this might be thought of as “overkill” compared to …

  • hr element rotations … and/or …
  • SVG

… arguably easier means to achieve a “diagonal element” look. Nevertheless, the more ways to achieve an objective up your sleeve, the better, we reckon!

Again, feel free to try out this proof of concept Nested Diagonal Elements web application below …


Previous relevant Nesting Primer Tutorial is shown below.

Nesting Primer Tutorial

Nesting Primer Tutorial

The text (which can include emojis) …

  • display: inline;
  • display: inline-block;

… HTML elements are endlessly fascinating in our eyes, regarding the “nesting” of elements.

You can read all you like about this at a website like W3schools but we find endless surprises, so we decided to code for a web application with scope within a table cell “parent” element …

  • reinitialize (ie. append) span or p or font or sup or sub or font or h1 or h2 or h3 or h4 or div element to the end of table cell content
  • nest span or p or font or sup or sub or font or h1 or h2 or h3 or h4 or div element onto the end of the most outer table cell element’s content within the table cell content, or a clicked element flagged with a pink background

We find it interesting changing up the choice above and font-size and new element content textbox settings and seeing what happens. You see the resultant HTML innards below in a textarea element which changes to are reflected above (and in this way, you can pick an element type not listed above, if you like), as are changes to second and on table cell content’s on the top row.

Feel free to try out this proof of concept Nesting web application below …

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 eLearning, Event-Driven Programming, iOS, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment