Details Summary Button Delayed Onclick Tutorial
โœ‚๐Ÿƒ๐Ÿพโ€โ™€๏ธ๐Ÿƒ๐Ÿผโ€โ™‚๏ธ
๐Ÿ“–

Details Summary Button Delayed Onclick Tutorial

Details Summary Button Delayed Onclick Tutorial

You might have noticed with yesterdayโ€™s Details Summary Button Onclick Primer Tutorialโ€˜s โ€ฆ.

  • details or summary element onclick logic that it relied on an assumption that โ€ฆ
  • the onclick event occurs after a details element attribute โ€œopenโ€ is finalized โ€ฆ and though โ€ฆ
  • we โ€œfeelโ€ that this might be true โ€ฆ yet, we would rather โ€ฆ
  • not chance it, and make it that the onclick event occurs โ€œdelayedโ€ after any details element attribute โ€œopenโ€ is finalized โ€ฆ using โ€ฆ
  • that ever useful setTimeout timer function

โ€ฆ but with more nuance than our usual Javascript โ€ฆ



function calledBySetTimeout_nothingPassed() {

console.log('called by setTimeout');

}



setTimeout(calledBySetTimeout_nothingPassed, 3000); // delayed by 3 seconds

โ€ฆ way of doing things, that we seem to use in every second project. Today, with great advice from this very useful link we jump quite a few nuances to more complexity than we had in mind for some future โ€œinfillingโ€ blog postings, but the ideas being so cute, we want to drop you users unfamiliar with the joys of the โ€œsetTimeoutโ€ timer into some quite deeeeeeeeeeep water โ€ฆ with โ€ฆ called โ€ฆ



function makeDelayedHandler(f, time){ // Delay execution of event handler function "f" by "time" ms, thanks to https://stackoverflow.com/questions/3048005/document-onclick-settimeout-function-javascript-help

return function(e){

var ev = e || window.event;

setTimeout(function(){

f(ev);

}, time);

};

}



function checkds(e) {

var ois = (e && e.target) || (event && event.srcElement);

var dpp='';

var dld='';

var oga='';

try {

dpp=ois.getAttribute('data-preid').replace(/^null$/g, '').replace(/^undefined$/g, '');

dld=ois.getAttribute('data-lastid').replace(/^null$/g, '').replace(/^undefined$/g, '');

} catch(ewq) {

}

if (ois.parentElement && ois.outerHTML.toLowerCase().indexOf('<summary') == 0) {

oga=('' + ois.getAttribute('data-pardet')).replace(/^null$/g, '').replace(/^undefined$/g, '').replace(/^false$/g, '');

if (oga != '') {

ois=document.getElementById(oga);

oga=ois.open; //('' + ois.getAttribute('open')).replace(/^null$/g, '').replace(/^undefined$/g, '').replace(/^false$/g, '');

try {

if (dpp.trim() == '' && dld.trim() == '') {

dpp=ois.getAttribute('data-preid').replace(/^null$/g, '').replace(/^undefined$/g, '');

dld=ois.getAttribute('data-lastid').replace(/^null$/g, '').replace(/^undefined$/g, '');

}

} catch(ewqtwo) {

}

} else {

oga=ois.parentElement.open; //('' + ois.parentElement.getAttribute('open')).replace(/^null$/g, '').replace(/^undefined$/g, '').replace(/^false$/g, '');

ois=ois.parentElement;

}

if (dpp.trim() == '' && dld.trim() == '') {

dpp=ois.getAttribute('data-preid').replace(/^null$/g, '').replace(/^undefined$/g, '');

dld=ois.getAttribute('data-lastid').replace(/^null$/g, '').replace(/^undefined$/g, '');

}

} else {

oga=ois.open; //('' + ois.getAttribute('open')).replace(/^null$/g, '').replace(/^undefined$/g, '').replace(/^false$/g, '');

}

if (oga) {

location.href='#' + dpp; //ois.getAttribute('data-preid');

location.href='#' + dld; //ois.getAttribute('data-lastid');

}

}

โ€ฆ via changed calling logic as per โ€ฆ



var initiallynone=false;




function lookfordsa() {

var lastdet1='', lastdet2='', lastdetid='';

var ebefore='', fbefore='';

var nodetails=true;

var lasteis=null, lastid='';

var indselems=document.getElementsByTagName('details');

var hashtop='top';

var bihis='';

if (eval('' + indselems.length) > 0) {

var inelems=document.getElementsByTagName('*');

nodetails=false;

if (initiallynone) { initiallynone=false; setTimeout(lookfordsa, 3000); return; }

bihis=document.body.innerHTML;




for (var iplj=0; iplj<inelems.length; iplj++) {

if (('' + inelems[iplj].outerHTML).toLowerCase().replace(/^null$/g, '').replace(/^undefined$/g, '').indexOf('<br') == 0) {

lastid=lastid;

} else if (('' + inelems[iplj].outerHTML).toLowerCase().replace(/^null$/g, '').replace(/^undefined$/g, '').indexOf('<summary') == 0) {

nodetails=false;

if (lastdetid != '') {

inelems[iplj].setAttribute('data-pardet', lastdetid);

lastdetid='';

}


if (lasteis && lastid != '') {

if (('' + inelems[iplj].onclick).replace(/^null$/g, '').replace(/^undefined$/g, '') == '') {

inelems[iplj].setAttribute('data-preid', '' + hashtop.replace('#',''));

inelems[iplj].setAttribute('data-lastid', '' + lastid);

if (1 == 1) {

inelems[iplj].onclick = makeDelayedHandler(checkds, 1000);

} else {


inelems[iplj].onclick = function(evt) { location.href='#' + evt.target.getAttribute('data-preid'); location.href='#' + evt.target.getAttribute('data-lastid'); }

}

console.log('summary:' + lastid);

}

}

lasteis=null;

lastid='';

} else if (('' + inelems[iplj].outerHTML).toLowerCase().replace(/^null$/g, '').replace(/^undefined$/g, '').indexOf('<details') == 0) {

nodetails=false;

if (lasteis && lastid != '') {

if (('' + inelems[iplj].onclick).replace(/^null$/g, '').replace(/^undefined$/g, '') == '') {

lastdet1=hashtop.replace('#','');

inelems[iplj].setAttribute('data-preid', '' + hashtop.replace('#',''));

lastdet2=lastid;

inelems[iplj].setAttribute('data-lastid', '' + lastid);

//document.getElementById('myh1').innerHTML+=('details:' + lastid);

if (1 == 1) {

inelems[iplj].onclick = makeDelayedHandler(checkds, 1000);

} else {


inelems[iplj].onclick = function(evt) { if (('' + evt.target.getAttribute('open')).replace(/^null$/g, '').replace(/^undefined$/g, '').replace(/^false$/g, '') != '') { location.href='#' + evt.target.getAttribute('data-preid'); location.href='#' + evt.target.getAttribute('data-lastid'); } }

}

//inelems[iplj].onclick = function(evt) { location.href='#' + evt.target.getAttribute('data-preid'); location.href='#' + evt.target.getAttribute('data-lastid'); }

lastdetid=('' + inelems[iplj].id);

lasteis=null;

lastid='';


}

} else {

if (bihis.indexOf(('' + inelems[iplj].outerHTML).replace(/^null$/g, '').replace(/^undefined$/g, '')) != -1) {

ebefore=bihis.split(('' + inelems[iplj].outerHTML).replace(/^null$/g, '').replace(/^undefined$/g, ''))[0].replace(/\ \;/g,'');

if ((ebefore.trim() + '~').indexOf('</a>~') != -1) {

fbefore='<a ' + ebefore.split('<a ')[eval(-1 + ebefore.split('<a ').length)];

if (fbefore.indexOf(' id="') != -1) {

lastid=fbefore.split(' id="')[1].split('"')[0];

lasteis=document.getElementById(lastid);

console.log(lastid);

console.log(lasteis.outerHTML);

console.log(lasteis.href);

if (('' + lasteis.href).indexOf('#') >= 0) {

hashtop='#' + lasteis.href.split('#')[1];

//alert('4:' + hashtop);

}


if (('' + inelems[iplj].onclick).replace(/^null$/g, '').replace(/^undefined$/g, '') == '') {

lastdet1=hashtop.replace('#','');

inelems[iplj].setAttribute('data-preid', '' + hashtop.replace('#',''));

lastdet2=lastid;

inelems[iplj].setAttribute('data-lastid', '' + lastid);

//document.getElementById('myh1').innerHTML+=('details:' + lastid);

if (1 == 1) {

inelems[iplj].onclick = makeDelayedHandler(checkds, 1000);

} else {


inelems[iplj].onclick = function(evt) { if (('' + evt.target.getAttribute('open')).replace(/^null$/g, '').replace(/^undefined$/g, '').replace(/^false$/g, '') != '') { location.href='#' + evt.target.getAttribute('data-preid'); location.href='#' + evt.target.getAttribute('data-lastid'); } }

}

lastdetid=('' + inelems[iplj].id);

lasteis=null;

lastid='';


}

}

//alert('Not Here ');

}

}

}

} else {

if (('' + inelems[iplj].type).toLowerCase() == 'a') {

if (('' + inelems[iplj].id) != '') {

if (('' + inelems[iplj].href).indexOf('#') >= 0) {

hashtop='#' + inelems[iplj].href.split('#')[1];

//alert('7:' + hashtop);

lasteis=inelems[iplj];

lastid=inelems[iplj].id;

} else {

lasteis=null;

lastid='';

}

}

} else if (('' + inelems[iplj].outerHTML).replace(/^null$/g, '').replace(/^undefined$/g, '').replace(/\ \;/g, '').trim() != '') {

//if (lasteis) { alert('lastid=' + lastid + ' and this.outerHTML=' + inelems[iplj].outerHTML); }

lasteis=null;

lastid='';

}

}

}

}

if (nodetails) { initiallynone=true; setTimeout(lookfordsa, 3000); } else if (initiallynone) { initiallynone=false; setTimeout(lookfordsa, 3000); }

}



setTimeout(lookfordsa, 3000);

โ€ฆ involved in thechanged external Javascript details_hashโšซjs that you can test with ourโœ‚inhouse chat web application.



Previous relevant Details Summary Button Onclick Primer Tutorial is shown below.

Details Summary Button Onclick Primer Tutorial

Details Summary Button Onclick Primer Tutorial

Weโ€™ve written an external Javascript details_hashโšซjs that โ€ฆ

  • adds button like qualities (ie. onclick logic) to details/summary element combinations that are โ€ฆ
  • preceeded by an โ€œaโ€ tag with # hashtag navigation โ€œhrefโ€ attribute โ€ฆ and a โ€ฆ

  • real โ€œidโ€ attribute (that, in turn, can be hashtag navigated to) โ€ฆ in which case โ€ฆ
  • dynamic โ€œonclickโ€ logic is added (to details or summary), if none defined already, to hashtag navigate to a good view of this details/summary content (to top of screen, but allowing for โ€œBack to Chatโ€ hashtag navigation, already there, as well)

โ€ฆ uses logic we had yesterdayโ€™s Chat No Sockets Chrome Hear It Tutorial web architecture to work from, with testing and which you can try yourself via todayโ€™schanged php_listenerโšซphpโ€˜s chatโœ‚web application.

Youโ€™ll see in that changed code above, the biggest changes being the call of this external Javascript, as per (within document.head) โ€ฆ

<?php echo โ€


<style>

b:hover { border: 1px solid red; }

a[href=\"#myh1\"] { font-size: 32px; }

summary { background-color:#f0f0f0; border: 1px solid olive; }


</style>

<script type='text/javascript' src='HTTP://www.rjmprogramming.com.au/PHP/details_hash.js?x=" . rand(0,23456) . "' defer></script>


โ€œ; ?>


Previous relevant Chat No Sockets Chrome Hear It Tutorial is shown below.

Chat No Sockets Chrome Hear It Tutorial

Chat No Sockets Chrome Hear It Tutorial

Back at the inhouse Chat web application today we combine โ€ฆ

โ€ฆ to get helped out by the excellent Google Translateโ€˜s translation and Text to Speech capabilities, to add a โ€œhear itโ€ layer of functionality to this Chat web application.

As well, we establish โ€ฆ

  • bold text styling of the latest chat line from a chat collaborator โ€ฆ that has โ€ฆ
  • HTML โ€ฆ


    <b onclick="gtit(this);" onmouseover="gtit(this);">Chat Line</b>


    โ€ฆ combining with โ€ฆ
  • Javascript โ€ฆ


    var gtw=null, gtwurl='';



    function windowopen(gtu, gtb, gtx) {

    if (gtu == gtwurl) {

    if (gtw) {

    if (gtw.closed) {

    return window.open(gtu, gtb, gtx);

    }

    } else {

    return window.open(gtu, gtb, gtx);

    }

    } else {

    gtwurl=gtu;

    if (gtw) {

    if (!gtw.closed) {

    gtw.close();

    }

    }

    return window.open(gtu, gtb, gtx);

    }

    return gtw;

    }



    function gtit(ihis) {

    var instuff=(ihis.innerHTML.split('<')[0]);

    gtw=windowopen('https://translate.google.com/#view=home&op=translate&sl=' + top.document.getElementById('ootw').value.substring(0,2).replace(top.document.getElementById('ootw').value.substring(2),'auto') + '&tl=' + top.document.getElementById('ootw').value.substring(2) + '&text=' + encodeURIComponent(instuff.split('<br>')[0]), '_blank', 'left=100,top=100,width=500,height=500');

    }

  • for the non-Microsoft web browsers we establish our favourite โ€œrevealโ€ stylers, the details/summary element combination that can programmatically โ€œscrunch upโ€ and allow user interactive flexibility via โ€ฆ
    <?php echo โ€


    function detsum(viaoid, thisoid, ems) {

    var eparts=ems.split('.'), ipre=0;

    var eprefix=\"<p title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#\" + eparts[0] + \";</p>\";

    eprefix=\"&#\" + eparts[0] + \";\";

    var esuffix='';

    if (navigator.appName == 'Microsoft Internet Explorer' || (navigator.appName == 'Netscape' && navigator.appVersion.indexOf('Edge') > -1)) {

    return '';

    }

    var noif=thisoid.replace('if','');

    if (viaoid.indexOf(noif) != -1) {

    if (eparts.length > 1) {

    eprefix=\"<span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#\" + eparts[0] + \";</span>\";

    for (ipre=1; ipre<eparts.length; ipre++) {

    esuffix+=\"<span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#\" + eparts[ipre] + \";</span>\";

    }

    }

    eprefix=eprefix.replace('</p>','</span>').replace('<p','<span');

    return '  <details id=det' + noif + ' style=display:inline-block;width:95%; open><summary style=display:inline;font-size:32px;>' + eprefix + esuffix + '</summary>';

    } else {

    if (eparts.length > 1) {

    eprefix=\"<span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#\" + eparts[0] + \";</span>\";

    for (ipre=1; ipre<eparts.length; ipre++) {

    esuffix+=\"<span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#\" + eparts[ipre] + \";</span>\";

    }

    }

    eprefix=eprefix.replace('</p>','</span>').replace('<p','<span');

    return '  <details id=det' + noif + ' style=display:inline-block;width:95%;><summary style=display:inline;font-size:32px;>' + eprefix + esuffix + '</summary>';

    }

    }




    function sumdet(viaoid, thisoid) {

    if (navigator.appName == 'Microsoft Internet Explorer' || (navigator.appName == 'Netscape' && navigator.appVersion.indexOf('Edge') > -1)) {

    return '';

    }

    return '</details>';

    }



    function ddivfbit(ioi) {

    var detlist=document.getElementsByTagName('details'), idetlist=1;

    if (document.getElementById('dfeedback').innerHTML == '') {

    document.getElementById('dfeedback').innerHTML=\"<a id=ifdict href=#myh1 style=vertical-align:top; title=Top>^</a>\" + detsum(ioi.id,'ifdict','128483') + \"<br><iframe id=idict style='width:100%;height:800px;' src='https://www.rjmprogramming.com.au/PHP/speech_supervisor.php?topchat=" . $enduring . "'></iframe>\" + sumdet(ioi.id,'ifdict') + \"<br><a id=ifimg href=#myh1 style=vertical-align:top; title=Top>^</a>\" + detsum(ioi.id,'ifimg','128444.127912') + \"<br><iframe id=iimg style='width:100%;height:800px;' src='../HTMLCSS/feedback.htm?sid=" . $enduring . "'></iframe>\" + sumdet(ioi.id,'ifimg') + \"<br><a id=ifav href=#myh1 style=vertical-align:top; title=Top>^</a>\" + detsum(ioi.id,'ifav','128452.128250') + \"<br><iframe id=iav style='width:100%;height:800px;' src='../macos_say_record.php?topchat=" . $enduring . "'></iframe>\" + sumdet(ioi.id,'ifav') + \"\";

    } else if (ioi.id.indexOf('dict') != -1 && document.getElementById('idict').src.indexOf('topchat=') == -1) {

    if (document.getElementById('detdict')) { document.getElementById('detdict').setAttribute('open',true); for (idetlist=1; idetlist<detlist.length; idetlist++) { detlist[idetlist].removeAttribute('open'); } }

    document.getElementById('idict').src=document.getElementById('idict').src.split('?')[0].split('#')[0] + '?topchat=" . $enduring . "';

    } else if (detlist.length > 0) {

    for (idetlist=0; idetlist<detlist.length; idetlist++) {

    if (detlist[idetlist].id.indexOf(ioi.id.replace('if','').replace('aa','')) != -1) {

    detlist[idetlist].setAttribute('open',true);

    } else {

    detlist[idetlist].removeAttribute('open');

    }

    }

    }

    }




    function divfbit(ioi) {

    var detlist=document.getElementsByTagName('details'), idetlist=1;

    if (document.getElementById('dfeedback').innerHTML == '') {

    document.getElementById('dfeedback').innerHTML=\"<a id=ifdict href=#myh1 style=vertical-align:top; title=Top>^</a>\" + detsum(ioi.id,'ifdict','128483') + \"<br><iframe id=idict style='width:100%;height:800px;' src='https://www.rjmprogramming.com.au/PHP/speech_supervisor.php'></iframe>\" + sumdet(ioi.id,'ifdict') + \"<br><a id=ifimg href=#myh1 style=vertical-align:top; title=Top>^</a>\" + detsum(ioi.id,'ifimg','128444.127912') + \"<br><iframe id=iimg style='width:100%;height:800px;' src='../HTMLCSS/feedback.htm?sid=" . $enduring . "'></iframe>\" + sumdet(ioi.id,'ifimg') + \"<br><a id=ifav href=#myh1 style=vertical-align:top; title=Top>^</a>\" + detsum(ioi.id,'ifav','128452.128250') + \"<br><iframe id=iav style='width:100%;height:800px;' src='../macos_say_record.php?topchat=" . $enduring . "'></iframe>\" + sumdet(ioi.id,'ifav') + \"\";

    } else if (ioi.id.indexOf('dict') != -1 && document.getElementById('idict').src.indexOf('topchat=') != -1) {

    if (document.getElementById('detdict')) { document.getElementById('detdict').setAttribute('open',true); for (idetlist=1; idetlist<detlist.length; idetlist++) { detlist[idetlist].removeAttribute('open'); } }

    document.getElementById('idict').src=document.getElementById('idict').src.split('?')[0].split('#')[0];

    } else if (detlist.length > 0) {

    for (idetlist=0; idetlist<detlist.length; idetlist++) {

    if (detlist[idetlist].id.indexOf(ioi.id.replace('if','').replace('aa','')) != -1) {

    detlist[idetlist].setAttribute('open',true);

    } else {

    detlist[idetlist].removeAttribute('open');

    }

    }

    }

    }


    โ€œ; ?>

Todayโ€™schanged php_listenerโšซphpโ€˜s chatโœ‚web application is worth your while (re)trying, we reckon.


Previous relevant Chat No Sockets Chrome Hands Free Tutorial is shown below.

Chat No Sockets Chrome Hands Free Tutorial

Chat No Sockets Chrome Hands Free Tutorial

Continuing on with yesterdayโ€™s Chat No Sockets Dictation Tutorial start to our โ€ฆ

Google Chrome โ€œHands Freeโ€ Chat dream

โ€ฆ weโ€™ve progressed a little via โ€ฆ

  • localStorage recall of last email or SMS into respective textbox โ€œplaceholderโ€ attributes (ie. not all the way to โ€œvalueโ€ attribute yet) โ€ฆ ready for โ€ฆ
  • new โ€œemailโ€ or โ€œsmsโ€ Dictation word logic to try to focus to respective (Email โ€œiemailโ€ or SMS โ€œismsโ€) textbox โ€ฆ triggering ..,.
  • respective (Email โ€œiemailโ€ or SMS โ€œismsโ€) textbox โ€œplaceholderโ€ attribute sets โ€œvalueโ€ attribute to that localStorage derived setting โ€ฆ
  • dictated โ€œemail inviteโ€ will send an email invitation via PHP mail rather than the extra interactions of using an โ€œaโ€ โ€œmailto:โ€ email client application link (as you can see with todayโ€™s tutorial picture)

Of course thereโ€™s more โ€œhands freeโ€ (logic) to go, but consider โ€œHey Siriโ€ or other ways to get to the webpageโ€™s web application, and the dream is gradually becoming a reality.

Todayโ€™schanged php_listenerโšซphpโ€˜s chatโœ‚web application now also interfaces to achanged speech_supervisorโšซphp PHP code for โ€œDictationโ€ functionalities.


Previous relevant Chat No Sockets Dictation Tutorial is shown below.

Chat No Sockets Dictation Tutorial

Chat No Sockets Dictation Tutorial

Weโ€™ve got a couple of concepts onto yesterdayโ€™s Chat No Sockets Media Tutorial progress, those being โ€ฆ

  • allow, at least for Google Chrome web browsing, โ€œDictationโ€ Speech to Text functionality thanks to Google Speech to Text functionality we last would have referenced with Looks Nice Nearby Speech to Text Game Video Tutorial โ€ฆ and associated with an overall aim for โ€œhands freeโ€ (as well) โ€ฆ
  • on some browsers weโ€™ve succeeded playing a Beeoop sound when your Chat collaborator โ€œchat lineโ€ has arrived, and weโ€™d like to thank this excellent link for the methodology used โ€ฆ Javascript โ€ฆ


    var a=null;

    if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {

    a=new AudioContext(); // browsers limit the number of concurrent audio contexts, so you better re-use'em

    }



    function beep(vol, freq, duration) { // thanks to https://odino.org/emit-a-beeping-sound-with-javascript/

    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {

    navigator.vibrate(200);

    } else if (a) {

    v=a.createOscillator();

    u=a.createGain();

    v.connect(u);

    v.frequency.value=freq;

    v.type="square";

    u.connect(a.destination);

    u.gain.value=vol*0.01;

    v.start(a.currentTime);

    v.stop(a.currentTime+duration*0.001);

    }

    }



    function mosay(instuff) {

    document.getElementById('bboop').click(); //beep(999, 220, 300);

    return instuff;

    }


    โ€ฆ to work with HTML โ€ฆ


    <button style='display:none;' id=bboop onclick='beep(999, 220, 300);'>Boop</button>

Todayโ€™schanged php_listenerโšซphpโ€˜s chatโœ‚web application now also interfaces to achanged speech_supervisorโšซphp PHP code for โ€œDictationโ€ functionalities.


Previous relevant Chat No Sockets Media Tutorial is shown below.

Chat No Sockets Media Tutorial

Chat No Sockets Media Tutorial

Adding to yesterdayโ€™s Chat No Sockets Imagery Tutorial โ€ฆ

  • image functionality โ€ฆ thereโ€™s more to โ€œmediaโ€ in the online wooooorrrrrlllllldddd than just images, and so today โ€ฆ we add the possibility for โ€ฆ
  • audio
  • video

โ€ฆ sharing capabilities with our inhouse Chat web application. We need to turn to a โ€œhelperโ€ that uses the HTML5 File API, and the recent one we almost immediately thought of (after some small room ruminations) that recent โ€œVoiceoverโ€ ideas web application (which became a helper, in turn, to the โ€œHaikuโ€ creator web application (connected to the knee bone)).

An awkward single โ€œaโ€ link seemed a bit forlorn in view of these Chat data functionality extensions, and so we constructed two Animated Emoji Button โ€œaโ€/โ€spanโ€ sets utilizing the Javascript โ€œthrobbingspans()โ€ function as per โ€ฆ



var tgsps=[], tgspsop=[], newres='', preurl='', tgspsopwhat=[];

// Eg. of html <a style='text-decoration:underline;cursor:pointer;' onclick=\"divfbit(); location.href='#ifimg'; \" title='Image Canvas'><span title='Animated Emoji' style='opacity: 0.4; font-size: 32px;'>&#128444;</span><span style='margin-left: -32px; opacity: 0.4; font-size: 32px;'>&#127912;</span></a>



function throbbingspans() {

var isps, jsps;

if (tgsps.length == 0) {

var sps=document.getElementsByTagName('span');

for (isps=0; isps<sps.length; isps++) {

if (('' + sps[isps].style.opacity) != '') {

if (eval('' + sps[isps].style.opacity) < 1.0) {

tgsps.push(sps[isps]);

tgspsop.push(eval('' + sps[isps].style.opacity));

tgspsopwhat.push(eval('0.10'));

}

}

}

}

if (tgsps.length != 0) {

for (jsps=0; jsps<tgsps.length; jsps+=2) {

if (tgspsop[jsps] > 0.12 && tgspsop[jsps] < 0.88 && tgspsop[1 + jsps] > 0.12 && tgspsop[1 + jsps] < 0.88) { // && tgspsop[jsps] >= tgspsop[1 + jsps]) {

tgspsop[jsps]+=tgspsopwhat[jsps];

tgspsop[1 + jsps]-=tgspsopwhat[1 + jsps];

tgsps[jsps].style.opacity='' + tgspsop[jsps];

tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];

} else if (tgspsop[jsps] > 0.12 && tgspsop[jsps] < 0.88 && tgspsop[1 + jsps] > 0.12 && tgspsop[1 + jsps] < 0.88) { // && tgspsop[jsps] <= tgspsop[1 + jsps]) {

tgspsop[jsps]-=tgspsopwhat[jsps];

tgspsop[1 + jsps]+=tgspsopwhat[1 + jsps];

tgsps[jsps].style.opacity='' + tgspsop[jsps];

tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];

} else if (tgspsop[jsps] > 0.88) {

tgspsop[jsps]-=0.1;

tgspsop[1 + jsps]+=0.1;

tgsps[jsps].style.opacity='' + tgspsop[jsps];

tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];

tgspsopwhat[jsps]=-tgspsopwhat[jsps];

tgspsopwhat[1 + jsps]=-tgspsopwhat[1 + jsps];

} else if (tgspsop[1 + jsps] > 0.88) {

tgspsop[jsps]+=0.1;

tgspsop[1 + jsps]-=0.1;

tgsps[jsps].style.opacity='' + tgspsop[jsps];

tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];

tgspsopwhat[jsps]=-tgspsopwhat[jsps];

tgspsopwhat[1 + jsps]=-tgspsopwhat[1 + jsps];

} else if (tgspsop[1 + jsps] < 0.12) {

tgspsop[jsps]-=0.1;

tgspsop[1 + jsps]+=0.1;

tgsps[jsps].style.opacity='' + tgspsop[jsps];

tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];

tgspsopwhat[jsps]=-tgspsopwhat[jsps];

tgspsopwhat[1 + jsps]=-tgspsopwhat[1 + jsps];

} else if (tgspsop[jsps] < 0.12) {

tgspsop[jsps]+=0.1;

tgspsop[1 + jsps]-=0.1;

tgsps[jsps].style.opacity='' + tgspsop[jsps];

tgsps[1 + jsps].style.opacity='' + tgspsop[1 + jsps];

tgspsopwhat[jsps]=-tgspsopwhat[jsps];

tgspsopwhat[1 + jsps]=-tgspsopwhat[1 + jsps];

}

}

setTimeout(throbbingspans, 900);

}

}

Todayโ€™schanged php_listenerโšซphpโ€˜s chatโœ‚web application now also interfaces to achanged macos_say_recordโšซphp PHP code for โ€œVoiceoverโ€ audio and video creation functionalities.


Previous relevant Chat No Sockets Imagery Tutorial is shown below.

Chat No Sockets Imagery Tutorial

Chat No Sockets Imagery Tutorial

SMS moved on many years ago from a text based content system onto one that these days allows media sharing, as well, so we should allow for this too, adding onto the functionality of yesterdayโ€™s Chat No Sockets SMS Invitation Tutorial.

We wanted to do this by interfacing to an inhouse web application that allows for canvas graphical data creation, and then onto the Chat invitee as imagery (via the [canvas].toDataURL method). For this we decided to interface to the inhouse โ€œFeedbackโ€ web application.

At regular intervals we call the โ€œFeedbackโ€ web application, flagging it to regularly check for changed canvas data conditions, in which case our parent โ€œChatโ€ web application table cell like โ€ฆ



<td id=thi style='background-size:contain;background-repeat:no-repeat;background-color:white;'></td>

โ€ฆ is given a background image (later passed onto your Chat collaborator) via Javascript DOM (that is the onload event logic of a child iframe to the parent Chat (PHP) web application) such as โ€ฆ



function zcheckitagain(iois) {

if (iois != null) {

var aconto = (iois.contentWindow || iois.contentDocument);

if (aconto != null) {

if (aconto.document) { aconto = aconto.document; }

if (aconto.body != null) {

if (aconto.body.innerHTML != '') {

if (aconto.body.innerHTML.indexOf('"da' + 'ta:') != -1) {

parent.otherimgdatauri='data:' + aconto.body.innerHTML.split('"da' + 'ta:')[1].split('"')[0];

parent.document.getElementById('thi').style.backgroundImage='URL(' + parent.otherimgdatauri + ')';

} else if (aconto.body.innerHTML.indexOf("'da" + 'ta:') != -1) {

parent.otherimgdatauri='data:' + aconto.body.innerHTML.split("'da" + 'ta:')[1].split("'")[0];

parent.document.getElementById('thi').style.backgroundImage='URL(' + parent.otherimgdatauri + ')';

}

}

}

}

}

}

Thechanged php_listenerโšซphpโ€˜s chatโœ‚web application โ€œfourth draftโ€ interfacing to the canvas functionality of the โ€œFeedbackโ€ web application, and helped out by thechanged external Javascript worldโšซjs code.


Previous relevant Chat No Sockets SMS Invitation Tutorial is shown below.

Chat No Sockets SMS Invitation Tutorial

Chat No Sockets SMS Invitation Tutorial

Yesterdayโ€™s Chat No Sockets Session Tutorial gives us an opportunity to become more โ€œgranularโ€ with our examination of nuances to โ€ฆ

  • the web applicationโ€™s โ€œsurfing the webโ€ look and aesthetics (first look) and usage practicalities (involving button disabling/enabling at appropriate places in the PHP code (writing Javascript logic)) โ€ฆ and โ€ฆ a bit gobsmacking to us โ€ฆ
  • the need to place a two step logic โ€œtidy upโ€ of obsolete files when dealing with SMS Invitations (to Chat)

โ€ฆ the latter being that we discovered that โ€ฆ

  • between the point an inviter opens their SMS Messaging app with a populated message that is the URL our Chat web application wants the inviter to send โ€ฆ and โ€ฆ
  • that inviter typing the carriage return character that โ€œrendersโ€ that SMS that is sent to the invitee โ€ฆ but โ€ฆ
  • before the invitee even sees the SMS

โ€ฆ that URL โ€œrenderโ€ causes an (unexpected to us) real visit of our web server code, and we need to just let the โ€œlook ofโ€ the โ€œresultant SMS webpageโ€ through at this point, but leave โ€œthe implicationsโ€ for the next time this โ€œSMS webpageโ€ is asked for when the invitee clicks/taps the SMS link they receive from the inviter. The timing of all this is controlled in the logic by the existence of a (what used to be exclusively) โ€œchat_*.lineโ€ file, but we now need (to allow for โ€œchat_*.lin2โ€ then โ€œchat_*.lineโ€) as per โ€ฆ

On clicking the โ€œInviteโ€ button, having filled out the โ€œSMS numberโ€ field (rather than the Email one)
function butlogic() {
if (document.getElementById(โ€˜ismsโ€™).value.trim() != โ€) {
document.getElementById(โ€˜jchildโ€™).src=document.URL.split(โ€˜#โ€™)[0].split(โ€˜?โ€™)[0] + โ€˜?sid=โ€ . $enduring . โ€œ&address=โ€™ + encodeURIComponent(document.getElementById(โ€˜ismsโ€™).value + โ€˜#โ€™) + โ€˜&ipaddress=โ€™ + encodeURIComponent(โ€˜โ€ . $sra . โ€œโ€˜) + โ€˜&ichat=โ€™ + encodeURIComponent(document.getElementById(โ€˜ichatโ€™).value);
var wasasms=document.getElementById(โ€˜asmsโ€™).href;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById(โ€˜asmsโ€™).href=(document.getElementById(โ€˜asmsโ€™).href.replace(โ€˜:&โ€™,โ€™:โ€™ + document.getElementById(โ€˜ismsโ€™).value + โ€˜&โ€™) + encodeURIComponent(document.URL.split(โ€˜#โ€™)[0].split(โ€˜?โ€™)[0]) + encodeURIComponent(โ€˜?address=โ€™ + dummyencodeURIComponent(encodeURIComponent(document.getElementById(โ€˜ismsโ€™).value)) + โ€˜#โ€™));
} else {
document.getElementById(โ€˜asmsโ€™).href=(document.getElementById(โ€˜asmsโ€™).href.replace(โ€˜:&โ€™,โ€™:โ€™ + document.getElementById(โ€˜ismsโ€™).value + โ€˜&โ€™) + encodeURIComponent(document.URL.split(โ€˜#โ€™)[0].split(โ€˜?โ€™)[0]) + encodeURIComponent(โ€˜?address=โ€™ + encodeURIComponent(encodeURIComponent(document.getElementById(โ€˜ismsโ€™).value)) + โ€˜#โ€™));
}
document.getElementById(โ€˜asmsโ€™).click();
document.getElementById(โ€˜asmsโ€™).href=wasasms;
} else if (document.getElementById(โ€˜iemailโ€™).value.indexOf(โ€˜@โ€™) != -1) {
document.getElementById(โ€˜jchildโ€™).src=document.URL.split(โ€˜#โ€™)[0].split(โ€˜?โ€™)[0] + โ€˜?sid=โ€ . $enduring . โ€œ&address=โ€™ + encodeURIComponent(document.getElementById(โ€˜iemailโ€™).value) + โ€˜&ipaddress=โ€™ + encodeURIComponent(โ€˜โ€ . $sra . โ€œโ€˜) + โ€˜&ichat=โ€™ + encodeURIComponent(document.getElementById(โ€˜ichatโ€™).value);
document.getElementById(โ€˜aemailโ€™).href=(document.getElementById(โ€˜aemailโ€™).href.replace(โ€˜:?โ€™,โ€™:โ€™ + document.getElementById(โ€˜iemailโ€™).value + โ€˜?โ€™) + encodeURIComponent(document.URL.split(โ€˜#โ€™)[0].split(โ€˜?โ€™)[0]) + encodeURIComponent(โ€˜?address=โ€™ + encodeURIComponent(document.getElementById(โ€˜iemailโ€™).value)));
document.getElementById(โ€˜aemailโ€™).click();
document.getElementById(โ€˜aemailโ€™).href=wasaemail;
}
}
Where the child iframe call above lobs onto in order to create an interim file
} else if (isset($_GET[โ€˜addressโ€™]) && isset($_GET[โ€˜ipaddressโ€™])) {
if (strpos(str_replace(โ€œ@โ€,โ€โ€,str_replace(โ€œ+โ€,โ€ โ€œ,urldecode($_GET[โ€˜addressโ€™]))), โ€œ#โ€) !== false) {
file_put_contents(โ€œchat_โ€ . explode(โ€œ#โ€, str_replace(โ€œ@โ€,โ€โ€,str_replace(โ€œ+โ€,โ€ โ€œ,urldecode($_GET[โ€˜addressโ€™]))))[0] . โ€œ__โ€ . str_replace(โ€œ+โ€,โ€ โ€œ,urldecode($_GET[โ€˜ipaddressโ€™])) . โ€œ.RLSโ€, str_replace(โ€œ+โ€,โ€ โ€œ,urldecode($_GET[โ€˜ichatโ€™])));
} else {

file_put_contents(โ€œchat_โ€ . explode(โ€œ#โ€, str_replace(โ€œ@โ€,โ€โ€,str_replace(โ€œ+โ€,โ€ โ€œ,urldecode($_GET[โ€˜addressโ€™]))))[0] . โ€œ__โ€ . str_replace(โ€œ+โ€,โ€ โ€œ,urldecode($_GET[โ€˜ipaddressโ€™])) . โ€œ.rlsโ€, str_replace(โ€œ+โ€,โ€ โ€œ,urldecode($_GET[โ€˜ichatโ€™])));
}
exit;
Where the โ€œcommand lineโ€ usage part does its bit to appropriately rename those interim files
if ($argv) { // command line โ€ฆ
$cfindings=โ€โ€;
$goes=0;
$howmanygoes=โ€-1โ€ณ;
$par=getenv(โ€œTERMโ€); // thanks to https://stackoverflow.com/questions/3214935/can-a-bash-script-tell-if-its-being-run-via-cron
if (โ€œ$parโ€ == โ€œโ€ || โ€œ$parโ€ == โ€œdummyโ€) { // via cron
$cfindings1=exec(โ€œcrontab -l | grep โ€˜php_listenerโ€™ | grep -v โ€˜grepโ€™ | cut -d โ€˜ โ€˜ -f 1โ€);
$cfindings2=exec(โ€œcrontab -l | grep โ€˜php_listenerโ€™ | grep -v โ€˜grepโ€™ | cut -d โ€˜ โ€˜ -f 2โ€);
$cfindings3=exec(โ€œcrontab -l | grep โ€˜php_listenerโ€™ | grep -v โ€˜grepโ€™ | cut -d โ€˜ โ€˜ -f 3โ€);
$cfindings4=exec(โ€œcrontab -l | grep โ€˜php_listenerโ€™ | grep -v โ€˜grepโ€™ | cut -d โ€˜ โ€˜ -f 4โ€);
$cfindings5=exec(โ€œcrontab -l | grep โ€˜php_listenerโ€™ | grep -v โ€˜grepโ€™ | cut -d โ€˜ โ€˜ -f 5โ€);
if (strpos($cfindings1, โ€œ*/โ€) !== false) {
$howmanygoes=12 * explode(โ€œ*/โ€, $cfindings1)[1];
} else if (strpos($cfindings2, โ€œ*/โ€) !== false) {
$howmanygoes=720 * explode(โ€œ*/โ€, $cfindings2)[1];
} else if (strpos($cfindings3, โ€œ*/โ€) !== false) {
$howmanygoes=17280 * explode(โ€œ*/โ€, $cfindings3)[1];
}
}
while (1) {
foreach (glob(dirname(__FILE__) . โ€œ/chat_*.rlsโ€) as $ourfilename) {
rename($ourfilename, explode(โ€œ.rlsโ€, $ourfilename)[0] . โ€œ.lineโ€);
}
foreach (glob(dirname(__FILE__) . โ€œ/chat_*.RLSโ€) as $ourfilename) {
rename($ourfilename, explode(โ€œ.RLSโ€, $ourfilename)[0] . โ€œ.lin2โ€);
}

if ($howmanygoes >= 0) { $goes++; if ($goes >= $howmanygoes) { exit; } }
sleep(5);
}
exit;
}
Where the โ€œcommand lineโ€ usage partโ€™s renamed file is found by the web application and the two step deletion is needed
} else { // here from email or SMS link
$sra=โ€โ€;
$cont=โ€โ€;
foreach (glob(โ€œchat_โ€ . str_replace(โ€œ@โ€,โ€โ€,str_replace(โ€œ+โ€,โ€ โ€œ,urldecode($_GET[โ€˜addressโ€™]))) . โ€œ__*.lin*โ€œ) as $ourfilename) {
$sra=explode(โ€œ.โ€,explode(โ€œchat_โ€ . str_replace(โ€œ@โ€,โ€โ€,str_replace(โ€œ+โ€,โ€ โ€œ,urldecode($_GET[โ€˜addressโ€™]))) . โ€œ__โ€, $ourfilename)[1])[0];
$scont=file_get_contents($ourfilename);
$cont=$scont . โ€œ<br>โ€;
if (trim($scont) != โ€œโ€) { $scont=โ€™ โ€ฆ starting with โ€œโ€˜ . file_get_contents($ourfilename) . โ€˜โ€โ€˜; }
if (strpos($ourfilename, โ€œ.lin2โ€) !== false) {
rename($ourfilename, explode(โ€œ.lin2โ€, $ourfilename)[0] . โ€œ.lineโ€);
$datait=โ€ data-โ€œ;
} else {

unlink($ourfilename);
}
}
echo โ€œ<!doctype html>
// etcetera etcetera etcetera
<body โ€ . $datait . โ€œonload=โ€™onlis();โ€™>
// etcetera etcetera etcetera
โ€œ;

So yet again, feel free to try thechanged (including โ€œsessionโ€ logic) php_listenerโšซphpโ€˜s chatโœ‚web application โ€œthird draftโ€.


Previous relevant Chat No Sockets Session Tutorial is shown below.

Chat No Sockets Session Tutorial

Chat No Sockets Session Tutorial

Back from the โ€œcommand lineโ€ PHP usage of yesterdayโ€™s Chat No Sockets Cron Tutorial that dayโ€™s thinking about how to improve the โ€œsurfing the netโ€ parts of the Chat web application weโ€™re developing got us starting to involve PHP โ€ฆ



Sessions

โ€ฆ and canโ€™t they just be really useful as the identifying methodology to hone in on a webpage session of interest, and exclude all irrelevant others โ€ฆ

<?php


session_start();

$enduring='' . session_id();

if (isset($_GET['sid'])) {

$enduring=str_replace("+"," ",urldecode($_GET['sid']));

} else if (isset($_POST['sid'])) {

$enduring=str_replace("+"," ",urldecode($_POST['sid']));

}

$dbit=' data-oe="" ';




function server_remote_addr() {

global $enduring;

$rma = $_SERVER['REMOTE_ADDR'];

$ua = strtolower($_SERVER['HTTP_USER_AGENT']);

// you can add different browsers with the same way ..

if(preg_match('/(opr)[ \/]([\w.]+)/', $ua))

$rma = '000'.$rma;

elseif(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))

$rma = '000000'.$rma;

elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))

$rma = '00000'.$rma;

elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))

$rma = '0000'.$rma;

elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))

$rma = '000'.$rma;

elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))

$rma = '00'.$rma;

elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))

$rma = '0'.$rma;

return str_replace(".", "x", str_replace(":", "x", $rma . $enduring));

}


?>

โ€ฆ the only nuance being that iframe children get their session IDs mapped to that of the parent via that โ€œsidโ€ argument above.

And so todayโ€™s work represents a โ€œshoring upโ€ day for the basis for a Chat, and a relief that this โ€œbetter honingโ€ also meant that we no longer needed to tweak those pesky $_SERVER[โ€˜HTTP_USER_AGENTโ€™] combinations (a dark art indeed).

So again, feel free to try thechanged php_listenerโšซphpโ€˜s chatโœ‚web application โ€œthird draftโ€.


Previous relevant Chat No Sockets Cron Tutorial is shown below.

Chat No Sockets Cron Tutorial

Chat No Sockets Cron Tutorial

Yesterdayโ€™s Chat No Sockets Primer Tutorial had a โ€œcommand lineโ€ PHP usage component, we wonder whether you noticed? We intend to keep this arrangement for our โ€œno socketsโ€ Chat web application. It will not function as that โ€œChatโ€ without the command line part of the โ€œequationโ€ being activated. You might think of it as the โ€œtraffic copโ€ of the web application.

As far as that โ€œcommand lineโ€ PHP usage goes โ€ฆ

  • Isnโ€™t it great to have the one code source for all this?
  • How are we going to manage this command line usage, out of โ€ฆ
    1. interactive in an interactive command line session
    2. set off a background process run of it via the โ€œ&โ€ suffix
    3. crontab it (on our Linux web server)

    ?

Suggestion 1 is kludgy, over the top and awkward to arrange for any long period of time, though useful if non-continuous โ€œprocess coverageโ€ is the go.

Suggestion 2 and 3 are great for โ€œcontinuous process coverageโ€ (we privately think of as โ€œjigsaw coverageโ€), but in our books (and the pamphlettes have scarpered it to Pamphlette Island โ€ฆ which they must intend on โ€œfoundingโ€?!) crontab is a better option to take for at least two reasons โ€ฆ

  • crontab resurrects itself on a system reboot
  • crontab is self documenting (an important advantage regarding command line processing usage)

โ€ฆ but if we are to use crontab โ€œjigsaw coverageโ€, to avoid โ€œjigsaw overlapโ€ weโ€™re going to have to change โ€ฆ regarding โ€ฆ

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ minute (0 โ€“ 59)
   โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ hour (0 โ€“ 23)
   โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€ day of month (1 โ€“ 31)
   โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€ month (1 โ€“ 12)
   โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€ day of week (0 โ€“ 6 => Sunday โ€“ Saturday, or
   โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ 1 โ€“ 7 => Monday โ€“ Sunday)
   โ†“ โ†“ โ†“ โ†“ โ†“
   * * * * * command to be executed

โ€ฆ thanks to https://stackoverflow.com/questions/18919151/crontab-day-of-the-week-syntax for above crontab syntax โ€ฆ as per ( our assumption being that the user will use one of the โ€œevery ? unitsโ€ syntax such as
*/6 * * * * php this_php_happens_every_six_minutes.php
) โ€ฆ

To <โ€” <โ€” From


if ($argv) { // command line ...

$cfindings="";

$goes=0;

$howmanygoes="-1";

$par=getenv("TERM"); // thanks to https://stackoverflow.com/questions/3214935/can-a-bash-script-tell-if-its-being-run-via-cron

if ("$par" == "$TERM") { // via cron

$cfindings1=exec("crontab -l | grep 'php_listener' | grep -v 'grep' | cut -d ' ' -f 1");

$cfindings2=exec("crontab -l | grep 'php_listener' | grep -v 'grep' | cut -d ' ' -f 2");

$cfindings3=exec("crontab -l | grep 'php_listener' | grep -v 'grep' | cut -d ' ' -f 3");

$cfindings4=exec("crontab -l | grep 'php_listener' | grep -v 'grep' | cut -d ' ' -f 4");

$cfindings5=exec("crontab -l | grep 'php_listener' | grep -v 'grep' | cut -d ' ' -f 5");

if (strpos($cfindings1, "*/") !== false) {

$howmanygoes=12 * explode("*/", $cfindings1)[1];

} else if (strpos($cfindings2, "*/") !== false) {

$howmanygoes=720 * explode("*/", $cfindings2)[1];

} else if (strpos($cfindings3, "*/") !== false) {

$howmanygoes=17280 * explode("*/", $cfindings3)[1];

}

}

while (1) {

foreach (glob("chat_*.rls") as $ourfilename) {

rename($ourfilename, explode(".rls", $ourfilename)[0] . ".line");

}

if ($howmanygoes >= 0) { $goes++; if ($goes >= $howmanygoes) { exit; } }

sleep(5);

}

exit;

}



if ($argv) { // command line ...

while (1) {

foreach (glob("chat_*.rls") as $ourfilename) {

rename($ourfilename, explode(".rls", $ourfilename)[0] . ".line");

}

sleep(5);

}

exit;

}

Again, feel free to try thechanged php_listenerโšซphpโ€˜s chatโœ‚web application โ€œsecond draftโ€.


Previous relevant Chat No Sockets Primer Tutorial is shown below.

Chat No Sockets Primer Tutorial

Chat No Sockets Primer Tutorial

Weโ€™re starting on a new PHP web application project. Weโ€™ve got a โ€œfirst draftโ€ of a chat web application that does not use sockets, but rather โ€ฆ

  1. invites somebody else (via โ€œInviteโ€ button) via email or SMS
  2. that โ€œsomebody elseโ€ opens the web application via email or SMS links
  3. from then on keep the chat going via โ€œSendโ€ buttons in the two chat incarnations

It needs more work, that is for sure, but perhaps you want to see php_listenerโšซphpโ€˜s chatโœ‚web application โ€œfirst draftโ€.

As with good learning between two parties, each listens, takes it in, and replies, as required.

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.

This entry was posted in eLearning, Event-Driven Programming, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *