MAMP Timekeeping Web Application Audio Commentary Tutorial
The recent MAMP Timekeeping Web Application PHP Notifications Tutorial โs Timekeeping via Screenshots changedโช quarter_hour_timer.html (latest) versus quarter_hour_timer.html---------GETME (this) quarter_hour_timer.html---------GETME (this) versus quarter_hour_timer.html--------GETME (previous ... default) quarter_hour_timer.html---------GETME (this) versus quarter_hour_timer.html-------GETME quarter_hour_timer.html---------GETME (this) versus quarter_hour_timer.html------GETME quarter_hour_timer.html---------GETME (this) versus quarter_hour_timer.html-----GETME quarter_hour_timer.html---------GETME (this) versus quarter_hour_timer.html----GETME quarter_hour_timer.html---------GETME (this) versus quarter_hour_timer.html---GETME quarter_hour_timer.html---------GETME (this) versus quarter_hour_timer.html--GETME quarter_hour_timer.html---------GETME (this) versus quarter_hour_timer.html-GETME quarter_hour_timer.html---------GETME (this) versus quarter_hour_timer.html_GETME quarter_hour_timer.html (latest) versus quarter_hour_timer.html_GETME (oldest) HTML and Javascript quarter_hour_timer html (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Web Application supervisor is another very suitable candidate for interfacing to our recent Webpage Audio Commentary functionality. Both โฆ
โฆ share an โฆ
underlying macOS or Mac OS X operating system dependence โฆ
underlying local web server such as MAMP โฆ
downloaded into that local web server Document Root folder PHP code
โฆ set of interest points for full and useful functionality, because of two macOS or Mac OS X commands, respectively โฆ
We add theโช macos_say_record.js (latest) versus macos_say_record.js---GETME (this) macos_say_record.js---GETME (this) versus macos_say_record.js--GETME (previous ... default) macos_say_record.js---GETME (this) versus macos_say_record.js-GETME macos_say_record.js---GETME (this) versus macos_say_record.js_GETME macos_say_record.js (latest) versus macos_say_record.js_GETME (oldest) changed macos_say_record js external Javascript call into the supervisory HTML and Javascript <head></head> webpage section via โฆ
<script type='text/javascript' src='//www.rjmprogramming.com.au/macos_say_record.js?ongoing= 1721156687576' defer></script>
โฆ sitting up at the Document Root of your public domain, that โ?ongoing=โ based $_GET[โongoingโ] argument deliberate, effectively asking the code to look out for โon the flyโ HTML elements created within an execution run of the webpage.
We add some โsmartsโ to those global data attribute usage we talked about at Webpage macOS Say Audio Commentary Access Count Tutorial , allowing some โdate extractionโ templating via the supervisory HTML and Javascript array declaration as per โฆ
<script type='text/javascript'> var commentary_array=['textarea', 'You can enter comments about this screenshot here %value%outerHTML%@yyyymmdd%hhmm% .', 'img', 'Timekeeper screenshot here %id%@yyyymmdd%hhmm% .']; </script>
โฆ where the first field describes an HTML element attribute to first look at, the optional second is a stand by attribute, followed by โdate extractionโ fields to match with numerical data found so as to substitute the blue parts with a โdate and timestampโ string.
MAMP Timekeeping Web Application PHP Notifications Tutorial MAMP Timekeeping Web Application Audio Commentary Tutorial Mac OS MAMP Timekeeping Web Application PHP Calendar Aesthetics Tutorial Mac OS MAMP Timekeeping Web Application PHP Calendar Windows Tutorial Mac OS MAMP Timekeeping Web Application PHP Calendar iCal Integration Tutorial Mac OS MAMP Timekeeping Web Application PHP Calendar Contenteditable Tutorial Mac OS MAMP Timekeeping Web Application PHP Calendar Past Tutorial Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial Mac OS X MAMP Timekeeping Web Application Email Tutorial Mac OS X MAMP Timekeeping Web Application Primer Tutorial Mac OS X Text to English Speech Primer Tutorial
Previous relevant MAMP Timekeeping Web Application PHP Notifications Tutorial is shown below.
MAMP Timekeeping Web Application PHP Notifications Tutorial
Today weโre revisiting the macOS (or Mac OS X) or Windows timekeeping web application of 2016โs Mac OS MAMP Timekeeping Web Application PHP Calendar Aesthetics Tutorial . Why? Well, given our recent work with Notifications API based web applications you can read about at Notification API Hidden Popup Tutorial , the timekeeping one is a great candidate for functionality improvement here, it being a web application that โฆ
can work behind the scenes โฆ
not necessarily frontmost โฆ but benefitting from any โฆ
notification reminders separate from web activities and webpage focus issues can help tell the user when they might want to turn back attention to the timekeeping screenshot recording
This needs PHP to work and it needs real access via PHP exec function to underlying operating system commands. When this happens, we still try to offer a public RJM Programming interface but this interface is far less useful if you have not downloaded to your local Apache/PHP/MySql local web server (such as a MAMP one) as per โฆ
theโช quarter_hour_timer.php (latest) versus quarter_hour_timer.php---------GETME (this) quarter_hour_timer.php---------GETME (this) versus quarter_hour_timer.php--------GETME (previous ... default) quarter_hour_timer.php---------GETME (this) versus quarter_hour_timer.php-------GETME quarter_hour_timer.php---------GETME (this) versus quarter_hour_timer.php------GETME quarter_hour_timer.php---------GETME (this) versus quarter_hour_timer.php-----GETME quarter_hour_timer.php---------GETME (this) versus quarter_hour_timer.php----GETME quarter_hour_timer.php---------GETME (this) versus quarter_hour_timer.php---GETME quarter_hour_timer.php---------GETME (this) versus quarter_hour_timer.php--GETME quarter_hour_timer.php---------GETME (this) versus quarter_hour_timer.php-GETME quarter_hour_timer.php---------GETME (this) versus quarter_hour_timer.php_GETME quarter_hour_timer.php (latest) versus quarter_hour_timer.php_GETME (oldest) changed quarter_hour_timer php (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage
the unchanged (from tutorial below, supervisory HTML and Javascript) quarter_hour_timer html (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application
theโช notifications_ideas.php (latest) versus notifications_ideas.php-----GETME (this) notifications_ideas.php-----GETME (this) versus notifications_ideas.php----GETME (previous ... default) notifications_ideas.php-----GETME (this) versus notifications_ideas.php---GETME notifications_ideas.php-----GETME (this) versus notifications_ideas.php--GETME notifications_ideas.php-----GETME (this) versus notifications_ideas.php-GETME notifications_ideas.php-----GETME (this) versus notifications_ideas.php_GETME notifications_ideas.php (latest) versus notifications_ideas.php_GETME (oldest) โhow we got thereโ PHP notifications_ideas php (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] subfolder) Notification API functionality PHP web application
โฆ in what we like to call an โIntranet feelingโ scenario.
Up at the public RJM Programming domain, as far as the Notification API functionality supervisor webpage goes, theโช notifications_ideas.html (latest) versus notifications_ideas.html----GETME (this) notifications_ideas.html----GETME (this) versus notifications_ideas.html---GETME (previous ... default) notifications_ideas.html----GETME (this) versus notifications_ideas.html--GETME notifications_ideas.html----GETME (this) versus notifications_ideas.html-GETME notifications_ideas.html----GETME (this) versus notifications_ideas.html_GETME notifications_ideas.html (latest) versus notifications_ideas.html_GETME (oldest) changed HTML and Javascript notifications_ideas html Notification API functionality HTML and Javascript web application is worth trying.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Aesthetics Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Aesthetics Tutorial
To finish up our revisit to the Timekeeping web application of the recent Mac OS MAMP Timekeeping Web Application PHP Calendar Iframe Tutorial we โฆ
make some styling calendar tweaks โฆ
<style> td { vertical-align: top; } #divmc { background-color: #ffffff; } p:not(:empty) { border: 1px dotted red; } td { text-align: center; vertical-align: top; } th { background-color: cyan; } #thyear { background-color: pink; } div { word-wrap: break-word; } .adaNOte { border: 3px solid pink; border-radius: 7px; } a.adate { border:2px solid transparent; background-color:lightgreen; border-radius:50px; } </style>
settle for mobile platforms never being able to screenshot, on this round of looking, and redirecting to the โMonthly Chroniclerโ web application (of (the unchanged) monthly_chronicler html we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) โฆ
<script> if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|iPad|Opera Mini|IEMobile/i)) { document.write("<scri" + "pt> location.href='./monthly_chronicler.html'; </scr" + "ipt> <style> a.adate { border:1px solid green; background-color:#f0f0f0; border-radius:50px; } </style> <table id=mtable style=display:none;width:95%;><tr><th><input style=width:450px; placeholder='' id=iask type=text value=''></input><</th><th><input onclick=\" document.getElementById('mtable').style.display='none'; document.getElementById('mybod').style.opacity='1.0'; postask(document.getElementById('iask'));\" type=button value=OK></input></th><th><input onclick=\"document.getElementById('iask').value=''; document.getElementById('mtable').style.display='none'; document.getElementById('mybod').style.opacity='1.0'; \" type=button value=Cancel></input></th></tr></table>"); } </script>
โฆ dumbing down, but working more reliably, using โJavascript writes Javascriptโ methodology
Again, feel free to try theโช quarter_hour_timer.html (latest) versus quarter_hour_timer.html--------GETME (this) quarter_hour_timer.html--------GETME (this) versus quarter_hour_timer.html-------GETME (previous ... default) quarter_hour_timer.html--------GETME (this) versus quarter_hour_timer.html------GETME quarter_hour_timer.html--------GETME (this) versus quarter_hour_timer.html-----GETME quarter_hour_timer.html--------GETME (this) versus quarter_hour_timer.html----GETME quarter_hour_timer.html--------GETME (this) versus quarter_hour_timer.html---GETME quarter_hour_timer.html--------GETME (this) versus quarter_hour_timer.html--GETME quarter_hour_timer.html--------GETME (this) versus quarter_hour_timer.html-GETME quarter_hour_timer.html--------GETME (this) versus quarter_hour_timer.html_GETME quarter_hour_timer.html (latest) versus quarter_hour_timer.html_GETME (oldest) changed quarter_hour_timer html (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a โmobileโช quarter_hour_timer.php (latest) versus quarter_hour_timer.php--------GETME (this) quarter_hour_timer.php--------GETME (this) versus quarter_hour_timer.php-------GETME (previous ... default) quarter_hour_timer.php--------GETME (this) versus quarter_hour_timer.php------GETME quarter_hour_timer.php--------GETME (this) versus quarter_hour_timer.php-----GETME quarter_hour_timer.php--------GETME (this) versus quarter_hour_timer.php----GETME quarter_hour_timer.php--------GETME (this) versus quarter_hour_timer.php---GETME quarter_hour_timer.php--------GETME (this) versus quarter_hour_timer.php--GETME quarter_hour_timer.php--------GETME (this) versus quarter_hour_timer.php-GETME quarter_hour_timer.php--------GETME (this) versus quarter_hour_timer.php_GETME quarter_hour_timer.php (latest) versus quarter_hour_timer.php_GETME (oldest) platform checkโ changed quarter_hour_timer php PHP (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) for you to try out on your MAMP macOS environment, or all showing up at an RJM Programming public domain webpage, in an iframe element, visible now.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Windows Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Windows Tutorial
Did you notice that the โTimekeepingโ PHP did not have to change for yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Calendar iCal Integration Tutorial ?
But the PHP is theโช quarter_hour_timer.php (latest) versus quarter_hour_timer.php-----GETME (this) quarter_hour_timer.php-----GETME (this) versus quarter_hour_timer.php----GETME (previous ... default) quarter_hour_timer.php-----GETME (this) versus quarter_hour_timer.php---GETME quarter_hour_timer.php-----GETME (this) versus quarter_hour_timer.php--GETME quarter_hour_timer.php-----GETME (this) versus quarter_hour_timer.php-GETME quarter_hour_timer.php-----GETME (this) versus quarter_hour_timer.php_GETME quarter_hour_timer.php (latest) versus quarter_hour_timer.php_GETME (oldest) change agent for Windows (client) integration called quarter_hour_timer php today โฆ
<?php
// blah top$lportbit=":8888"; $user_agent = $_SERVER["HTTP_USER_AGENT"]; function getOS() { // thanks to https://www.daniweb.com/programming/web-development/threads/495588/getting-users-os-info-out-of-server-http-user-agent global $user_agent, $lportbit; $os_platform = "win Unknown OS Platform"; $os_array = array( '/windows nt 10/i' => 'Windows 10', '/windows nt 6.3/i' => 'Windows 8.1', '/windows nt 6.2/i' => 'Windows 8', '/windows nt 6.1/i' => 'Windows 7', '/windows nt 6.0/i' => 'Windows Vista', '/windows nt 5.2/i' => 'Windows Server 2003/XP x64', '/windows nt 5.1/i' => 'Windows XP', '/windows xp/i' => 'Windows XP', '/windows nt 5.0/i' => 'Windows 2000', '/windows me/i' => 'Windows ME', '/win98/i' => 'Windows 98', '/win95/i' => 'Windows 95', '/win16/i' => 'Windows 3.11', '/macintosh|mac os x/i' => 'Mac OS X', '/mac_powerpc/i' => 'Mac OS 9', '/linux/i' => 'Linux', '/ubuntu/i' => 'Ubuntu', '/iphone/i' => 'iPhone', '/ipod/i' => 'iPod', '/ipad/i' => 'iPad', '/android/i' => 'Android', '/blackberry/i' => 'BlackBerry', '/webos/i' => 'Mobile' ); foreach ($os_array as $regex => $value) { if (preg_match($regex, $user_agent)) { $os_platform = $value; } } return $os_platform; } $callornot="call "; $precmds=""; $impreexe="screenCapture"; //"import"; $switches=""; //" -window root "; if (substr(strtoupper(getOS()),0,3) === 'WIN') { $lportbit=""; if (file_exists($_SERVER['DOCUMENT_ROOT'] . "\\" . $impreexe . ".exe")) { $precmds=$_SERVER['DOCUMENT_ROOT'] . "\\"; } else { foreach (glob("C:\\Users\\*\\" . $impreexe . ".exe") as $infl) { $precmds=explode($impreexe . ".exe", $infl)[0]; } } } // blah blah some other PHP functions if (isset($_GET['yourta'])) { // calendar work } else if (isset($_GET['myta'])) { // embed image metadata } else if (isset($_POST['myta'])) { // parse image metadata } else if ($lportbit != "") { exec("/usr/sbin/screencapture -Cd -tjpg " . $_SERVER['DOCUMENT_ROOT'] . "/screen-`date +\"%Y%m%d-%H%M\"`.jpg"); } else { if (isset($_GET['tz'])) { $tzis=str_replace('+','_',urldecode($_GET['tz'])); if (strpos($tzis, "/") !== false) { date_default_timezone_set($tzis); } } $dateis = date('Ymd-Hi'); if (file_exists($_SERVER['DOCUMENT_ROOT'] . "\\screenCapture.jpg")) { exec('copy ' . '"' . $_SERVER['DOCUMENT_ROOT'] . "\\screenCapture.jpg" . '" "' . $_SERVER['DOCUMENT_ROOT'] . "\\screen-" . $dateis . '.jpg"'); // exec('erase ' . '"' . $_SERVER['DOCUMENT_ROOT'] . "\\screenCapture.jpg" . '"'); } else { exec($callornot . '"' . $precmds . $impreexe . '.exe" ' . $switches . ' "' . $_SERVER['DOCUMENT_ROOT'] . "\\screen-" . $dateis . '.jpg"'); } } exit;
?>
โฆ which you may glean has a Windows โfallbackโ position (with that โcopyโ codeline). Why? Well, we found a .Net framework โexe creation via batโ using ScreenCapture bat (thanks to this useful link ) created black screen shots. Probably a privilege thing or PHP exec thing, but weโve opted for the workaround, which is just โWindows talkโ โฆ
write Windows batch scapcontinuous bat as a continuous fifteen minute user of the .Net Framework (ScreenCapture.exe) derived from above
set up a task via โTask Schedularโ (please ignore the warts โn all โgarden pathโ schtask ideas in the video below) that has an action โC:\MAMP\htdocs\scapcontinuous.batโ and starts when the Windows user logs in and takes (successful) screen shots at 14 and 29 and 44 and 59 minutes (in the hour) times
Take a more detailed look at โwarts โn allโ crab progression towards the Windows (client) solution, below โฆ
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar iCal Integration Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar iCal Integration Tutorial
Yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Calendar Contenteditable Tutorial โs โCalendar Pastโ improvements donโt have to be the end of the story regarding โcalendar timingsโ. There is an Apple iCal standard interfacing format that can drive calendar integrations with many well known online Calendar applications.
You may recall us talking about this with Calendar Location Services Integration Tutorial and we tweak theโช ics_attachment.php (latest) versus ics_attachment.php----GETME (this) ics_attachment.php----GETME (this) versus ics_attachment.php---GETME (previous ... default) ics_attachment.php----GETME (this) versus ics_attachment.php--GETME ics_attachment.php----GETME (this) versus ics_attachment.php-GETME ics_attachment.php----GETME (this) versus ics_attachment.php_GETME ics_attachment.php (latest) versus ics_attachment.php_GETME (oldest) changed ics_attachment php (which weโd ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โPHPโ subfolder) and its standalone ical creator to better integrate with theโช quarter_hour_timer.html (latest) versus quarter_hour_timer.html------GETME (this) quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html-----GETME (previous ... default) quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html----GETME quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html---GETME quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html--GETME quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html-GETME quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html_GETME quarter_hour_timer.html (latest) versus quarter_hour_timer.html_GETME (oldest) changed quarter_hour_timer html (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage.
This bit of functionality works (interfacing) both with MAMP and with the public RJM Programming domain incarnation of the Timekeeping web application, so that could be interesting. It can interface via โฆ
Future Calendar Entries via Iframe Future Calendar Entries via Popup No Future Calendar Entries All Calendar Entries via Iframe All Calendar Entries via Popup
โฆ modes of use. In action, should you create an iCal file this way, the web application will download the resultant .ics file into your Downloads folder and to interface into your default online Calendar application double click that Downloads folder file to complete the Calendar integration โฆ
function icalpostit(tl, tg) { var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); var hh = today.getHours(); var minm = today.getMinutes(); //January is 0! //if (icalavailable) { alert('is ' + ('' + yyyy + ('00' + mm).slice(-2) + ('00' + dd).slice(-2) ) + ' >= ' + tl.substring(1)); } if ((document.getElementById('yics').value.indexOf('all') != -1 || tl.substring(1) >= ('' + yyyy + ('00' + mm).slice(-2) + ('00' + dd).slice(-2) )) && icalavailable && document.getElementById('yics').value != '') { if (document.getElementById('yics').value.indexOf('nw') != -1) { icald=tl.substring(1) + ':' + ('00' + hh).slice(-2) + ('00' + minm).slice(-2) + '59'; icalg=tg; if (icalwo != null) { icalwo.close(); icalwo=null; } icalwo=window.open('../PHP/ics_attachment.php','_blank','top=100,left=100,width=740,height=800'); if (1 == 1) { setTimeout(icalw, 3000); } else { icalwo.document.getElementById('datestart').value=icald; icalwo.document.getElementById('dateend').value=icald; icalwo.document.getElementById('eventwords').value=icalg.replace(/\<br\>/g, String.fromCharCode(10)).replace(/\<Br\>/g, String.fromCharCode(10)).replace(/\<BR\>/g, String.fromCharCode(10)); if (document.URL.indexOf('localhost') != -1) { var jcald=icalg.replace(/\<br\>/g, String.fromCharCode(10)).replace(/\<Br\>/g, String.fromCharCode(10)).replace(/\<BR\>/g, String.fromCharCode(10)).replace(/\ \;>/g, ' '); while (jcald.indexOf(String.fromCharCode(10)) != -1) { jcald=jcald.replace(String.fromCharCode(10),' '); } icalwo.document.getElementById('title').value=jcald; } else { icalwo.document.getElementById('title').value='Calendar event at ' + icald; } icalwo.document.getElementById('description').value='Calendar event at ' + icald; icalwo.document.getElementById('address').value=document.URL.split('?')[0].split('#')[0]; icalwo.document.getElementById('mmdatestart').value=icald.substring(4,6); icalwo.document.getElementById('mmdateend').value=icald.substring(4,6); icalwo.document.getElementById('dddatestart').value=icald.substring(6,8); icalwo.document.getElementById('dddateend').value=icald.substring(6,8); icalwo.document.getElementById('ssdatestart').value='59'; icalwo.document.getElementById('ssdateend').value='59'; icalwo.document.getElementById('yyyydatestart').value=icald.substring(0,4); icalwo.document.getElementById('yyyydateend').value=icald.substring(0,4); if ( ('' + today.getTimezoneOffset()).replace('null','').replace('undefined','') != '' ) { //alert(('' + eval(eval('' + qd.getTimezoneOffset()) / 60.0)).replace('.00','').replace('.0','')); icalwo.document.getElementById('tz').value=('' + eval(eval('' + today.getTimezoneOffset()) / 60.0)).replace('.00','').replace('.0',''); } //icalwo.document.getElementById('pform').onsubmit=function() { window.opener.document.getElementById('icalstatus').innerHTML=' '; return true; }; } } else if (document.getElementById('yics').value.indexOf('if') != -1) { icald=tl.substring(1) + ':' + ('00' + hh).slice(-2) + ('00' + minm).slice(-2) + '59'; icalg=tg; document.getElementById('divics').style.display='block'; document.getElementById('divics').style.width='100%'; document.getElementById('divics').style.height='800px'; document.getElementById('icslocit').style.display='block'; document.getElementById('icslocit').style.width='100%'; document.getElementById('icslocit').style.height='800px'; document.getElementById('icslocit').src='../PHP/ics_attachment.php?rand=' + Math.floor(Math.random() * 19876564); } else { var xzhr = new XMLHttpRequest(); var xform=new FormData(); xform.append('icald',tl.substring(1) + ':' + ('00' + hh).slice(-2) + ('00' + minm).slice(-2) + '59'); xform.append('icalc',tg); xzhr.open('post','./quarter_hour_timer.php',true); xzhr.send(xform); } } }
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Contenteditable Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Contenteditable Tutorial
Weโve spoken quite a bit in the past about the joys of involving the โcontenteditable =true โ attribute for HTML elements that have an โinnerHTMLโ (ie. they have a formalized end tag arrangement eg. div, span, p, td, th etcetera) and with todayโs work which extends that started with yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Calendar Past Tutorial it is the turn of a set of โpโ elements it helps out today.
The scenario is that yesterdayโs work did not allow for โorphaned screenshotsโ of the past be allowed to be brought back into play to โannotate themโ and in so doing โgive them a homeโ. This led us to โฆ
allow for a new โInfill Earlier Days All Screenshotsโ button augment yesterday โs โInfill Earlier Days Just Annotated Screenshotsโ button โฆ
the pressing of that new โInfill Earlier Days All Screenshotsโ button causes all screenshot 15 minute entries relevant to the current year be displayed in the calendar โฆ but then it occurred to us users might want to โannotate themโ โฆ but how? โฆ
in the PHP we introduced code โฆ
<?php
if (isset($_GET['yourta'])) { $dru="//" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/"; $cet=""; if (strlen($_GET['yourta']) != 0) { $cet=" contenteditable=true onblur=repostit(this); onfocus=wopen(event,false); "; } // blah blah blah $ccpre="" . $cet . " onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-repeat:no-repeat;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); onmouseover=wopen(event,true); onmouseout=wopen(event,false); title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">"; // blah blah blah }
?>
โฆ to, when an โorphanedโ screen shot image is happened upon, allows โฆ
contenteditable =true โdoes its stuffโ turning might might have been a pretty unintelligent HTML element into a โtextareaโ type collector of user input, and then that onblur event logicโs โmidair feelingโ Ajax /FormData โrecursive feelingโ methodology โฆ
function repostit(ih) { var ihis=(ih.innerText || ih.contentWindow || ih.contentDocument); var pathpart=ih.id; if (ihis != '') { var xzhr = new XMLHttpRequest(); var xform=new FormData(); xform.append('myta',ihis); xform.append(pathpart.split('.')[0].replace('ip_','screen-').replace('_','-'),''); xzhr.open('post','./quarter_hour_timer.php',true); xzhr.send(xform); } }
โฆ which can cement that (newly user entered) annotation into future permanency in the โYearly Report Calendarโ section
โฆ of theโช quarter_hour_timer.html (latest) versus quarter_hour_timer.html------GETME (this) quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html-----GETME (previous ... default) quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html----GETME quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html---GETME quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html--GETME quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html-GETME quarter_hour_timer.html------GETME (this) versus quarter_hour_timer.html_GETME quarter_hour_timer.html (latest) versus quarter_hour_timer.html_GETME (oldest) changed quarter_hour_timer html (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a contenteditable=trueโช quarter_hour_timer.php (latest) versus quarter_hour_timer.php----GETME (this) quarter_hour_timer.php----GETME (this) versus quarter_hour_timer.php---GETME (previous ... default) quarter_hour_timer.php----GETME (this) versus quarter_hour_timer.php--GETME quarter_hour_timer.php----GETME (this) versus quarter_hour_timer.php-GETME quarter_hour_timer.php----GETME (this) versus quarter_hour_timer.php_GETME quarter_hour_timer.php (latest) versus quarter_hour_timer.php_GETME (oldest) changed quarter_hour_timer php PHP (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) for you to try out on your MAMP macOS environment.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Past Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Past Tutorial
If youโve been using the Timekeeping web application as of yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial you would have noticed a very โฆ
first person
present tense
โฆ feel to it all. Today, we improve on the latter โrestrictivenessโ issue, within yesterdayโs โYearly Report Calendarโ new functionality, by looking back into the current calendar yearโs โpastโ with respect to the date of using the web application, whether that be โฆ
screen captures from days in the current calendar yearโs โpastโ
text entries made and remembered (in window.localStorage ) in the current calendar yearโs โpastโ
โฆ to infill and flesh out that โYearly Report Calendarโ better. This involved bringing over a lot of (the unchanged) monthly_chronicler html โs Javascript logic into theโช quarter_hour_timer.html (latest) versus quarter_hour_timer.html-----GETME (this) quarter_hour_timer.html-----GETME (this) versus quarter_hour_timer.html----GETME (previous ... default) quarter_hour_timer.html-----GETME (this) versus quarter_hour_timer.html---GETME quarter_hour_timer.html-----GETME (this) versus quarter_hour_timer.html--GETME quarter_hour_timer.html-----GETME (this) versus quarter_hour_timer.html-GETME quarter_hour_timer.html-----GETME (this) versus quarter_hour_timer.html_GETME quarter_hour_timer.html (latest) versus quarter_hour_timer.html_GETME (oldest) changed quarter_hour_timer html (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a calendarโsโช quarter_hour_timer.php (latest) versus quarter_hour_timer.php---GETME (this) quarter_hour_timer.php---GETME (this) versus quarter_hour_timer.php--GETME (previous ... default) quarter_hour_timer.php---GETME (this) versus quarter_hour_timer.php-GETME quarter_hour_timer.php---GETME (this) versus quarter_hour_timer.php_GETME quarter_hour_timer.php (latest) versus quarter_hour_timer.php_GETME (oldest) past integrationally changed quarter_hour_timer php PHP (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) for you to try out on your MAMP macOS environment.
<?php
// quarter_hour_timer.php // RJM Programming // December, 2021if (isset($_GET['yourta'])) { $dru="HTTP://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/"; $contis=str_replace('+',' ',urldecode($_GET['yourta'])); //file_put_contents('xx.xx', $contis); $htmlis=''; $myf=''; $backi=''; $cali=''; $taback=''; $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'"; if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); } if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); } foreach ($_GET as $name=>$val) { if ($name != 'yourta') { // && $val == '') { //echo $name; $orig=$name; $myf=$name; for ($imh=12; $imh>=1; $imh--) { for ($idd=31; $idd>=1; $idd--) { //file_put_contents('xz.xz',$orig . ' Is ' . substr('00' . $imh,-2,2) . substr('00' . $idd,-2,2) . ' less than ' . $val); if (substr('00' . $imh,-2,2) . substr('00' . $idd,-2,2) < $val) { for ($ihh=0; $ihh<=23; $ihh++) { for ($imm=0; $imm<=45; $imm+=15) { //if ($ihh != 0 || $imm != 0) { $myf=str_replace("0101_", substr('00' . $imh,-2,2) . substr('00' . $idd,-2,2) . "_",$orig); $myf=str_replace("_0000", "_" . substr('00' . $ihh,-2,2) . substr('00' . $imm,-2,2),$myf); //} $taback=str_replace('-','_',str_replace('itd','tatd',$myf)); $backi=str_replace('-','_',str_replace('screen-','itd_',$myf)); $cali=str_replace('-','',str_replace('screen-','td',$myf)); $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0]; // Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html // Path to jpeg file $path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg'; //file_put_contents('x.x',$path); if (file_exists($path)) { $capt = ""; // Thanks to https://www.php.net/manual/en/function.iptcparse.php $size = getimagesize( $path, $info ); if (isset($info["APP13"])) { //file_put_contents('xx.xx',$path); if ($iptc = iptcparse( $info["APP13"] ) ) { //file_put_contents('xxx.xxx',$path); $capt = str_replace( "\000", "", $iptc["2#120"][0] ); //file_put_contents('xxxx.xxxx',$capt); } } $bcontis="" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . ""; $ccpre="<p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-repeat:no-repeat;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); onmouseover=wopen(event,true); onmouseout=wopen(event,false); title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">"; $ccpost="</p>"; $ccontis="<br><p style='background-color:orange; title='" . str_replace('td','p',$cali) . "' id=" . str_replace('td','p',$cali) . ">" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "<br>", str_replace("\r\n", "<br>", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "</p>"; //file_put_contents('xxxxx.xxxxx',$bcontis); //file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi); //file_put_contents('xxxxxxx.xxxxxxx',"parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; "); } if ($bcontis != "''" && $bcontis != "") { if ($htmlis == '') { $htmlis="<html><head><script type=text/javascript> var imois=null, iwo=null; function wopen(event,overvsout) { if (!overvsout) { if (imois == event.target) { imois=null; } return; } imois=event.target; setTimeout(postwopen, 2000); } function postwopen() { var pois=imois; if (pois.outerHTML.indexOf('URL(') != -1) { window.open(pois.outerHTML.split('URL(')[1].split(')')[0].replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),''),'_blank','top=50,left=50,width=600,height=600'); } }</script></head><body onload=\" var huhg=''; if (parent.document.getElementById('" . $idcali . "')) { huhg='" . $ccpre . $bcontis . $ccpost . "'; while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>'); } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } \"></body></html>"; } else if (strpos($htmlis, $bcontis) === false) { $htmlis=str_replace("+=huhg; }", "+=huhg; huhg='" . $ccpre . $bcontis . $ccpost . "'; while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>'); } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; }", $htmlis); } } } } if ($htmlis != "") { echo $htmlis; } } } } } } } // blah else if blah else if blah
?>
โฆ which you may notice implements a โlong hoverโ window.open scenario (using non-mobile platforms) for screenshot images on the calendar by combining the use of โฆ
global variables โฆ
var imois=null; var iwo=null;
onmouseover event logic โฆ
Call
onmouseover=wopen(event,true);
setTimeout delays โฆ
Called
function wopen(event,overvsout) { if (!overvsout) { if (imois == event.target) { imois=null; } return; } imois=event.target; setTimeout(postwopen, 2000); } function postwopen() { //pois) { if (imois) { var pois=imois; if (pois.outerHTML.indexOf('URL(') != -1) { if (iwo) { iwo.close(); iwo=null; } iwo = window.open(pois.outerHTML.split('URL(')[1].split(')')[0].replace(String.fromCharCode(34), '').replace(String.fromCharCode(34), ''), '_blank', 'top=50,left=50,width=600,height=600'); } } }
onmouseout event logic โฆ
Call
onmouseout=wopen(event,false);
โฆ so that this logic is not responsible for clobbering the default โhoverโ shows of the โpโ element โtitleโ attribute with the onmouseover event for non-mobile platforms.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial
Okay then, yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial โimage metadata smartsโ puts us in a position to get onto the โbells and whistlesโ side of our Timekeeping (macOS and Mac OS X only at this stage) web application. We channel the calendar display talents of Monthly Chronicler LocalStorage Tutorial in thought and act (its web application is opened in an iframe โฆ hence our need to ask you to download monthly_chronicler html to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) to offer a new (โrevealโ ) piece of details /summary hosted โYearly Report Calendarโ functionality.
<?php
// quarter_hour_timer.php // RJM Programming // December, 2021 // iptc_make_tag() function by Thies C. Arntzen function iptc_make_tag($rec, $data, $value) { $length = strlen($value); $retval = chr(0x1C) . chr($rec) . chr($data); if($length < 0x8000) { $retval .= chr($length >> 8) . chr($length & 0xFF); } else { $retval .= chr(0x80) . chr(0x04) . chr(($length >> 24) & 0xFF) . chr(($length >> 16) & 0xFF) . chr(($length >> 8) & 0xFF) . chr($length & 0xFF); } return $retval . $value; } if (isset($_GET['myta'])) { $dru="HTTP://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/"; $contis=str_replace('+',' ',urldecode($_GET['myta'])); //file_put_contents('xx.xx', $contis); $myf=''; $backi=''; $cali=''; $taback=''; $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'"; if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); } if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); } foreach ($_GET as $name=>$val) { if ($name != 'myta' && $val == '') { //echo $name; $myf=$name; $taback=str_replace('-','_',str_replace('itd','tatd',$myf)); $backi=str_replace('-','_',str_replace('screen-','itd_',$myf)); $cali=str_replace('-','',str_replace('screen-','td',$myf)); $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0]; // Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html // Path to jpeg file $path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg'; //file_put_contents('x.x',$path); $capt = ""; // Thanks to https://www.php.net/manual/en/function.iptcparse.php $size = getimagesize( $path, $info ); if (isset($info["APP13"])) { //file_put_contents('xx.xx',$path); if ($iptc = iptcparse( $info["APP13"] ) ) { //file_put_contents('xxx.xxx',$path); $capt = str_replace( "\000", "", $iptc["2#120"][0] ); //file_put_contents('xxxx.xxxx',$capt); } } $bcontis="" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . ""; $ccpre="<p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">"; $ccpost="</p>"; $ccontis="<br><p style='background-color:orange; title='" . str_replace('td','p',$cali) . "' id=" . str_replace('td','p',$cali) . ">" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "<br>", str_replace("\r\n", "<br>", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "</p>"; //file_put_contents('xxxxx.xxxxx',$bcontis); //file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi); //file_put_contents('xxxxxxx.xxxxxxx',"parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; "); } if ($bcontis != "''") { echo "<html><body onload=\" parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; if (parent.document.getElementById('" . $idcali . "')) { var huhg='" . $ccpre . "' + parent.document.getElementById('" . $taback . "').value + '" . $ccpost . "'; while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>'); } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } \"></body></html>"; } } } else if (isset($_POST['myta'])) { $dru="HTTP://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/"; $contis=str_replace('+',' ',urldecode($_POST['myta'])); //file_put_contents('xx.xx', $contis); $myf=''; $backi=''; $cali=''; $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'"; $ccpre="<p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">"; $ccpost="</p>"; $ccontis="<br><p style='background-color:orange; title='" . str_replace('td','p',$cali) . "' id=" . str_replace('td','p',$cali) . ">" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "<br>", str_replace("\r\n", "<br>", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "</p>"; if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); } if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); } foreach ($_POST as $name=>$val) { if ($name != 'myta') { $myf=$name; $backi=str_replace('-','_',str_replace('screen-','itd_',$myf)); $taback=str_replace('tatd','tatd_',substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),0,12)) . '_' . substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),-4,4); $pback=str_replace('tatd','ip',$taback); $cali=str_replace('-','',str_replace('screen-','td',$myf)); $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0]; // Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html // Path to jpeg file $path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $myf . '.jpg'; //file_put_contents('x.x', $path); // Set the IPTC tags $iptc = array( '2#120' => $contis, '2#116' => 'Copyright 2021, RJM Programming' ); // Convert the IPTC tags into binary code $data = ''; foreach($iptc as $tag => $string) { $tag = substr($tag, 2); $data .= iptc_make_tag(2, $tag, $string); } // Embed the IPTC data $content = iptcembed($data, $path); // Write the new image data out to the file. $fp = fopen($path, "wb"); fwrite($fp, $content); fclose($fp); } echo "<html><body onload=\" parent.document.getElementById('" . $backi . "').title=" . $bcontis . "; if (parent.document.getElementById('" . $idcali . "')) { var huhg='" . $ccpre . "' + parent.document.getElementById('" . $taback . "').value + '" . $ccpost . "'; if (parent.document.getElementById('" . $pback . "')) { huhg=parent.document.getElementById('" . $taback . "').value; } while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>'); } if (parent.document.getElementById('" . $pback . "')) { parent.document.getElementById('" . $pback . "').innerHTML=huhg; } else { parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } } \"></body></html>"; } } else { exec("/usr/sbin/screencapture -Cd -tjpg /Applications/MAMP/htdocs/screen-`date +\"%Y%m%d-%H%M\"`.jpg"); } exit;
?>
And so, again, ourโช quarter_hour_timer.html (latest) versus quarter_hour_timer.html----GETME (this) quarter_hour_timer.html----GETME (this) versus quarter_hour_timer.html---GETME (previous ... default) quarter_hour_timer.html----GETME (this) versus quarter_hour_timer.html--GETME quarter_hour_timer.html----GETME (this) versus quarter_hour_timer.html-GETME quarter_hour_timer.html----GETME (this) versus quarter_hour_timer.html_GETME quarter_hour_timer.html (latest) versus quarter_hour_timer.html_GETME (oldest) changed quarter_hour_timer html (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a calendarโช quarter_hour_timer.php (latest) versus quarter_hour_timer.php--GETME (this) quarter_hour_timer.php--GETME (this) versus quarter_hour_timer.php-GETME (previous ... default) quarter_hour_timer.php--GETME (this) versus quarter_hour_timer.php_GETME quarter_hour_timer.php (latest) versus quarter_hour_timer.php_GETME (oldest) integrationally changed quarter_hour_timer php PHP (we ask you to download to MAMP โs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) for you to try out on your MAMP macOS environment.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial
In our opinion, what would make the day before yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial โTimekeeping Web Applicationโ cooler would be to add to the intelligence of the screen capture images, ahead of other data related improvements to come.
Weโve spoken in the past about Exif in that respect but PHP has Iptc image metadata functions we can call on โฆ
iptcembed to embed new metadata into an existant image from those associated โcaptionโ textarea elements we offer
iptcparse to extract old metadata from an existant image into those associated โcaptionโ textarea elements we offer
This metadata can be like a database source we use moving forward on this project, meaning the one image data entity can suffice for both visual and textual usage purposes.
And so ourโช quarter_hour_timer.html (latest) versus quarter_hour_timer.html---GETME (this) quarter_hour_timer.html---GETME (this) versus quarter_hour_timer.html--GETME (previous ... default) quarter_hour_timer.html---GETME (this) versus quarter_hour_timer.html-GETME quarter_hour_timer.html---GETME (this) versus quarter_hour_timer.html_GETME quarter_hour_timer.html (latest) versus quarter_hour_timer.html_GETME (oldest) changed quarter_hour_timer html Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a muchโช quarter_hour_timer.php (latest) versus quarter_hour_timer.php-GETME (this) quarter_hour_timer.php-GETME (this) versus quarter_hour_timer.php_GETME (previous ... default) quarter_hour_timer.php (latest) versus quarter_hour_timer.php_GETME (oldest) more usefully changed quarter_hour_timer php PHP โฆ
<?php
// quarter_hour_timer.php // RJM Programming // December, 2021 // iptc_make_tag() function by Thies C. Arntzen function iptc_make_tag($rec, $data, $value) { $length = strlen($value); $retval = chr(0x1C) . chr($rec) . chr($data); if($length < 0x8000) { $retval .= chr($length >> 8) . chr($length & 0xFF); } else { $retval .= chr(0x80) . chr(0x04) . chr(($length >> 24) & 0xFF) . chr(($length >> 16) & 0xFF) . chr(($length >> 8) & 0xFF) . chr($length & 0xFF); } return $retval . $value; } if (isset($_GET['myta'])) { $contis=str_replace('+',' ',urldecode($_GET['myta'])); //file_put_contents('xx.xx', $contis); $myf=''; $backi=''; $taback=''; $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'"; if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); } if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); } foreach ($_GET as $name=>$val) { if ($name != 'myta' && $val == '') { //echo $name; $myf=$name; $taback=str_replace('-','_',str_replace('itd','tatd',$myf)); $backi=str_replace('-','_',str_replace('screen-','itd_',$myf)); // Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html // Path to jpeg file $path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg'; //file_put_contents('x.x',$path); $capt = ""; // Thanks to https://www.php.net/manual/en/function.iptcparse.php $size = getimagesize( $path, $info ); if (isset($info["APP13"])) { //file_put_contents('xx.xx',$path); if ($iptc = iptcparse( $info["APP13"] ) ) { //file_put_contents('xxx.xxx',$path); $capt = str_replace( "\000", "", $iptc["2#120"][0] ); //file_put_contents('xxxx.xxxx',$capt); } } $bcontis="" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . ""; //file_put_contents('xxxxx.xxxxx',$bcontis); //file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi); //file_put_contents('xxxxxxx.xxxxxxx',"parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; "); } if ($bcontis != "''") { echo "<html><body onload=\" parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; \"><p>parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "';</p></body></html>"; } } } else if (isset($_POST['myta'])) { $contis=str_replace('+',' ',urldecode($_POST['myta'])); //file_put_contents('xx.xx', $contis); $myf=''; $backi=''; $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'"; if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); } if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); } foreach ($_POST as $name=>$val) { if ($name != 'myta') { $myf=$name; $backi=str_replace('-','_',str_replace('screen-','itd_',$myf)); // Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html // Path to jpeg file $path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $myf . '.jpg'; //file_put_contents('x.x', $path); // Set the IPTC tags $iptc = array( '2#120' => $contis, '2#116' => 'Copyright 2021, RJM Programming' ); // Convert the IPTC tags into binary code $data = ''; foreach($iptc as $tag => $string) { $tag = substr($tag, 2); $data .= iptc_make_tag(2, $tag, $string); } // Embed the IPTC data $content = iptcembed($data, $path); // Write the new image data out to the file. $fp = fopen($path, "wb"); fwrite($fp, $content); fclose($fp); } echo "<html><body onload=\" parent.document.getElementById('" . $backi . "').title=" . $bcontis . "; \"></body></html>"; } } else { exec("/usr/sbin/screencapture -Cd -tjpg /Applications/MAMP/htdocs/screen-`date +\"%Y%m%d-%H%M\"`.jpg"); } exit;
?>
Previous relevant Mac OS X MAMP Timekeeping Web Application Email Tutorial is shown below.
Mac OS X MAMP Timekeeping Web Application Email Tutorial
The practicalities of yesterdayโs (Mac OS X MAMP Timekeeping Web Application Primer Tutorial ) timekeeping Mac OS X Web Application, left as they are, would leave you with a somewhat useful web application whose use is only for the here and now , but what if you want it to be more accountable? Well, that is when we, here, at RJM Programming, like to use that tried and trusted email form of communication.
Todayโs email methods spurn the use of server-side intervention, at least for now. So what is available to us as tools, if we donโt include Ajax nor jQuery in that list? Well, we have, to our minds โฆ
mailto links (get us to the email client) +
the body section of that email can have a clipboard image pasted into it, for which we can utilize HTML5 canvas elementโs toDataURL () method, teamed up with a window.open popup window of the toDataURL image data, which can be selected and copied , optionally, by the user themselves, should they wish this to make their email more self explanatory
We last discussed this thinking with Canvas Annotation Email Attachment Clipboard Tutorial .
We rely on the crontab functionality, being as there is no server-side help, to create the image file, whose contents eventually go to make up the contents that can be selected and copied and pasted by the user into the body section of the email (and sent off to whosoever they feel like sending it too, as you have the full power of the email client available to you with the interaction you have with an actual email client program).
Here is the HTML and Javascript quarter_hour_timer html which changed to cater for todayโs email functionality in thisโช quarter_hour_timer.html (latest) versus quarter_hour_timer.html-GETME (this) quarter_hour_timer.html-GETME (this) versus quarter_hour_timer.html_GETME (previous ... default) quarter_hour_timer.html (latest) versus quarter_hour_timer.html_GETME (oldest) way , and, as per the Stop Press from yesterday, weโll also have a live run link here today.
Previous relevant Mac OS X MAMP Timekeeping Web Application Primer Tutorial is shown below.
Mac OS X MAMP Timekeeping Web Application Primer Tutorial
Sometimes when you program, especially for administrative type functionality, there are useful programs to write, that are able to become web applications, but in a limited set of platforms. So it is today with our timekeeping web application that relies on โฆ
Mac OS X operating system +
Existance of [/usr/sbin/]screencapture +
crontab active and editable via crontab -e +
One of โฆ
MAMP installed to, in our case, /Applications/MAMP/htdocs/ (as is mentioned in the relevant crontab background task that snapshots the userโs screen every quarter hour) that maps to the MAMP web application URL //localhost:8888/ โฆ or โฆ
crontab directory mention that corresponds to a URL call of our web application like for our Google Chrome example (where the directory below, used, could be a place of your choosing (that matches what is in your crontab task entry)) โฆ
file:///Applications/MAMP/htdocs/ quarter_hour_timer.html?localplace=
โฆ or just, via the web browserโs File -> Open File menu โฆ
file:///Applications/MAMP/htdocs/ quarter_hour_timer.html
โฆ pretty restrictive, huh? โฆ but pretty useful for our quarter hour timekeeping purposes today.
We want to have a web application that is running at the userโs discretion, and when first fired up, looks for outputs from crontab tasks above โฆ
0,15,30,45 * * * * /usr/sbin/screencapture -Cd -tjpg /Applications/MAMP/htdocs/ screen-`date +"\%Y\%m\%d-\%H\%M"`.jpg
โฆ for the current day in question and if existant show โฆ
a date and time stamp +
the snapshot of what you were doing at the quarter hour, that is clickable to make bigger for more in depth viewing +
an HTML textarea element in which you can optionally type in more specifics about that quarter hour
So, as much as we like to think of Mac OS X Terminal applicationโs BSD (a unix derivative) operating system, as being a lot like Linux, there are some commands and usage that โฆ
adds Mac OS X specific command line functionality to a Linux or unix base set of functionality, like for todayโs screencapture command โฆ and weโve included another such example, below, with the command say featuring in Mac OS X Text to English Speech Primer Tutorial as shown below
changes switches on Linux or unix commands
wonโt have some Linux or unix commands that other platforms do
In the great tradition of behoving โฆ we behove โฆ we behove thee quarter_hour_timer html if you like, my liege. On this occasion youโll have gleaned that there is no live run link, because the RJM Programming web server is not Mac OS X โฆ so command line screencapture has no meaning for a CentOS web serverโs operating system command line. Youโll see in the code that rather than use โClient Pre-emptive Iframeโ concepts to check for existence of crontab screen capture images, we, instead use the onerror event for HTML img elements to check for non-existance.
Stop Press
Just noticed that, perhaps, after all, a live run from the RJM Programming website can make sense if you have a Mac OS X laptop, for instance, that is running that suggested crontab entry as explained in tutorial above. That type of live run managed to latch on to our local crontab screencaptures on my MacBook Pro.
Previous relevant Mac OS X Text to English Speech Primer Tutorial is shown below.
Mac OS X Text to English Speech Primer Tutorial
Weโve got a few new ideas today โฆ
Text to English Speech via Mac OS Xโs command line say command used by PHP via exec to make say php (which is useful as a download to a Mac OS X laptop using MAMP ) which, today, does not have a live run because the web server of domain rjmprogramming.com.au is a CentOS Linux server โฆ Linux equivalent of Mac OS Xโs say ? โฆ read here
Trying to present this brought up the usual movie production problem with iMovie overlaying the audio on top of the video (though you may want to try, and you could start reading with this link ) versus QuickTime Player talent to catch both audio and video tracks (and that we ended up using), but not of the โscreen goings onโ, alas versus MPlayer OSX Extended which can play separately but not two tracks on top and doesnโt do any reconstituting โฆ so โฆ
Improved on our inhouse Video/Audio synchronizing efforts by allowing audio_video html supervisor (changed in thisโช audio_video.html (latest) versus audio_video.html---GETME (this) audio_video.html---GETME (this) versus audio_video.html--GETME (previous ... default) audio_video.html---GETME (this) versus audio_video.html-GETME audio_video.html---GETME (this) versus audio_video.html_GETME audio_video.html (latest) versus audio_video.html_GETME (oldest) way ) be able to be called to press one of its preconceived synchronization buttons onload which we do with (the newly added) Macbeth Act 1 Scene 1 โฆ in a small celebration of the Bard โฆ who, am thinking (in that Falstaff way), would have got a huge chuckle out of โanonymousโ instead of โanonโ during the Three Witches scene โฆ we had to do something to say Happy Birthday
Along the way we tried filming the MacBook Pro with the iPad to a YouTube โฆ
VIDEO
โฆ but werenโt happy with the audio quality, alas (too/two).
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
MAMP Timekeeping Web Application Audio Commentary Tutorial


โ 
MAMP Timekeeping Web Application Audio Commentary Tutorial
The recent MAMP Timekeeping Web Application PHP Notifications Tutorialโs Timekeeping via Screenshots changedHTML and Javascript quarter_hour_timer
html (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Web Application supervisor is another very suitable candidate for interfacing to our recent Webpage Audio Commentary functionality. Both โฆ
โฆ share an โฆ
โฆ set of interest points for full and useful functionality, because of two macOS or Mac OS X commands, respectively โฆ
We add thechanged macos_say_record
js external Javascript call into the supervisory HTML and Javascript <head></head> webpage section via โฆ
<script type='text/javascript' src='//www.rjmprogramming.com.au/macos_say_record.js?ongoing=1721156687576' defer></script>
โฆ sitting up at the Document Root of your public domain, that โ?ongoing=โ based $_GET[โongoingโ] argument deliberate, effectively asking the code to look out for โon the flyโ HTML elements created within an execution run of the webpage.
We add some โsmartsโ to those global data attribute usage we talked about at Webpage macOS Say Audio Commentary Access Count Tutorial, allowing some โdate extractionโ templating via the supervisory HTML and Javascript array declaration as per โฆ
<script type='text/javascript'>
var commentary_array=['textarea', 'You can enter comments about this screenshot here %value%outerHTML%@yyyymmdd%hhmm%.', 'img', 'Timekeeper screenshot here %id%@yyyymmdd%hhmm%.'];
</script>
โฆ where the first field describes an HTML element attribute to first look at, the optional second is a stand by attribute, followed by โdate extractionโ fields to match with numerical data found so as to substitute the blue parts with a โdate and timestampโ string.
Previous relevant MAMP Timekeeping Web Application PHP Notifications Tutorial is shown below.
MAMP Timekeeping Web Application PHP Notifications Tutorial
Today weโre revisiting the macOS (or Mac OS X) or Windows timekeeping web application of 2016โs Mac OS MAMP Timekeeping Web Application PHP Calendar Aesthetics Tutorial. Why? Well, given our recent work with Notifications API based web applications you can read about at Notification API Hidden Popup Tutorial, the timekeeping one is a great candidate for functionality improvement here, it being a web application that โฆ
This needs PHP to work and it needs real access via PHP exec function to underlying operating system commands. When this happens, we still try to offer a public RJM Programming interface but this interface is far less useful if you have not downloaded to your local Apache/PHP/MySql local web server (such as a MAMP one) as per โฆ
โฆ in what we like to call an โIntranet feelingโ scenario.
Up at the public RJM Programming domain, as far as the Notification API functionality supervisor webpage goes, thechanged HTML and Javascript notifications_ideas
html Notification API functionality HTML and Javascript web application is worth trying.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Aesthetics Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Aesthetics Tutorial
To finish up our revisit to the Timekeeping web application of the recent Mac OS MAMP Timekeeping Web Application PHP Calendar Iframe Tutorial we โฆ
<style>
td { vertical-align: top; }
#divmc { background-color: #ffffff; }
p:not(:empty) { border: 1px dotted red; }
td { text-align: center; vertical-align: top; }
th { background-color: cyan; }
#thyear { background-color: pink; }
div { word-wrap: break-word; }
.adaNOte { border: 3px solid pink; border-radius: 7px; }
a.adate { border:2px solid transparent; background-color:lightgreen; border-radius:50px; }
</style>
<script>
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|iPad|Opera Mini|IEMobile/i)) {
document.write("<scri" + "pt> location.href='./monthly_chronicler.html'; </scr" + "ipt> <style> a.adate { border:1px solid green; background-color:#f0f0f0; border-radius:50px; } </style> <table id=mtable style=display:none;width:95%;><tr><th><input style=width:450px; placeholder='' id=iask type=text value=''></input><</th><th><input onclick=\" document.getElementById('mtable').style.display='none'; document.getElementById('mybod').style.opacity='1.0'; postask(document.getElementById('iask'));\" type=button value=OK></input></th><th><input onclick=\"document.getElementById('iask').value=''; document.getElementById('mtable').style.display='none'; document.getElementById('mybod').style.opacity='1.0'; \" type=button value=Cancel></input></th></tr></table>");
}
</script>
โฆ dumbing down, but working more reliably, using โJavascript writes Javascriptโ methodology
Again, feel free to try thechanged quarter_hour_timer
html (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a โmobileplatform checkโ changed quarter_hour_timer
php PHP (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) for you to try out on your MAMP macOS environment, or all showing up at an RJM Programming public domain webpage, in an iframe element, visible now.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Windows Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Windows Tutorial
Did you notice that the โTimekeepingโ PHP did not have to change for yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Calendar iCal Integration Tutorial?
But the PHP is thechange agent for Windows (client) integration called quarter_hour_timer
php today โฆ
<?php
// blah top
$lportbit=":8888";
$user_agent = $_SERVER["HTTP_USER_AGENT"];
function getOS() { // thanks to https://www.daniweb.com/programming/web-development/threads/495588/getting-users-os-info-out-of-server-http-user-agent
global $user_agent, $lportbit;
$os_platform = "win Unknown OS Platform";
$os_array = array(
'/windows nt 10/i' => 'Windows 10',
'/windows nt 6.3/i' => 'Windows 8.1',
'/windows nt 6.2/i' => 'Windows 8',
'/windows nt 6.1/i' => 'Windows 7',
'/windows nt 6.0/i' => 'Windows Vista',
'/windows nt 5.2/i' => 'Windows Server 2003/XP x64',
'/windows nt 5.1/i' => 'Windows XP',
'/windows xp/i' => 'Windows XP',
'/windows nt 5.0/i' => 'Windows 2000',
'/windows me/i' => 'Windows ME',
'/win98/i' => 'Windows 98',
'/win95/i' => 'Windows 95',
'/win16/i' => 'Windows 3.11',
'/macintosh|mac os x/i' => 'Mac OS X',
'/mac_powerpc/i' => 'Mac OS 9',
'/linux/i' => 'Linux',
'/ubuntu/i' => 'Ubuntu',
'/iphone/i' => 'iPhone',
'/ipod/i' => 'iPod',
'/ipad/i' => 'iPad',
'/android/i' => 'Android',
'/blackberry/i' => 'BlackBerry',
'/webos/i' => 'Mobile'
);
foreach ($os_array as $regex => $value) {
if (preg_match($regex, $user_agent)) {
$os_platform = $value;
}
}
return $os_platform;
}
$callornot="call ";
$precmds="";
$impreexe="screenCapture"; //"import";
$switches=""; //" -window root ";
if (substr(strtoupper(getOS()),0,3) === 'WIN') {
$lportbit="";
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "\\" . $impreexe . ".exe")) {
$precmds=$_SERVER['DOCUMENT_ROOT'] . "\\";
} else {
foreach (glob("C:\\Users\\*\\" . $impreexe . ".exe") as $infl) {
$precmds=explode($impreexe . ".exe", $infl)[0];
}
}
}
// blah blah some other PHP functions
if (isset($_GET['yourta'])) {
// calendar work
} else if (isset($_GET['myta'])) {
// embed image metadata
} else if (isset($_POST['myta'])) {
// parse image metadata
} else if ($lportbit != "") {
exec("/usr/sbin/screencapture -Cd -tjpg " . $_SERVER['DOCUMENT_ROOT'] . "/screen-`date +\"%Y%m%d-%H%M\"`.jpg");
} else {
if (isset($_GET['tz'])) {
$tzis=str_replace('+','_',urldecode($_GET['tz']));
if (strpos($tzis, "/") !== false) { date_default_timezone_set($tzis); }
}
$dateis = date('Ymd-Hi');
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "\\screenCapture.jpg")) {
exec('copy ' . '"' . $_SERVER['DOCUMENT_ROOT'] . "\\screenCapture.jpg" . '" "' . $_SERVER['DOCUMENT_ROOT'] . "\\screen-" . $dateis . '.jpg"');
// exec('erase ' . '"' . $_SERVER['DOCUMENT_ROOT'] . "\\screenCapture.jpg" . '"');
} else {
exec($callornot . '"' . $precmds . $impreexe . '.exe" ' . $switches . ' "' . $_SERVER['DOCUMENT_ROOT'] . "\\screen-" . $dateis . '.jpg"');
}
}
exit;
?>
โฆ which you may glean has a Windows โfallbackโ position (with that โcopyโ codeline). Why? Well, we found a .Net framework โexe creation via batโ using ScreenCapture
bat (thanks to this useful link) created black screen shots. Probably a privilege thing or PHP exec thing, but weโve opted for the workaround, which is just โWindows talkโ โฆ
Take a more detailed look at โwarts โn allโ crab progression towards the Windows (client) solution, below โฆ
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar iCal Integration Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar iCal Integration Tutorial
Yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Calendar Contenteditable Tutorialโs โCalendar Pastโ improvements donโt have to be the end of the story regarding โcalendar timingsโ. There is an Apple iCal standard interfacing format that can drive calendar integrations with many well known online Calendar applications.
You may recall us talking about this with Calendar Location Services Integration Tutorial and we tweak thechanged ics_attachment
php (which weโd ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โPHPโ subfolder) and its standalone ical creator to better integrate with thechanged quarter_hour_timer
html (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage.
This bit of functionality works (interfacing) both with MAMP and with the public RJM Programming domain incarnation of the Timekeeping web application, so that could be interesting. It can interface via โฆ
โฆ modes of use. In action, should you create an iCal file this way, the web application will download the resultant .ics file into your Downloads folder and to interface into your default online Calendar application double click that Downloads folder file to complete the Calendar integration โฆ
function icalpostit(tl, tg) {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
var hh = today.getHours();
var minm = today.getMinutes(); //January is 0!
//if (icalavailable) { alert('is ' + ('' + yyyy + ('00' + mm).slice(-2) + ('00' + dd).slice(-2) ) + ' >= ' + tl.substring(1)); }
if ((document.getElementById('yics').value.indexOf('all') != -1 || tl.substring(1) >= ('' + yyyy + ('00' + mm).slice(-2) + ('00' + dd).slice(-2) )) && icalavailable && document.getElementById('yics').value != '') {
if (document.getElementById('yics').value.indexOf('nw') != -1) {
icald=tl.substring(1) + ':' + ('00' + hh).slice(-2) + ('00' + minm).slice(-2) + '59';
icalg=tg;
if (icalwo != null) { icalwo.close(); icalwo=null; }
icalwo=window.open('../PHP/ics_attachment.php','_blank','top=100,left=100,width=740,height=800');
if (1 == 1) {
setTimeout(icalw, 3000);
} else {
icalwo.document.getElementById('datestart').value=icald;
icalwo.document.getElementById('dateend').value=icald;
icalwo.document.getElementById('eventwords').value=icalg.replace(/\<br\>/g, String.fromCharCode(10)).replace(/\<Br\>/g, String.fromCharCode(10)).replace(/\<BR\>/g, String.fromCharCode(10));
if (document.URL.indexOf('localhost') != -1) {
var jcald=icalg.replace(/\<br\>/g, String.fromCharCode(10)).replace(/\<Br\>/g, String.fromCharCode(10)).replace(/\<BR\>/g, String.fromCharCode(10)).replace(/\ \;>/g, ' ');
while (jcald.indexOf(String.fromCharCode(10)) != -1) { jcald=jcald.replace(String.fromCharCode(10),' '); }
icalwo.document.getElementById('title').value=jcald;
} else {
icalwo.document.getElementById('title').value='Calendar event at ' + icald;
}
icalwo.document.getElementById('description').value='Calendar event at ' + icald;
icalwo.document.getElementById('address').value=document.URL.split('?')[0].split('#')[0];
icalwo.document.getElementById('mmdatestart').value=icald.substring(4,6);
icalwo.document.getElementById('mmdateend').value=icald.substring(4,6);
icalwo.document.getElementById('dddatestart').value=icald.substring(6,8);
icalwo.document.getElementById('dddateend').value=icald.substring(6,8);
icalwo.document.getElementById('ssdatestart').value='59';
icalwo.document.getElementById('ssdateend').value='59';
icalwo.document.getElementById('yyyydatestart').value=icald.substring(0,4);
icalwo.document.getElementById('yyyydateend').value=icald.substring(0,4);
if ( ('' + today.getTimezoneOffset()).replace('null','').replace('undefined','') != '' ) {
//alert(('' + eval(eval('' + qd.getTimezoneOffset()) / 60.0)).replace('.00','').replace('.0',''));
icalwo.document.getElementById('tz').value=('' + eval(eval('' + today.getTimezoneOffset()) / 60.0)).replace('.00','').replace('.0','');
}
//icalwo.document.getElementById('pform').onsubmit=function() { window.opener.document.getElementById('icalstatus').innerHTML=' '; return true; };
}
} else if (document.getElementById('yics').value.indexOf('if') != -1) {
icald=tl.substring(1) + ':' + ('00' + hh).slice(-2) + ('00' + minm).slice(-2) + '59';
icalg=tg;
document.getElementById('divics').style.display='block';
document.getElementById('divics').style.width='100%';
document.getElementById('divics').style.height='800px';
document.getElementById('icslocit').style.display='block';
document.getElementById('icslocit').style.width='100%';
document.getElementById('icslocit').style.height='800px';
document.getElementById('icslocit').src='../PHP/ics_attachment.php?rand=' + Math.floor(Math.random() * 19876564);
} else {
var xzhr = new XMLHttpRequest();
var xform=new FormData();
xform.append('icald',tl.substring(1) + ':' + ('00' + hh).slice(-2) + ('00' + minm).slice(-2) + '59');
xform.append('icalc',tg);
xzhr.open('post','./quarter_hour_timer.php',true);
xzhr.send(xform);
}
}
}
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Contenteditable Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Contenteditable Tutorial
Weโve spoken quite a bit in the past about the joys of involving the โcontenteditable=trueโ attribute for HTML elements that have an โinnerHTMLโ (ie. they have a formalized end tag arrangement eg. div, span, p, td, th etcetera) and with todayโs work which extends that started with yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Calendar Past Tutorial it is the turn of a set of โpโ elements it helps out today.
The scenario is that yesterdayโs work did not allow for โorphaned screenshotsโ of the past be allowed to be brought back into play to โannotate themโ and in so doing โgive them a homeโ. This led us to โฆ
<?php
if (isset($_GET['yourta'])) {
$dru="//" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/";
$cet="";
if (strlen($_GET['yourta']) != 0) { $cet=" contenteditable=true onblur=repostit(this); onfocus=wopen(event,false); "; }
// blah blah blah
$ccpre="
" . $cet . " onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-repeat:no-repeat;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); onmouseover=wopen(event,true); onmouseout=wopen(event,false); title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">";
// blah blah blah
}
?>
โฆ to, when an โorphanedโ screen shot image is happened upon, allows โฆ
function repostit(ih) {
var ihis=(ih.innerText || ih.contentWindow || ih.contentDocument);
var pathpart=ih.id;
if (ihis != '') {
var xzhr = new XMLHttpRequest();
var xform=new FormData();
xform.append('myta',ihis);
xform.append(pathpart.split('.')[0].replace('ip_','screen-').replace('_','-'),'');
xzhr.open('post','./quarter_hour_timer.php',true);
xzhr.send(xform);
}
}
โฆ which can cement that (newly user entered) annotation into future permanency in the โYearly Report Calendarโ section
โฆ of thechanged quarter_hour_timer
html (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a contenteditable=truechanged quarter_hour_timer
php PHP (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) for you to try out on your MAMP macOS environment.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Past Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Past Tutorial
If youโve been using the Timekeeping web application as of yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial you would have noticed a very โฆ
โฆ feel to it all. Today, we improve on the latter โrestrictivenessโ issue, within yesterdayโs โYearly Report Calendarโ new functionality, by looking back into the current calendar yearโs โpastโ with respect to the date of using the web application, whether that be โฆ
โฆ to infill and flesh out that โYearly Report Calendarโ better. This involved bringing over a lot of (the unchanged) monthly_chronicler
htmlโs Javascript logic into thechanged quarter_hour_timer
html (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a calendarโspast integrationally changed quarter_hour_timer
php PHP (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) for you to try out on your MAMP macOS environment.
<?php
// quarter_hour_timer.php
// RJM Programming
// December, 2021
if (isset($_GET['yourta'])) {
$dru="HTTP://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/";
$contis=str_replace('+',' ',urldecode($_GET['yourta']));
//file_put_contents('xx.xx', $contis);
$htmlis='';
$myf='';
$backi='';
$cali='';
$taback='';
$bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'";
if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); }
if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }
foreach ($_GET as $name=>$val) {
if ($name != 'yourta') { // && $val == '') {
//echo $name;
$orig=$name;
$myf=$name;
for ($imh=12; $imh>=1; $imh--) {
for ($idd=31; $idd>=1; $idd--) {
//file_put_contents('xz.xz',$orig . ' Is ' . substr('00' . $imh,-2,2) . substr('00' . $idd,-2,2) . ' less than ' . $val);
if (substr('00' . $imh,-2,2) . substr('00' . $idd,-2,2) < $val) {
for ($ihh=0; $ihh<=23; $ihh++) {
for ($imm=0; $imm<=45; $imm+=15) {
//if ($ihh != 0 || $imm != 0) {
$myf=str_replace("0101_", substr('00' . $imh,-2,2) . substr('00' . $idd,-2,2) . "_",$orig);
$myf=str_replace("_0000", "_" . substr('00' . $ihh,-2,2) . substr('00' . $imm,-2,2),$myf);
//}
$taback=str_replace('-','_',str_replace('itd','tatd',$myf));
$backi=str_replace('-','_',str_replace('screen-','itd_',$myf));
$cali=str_replace('-','',str_replace('screen-','td',$myf));
$idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0];
// Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html
// Path to jpeg file
$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg';
//file_put_contents('x.x',$path);
if (file_exists($path)) {
$capt = ""; // Thanks to https://www.php.net/manual/en/function.iptcparse.php
$size = getimagesize( $path, $info );
if (isset($info["APP13"])) {
//file_put_contents('xx.xx',$path);
if ($iptc = iptcparse( $info["APP13"] ) ) {
//file_put_contents('xxx.xxx',$path);
$capt = str_replace( "\000", "", $iptc["2#120"][0] );
//file_put_contents('xxxx.xxxx',$capt);
}
}
$bcontis="" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "";
$ccpre="<p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-repeat:no-repeat;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); onmouseover=wopen(event,true); onmouseout=wopen(event,false); title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">";
$ccpost="</p>";
$ccontis="<br><p style='background-color:orange; title='" . str_replace('td','p',$cali) . "' id=" . str_replace('td','p',$cali) . ">" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "<br>", str_replace("\r\n", "<br>", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "</p>";
//file_put_contents('xxxxx.xxxxx',$bcontis);
//file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi);
//file_put_contents('xxxxxxx.xxxxxxx',"parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; ");
}
if ($bcontis != "''" && $bcontis != "") {
if ($htmlis == '') {
$htmlis="<html><head><script type=text/javascript> var imois=null, iwo=null; function wopen(event,overvsout) { if (!overvsout) { if (imois == event.target) { imois=null; } return; } imois=event.target; setTimeout(postwopen, 2000); } function postwopen() { var pois=imois; if (pois.outerHTML.indexOf('URL(') != -1) { window.open(pois.outerHTML.split('URL(')[1].split(')')[0].replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),''),'_blank','top=50,left=50,width=600,height=600'); } }</script></head><body onload=\" var huhg=''; if (parent.document.getElementById('" . $idcali . "')) { huhg='" . $ccpre . $bcontis . $ccpost . "'; while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>'); } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } \"></body></html>";
} else if (strpos($htmlis, $bcontis) === false) {
$htmlis=str_replace("+=huhg; }", "+=huhg; huhg='" . $ccpre . $bcontis . $ccpost . "'; while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>'); } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; }", $htmlis);
}
}
}
}
if ($htmlis != "") { echo $htmlis; }
}
}
}
}
}
}
// blah else if blah else if blah
?>
โฆ which you may notice implements a โlong hoverโ window.open scenario (using non-mobile platforms) for screenshot images on the calendar by combining the use of โฆ
var imois=null;
var iwo=null;
function wopen(event,overvsout) {
if (!overvsout) {
if (imois == event.target) {
imois=null;
}
return;
}
imois=event.target;
setTimeout(postwopen, 2000);
}
function postwopen() { //pois) {
if (imois) {
var pois=imois;
if (pois.outerHTML.indexOf('URL(') != -1) {
if (iwo) { iwo.close(); iwo=null; }
iwo = window.open(pois.outerHTML.split('URL(')[1].split(')')[0].replace(String.fromCharCode(34), '').replace(String.fromCharCode(34), ''), '_blank', 'top=50,left=50,width=600,height=600');
}
}
}
โฆ so that this logic is not responsible for clobbering the default โhoverโ shows of the โpโ element โtitleโ attribute with the onmouseover event for non-mobile platforms.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial
Okay then, yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial โimage metadata smartsโ puts us in a position to get onto the โbells and whistlesโ side of our Timekeeping (macOS and Mac OS X only at this stage) web application. We channel the calendar display talents of Monthly Chronicler LocalStorage Tutorial in thought and act (its web application is opened in an iframe โฆ hence our need to ask you to download monthly_chronicler
html to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) to offer a new (โrevealโ) piece of details/summary hosted โYearly Report Calendarโ functionality.
<?php
// quarter_hour_timer.php
// RJM Programming
// December, 2021
// iptc_make_tag() function by Thies C. Arntzen
function iptc_make_tag($rec, $data, $value) {
$length = strlen($value);
$retval = chr(0x1C) . chr($rec) . chr($data);
if($length < 0x8000)
{
$retval .= chr($length >> 8) . chr($length & 0xFF);
}
else
{
$retval .= chr(0x80) .
chr(0x04) .
chr(($length >> 24) & 0xFF) .
chr(($length >> 16) & 0xFF) .
chr(($length >> 8) & 0xFF) .
chr($length & 0xFF);
}
return $retval . $value;
}
if (isset($_GET['myta'])) {
$dru="HTTP://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/";
$contis=str_replace('+',' ',urldecode($_GET['myta']));
//file_put_contents('xx.xx', $contis);
$myf='';
$backi='';
$cali='';
$taback='';
$bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'";
if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); }
if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }
foreach ($_GET as $name=>$val) {
if ($name != 'myta' && $val == '') {
//echo $name;
$myf=$name;
$taback=str_replace('-','_',str_replace('itd','tatd',$myf));
$backi=str_replace('-','_',str_replace('screen-','itd_',$myf));
$cali=str_replace('-','',str_replace('screen-','td',$myf));
$idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0];
// Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html
// Path to jpeg file
$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg';
//file_put_contents('x.x',$path);
$capt = ""; // Thanks to https://www.php.net/manual/en/function.iptcparse.php
$size = getimagesize( $path, $info );
if (isset($info["APP13"])) {
//file_put_contents('xx.xx',$path);
if ($iptc = iptcparse( $info["APP13"] ) ) {
//file_put_contents('xxx.xxx',$path);
$capt = str_replace( "\000", "", $iptc["2#120"][0] );
//file_put_contents('xxxx.xxxx',$capt);
}
}
$bcontis="" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "";
$ccpre="<p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">";
$ccpost="</p>";
$ccontis="<br><p style='background-color:orange; title='" . str_replace('td','p',$cali) . "' id=" . str_replace('td','p',$cali) . ">" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "<br>", str_replace("\r\n", "<br>", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "</p>";
//file_put_contents('xxxxx.xxxxx',$bcontis);
//file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi);
//file_put_contents('xxxxxxx.xxxxxxx',"parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; ");
}
if ($bcontis != "''") { echo "<html><body onload=\" parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; if (parent.document.getElementById('" . $idcali . "')) { var huhg='" . $ccpre . "' + parent.document.getElementById('" . $taback . "').value + '" . $ccpost . "'; while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>'); } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } \"></body></html>"; }
}
} else if (isset($_POST['myta'])) {
$dru="HTTP://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/";
$contis=str_replace('+',' ',urldecode($_POST['myta']));
//file_put_contents('xx.xx', $contis);
$myf='';
$backi='';
$cali='';
$bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'";
$ccpre="<p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">";
$ccpost="</p>";
$ccontis="<br><p style='background-color:orange; title='" . str_replace('td','p',$cali) . "' id=" . str_replace('td','p',$cali) . ">" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "<br>", str_replace("\r\n", "<br>", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "</p>";
if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); }
if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }
foreach ($_POST as $name=>$val) {
if ($name != 'myta') {
$myf=$name;
$backi=str_replace('-','_',str_replace('screen-','itd_',$myf));
$taback=str_replace('tatd','tatd_',substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),0,12)) . '_' . substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),-4,4);
$pback=str_replace('tatd','ip',$taback);
$cali=str_replace('-','',str_replace('screen-','td',$myf));
$idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0];
// Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html
// Path to jpeg file
$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $myf . '.jpg';
//file_put_contents('x.x', $path);
// Set the IPTC tags
$iptc = array(
'2#120' => $contis,
'2#116' => 'Copyright 2021, RJM Programming'
);
// Convert the IPTC tags into binary code
$data = '';
foreach($iptc as $tag => $string) {
$tag = substr($tag, 2);
$data .= iptc_make_tag(2, $tag, $string);
}
// Embed the IPTC data
$content = iptcembed($data, $path);
// Write the new image data out to the file.
$fp = fopen($path, "wb");
fwrite($fp, $content);
fclose($fp);
}
echo "<html><body onload=\" parent.document.getElementById('" . $backi . "').title=" . $bcontis . "; if (parent.document.getElementById('" . $idcali . "')) { var huhg='" . $ccpre . "' + parent.document.getElementById('" . $taback . "').value + '" . $ccpost . "'; if (parent.document.getElementById('" . $pback . "')) { huhg=parent.document.getElementById('" . $taback . "').value; } while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>'); } if (parent.document.getElementById('" . $pback . "')) { parent.document.getElementById('" . $pback . "').innerHTML=huhg; } else { parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } } \"></body></html>";
}
} else {
exec("/usr/sbin/screencapture -Cd -tjpg /Applications/MAMP/htdocs/screen-`date +\"%Y%m%d-%H%M\"`.jpg");
}
exit;
?>
And so, again, ourchanged quarter_hour_timer
html (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a calendarintegrationally changed quarter_hour_timer
php PHP (we ask you to download to MAMPโs $_SERVER[โDOCUMENT_ROOTโ] โHTMLCSSโ subfolder) for you to try out on your MAMP macOS environment.
Previous relevant Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial is shown below.
Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial
In our opinion, what would make the day before yesterdayโs Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial โTimekeeping Web Applicationโ cooler would be to add to the intelligence of the screen capture images, ahead of other data related improvements to come.
Weโve spoken in the past about Exif in that respect but PHP has Iptc image metadata functions we can call on โฆ
This metadata can be like a database source we use moving forward on this project, meaning the one image data entity can suffice for both visual and textual usage purposes.
And so ourchanged quarter_hour_timer
html Timekeeping Web Application suited to macOS (or Mac OS X) โscreencaptureโ command line usage, is helped out by a muchmore usefully changed quarter_hour_timer
php PHP โฆ
<?php
// quarter_hour_timer.php
// RJM Programming
// December, 2021
// iptc_make_tag() function by Thies C. Arntzen
function iptc_make_tag($rec, $data, $value) {
$length = strlen($value);
$retval = chr(0x1C) . chr($rec) . chr($data);
if($length < 0x8000)
{
$retval .= chr($length >> 8) . chr($length & 0xFF);
}
else
{
$retval .= chr(0x80) .
chr(0x04) .
chr(($length >> 24) & 0xFF) .
chr(($length >> 16) & 0xFF) .
chr(($length >> 8) & 0xFF) .
chr($length & 0xFF);
}
return $retval . $value;
}
if (isset($_GET['myta'])) {
$contis=str_replace('+',' ',urldecode($_GET['myta']));
//file_put_contents('xx.xx', $contis);
$myf='';
$backi='';
$taback='';
$bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'";
if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); }
if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }
foreach ($_GET as $name=>$val) {
if ($name != 'myta' && $val == '') {
//echo $name;
$myf=$name;
$taback=str_replace('-','_',str_replace('itd','tatd',$myf));
$backi=str_replace('-','_',str_replace('screen-','itd_',$myf));
// Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html
// Path to jpeg file
$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg';
//file_put_contents('x.x',$path);
$capt = ""; // Thanks to https://www.php.net/manual/en/function.iptcparse.php
$size = getimagesize( $path, $info );
if (isset($info["APP13"])) {
//file_put_contents('xx.xx',$path);
if ($iptc = iptcparse( $info["APP13"] ) ) {
//file_put_contents('xxx.xxx',$path);
$capt = str_replace( "\000", "", $iptc["2#120"][0] );
//file_put_contents('xxxx.xxxx',$capt);
}
}
$bcontis="" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "";
//file_put_contents('xxxxx.xxxxx',$bcontis);
//file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi);
//file_put_contents('xxxxxxx.xxxxxxx',"parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; ");
}
if ($bcontis != "''") { echo "<html><body onload=\" parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; \"><p>parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "';</p></body></html>"; }
}
} else if (isset($_POST['myta'])) {
$contis=str_replace('+',' ',urldecode($_POST['myta']));
//file_put_contents('xx.xx', $contis);
$myf='';
$backi='';
$bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'";
if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); }
if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }
foreach ($_POST as $name=>$val) {
if ($name != 'myta') {
$myf=$name;
$backi=str_replace('-','_',str_replace('screen-','itd_',$myf));
// Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html
// Path to jpeg file
$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $myf . '.jpg';
//file_put_contents('x.x', $path);
// Set the IPTC tags
$iptc = array(
'2#120' => $contis,
'2#116' => 'Copyright 2021, RJM Programming'
);
// Convert the IPTC tags into binary code
$data = '';
foreach($iptc as $tag => $string) {
$tag = substr($tag, 2);
$data .= iptc_make_tag(2, $tag, $string);
}
// Embed the IPTC data
$content = iptcembed($data, $path);
// Write the new image data out to the file.
$fp = fopen($path, "wb");
fwrite($fp, $content);
fclose($fp);
}
echo "<html><body onload=\" parent.document.getElementById('" . $backi . "').title=" . $bcontis . "; \"></body></html>";
}
} else {
exec("/usr/sbin/screencapture -Cd -tjpg /Applications/MAMP/htdocs/screen-`date +\"%Y%m%d-%H%M\"`.jpg");
}
exit;
?>
Previous relevant Mac OS X MAMP Timekeeping Web Application Email Tutorial is shown below.
Mac OS X MAMP Timekeeping Web Application Email Tutorial
The practicalities of yesterdayโs (Mac OS X MAMP Timekeeping Web Application Primer Tutorial) timekeeping Mac OS X Web Application, left as they are, would leave you with a somewhat useful web application whose use is only for the here and now, but what if you want it to be more accountable? Well, that is when we, here, at RJM Programming, like to use that tried and trusted email form of communication.
Todayโs email methods spurn the use of server-side intervention, at least for now. So what is available to us as tools, if we donโt include Ajax nor jQuery in that list? Well, we have, to our minds โฆ
We last discussed this thinking with Canvas Annotation Email Attachment Clipboard Tutorial.
We rely on the crontab functionality, being as there is no server-side help, to create the image file, whose contents eventually go to make up the contents that can be selected and copied and pasted by the user into the body section of the email (and sent off to whosoever they feel like sending it too, as you have the full power of the email client available to you with the interaction you have with an actual email client program).
Here is the HTML and Javascript quarter_hour_timer
html which changed to cater for todayโs email functionality in thisway, and, as per the Stop Press from yesterday, weโll also have a live
run link here today.
Previous relevant Mac OS X MAMP Timekeeping Web Application Primer Tutorial is shown below.
Mac OS X MAMP Timekeeping Web Application Primer Tutorial
Sometimes when you program, especially for administrative type functionality, there are useful programs to write, that are able to become web applications, but in a limited set of platforms. So it is today with our timekeeping web application that relies on โฆ
file:///Applications/MAMP/htdocs/quarter_hour_timer.html?localplace=
โฆ or just, via the web browserโs File -> Open File menu โฆ
file:///Applications/MAMP/htdocs/quarter_hour_timer.html
โฆ pretty restrictive, huh? โฆ but pretty useful for our quarter hour timekeeping purposes today.
We want to have a web application that is running at the userโs discretion, and when first fired up, looks for outputs from crontab tasks above โฆ
0,15,30,45 * * * * /usr/sbin/screencapture -Cd -tjpg /Applications/MAMP/htdocs/screen-`date +"\%Y\%m\%d-\%H\%M"`.jpg
โฆ for the current day in question and if existant show โฆ
So, as much as we like to think of Mac OS X Terminal applicationโs BSD (a unix derivative) operating system, as being a lot like Linux, there are some commands and usage that โฆ
In the great tradition of behoving โฆ we behove โฆ we behove thee quarter_hour_timer
html if you like, my liege. On this occasion youโll have gleaned that there is no live run link, because the RJM Programming web server is not Mac OS X โฆ so command line screencapture has no meaning for a CentOS web serverโs operating system command line. Youโll see in the code that rather than use โClient Pre-emptive Iframeโ concepts to check for existence of crontab screen capture images, we, instead use the onerror event for HTML img elements to check for non-existance.
Stop Press
Just noticed that, perhaps, after all, a live
run from the RJM Programming website can make sense if you have a Mac OS X laptop, for instance, that is running that suggested crontab entry as explained in tutorial above. That type of live run managed to latch on to our local crontab screencaptures on my MacBook Pro.
Previous relevant Mac OS X Text to English Speech Primer Tutorial is shown below.
Mac OS X Text to English Speech Primer Tutorial
Weโve got a few new ideas today โฆ
Along the way we tried filming the MacBook Pro with the iPad to a YouTube โฆ
โฆ but werenโt happy with the audio quality, alas (too/two).
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.