we wanted to not show iframe that used to house the weather information any more when that information comes, these days, from a Google search engine query popup window … and …
where it used to give a result such as …
Earth Coriolis Force for Latitude,Longitude below represents a 6.84e-5 ms-2 deflection from → West to → East for each ms-1 of Southerly ↑ wind
… it used to be possible for the dropdowns below that to not reflect the Latitude,Longitude entered in by the user via the clicking of links mentioning “Coriolis” … very annoying …
A couple of days ago, when we added PHP Earth Rotational Speed Primer Tutorial as shown below, to our blogroll mix, it got us relooking at our Geographicals Suite of Web Applications at this blog that use this live run interface.
We discovered a way to calculate the Earth’s rotational speed for a given latitude. When you see how fast we’re moving relative to somebody still in space you’ll be amazed and think gravity is pretty cool. Even if you’re standing on your head right now, you’d have to agree with me that “ytivarg” is not such a bad concept also … “can tell you it saved my bacon back in ’66 when that boar from yonder ridge fell on me when I was stuck practising them thar cartwheely thingos, and got stuck not the right way up … if youse knows what ah mean” … but we digress.
The Earth is like a ball with a rod through it coming out at the North and South poles, and if you can imagine this, then you can probably imagine that the rotational speeds are the biggest near the Equator and get a lot smaller near the Poles.
Still and all, at pretty big latitudes like for Archangel, in Russia, the rotational speeds get up with what we were taught was the speed of a Jumbo jet … back in the day. As for Singapore … wow … take a look at our tutorial picture or try a live run for yourself, and this is our PHP source code you could call rotational_speed_at.php
Ahhhh … the “where” of life … so interesting?!
Believe it or not, the equation to calculate this we found in “New Century Maths 9 (second edition) Stages 5.2/5.3” so thanks. It goes like …
Earth Rotational Speed (in km/h) = ( 2 x Π x 6371 x cos(latitude) ) / 24
… where 6371 will do as radius of Earth in kilometres and 24 is the number of hours in an Earth day and latitude (for most functionalities such as Javascript’s Maths.cos() function) should be expressed in radians (where 1 degree = ( 1 x Π ) / 180 radians), and Π is, well, Π
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.
We really like HTML iframe usage around here. In terms of …
Software Need Not Be Hard
… being our company byline, they tick a lot of boxes. You’ll read online, though, issues with security and whatnot regarding them, so, as with all these matters, it is better to read around. However, if you intend building up lots of web applications in your domain, online, HTML iframe elements …
allow for chance to modularize …
without it, necessarily, looking clunky … as well as …
is a means to introduce onload event logic not tied to document.body onload event … like a chance to “reset” … as well as …
can be a means, what we like to call “Client Pre-emptive Iframe” thinking, to test for the existence of a URL … as well as …
the HTML iframe name attribute can tee up with second argument of Javascript window.open to think of “the dreaded popup window actually being the more acceptable iframe window (relatively speaking)” … as well as …
the HTML iframe src attribute is a good Javascript DOM access point to use an iframe when you know the URL … versus …
the HTML iframe srcdoc attribute is a good Javascript DOM access point to use an iframe when you know the content
Hence, iframe usage got front and centre when thinking on how to revamp the Emoji Menu arrangements, at this blog, talked about at WordPress Emoji Menu Primer Tutorial. That old arrangement opened new (second _blank arguments to window.open) to new windows, only, and felt a bit over the top, to us, especially because these Emoji Menus predominantly showcased Inhouse Web Applications. Why not, at least, involve HTML iframe elements into the mix?
That got us adjusting a WordPress “Emoji Menu”Page for “clicking the Emoji Menu, here at this blog (or in new window), purposes” scenario and then there was the changedemoji_widget_idea.htmstandalone Emoji Menu web application we wrote for the “hovering over the Emoji Menu, here at this blog, purposes” scenario.
We think the filling in of webpage space to the right of the Emoji Menu dropdown element is more elegant. What do you think?
add a new WordPress primary menu level “Emoji Menu” option (via the WordPress administration section’s Add Page option) … that …
onclick calls a (WordPress) Page that is a select (dropdown) element size=9 (for non-mobile browser usefulness) whose innerHTML (ie. what you see) consists of emojis … and on a selection …
opens into a new webpage a web application from the RJM Programming domain … similarly for the …
onmouseover (hover (Ajax feeling functionality), for non-mobile browser usefulness) immediate display of a (smaller) select (dropdown) element directly below the “Emoji Menu” option heading … facilitated by a changed header.php coding change …
<script type="text/javascript"> function donow() {
var sbitis='<select size=9 id="emojih" onchange=window.open(this.value,"_blank");><option title="Web Audio" style="cursor:pointer;text-decoration:none;font-size:36px;" target="iweb_audio" id="aweb_audio" value="//www.rjmprogramming.com.au/HTMLCSS/web_audio.htm">🔊</option><option title="Square Hr Tracing" style="cursor:pointer;text-decoration:none;font-size:36px;" target="isquare_hr_tracing" id="asquare_hr_tracing" value="//www.rjmprogramming.com.au/HTMLCSS/square_hr_tracing.htm">📏</option><option title="Emoji Walk Animation" style="cursor:pointer;text-decoration:none;font-size:36px;" target="iemoji_walk_animation" id="aemoji_walk_animation" value="//www.rjmprogramming.com.au/HTMLCSS/emoji_walk_animation.htm">🏃🏾‍♀️</option><option title="Fruits" style="cursor:pointer;text-decoration:none;font-size:36px;" target="ifruits" id="afruits" value="//www.rjmprogramming.com.au/HTMLCSS/fruits.html">🍌</option><option title="Name Your Mascot" style="cursor:pointer;text-decoration:none;font-size:36px;" target="iname_your_mascot" id="aname_your_mascot" value="//www.rjmprogramming.com.au/HTMLCSS/name_your.html">📧</option><option title="Sushi Train" style="cursor:pointer;text-decoration:none;font-size:36px;" target="isushi_train" id="asushi_train" value="//www.rjmprogramming.com.au/HTMLCSS/circuit.htm">🍱</option><option title="Flag Quiz" style="cursor:pointer;text-decoration:none;font-size:36px;" target="iflag_quiz" id="aflag_quiz" value="//www.rjmprogramming.com.au/HTMLCSS/flagquiz.htm">🇦🇩</option><option title="Emoji Overlay" style="cursor:pointer;text-decoration:none;font-size:36px;" target="iemoji_overlay" id="aemoji_overlay" value="//www.rjmprogramming.com.au/HTMLCSS/emoji_overlay.htm">🔝</option><option value="" selected></option></select>';
sbitis='<iframe src="//www.rjmprogramming.com.au/HTMLCSS/emoji_widget_idea.htm"></iframe>';
var isdone=0, is2done=0;
if (document.getElementsByClassName){
var x304x = document.getElementsByClassName('page-item-304');
x304x[0].onmouseover = function() { var xl=document.getElementById('x2language'); xl.style.display = 'block'; };
isdone = 1; var x46544x = document.getElementsByClassName('page-item-46575');
x46544x[0].onmouseover = function() { if (this.innerHTML.replace('iframe ','select ').indexOf('select ') == -1) { this.innerHTML+=sbitis; } };
is2done = 1;
} else { // IE
//var qis = document.getElementById("pick_content").contentWindow.document;
var ilis = 0;
var eleis, ele2is;
var lisis = document.getElementsByTagName("li");
while (eleis = lisis[ilis++]) {
if (eleis.className == "page-item-304" && isdone == 0) {
eleis.onmouseover = function() { var xl=document.getElementById('x2language'); xl.style.display = 'block'; };
isdone = 1;
} if (eleis.className.indexOf("page-item-46575") != -1 && is2done == 0) {
eleis.onmouseover = function() { var xl2=document.getElementById('emojih'); xl2.style.display = 'block'; };
is2done = 1;
}
}
} }
setTimeout(donow,2000);
</script>
… that HTML iframe emoji_widget_idea.htm content (live run) preference above arising from our desire to add more flexibility to this content down the track.
a supervisory “emoji menu” web application hosting …
supervised iframe element hosted web applications
… and you may think, if all this is going on with web applications on the same domain, what’s the big deal? What could go wrong? (These words always bringing a knowing chuckle around here!)
For the most part, it’s true, there were no issues, but one “supervised iframe element hosted web application” we tried did not behave with all its functionality happening. Lo and behold, applying a web inspector showed up an error, with a codeline (in Javascript) that went …
mcp=parent.document.getElementById('lcp').value;
… and then we summed this up in two different strands of thought …
can we write a generic external piece of Javascript called just before </body> that can pluck out lines of code, with corresponding line codes, and see if “parent.document” or “top.document” occur in them and effectively “better debug” within an errorHandler function that further examines this “null” return error … which looking into is not as easy as first optimistically envisaged … versus …
get in there specifically with the web inspector, adjust the code of the “supervised iframe element hosted web application” and have it work being …
additionally supervised this way … and more importantly …
still work the way it used to unsupervised, as ever it has worked up to now
… via the simple (age old) paradigm, involving debugging (web applications, at the client level) via tools like (the web browser) Safari’s Web Inspector …
Using Web Inspector type tools:
Identify the issue via …
Error line
Error line number
Using Web Inspector type tools:
Fix the issue until no errors happen
And what would have been the better generic coding for a web application that may become a “supervised web application” (in different ways) into the future.
Don’t just …
if (window.top.document) {
if (window.top.document != window.document) {
document.getElementById('reout').style.height='250px';
if (window.top.document != window.parent.document) {
mcp=parent.document.getElementById('lcp').value;
rcp=top.document.getElementById('rcp').value;
lcp=top.document.getElementById('lcp').value;
// more logic here
} else {
mcp=parent.document.getElementById('mcp').value;
rcp=parent.document.getElementById('rcp').value;
lcp=parent.document.getElementById('lcp').value;
// more logic here
}
}
}
But do…
if (top.window && parent.window) { // if (window.top.document) { var plcp=parent.document.getElementById('lcp');
if (window.top.document != window.document) {
document.getElementById('reout').style.height='250px';
if (window.top.document != window.parent.document && parent.document.getElementById('lcp')) {
mcp=parent.document.getElementById('lcp').value;
rcp=top.document.getElementById('rcp').value;
lcp=top.document.getElementById('lcp').value;
// more logic here
} else if (parent.window && plcp) {
mcp=parent.document.getElementById('mcp').value;
rcp=parent.document.getElementById('rcp').value;
lcp=parent.document.getElementById('lcp').value;
// more logic here
}
}
}
On Scroll Sticky Header
The header will stick to the top when you reach its scroll position.
Scroll back up to remove the sticky effect.
Which takes us to what we wanted to try as an inhouse addition to functionality. We like emojis, as “text meets button design”. Hence, we also like the “text” emoji being like an “a” link “button”, for two biggish reasons …
emoji buttons save space
emoji buttons can look like images that can attract user attention, and be like an Internationizational improvement to your web application, given some careful consideration
… that lead us to want to have the “Sticky Header” contain an “emoji menu” of “emoji buttons”, the “onclick” events of which show content below the “Sticky Header” in a one row table that pushes the latest content to the left of that row (so that our hashtagging logic will still see the emojis along with the latest selected content), yet allow an intrepid user venture right to “uncontrolled lands of functionality” should they wish. We’re sticking left … chortle, chortle.
HTML and Javascript and CSS Survey Levelling Tutorial
With the “terrestrial” side to Land Surveying (ie. that of the small distances kind), two “get out there and do it” skills spring to mind, those being …
performing a traverse via the use of a theodolite (or “total station”) (as the web application works the mathematics of, off the field book, with the previous HTML and Javascript and CSS Survey Traverse Tutorial) working out the (“X”,”Y”) of 2D “life” … and today, we add to that with …
performing a levelling run via the use of a level (or “total station”) …
… and with today’s web application we simulate, to some degree, minus “how to level a level”, looking through the “level” viewer towards a “surveying staff” (held level and straight) on a point of something you want to know the elevation (or (3D “life”) “Z”) of in terrestrial terms, relative to known elevations you will probably want to start pointing at (the “surveying staff” being on) with your first (often a known “datum”) …
Backsight … then …
(however many Inter Sights followed by a) Foresight (and then back to Backsight, as necessary)
… series of measurements (or “reading”) to derive “reduced levels” for each point the “surveying staff” visits. This, in most practice, involves alternately leapfrogging (each other, at different times) …
Land Surveyor recording and levelling the “level” … and a …
Chainperson levelling and straightening the “surveying staff”
… the “surveying staff” we simulate in our web application (somewhat) thanks to Cody.
That’s the “what” of the web application, but what about the “how” (let alone the who)? Here, we thank the great W3schools parallax ideas.
The “central CSS smart” of these parallax ideas is the idea of …
HTML and Javascript and CSS Survey Traverse Tutorial
Here is a tutorial showing some client-side basics in HTML and Javascript and CSS all in the one HTML file, to simplify concepts. The tutorial subject matter is a webpage to perform Survey Traverse calculations. A Survey Traverse is:
Traverse is a method in the field of surveying to establish control networks.[1] It is also used in geodesy. Traverse networks involve placing survey stations along a line or path of travel, and then using the previously surveyed points as a base for observing the next point. Traverse networks have many advantages, including:
Less reconnaissance and organization needed;
While in other systems, which may require the survey to be performed along a rigid polygon shape, the traverse can change to any shape and thus can accommodate a great deal of different terrains;
Only a few observations need to be taken at each station, whereas in other survey networks a great deal of angular and linear observations need to be made and considered;
Traverse networks are free of the strength of figure considerations that happen in triangular systems;
Scale error does not add up as the traverse is performed. Azimuth swing errors can also be reduced by increasing the distance between stations.
The traverse is more accurate than triangulateration[2] (a combined function of the triangulation and trilateration practice).[3]
Let’s see some simple HTML in action in a tutorial …
Link to HTML “spiritual home” … at W3Schools has many tutorials.
Link to Survey Traverse live run … here.
Link to Survey Traverse live run (additional Google Line Chart functionality) here.
Link to Survey Traverse information … from Wikipedia from which quote above comes.
Link to some downloadable HTML code … rename to SurveyTraverse.html which packages up a lot of Javascript and a little bit of CSS … or JaCvasScriptS … not sure whether this would ever catch on.
Link to some downloadable PHP programming code (additional Google Line Chart functionality) … rename to SurveyTraverse.php
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.
After a few days of trying out the WordPress Blog (TwentyTen themed) search functionality (searching for GETME[space]) and creating Oldest link ideas from the recent WordPress Blog Getme Searches Tutorial we have come to two conclusions …
(though we dislike changing the premise of a modification, we’re going to) change the appending delimiting character from a space to a + (plus) character because it fits in better with previous functionalities offered … and all that withstanding …
we like the basic idea (of searching for the genesis of a search regarding this blog) and want to extend it to other non-GETME searches … to just have it that (all in TwentyTen theme’s header.php) …
<?php echo ”
document.getElementById('s').placeholder='Space appended compares to whole posting content. One plus (+) after GETME (or, actually, now, any) search facilitates Oldest link.';
… and ready for you to try yourself, sometime, we’re hoping, to get to “first mentions” of your search string(s) at this WordPress Blog’s search textbox.
We noted, looking at our Apache Status report, that fairly often readers of this blog, thanks, search for mention of a particular GETME file, it being our “source control” basis whereby …
first draft of a “source control” file, named cowsay.php as an example, would be called …
cowsay.php_GETME
and then subsequent drafts use –s rather than _ meaning a “second draft” would be called …
cowsay.php-GETME
… and a fourth …
cowsay.php---GETME
You go through with a particularized search like that and you’d be looking for specific referencing, we reckon. And yet, once the project rolls along a search for cowsay.php_GETME as your example will land you on four or five or six mentioning tutorials, the way we do it around here. We want to tell a story, and build it up (but please do your own research regarding Google SEO before thinking this is such a good idea, as repeating content is quite often a no-no). But, like we’re intimating, such a particularized search result set like this may annoy many people looking for some quick, definitive answer.
Well, we think for some such searches, again using cowsay.php_GETME as an example, the adding and then clicking of …
… as the oldest mention of cowsay.php_GETME, could be a useful new feature … ie. getting to it’s genesis. Many people will be most interested going back to this genesis, but please note, in the case we’ve mentioned, using our “present as a book” emoji button (📖 📖) functionality (reading like a book, functionality talked about with WordPress Blog Posting Thread Book Primer Tutorial) on the topmost (usually, but regarding hot off the press business “topmost that does not have the title WordPress Blog Getme Searches Tutorial“) link you are presented with would do a good job here too.
Okay, so how does a user start getting to this additional Oldest link creation logic? Well, in our changed bits on our WordPress blog TwentyTen themed header.php (a modus operandi also used for WordPress Blog Byline Zoom Fix Tutorial) …
… reading between the lines and taking into consideration a changed codeline in function precc …
<?php echo ”
document.getElementById('s').placeholder='Space appended compares to whole posting content. Spaces after GETME search facilitates Oldest link.';
setInterval(sipreradiocc, 5000);
“; ?>
… in conjunction with a new document.body onload Javascript function …
<?php echo ”
function chkinodo() {
var mkh=0, lastahelsid='', lastahelstitle='';
if (document.URL.indexOf('s=') != -1 && document.URL.indexOf('wopenall=') != -1 && document.URL.indexOf('ifnooldestdoone=') != -1 && document.URL.replace('/page','page=').indexOf('page=') == -1) {
var hels=document.getElementsByTagName('h1');
if (eval('' + hels.length) > 0 && document.body.innerHTML.indexOf('lder post') == -1) {
if (hels[0].innerHTML.indexOf('ldest') == -1) {
if (hels[0].innerHTML.toLowerCase().indexOf('search result') != -1) {
var ahels=document.getElementsByTagName('a');
for (var jkh=0; jkh<ahels.length; jkh++) {
if (('' + ahels[jkh].title).indexOf('Permalink to ') != -1) {
if (('' + ahels[jkh].outerHTML).indexOf(' id=') == -1) {
ahels[jkh].id='mya' + mkh;
lastahelsid='' + ahels[jkh].id;
lastahelstitle='' + ('' + ahels[jkh].title).split('Permalink to ')[1];
mkh++;
} else {
lastahelsid='' + ahels[jkh].id;
lastahelstitle='' + ('' + ahels[jkh].title).split('Permalink to ')[1];
}
}
}
}
}
if (lastahelsid != '' && lastahelstitle != '') {
hels[0].innerHTML+=' ... <a href="#' + lastahelsid + '" title="' + lastahelstitle + '">Oldest</a> ';
}
}
}
}
“; ?>
… the user just adds a trailing space to their entered GETME search textbox entry, to pre-empt the underlying HTML form navigation and, instead, do a navigation such as …
How on non-mobile, with this blog, the byline …
A “Dot Dot Dot” Information Technology Blog
… can mal-align as a user zooms in or out.
And we were doing things for the first time we can remember, regarding the fix, which we weren’t expecting. So …
For the first time we can remember …
for a position: absolute “overlay” scenerio … we did not use a left: 123px style of positioning … but, rather …
used a right: 45.6% style of positioning …
lining the byline’s right with the blog title’s right … more or less …
making the byline more central …
giving it more “wander room” as a user zooms in or out
Ever since the advent of “mobile” platforms, the idea of “zoom” has become more and more of a “mute point”, but not for “non-mobile”, as with this “kind of unusual” adding, via “overlay” idea, regarding HTML elements.
On this topic, we’d like to thank this excellent link which reminded us that “responsive design”‘s biggest friend is the percent (ie. “%”) unit of webpage measure!
By the way, even on “non-mobile”, the window.onresize event is triggered we found, but once there we struggled to do much about the mal-alignment zooming in or out was sometimes doing to the byline off to the left.
The new code (intervention, that made the difference), in good ol’ header.php?
enter in more than one image filtering “verb” … space separated … as well as …
chance for user to establish their own arguments relevant to some of the “verbs”
substanceverb=ourprompt('Please enter word image filter idea(s), separated by space ... ' + String.fromCharCode(10) + String.fromCharCode(10) + 'emboss edge negedge sharpen boxblur negate colourizered colourizeblue colourizegreen colourize pixellate smooth contrast brightness sketchy mean_removal flipvertical fliphorizontal flip ' + String.fromCharCode(10) + String.fromCharCode(10) + ' ... or none for original, while comma separate your own arguments with no spaces in amongst those? Eg. emboss,array([-2,-1,3],[-1,4,3],[0,4,3]) brightness', '');
This involved making PHP function new_contentrecursive by nature (exemplified by) …
… when these multiple filtering verbs are encountered. In this way, sometimes, rather than return a static value, function new_content might return it’s own recalled return value.
Again, coming from the serverside we decided to pack more into …
a changedlatest draft cowsay.php media creator via slides via ffmpeg inhouse talent … and from the clientside …
… we’re using the great PHP GD library image filtering talents to open up to the user in “name”, that is, any numerical arguments fixed in a static way by us (and we’ll see about otherwise into the future).
The user can pick (so far one at a time, but we’ll review into the future) from …
… and some of the resultant effects can be quite startling.
Coming from the serverside we decided to pack more into …
a changedlatest draft cowsay.php media creator via slides via ffmpeg inhouse talent … and from the clientside …
… to make these optional and additional image filtering options to be available to users of Inhouse Slideshows (eg. Jenkins) hereabouts.
Did you know?
Keen observers will know that we (just about) always assemble a group of image screenshot slides into animated GIFs these days. And if you have read some oldish tutorials you will know, about RJM Programming history …
for many years it was hosted on a CentOS Apache/PHP5/MySql Linux web server where we had both …
disk inode count
diskspace (in bytes)
… hair trigger issues to worry about for several years … until …
recently a migration to AlmaLinux Apache/PHP8/MySql Linux web server eased those worries in both senses
But, analogous (in motivation) to how programmers worked with limited amounts of memory in those early Windows and Mac OS X days, we switched tack using inhouse slideshow concepts (eating into the CentOS inode count, hence the push over that time, to get PHP zip help to have the one zipfile be used to zip/(temporarily)unzip the image slide files) in favour of (the one file) animated GIF paradigm. Do we change back? We (with consultation) are not that tempted because …
we’ve gotten better with animated GIF creation functionality …
though inhouse slideshow can have cute features, it is a pretty resource intensive way to go about things
… and so (with consultation) we’ll see … and Nala says to say “hear” … and Luna says to say “smell” (and she’s right in that that “smellorama” project is still on the go).
new CSS Style dropdown option … handled by the changedinhouse_slideshow.js Inhouse Slideshow external Javascript helper only
Of course, that is what external Javascript design is all about. You adjust one code source only, to affect a whole lot of web applications, rather than the worry of many code source changes. We know which we prefer, as programmers?!
Is your way into programming via CSS styling? Perhaps it would tempt you if we pointed out that there are I.T. jobs out there asking for people with expert CSS styling skills. By this, you may understand it can be an art form transforming dreary looking HTML content into dynamic and vibrant looking webpages (all with the same content).
We’ve learnt most about CSS styling, fast, via web browser web inspectors and seeing an initial webpage look change before our eyes via tweaks applied dynamically. We recommend this highly, but don’t expect everyone to be that keen. In any case, we’re trying to channel that dynamism today, offering the user to see our Inhouse Slideshow change it’s look via user CSS Styling entries in a prompt window instigated by a new “Style” dropdown option.
CSS styling does well with webpages dynamically because, quite often, the Javascript DOM approach (where yourselectorpluscss contains CSS styling code) …
… types of CSS clauses to mildly change the styling for each cartoon slide. After using this, for the first time, we wrote down for future tutorial ideas “write a web application helping users improve on their selector smarts”. But we think this Inhouse Slideshow opportunity might be a better dynamic approach for this.
… we can add two more dropdown modus operandi options for …
Video
Animated GIF
… feeding it through to a changedlatest draft cowsay.php media creator via slides via ffmpeg inhouse talent, called by our inhouse slideshow external Javascript helper …
function changeto(tvis) {
if (tvis.toLowerCase().indexOf('video') == 0) {
document.getElementById('divcowpf').innerHTML+='<input type=hidden name=fromindex id=fromindex value=y></input>';
document.getElementById('vlist').click();
document.getElementById('mycowifr').style.display='block';
document.getElementById('mycowifr').style.visibility='hidden';
document.getElementById('mycowifr').style.height='1px';
//document.getElementById('mycowifr').scrollIntoView();
//location.href='#mycowifr';
setTimeout(function(){ document.getElementById('mycowifr').scrollIntoView(); }, 8000);
} else if (tvis.toLowerCase().indexOf('animated gif') == 0) {
document.getElementById('divcowpf').innerHTML+='<input type=hidden name=fromindex id=fromindex value=y></input>';
document.getElementById('aglist').click();
document.getElementById('mycowifr').style.display='block';
document.getElementById('mycowifr').style.visibility='hidden';
document.getElementById('mycowifr').style.height='1px';
//document.getElementById('mycowifr').scrollIntoView();
//location.href='#mycowifr';
setTimeout(function(){ document.getElementById('mycowifr').scrollIntoView(); }, 8000);
} else if (tvis.toLowerCase().indexOf('exif') == 0) {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?exif=y');
} else {
location.href=posturl(document.URL.split('#')[0].replace(/pdf\=/g, 'pdTf=') + '&exif=y');
}
} else if (tvis.toLowerCase().indexOf('pdf') == 0) {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?pdf=y');
} else {
location.href=posturl(document.URL.split('#')[0].replace(/exif\=/g, 'exTif=') + '&pdf=y');
}
} else if (tvis.toLowerCase().indexOf('emoji') == 0) {
//var borderis=prompt('Please enter comma separated HTML decimal entity(s) for your Emoji Border to slideshow. Can use an Emoji Menu entry.', '');
var bbsuffix=' Optionally append &[text|image]css=[CSSstyle] to change styling. Optionally justify some text via &[ul|uc|ur|ml|[mc]|mr|bl|bc|br]text=[someText%0AsecondLine] to change styling. Eg. ' + String.fromCodePoint(127958) + '&css=opacity:0.9;&textcss=font-size:20px;&ultext=Hello%0AThere ';
borderblurb='Please enter comma separated HTML decimal entity(s) for your Emoji Border to slideshow. Can use an Emoji Menu entry (eg. control-command-space for macOS or Mac OS X, logo key + . (period) for Windows, control+space for iOS, top left + for Android keyboard). ' + bbsuffix;
var borderis=prompt(borderblurb, '');
var emojiy='', emojisuffix='';
if (borderis == null) {
borderis='';
} else if (borderis.indexOf('&') != -1) {
if (borderis.split('&')[0].trim() == '') {
emojisuffix=encodeURIComponent(borderis.replace(/\%23[cC][iI][rR][cC][lL][eE]/g, '#circle').replace(/\%23[eE][lL][lL][iI][pP][sS][eE]/g, '#ellipse').replace(/\%23[tT][eE][xX][tT]/g, '#text').replace(/\%23[lL][iI][nN][eE]/g, '#line').replace(/\%23[pP][oO][lL][yY][lL][iI][nN][eE]/g, '#polyline').replace(/\%23[pP][oO][lL][yY][gG][oO][nN]/g, '#polygon').replace(/\%23/g, encodeURIComponent('%23')).replace(/\%23/g, encodeURIComponent('%23')).replace(/\%0a/g, encodeURIComponent('%0A')).replace(/\%0A/g, encodeURIComponent('%0A'))); //.replace(/\&/g,'%26').replace(/\=/g,'%3D');
borderis='';
} else {
emojisuffix=encodeURIComponent(borderis.replace(borderis.split('&')[0], '').replace(/\%23[cC][iI][rR][cC][lL][eE]/g, '#circle').replace(/\%23[eE][lL][lL][iI][pP][sS][eE]/g, '#ellipse').replace(/\%23[tT][eE][xX][tT]/g, '#text').replace(/\%23[lL][iI][nN][eE]/g, '#line').replace(/\%23[pP][oO][lL][yY][lL][iI][nN][eE]/g, '#polyline').replace(/\%23[pP][oO][lL][yY][gG][oO][nN]/g, '#polygon').replace(/\%23/g, encodeURIComponent('%23')).replace(/\%23/g, encodeURIComponent('%23')).replace(/\%0a/g, encodeURIComponent('%0A')).replace(/\%0A/g, encodeURIComponent('%0A'))); //.replace(/\&/g,'%26').replace(/\=/g,'%3D');
borderis=postbb(borderis.split('&')[0]);
}
} else {
borderis=postbb(borderis.split('&')[0]);
}
if ((borderis + emojisuffix) != '') { emojiy='emoji=' + encodeURIComponent(borderis) + emojisuffix; }
if (emojiy != '') {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?' + emojiy);
} else {
location.href=posturl(document.URL.split('#')[0].replace(/emoji\=/g, 'emojTi=') + '&' + emojiy);
}
}
} else {
if (document.URL.indexOf('exif=') != -1 || document.URL.indexOf('pdf=') != -1) {
location.href=posturl(document.URL.split('#')[0].replace(/exif\=/g, 'exTif=').replace(/pdf\=/g, 'pdTf='));
} else {
location.href=posturl(document.URL.split('#')[0] + '&eHuhxif=y');
}
}
}
… approach we have used successfully recently did not work here. Anyway, deprecated or non-existant it doesn’t matter, we decided to resort to good ol’ PHP exec methodologies in a new “inhouse slideshow” (featuring in a changed example PHP inhouse slideshow creator web application) call …
if (file_exists($zipisis)) {
$items = glob($hereis . "*[-_][0-9]*of.[jJgGpP][pPiInN]*");
foreach ($items as $key => $val) {
$alreadythere=true;
}
}
if (!function_exists("zip_entry_read")) {
function zip_entry_read($zip_read_output, $zip_entry_len) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output, $gzip_entry_len;
return 'pork';
}
}
if (!function_exists("zip_entry_filesize")) {
function zip_entry_filesize($zip_read_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_entry_filename;
return 'pork';
}
}
if (!function_exists("zip_read")) {
function zip_read($zip_oben_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}
if (!function_exists("zip_open")) {
function zip_open($zip_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_filename;
$gzip_filename=$zip_filename;
$gzip_number=0;
$gzip_open_handle='pork';
return 'pork';
}
}
if (!function_exists("zip_entry_name")) {
function zip_entry_name($zip_read_output) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output;
return 'pork';
}
}
if (!function_exists("zip_entry_open")) {
function zip_entry_open($zip_open_handle, $zip_read_output, $inmode) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle, $gzip_read_output;
return 'pork';
}
}
if (!function_exists("zip_close")) {
function zip_close($zip_open_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}
… as a first draft. We have much more to do trying to resurrect, if possible, some other inhouse PHP web applications we’ve based on the use of Zip in PHP. Pardon us, until tomorrow, while we have a little cry.
… that means we can back up a “peer based” solution such as talked about with Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial (ie. done as a user is surfing the net with some PHP of ours) methodology should it fail. We think we have an occasionally failing one as far as the tidy up of zipped up inhouse slideshows goes. It could be to do with a search engine crawling operation, we have not found out for sure, but we’ve decided to write our own …
PHP … via …
crontab
curl
… based independent tidying up procedure we’ll run once an hour via crontab record …
for ($i=0; $i<sizeof($lines); $i++) {
$lines[$i]=explode("\n", $lines[$i])[0];
if (file_exists(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) {
if (('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) == '38794') {
if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}
exec("unzip -l " . $lines[$i] . " | grep '.jpg' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | cut -f4 -d' ' | grep '-' > " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
if (file_exists("slideshow_zero.txx")) {
$sublines=file(dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
for ($j=0; $j<sizeof($sublines); $j++) {
$sublines[$j]=explode(" ", explode("\n", $sublines[$j])[0])[0];
$fis=explode("slideshow_0.zip", $lines[$i])[0] . $sublines[$j];
if (file_exists($fis)) {
$md=filemtime($fis);
if ($md) {
if ((time() - $md) > 1200) {
if (file_exists("slideshow_zero.kkk")) {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "rm -f " . $fis . "\n");
} else {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", "rm -f " . $fis . "\n");
}
}
}
}
}
}
} else if (1 == 3) {
if (file_exists("slideshow_zero.kkk")) {
file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
} else {
file_put_contents("slideshow_zero.kkk", "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
}
}
}
}
if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}
if (file_exists("slideshow_zero.txt")) {
unlink("slideshow_zero.txt");
}
if (file_exists("slideshow_zero.kkk")) {
unlink("slideshow_zero.kkk");
}
//echo $htmlis;
exit;
?>
… as that “ahhhhhhhh, what a relief” reliever of tension running the RJM Programming website. The subtext is, our inode limits are a concern!
We think another lesson here is that PHP can be a good alternative to scripting languages such as Korn Shell to create “operational” procedures, especially when you consider that curl means it can be like writing your “surfing the net” type of PHP (slideshow_zero.php) work.
it is information we do not want everyone to be able to see (easily, shall we say) … and in the sense that …
the report is stored away from RJM Programming’s “public_html” folder (ie. its Apache/PHP/MySql “Document Root”) is good … but even with today’s work …
hidden from everybody who does not have access to the RJM Programming’s web server … but …
the administrator of the RJM Programming’s web server (yoo hoo!) wants a mechanism to view the report that does not involve some “arcane procedure” each time to view it
… and so we decided that because …
the administrator of the RJM Programming's web server = the administrator of this blog
… we’d like to organize a system that latches onto that “security footing” and only show a “broom emoji button” (🧹 🧹) way to access the report when the administrator of this blog is logged in. We can do this by amending our Twenty Ten theme’s good ol’ header.php as per (where the “function mlater” you may recall from the days of WordPress Blog Email Post Collaboration Ajax Image Tutorial) …
<?php
$fns="36";
function doisr() {
global $fns;
$inmb="";
if (('' . get_current_user_id()) != '0' && ('' . get_current_user_id()) == '1') {
if (file_exists('/tmp/slideshow_cleanup.txt')) {
$fns="24";
$inmb="<a style=font-size:24px; title='Inhouse Slideshow Tidy Up Report' onclick=\"var iswo=window.open('','_blank','top=100,left=100,height=600,width=730'); iswo.document.write('<html><head><title>Inhouse Slideshow Tidy Up Report</title></head><body><pre>" . str_replace("\n","<br>",file_get_contents('/tmp/slideshow_cleanup.txt')) . "</pre></body></html>'); \">🧹</a> ";
}
}
return str_replace("'","' + String.fromCharCode(39) + '",$inmb);
}
?>
… PHP affects some (PHP writes) Javascript below …
<?php
function mlater() {
if (1 == 1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i)) {
if (dbihis == '') { dbihis=document.body.innerHTML; }
var xstih=document.getElementById('site-title').innerHTML;
if (xstih.indexOf("up" + "top") == -1) {
document.getElementById('site-title').innerHTML+='<?php echo doisr(); ?>' + '<a id="avs" style="text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" href=# onmouseover="getVisualSynopsis(event);" onmouseout="yehbut();" ontouchstart="getVisualSynopsis(event);" ontouchend="yehbut();" onclick=" uptop(); " title="... you can wait for the long hover functionality about Visual Synopsis (Slideshows)">🎦</a> <a style="cursor:pointer;text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" onclick="diffphpfix(this);" title="Code Difference Functional Links">📖</a> <a style="cursor:pointer;text-decoration:none;font-size:36px;" onclick="popselid();" title="Filter Content via Div ID">➗</a> <a style="cursor:pointer;text-decoration:none;visibility:hidden;font-size:<?php global $fns; echo $fns; ?>px;" title="Blog post contents reduced to summary" id="eds" onclick="pre_details_summary();">➖</a>' + printscreen(0);
if (document.URL.indexOf("visualsynopsis=") != -1) document.getElementById('avs').click();
}
}
}
use zip files to “scrunch up” a series of image files into the one zip file … for the vast majority of time … but when asked to, by a user …
unzip the image files when required by a user wanting to see them … and then …
tidy up, after some delay in time
… but we want to design a PHP way to independently tidy up as a backup mechanism. And we say, with PHP code, that if such files have been on the web server longer than ten minutes, this PHP callable slideshow_cleanup.php code …
<?php
// slideshow_cleanup.php
// RJM Programming
// May, 2022
The recent Inhouse Slideshow Mobile Tutorial did not satisfy all the “mobile usability” tests performed by the “Google Crawl” algorithm, failing on “Content wider than screen”, and you can read some background to this with Google Crawl Viewport Geographicals Tutorial. And so we try some refinements here today, with an idea to control on mobile platforms the max-width CSS property of the document.body of a Inhouse Slideshow webpage, which made up the URLs failing this test at the Google Search Console.
We were reading this great and useful link, thanks, and decided to see whether this stopping of scrolling in X on mobile platform versions of the Inhouse Slideshow webpages gels better with Google Search Console “Google Crawl” Mobility Usability algorithms.
Yet again, deployment of these changes is similar to that last time, and the times before that, as per …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
In a “going off to the right table row of cells” arrangement like this, what are some considerations that improve the user experience (of our inhouse slideshows) for mobile platform users?
turn the “@” link into an “emoji button” as per ➡ ( ➡ )
for both mobile and non-mobile, we’ve decided …
UTF-8 meta …
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<style>
td { vertical-align:top; }
</style>
change the h4 element to be h2 to help with legibility
iOS (ie. iPad and iPhone) PDF iframe elements have known scrolling issues, which we decided to bypass by opening these PDF creations in a new webpage window
Deployment of these changes is similar to that last time, and the times before that, as per …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
Exif Slideshow … and the new, as of today’s work …
PDF Slideshow
… that little bit different in that a PDF Slideshow occupies just the one table cell (rather than the many horizontal cells of the other display modes) and the resultant embedded PDF data vertically scrolls when multiple image slides are involved.
This new option also adds onto this “Inhouse Slideshow” functionality the chance to download and keep a PDF representation of that slideshow to your local system. Perhaps this makes this be of interest to you?!
The changedform_creator.php‘s live run is what gets integrated into the “Inhouse Slideshow” “sisterhood”. We say “sisterhood” because this “Inhouse Slideshow” is designed as a single PHP codefile “hived off” to a lot of other web server folders as their default “index.php” web browser default webpage in a “peer to peer” feeling arrangement. Such an arrangement asks a bit of the deployment arrangements, and we’ve talked about this before (with underlying links pointing to today’s work, should you be interested) …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
But when we say “Unit testing completed” above, we need to fill you in on a Fpdf issue we came across during unit testing of our changes. We were getting a …
FPDF Error: Not a JPEG file
… Fpdf error message choosing the new “PDF Slideshow” option on some, but not all, “Inhouse Slideshow” address bar URLs. And so the online research began as per …
… almost getting us there to a solution (and as far as the last link goes “that was before we posted the suggestion below”). Then we took one of the error messages at its word …
FPDF error: Not a JPEG file: ../Mac/Linux_drutil-238of.jpg
… and independently looked into the issue via Linux (or macOS command line) file command …
# cd $HOME/public_html/Mac
# ls -l Linux_dr*
-rw-r--r-- 1 owner group 724353 Oct 29 08:00 Linux_drutil-238of.jpg
-rw-r--r-- 1 owner group 132707 Oct 29 08:00 Linux_drutil-239of.jpg
-rw-r--r-- 1 owner group 109595 Oct 29 08:00 Linux_drutil-240of.jpg
# file Linux_drutil-238of.jpg
Linux_drutil-238of.jpg: PNG image data, 1280 x 800, 8-bit/color RGBA, non-interlaced
# file Linux_drutil-239of.jpg
Linux_drutil-239of.jpg: JPEG image data, JFIF standard 1.01
#
… when the penny dropped (about our (macOS) Paintbrush slideshow slide creation habits)! We quote our entry into “php – FPDF error: Not a JPEG file: http://10.11.201.93:81/webdocc/uploaded/tes3.jpg – Stack Overflow” …
Have found that constructing slideshows with Paintbrush on a MacBook Pro for years have sometimes been saving what “file jpeg_filename.jpg” determines is a PNG, as a JPEG, which is not the end of the world as far as the browsers go rendering this. Within FPDF’s fpdf.php I fixed my own shortcomings that were resulting in “FPDF Error: Not a JPEG file” via the kludgy “if($a[2]==3) { return $this->_parsepng($file); }” additional codeline below …
… and this change to Fpdf’s fpdf.php fixed the issue in our case for a lot of our previously erroneous “PDF Slideshow” displays of “Inhouse Slideshows”.
PDF Slideshow and Form Creation Helper Primer Tutorial
Our recent work involving the great Fpdf creator of PDF files when we presented Ajax FormData Object No Body PHP PDF Tutorial has got us starting on a new PDF (PHP) web application we are starting out thinking will help with …
online forms (probably via thinking in terms of Fpdf open source programmers like Rick van Buuren and Clément Lavoillotte‘s excellent HTML table rendering ideas) via HTML table intermediate user interactions … and …
slideshows
… but we will not be surprised if the project branches out into other ideas. We’ll see over time.
We hope you come along for the trip starting with a bit of a proof of concept form_creator.php‘s live run for you to try, where we allow you to enter (and be able to change) some HTML table code (if that’s what you end up with?!) in a pink HTML textarea element, and that will become PDF should you click the underlying HTML form’s yellow submit button.
Hope to see you for tomorrow’s PDF writing developments here.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
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.
… we’re using the great PHP GD library image filtering talents to open up to the user in “name”, that is, any numerical arguments fixed in a static way by us (and we’ll see about otherwise into the future).
The user can pick (so far one at a time, but we’ll review into the future) from …
… and some of the resultant effects can be quite startling.
Coming from the serverside we decided to pack more into …
a changedlatest draft cowsay.php media creator via slides via ffmpeg inhouse talent … and from the clientside …
… to make these optional and additional image filtering options to be available to users of Inhouse Slideshows (eg. Jenkins) hereabouts.
Did you know?
Keen observers will know that we (just about) always assemble a group of image screenshot slides into animated GIFs these days. And if you have read some oldish tutorials you will know, about RJM Programming history …
for many years it was hosted on a CentOS Apache/PHP5/MySql Linux web server where we had both …
disk inode count
diskspace (in bytes)
… hair trigger issues to worry about for several years … until …
recently a migration to AlmaLinux Apache/PHP8/MySql Linux web server eased those worries in both senses
But, analogous (in motivation) to how programmers worked with limited amounts of memory in those early Windows and Mac OS X days, we switched tack using inhouse slideshow concepts (eating into the CentOS inode count, hence the push over that time, to get PHP zip help to have the one zipfile be used to zip/(temporarily)unzip the image slide files) in favour of (the one file) animated GIF paradigm. Do we change back? We (with consultation) are not that tempted because …
we’ve gotten better with animated GIF creation functionality …
though inhouse slideshow can have cute features, it is a pretty resource intensive way to go about things
… and so (with consultation) we’ll see … and Nala says to say “hear” … and Luna says to say “smell” (and she’s right in that that “smellorama” project is still on the go).
new CSS Style dropdown option … handled by the changedinhouse_slideshow.js Inhouse Slideshow external Javascript helper only
Of course, that is what external Javascript design is all about. You adjust one code source only, to affect a whole lot of web applications, rather than the worry of many code source changes. We know which we prefer, as programmers?!
Is your way into programming via CSS styling? Perhaps it would tempt you if we pointed out that there are I.T. jobs out there asking for people with expert CSS styling skills. By this, you may understand it can be an art form transforming dreary looking HTML content into dynamic and vibrant looking webpages (all with the same content).
We’ve learnt most about CSS styling, fast, via web browser web inspectors and seeing an initial webpage look change before our eyes via tweaks applied dynamically. We recommend this highly, but don’t expect everyone to be that keen. In any case, we’re trying to channel that dynamism today, offering the user to see our Inhouse Slideshow change it’s look via user CSS Styling entries in a prompt window instigated by a new “Style” dropdown option.
CSS styling does well with webpages dynamically because, quite often, the Javascript DOM approach (where yourselectorpluscss contains CSS styling code) …
… types of CSS clauses to mildly change the styling for each cartoon slide. After using this, for the first time, we wrote down for future tutorial ideas “write a web application helping users improve on their selector smarts”. But we think this Inhouse Slideshow opportunity might be a better dynamic approach for this.
… we can add two more dropdown modus operandi options for …
Video
Animated GIF
… feeding it through to a changedlatest draft cowsay.php media creator via slides via ffmpeg inhouse talent, called by our inhouse slideshow external Javascript helper …
function changeto(tvis) {
if (tvis.toLowerCase().indexOf('video') == 0) {
document.getElementById('divcowpf').innerHTML+='<input type=hidden name=fromindex id=fromindex value=y></input>';
document.getElementById('vlist').click();
document.getElementById('mycowifr').style.display='block';
document.getElementById('mycowifr').style.visibility='hidden';
document.getElementById('mycowifr').style.height='1px';
//document.getElementById('mycowifr').scrollIntoView();
//location.href='#mycowifr';
setTimeout(function(){ document.getElementById('mycowifr').scrollIntoView(); }, 8000);
} else if (tvis.toLowerCase().indexOf('animated gif') == 0) {
document.getElementById('divcowpf').innerHTML+='<input type=hidden name=fromindex id=fromindex value=y></input>';
document.getElementById('aglist').click();
document.getElementById('mycowifr').style.display='block';
document.getElementById('mycowifr').style.visibility='hidden';
document.getElementById('mycowifr').style.height='1px';
//document.getElementById('mycowifr').scrollIntoView();
//location.href='#mycowifr';
setTimeout(function(){ document.getElementById('mycowifr').scrollIntoView(); }, 8000);
} else if (tvis.toLowerCase().indexOf('exif') == 0) {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?exif=y');
} else {
location.href=posturl(document.URL.split('#')[0].replace(/pdf\=/g, 'pdTf=') + '&exif=y');
}
} else if (tvis.toLowerCase().indexOf('pdf') == 0) {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?pdf=y');
} else {
location.href=posturl(document.URL.split('#')[0].replace(/exif\=/g, 'exTif=') + '&pdf=y');
}
} else if (tvis.toLowerCase().indexOf('emoji') == 0) {
//var borderis=prompt('Please enter comma separated HTML decimal entity(s) for your Emoji Border to slideshow. Can use an Emoji Menu entry.', '');
var bbsuffix=' Optionally append &[text|image]css=[CSSstyle] to change styling. Optionally justify some text via &[ul|uc|ur|ml|[mc]|mr|bl|bc|br]text=[someText%0AsecondLine] to change styling. Eg. ' + String.fromCodePoint(127958) + '&css=opacity:0.9;&textcss=font-size:20px;&ultext=Hello%0AThere ';
borderblurb='Please enter comma separated HTML decimal entity(s) for your Emoji Border to slideshow. Can use an Emoji Menu entry (eg. control-command-space for macOS or Mac OS X, logo key + . (period) for Windows, control+space for iOS, top left + for Android keyboard). ' + bbsuffix;
var borderis=prompt(borderblurb, '');
var emojiy='', emojisuffix='';
if (borderis == null) {
borderis='';
} else if (borderis.indexOf('&') != -1) {
if (borderis.split('&')[0].trim() == '') {
emojisuffix=encodeURIComponent(borderis.replace(/\%23[cC][iI][rR][cC][lL][eE]/g, '#circle').replace(/\%23[eE][lL][lL][iI][pP][sS][eE]/g, '#ellipse').replace(/\%23[tT][eE][xX][tT]/g, '#text').replace(/\%23[lL][iI][nN][eE]/g, '#line').replace(/\%23[pP][oO][lL][yY][lL][iI][nN][eE]/g, '#polyline').replace(/\%23[pP][oO][lL][yY][gG][oO][nN]/g, '#polygon').replace(/\%23/g, encodeURIComponent('%23')).replace(/\%23/g, encodeURIComponent('%23')).replace(/\%0a/g, encodeURIComponent('%0A')).replace(/\%0A/g, encodeURIComponent('%0A'))); //.replace(/\&/g,'%26').replace(/\=/g,'%3D');
borderis='';
} else {
emojisuffix=encodeURIComponent(borderis.replace(borderis.split('&')[0], '').replace(/\%23[cC][iI][rR][cC][lL][eE]/g, '#circle').replace(/\%23[eE][lL][lL][iI][pP][sS][eE]/g, '#ellipse').replace(/\%23[tT][eE][xX][tT]/g, '#text').replace(/\%23[lL][iI][nN][eE]/g, '#line').replace(/\%23[pP][oO][lL][yY][lL][iI][nN][eE]/g, '#polyline').replace(/\%23[pP][oO][lL][yY][gG][oO][nN]/g, '#polygon').replace(/\%23/g, encodeURIComponent('%23')).replace(/\%23/g, encodeURIComponent('%23')).replace(/\%0a/g, encodeURIComponent('%0A')).replace(/\%0A/g, encodeURIComponent('%0A'))); //.replace(/\&/g,'%26').replace(/\=/g,'%3D');
borderis=postbb(borderis.split('&')[0]);
}
} else {
borderis=postbb(borderis.split('&')[0]);
}
if ((borderis + emojisuffix) != '') { emojiy='emoji=' + encodeURIComponent(borderis) + emojisuffix; }
if (emojiy != '') {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?' + emojiy);
} else {
location.href=posturl(document.URL.split('#')[0].replace(/emoji\=/g, 'emojTi=') + '&' + emojiy);
}
}
} else {
if (document.URL.indexOf('exif=') != -1 || document.URL.indexOf('pdf=') != -1) {
location.href=posturl(document.URL.split('#')[0].replace(/exif\=/g, 'exTif=').replace(/pdf\=/g, 'pdTf='));
} else {
location.href=posturl(document.URL.split('#')[0] + '&eHuhxif=y');
}
}
}
… approach we have used successfully recently did not work here. Anyway, deprecated or non-existant it doesn’t matter, we decided to resort to good ol’ PHP exec methodologies in a new “inhouse slideshow” (featuring in a changed example PHP inhouse slideshow creator web application) call …
if (file_exists($zipisis)) {
$items = glob($hereis . "*[-_][0-9]*of.[jJgGpP][pPiInN]*");
foreach ($items as $key => $val) {
$alreadythere=true;
}
}
if (!function_exists("zip_entry_read")) {
function zip_entry_read($zip_read_output, $zip_entry_len) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output, $gzip_entry_len;
return 'pork';
}
}
if (!function_exists("zip_entry_filesize")) {
function zip_entry_filesize($zip_read_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_entry_filename;
return 'pork';
}
}
if (!function_exists("zip_read")) {
function zip_read($zip_oben_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}
if (!function_exists("zip_open")) {
function zip_open($zip_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_filename;
$gzip_filename=$zip_filename;
$gzip_number=0;
$gzip_open_handle='pork';
return 'pork';
}
}
if (!function_exists("zip_entry_name")) {
function zip_entry_name($zip_read_output) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output;
return 'pork';
}
}
if (!function_exists("zip_entry_open")) {
function zip_entry_open($zip_open_handle, $zip_read_output, $inmode) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle, $gzip_read_output;
return 'pork';
}
}
if (!function_exists("zip_close")) {
function zip_close($zip_open_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}
… as a first draft. We have much more to do trying to resurrect, if possible, some other inhouse PHP web applications we’ve based on the use of Zip in PHP. Pardon us, until tomorrow, while we have a little cry.
… that means we can back up a “peer based” solution such as talked about with Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial (ie. done as a user is surfing the net with some PHP of ours) methodology should it fail. We think we have an occasionally failing one as far as the tidy up of zipped up inhouse slideshows goes. It could be to do with a search engine crawling operation, we have not found out for sure, but we’ve decided to write our own …
PHP … via …
crontab
curl
… based independent tidying up procedure we’ll run once an hour via crontab record …
for ($i=0; $i<sizeof($lines); $i++) {
$lines[$i]=explode("\n", $lines[$i])[0];
if (file_exists(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) {
if (('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) == '38794') {
if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}
exec("unzip -l " . $lines[$i] . " | grep '.jpg' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | cut -f4 -d' ' | grep '-' > " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
if (file_exists("slideshow_zero.txx")) {
$sublines=file(dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
for ($j=0; $j<sizeof($sublines); $j++) {
$sublines[$j]=explode(" ", explode("\n", $sublines[$j])[0])[0];
$fis=explode("slideshow_0.zip", $lines[$i])[0] . $sublines[$j];
if (file_exists($fis)) {
$md=filemtime($fis);
if ($md) {
if ((time() - $md) > 1200) {
if (file_exists("slideshow_zero.kkk")) {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "rm -f " . $fis . "\n");
} else {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", "rm -f " . $fis . "\n");
}
}
}
}
}
}
} else if (1 == 3) {
if (file_exists("slideshow_zero.kkk")) {
file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
} else {
file_put_contents("slideshow_zero.kkk", "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
}
}
}
}
if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}
if (file_exists("slideshow_zero.txt")) {
unlink("slideshow_zero.txt");
}
if (file_exists("slideshow_zero.kkk")) {
unlink("slideshow_zero.kkk");
}
//echo $htmlis;
exit;
?>
… as that “ahhhhhhhh, what a relief” reliever of tension running the RJM Programming website. The subtext is, our inode limits are a concern!
We think another lesson here is that PHP can be a good alternative to scripting languages such as Korn Shell to create “operational” procedures, especially when you consider that curl means it can be like writing your “surfing the net” type of PHP (slideshow_zero.php) work.
it is information we do not want everyone to be able to see (easily, shall we say) … and in the sense that …
the report is stored away from RJM Programming’s “public_html” folder (ie. its Apache/PHP/MySql “Document Root”) is good … but even with today’s work …
hidden from everybody who does not have access to the RJM Programming’s web server … but …
the administrator of the RJM Programming’s web server (yoo hoo!) wants a mechanism to view the report that does not involve some “arcane procedure” each time to view it
… and so we decided that because …
the administrator of the RJM Programming's web server = the administrator of this blog
… we’d like to organize a system that latches onto that “security footing” and only show a “broom emoji button” (🧹 🧹) way to access the report when the administrator of this blog is logged in. We can do this by amending our Twenty Ten theme’s good ol’ header.php as per (where the “function mlater” you may recall from the days of WordPress Blog Email Post Collaboration Ajax Image Tutorial) …
<?php
$fns="36";
function doisr() {
global $fns;
$inmb="";
if (('' . get_current_user_id()) != '0' && ('' . get_current_user_id()) == '1') {
if (file_exists('/tmp/slideshow_cleanup.txt')) {
$fns="24";
$inmb="<a style=font-size:24px; title='Inhouse Slideshow Tidy Up Report' onclick=\"var iswo=window.open('','_blank','top=100,left=100,height=600,width=730'); iswo.document.write('<html><head><title>Inhouse Slideshow Tidy Up Report</title></head><body><pre>" . str_replace("\n","<br>",file_get_contents('/tmp/slideshow_cleanup.txt')) . "</pre></body></html>'); \">🧹</a> ";
}
}
return str_replace("'","' + String.fromCharCode(39) + '",$inmb);
}
?>
… PHP affects some (PHP writes) Javascript below …
<?php
function mlater() {
if (1 == 1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i)) {
if (dbihis == '') { dbihis=document.body.innerHTML; }
var xstih=document.getElementById('site-title').innerHTML;
if (xstih.indexOf("up" + "top") == -1) {
document.getElementById('site-title').innerHTML+='<?php echo doisr(); ?>' + '<a id="avs" style="text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" href=# onmouseover="getVisualSynopsis(event);" onmouseout="yehbut();" ontouchstart="getVisualSynopsis(event);" ontouchend="yehbut();" onclick=" uptop(); " title="... you can wait for the long hover functionality about Visual Synopsis (Slideshows)">🎦</a> <a style="cursor:pointer;text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" onclick="diffphpfix(this);" title="Code Difference Functional Links">📖</a> <a style="cursor:pointer;text-decoration:none;font-size:36px;" onclick="popselid();" title="Filter Content via Div ID">➗</a> <a style="cursor:pointer;text-decoration:none;visibility:hidden;font-size:<?php global $fns; echo $fns; ?>px;" title="Blog post contents reduced to summary" id="eds" onclick="pre_details_summary();">➖</a>' + printscreen(0);
if (document.URL.indexOf("visualsynopsis=") != -1) document.getElementById('avs').click();
}
}
}
use zip files to “scrunch up” a series of image files into the one zip file … for the vast majority of time … but when asked to, by a user …
unzip the image files when required by a user wanting to see them … and then …
tidy up, after some delay in time
… but we want to design a PHP way to independently tidy up as a backup mechanism. And we say, with PHP code, that if such files have been on the web server longer than ten minutes, this PHP callable slideshow_cleanup.php code …
<?php
// slideshow_cleanup.php
// RJM Programming
// May, 2022
The recent Inhouse Slideshow Mobile Tutorial did not satisfy all the “mobile usability” tests performed by the “Google Crawl” algorithm, failing on “Content wider than screen”, and you can read some background to this with Google Crawl Viewport Geographicals Tutorial. And so we try some refinements here today, with an idea to control on mobile platforms the max-width CSS property of the document.body of a Inhouse Slideshow webpage, which made up the URLs failing this test at the Google Search Console.
We were reading this great and useful link, thanks, and decided to see whether this stopping of scrolling in X on mobile platform versions of the Inhouse Slideshow webpages gels better with Google Search Console “Google Crawl” Mobility Usability algorithms.
Yet again, deployment of these changes is similar to that last time, and the times before that, as per …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
In a “going off to the right table row of cells” arrangement like this, what are some considerations that improve the user experience (of our inhouse slideshows) for mobile platform users?
turn the “@” link into an “emoji button” as per ➡ ( ➡ )
for both mobile and non-mobile, we’ve decided …
UTF-8 meta …
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<style>
td { vertical-align:top; }
</style>
change the h4 element to be h2 to help with legibility
iOS (ie. iPad and iPhone) PDF iframe elements have known scrolling issues, which we decided to bypass by opening these PDF creations in a new webpage window
Deployment of these changes is similar to that last time, and the times before that, as per …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
Exif Slideshow … and the new, as of today’s work …
PDF Slideshow
… that little bit different in that a PDF Slideshow occupies just the one table cell (rather than the many horizontal cells of the other display modes) and the resultant embedded PDF data vertically scrolls when multiple image slides are involved.
This new option also adds onto this “Inhouse Slideshow” functionality the chance to download and keep a PDF representation of that slideshow to your local system. Perhaps this makes this be of interest to you?!
The changedform_creator.php‘s live run is what gets integrated into the “Inhouse Slideshow” “sisterhood”. We say “sisterhood” because this “Inhouse Slideshow” is designed as a single PHP codefile “hived off” to a lot of other web server folders as their default “index.php” web browser default webpage in a “peer to peer” feeling arrangement. Such an arrangement asks a bit of the deployment arrangements, and we’ve talked about this before (with underlying links pointing to today’s work, should you be interested) …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
But when we say “Unit testing completed” above, we need to fill you in on a Fpdf issue we came across during unit testing of our changes. We were getting a …
FPDF Error: Not a JPEG file
… Fpdf error message choosing the new “PDF Slideshow” option on some, but not all, “Inhouse Slideshow” address bar URLs. And so the online research began as per …
… almost getting us there to a solution (and as far as the last link goes “that was before we posted the suggestion below”). Then we took one of the error messages at its word …
FPDF error: Not a JPEG file: ../Mac/Linux_drutil-238of.jpg
… and independently looked into the issue via Linux (or macOS command line) file command …
# cd $HOME/public_html/Mac
# ls -l Linux_dr*
-rw-r--r-- 1 owner group 724353 Oct 29 08:00 Linux_drutil-238of.jpg
-rw-r--r-- 1 owner group 132707 Oct 29 08:00 Linux_drutil-239of.jpg
-rw-r--r-- 1 owner group 109595 Oct 29 08:00 Linux_drutil-240of.jpg
# file Linux_drutil-238of.jpg
Linux_drutil-238of.jpg: PNG image data, 1280 x 800, 8-bit/color RGBA, non-interlaced
# file Linux_drutil-239of.jpg
Linux_drutil-239of.jpg: JPEG image data, JFIF standard 1.01
#
… when the penny dropped (about our (macOS) Paintbrush slideshow slide creation habits)! We quote our entry into “php – FPDF error: Not a JPEG file: http://10.11.201.93:81/webdocc/uploaded/tes3.jpg – Stack Overflow” …
Have found that constructing slideshows with Paintbrush on a MacBook Pro for years have sometimes been saving what “file jpeg_filename.jpg” determines is a PNG, as a JPEG, which is not the end of the world as far as the browsers go rendering this. Within FPDF’s fpdf.php I fixed my own shortcomings that were resulting in “FPDF Error: Not a JPEG file” via the kludgy “if($a[2]==3) { return $this->_parsepng($file); }” additional codeline below …
… and this change to Fpdf’s fpdf.php fixed the issue in our case for a lot of our previously erroneous “PDF Slideshow” displays of “Inhouse Slideshows”.
PDF Slideshow and Form Creation Helper Primer Tutorial
Our recent work involving the great Fpdf creator of PDF files when we presented Ajax FormData Object No Body PHP PDF Tutorial has got us starting on a new PDF (PHP) web application we are starting out thinking will help with …
online forms (probably via thinking in terms of Fpdf open source programmers like Rick van Buuren and Clément Lavoillotte‘s excellent HTML table rendering ideas) via HTML table intermediate user interactions … and …
slideshows
… but we will not be surprised if the project branches out into other ideas. We’ll see over time.
We hope you come along for the trip starting with a bit of a proof of concept form_creator.php‘s live run for you to try, where we allow you to enter (and be able to change) some HTML table code (if that’s what you end up with?!) in a pink HTML textarea element, and that will become PDF should you click the underlying HTML form’s yellow submit button.
Hope to see you for tomorrow’s PDF writing developments here.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
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.
… on a device the size of an iPhone? We’ll leave the answer up to you, but we would say …
a lot of the world’s population is asked, at various points of their life … to work with …
documents and letters or spreadsheets or presentations or book publications … to us, under the umbrella term …
Document Processing
… and we figure there will be times you are out and about, cornered to deal with an issue, and want some access to professional document editing smarts. Here we’ve talked about Open Source ways (such as with Word to HTML to CSV Delimitation Primer Tutorial below) that did not involve any Microsoft Office functionality, and we still use LibreOffice around here on our MacBook Air (using macOS), for these purposes. But what about the iPhone or iPad (on iOS) regarding this thinking, and embracing the expertise of Microsoft in the Document Processing arena?
Well, we came across the, initially free, Microsoft 365 product (for iOS), that might fit the requirements of a lot of iPhone or iPad users out there.
It certainly looks the part and wherever Microsoft meets iOS has got to be a crossover reason to celebrate … right?!
The modern document applications allow conversion to HTML. What happens during that process, exactly? Well, that’s “under the hood” stuff. A little background, though, and context …
Why would you want to convert, say a Word file, to HTML (using, perhaps, LibreOffice, in our case, or Microsoft Word)? … well, as a mere mortal programmer …
(any form of) text is easier to deal with for “mere mortal programmer” languages we might want to use like …
PHP … is very good at the delimiter processing bits that allow the programmer be useful …
converting … the data into other guises, the one that interested us being …
CSV (comma separated value) data … to be fed into spreadsheet applications like Excel or LibreOffice’s one … and then create charts
… and to do useful delimiter work in PHP you need to know, or suss out, “what happens”, or evidence of that … think hex dumps (where $dr is a PHP variable containing an HTML file record) …
<?php
echo bin2hex($dr) . "\n";
// ... gave, in our case, output such as ...
// c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020c2a020546f74616c207c20c2a020c2a02036302c30333220c2a020c2a020c2a03130302e3030
?>
And so we line up all the useful contributors …
CP3O
C2A0
R2D2
… … …
Hang on?! What’s with C2A0? And for that matter, the pitiful “am typing” simulation “… … … “?!
Well, we asked around, and got to this useful link telling us these are non-ascii characters describing a …
Non-breaking space
… scenario programmers of HTML will know can be those …
… HTML entities in your webpage content. Well, now, at least to us, that all makes sense. But, for our job, that could be the tip of the “UTF-8 headache” situation! We know we’re only interested in ascii data characters for the conversion job we are trying to do. Is there a way to simplify this “middleperson” HTML data content? Well, this other useful link … got us to use …
new CSS Style dropdown option … handled by the changedinhouse_slideshow.js Inhouse Slideshow external Javascript helper only
Of course, that is what external Javascript design is all about. You adjust one code source only, to affect a whole lot of web applications, rather than the worry of many code source changes. We know which we prefer, as programmers?!
Is your way into programming via CSS styling? Perhaps it would tempt you if we pointed out that there are I.T. jobs out there asking for people with expert CSS styling skills. By this, you may understand it can be an art form transforming dreary looking HTML content into dynamic and vibrant looking webpages (all with the same content).
We’ve learnt most about CSS styling, fast, via web browser web inspectors and seeing an initial webpage look change before our eyes via tweaks applied dynamically. We recommend this highly, but don’t expect everyone to be that keen. In any case, we’re trying to channel that dynamism today, offering the user to see our Inhouse Slideshow change it’s look via user CSS Styling entries in a prompt window instigated by a new “Style” dropdown option.
CSS styling does well with webpages dynamically because, quite often, the Javascript DOM approach (where yourselectorpluscss contains CSS styling code) …
… types of CSS clauses to mildly change the styling for each cartoon slide. After using this, for the first time, we wrote down for future tutorial ideas “write a web application helping users improve on their selector smarts”. But we think this Inhouse Slideshow opportunity might be a better dynamic approach for this.
… we can add two more dropdown modus operandi options for …
Video
Animated GIF
… feeding it through to a changedlatest draft cowsay.php media creator via slides via ffmpeg inhouse talent, called by our inhouse slideshow external Javascript helper …
function changeto(tvis) {
if (tvis.toLowerCase().indexOf('video') == 0) {
document.getElementById('divcowpf').innerHTML+='<input type=hidden name=fromindex id=fromindex value=y></input>';
document.getElementById('vlist').click();
document.getElementById('mycowifr').style.display='block';
document.getElementById('mycowifr').style.visibility='hidden';
document.getElementById('mycowifr').style.height='1px';
//document.getElementById('mycowifr').scrollIntoView();
//location.href='#mycowifr';
setTimeout(function(){ document.getElementById('mycowifr').scrollIntoView(); }, 8000);
} else if (tvis.toLowerCase().indexOf('animated gif') == 0) {
document.getElementById('divcowpf').innerHTML+='<input type=hidden name=fromindex id=fromindex value=y></input>';
document.getElementById('aglist').click();
document.getElementById('mycowifr').style.display='block';
document.getElementById('mycowifr').style.visibility='hidden';
document.getElementById('mycowifr').style.height='1px';
//document.getElementById('mycowifr').scrollIntoView();
//location.href='#mycowifr';
setTimeout(function(){ document.getElementById('mycowifr').scrollIntoView(); }, 8000);
} else if (tvis.toLowerCase().indexOf('exif') == 0) {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?exif=y');
} else {
location.href=posturl(document.URL.split('#')[0].replace(/pdf\=/g, 'pdTf=') + '&exif=y');
}
} else if (tvis.toLowerCase().indexOf('pdf') == 0) {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?pdf=y');
} else {
location.href=posturl(document.URL.split('#')[0].replace(/exif\=/g, 'exTif=') + '&pdf=y');
}
} else if (tvis.toLowerCase().indexOf('emoji') == 0) {
//var borderis=prompt('Please enter comma separated HTML decimal entity(s) for your Emoji Border to slideshow. Can use an Emoji Menu entry.', '');
var bbsuffix=' Optionally append &[text|image]css=[CSSstyle] to change styling. Optionally justify some text via &[ul|uc|ur|ml|[mc]|mr|bl|bc|br]text=[someText%0AsecondLine] to change styling. Eg. ' + String.fromCodePoint(127958) + '&css=opacity:0.9;&textcss=font-size:20px;&ultext=Hello%0AThere ';
borderblurb='Please enter comma separated HTML decimal entity(s) for your Emoji Border to slideshow. Can use an Emoji Menu entry (eg. control-command-space for macOS or Mac OS X, logo key + . (period) for Windows, control+space for iOS, top left + for Android keyboard). ' + bbsuffix;
var borderis=prompt(borderblurb, '');
var emojiy='', emojisuffix='';
if (borderis == null) {
borderis='';
} else if (borderis.indexOf('&') != -1) {
if (borderis.split('&')[0].trim() == '') {
emojisuffix=encodeURIComponent(borderis.replace(/\%23[cC][iI][rR][cC][lL][eE]/g, '#circle').replace(/\%23[eE][lL][lL][iI][pP][sS][eE]/g, '#ellipse').replace(/\%23[tT][eE][xX][tT]/g, '#text').replace(/\%23[lL][iI][nN][eE]/g, '#line').replace(/\%23[pP][oO][lL][yY][lL][iI][nN][eE]/g, '#polyline').replace(/\%23[pP][oO][lL][yY][gG][oO][nN]/g, '#polygon').replace(/\%23/g, encodeURIComponent('%23')).replace(/\%23/g, encodeURIComponent('%23')).replace(/\%0a/g, encodeURIComponent('%0A')).replace(/\%0A/g, encodeURIComponent('%0A'))); //.replace(/\&/g,'%26').replace(/\=/g,'%3D');
borderis='';
} else {
emojisuffix=encodeURIComponent(borderis.replace(borderis.split('&')[0], '').replace(/\%23[cC][iI][rR][cC][lL][eE]/g, '#circle').replace(/\%23[eE][lL][lL][iI][pP][sS][eE]/g, '#ellipse').replace(/\%23[tT][eE][xX][tT]/g, '#text').replace(/\%23[lL][iI][nN][eE]/g, '#line').replace(/\%23[pP][oO][lL][yY][lL][iI][nN][eE]/g, '#polyline').replace(/\%23[pP][oO][lL][yY][gG][oO][nN]/g, '#polygon').replace(/\%23/g, encodeURIComponent('%23')).replace(/\%23/g, encodeURIComponent('%23')).replace(/\%0a/g, encodeURIComponent('%0A')).replace(/\%0A/g, encodeURIComponent('%0A'))); //.replace(/\&/g,'%26').replace(/\=/g,'%3D');
borderis=postbb(borderis.split('&')[0]);
}
} else {
borderis=postbb(borderis.split('&')[0]);
}
if ((borderis + emojisuffix) != '') { emojiy='emoji=' + encodeURIComponent(borderis) + emojisuffix; }
if (emojiy != '') {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?' + emojiy);
} else {
location.href=posturl(document.URL.split('#')[0].replace(/emoji\=/g, 'emojTi=') + '&' + emojiy);
}
}
} else {
if (document.URL.indexOf('exif=') != -1 || document.URL.indexOf('pdf=') != -1) {
location.href=posturl(document.URL.split('#')[0].replace(/exif\=/g, 'exTif=').replace(/pdf\=/g, 'pdTf='));
} else {
location.href=posturl(document.URL.split('#')[0] + '&eHuhxif=y');
}
}
}
… approach we have used successfully recently did not work here. Anyway, deprecated or non-existant it doesn’t matter, we decided to resort to good ol’ PHP exec methodologies in a new “inhouse slideshow” (featuring in a changed example PHP inhouse slideshow creator web application) call …
if (file_exists($zipisis)) {
$items = glob($hereis . "*[-_][0-9]*of.[jJgGpP][pPiInN]*");
foreach ($items as $key => $val) {
$alreadythere=true;
}
}
if (!function_exists("zip_entry_read")) {
function zip_entry_read($zip_read_output, $zip_entry_len) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output, $gzip_entry_len;
return 'pork';
}
}
if (!function_exists("zip_entry_filesize")) {
function zip_entry_filesize($zip_read_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_entry_filename;
return 'pork';
}
}
if (!function_exists("zip_read")) {
function zip_read($zip_oben_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}
if (!function_exists("zip_open")) {
function zip_open($zip_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_filename;
$gzip_filename=$zip_filename;
$gzip_number=0;
$gzip_open_handle='pork';
return 'pork';
}
}
if (!function_exists("zip_entry_name")) {
function zip_entry_name($zip_read_output) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output;
return 'pork';
}
}
if (!function_exists("zip_entry_open")) {
function zip_entry_open($zip_open_handle, $zip_read_output, $inmode) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle, $gzip_read_output;
return 'pork';
}
}
if (!function_exists("zip_close")) {
function zip_close($zip_open_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}
… as a first draft. We have much more to do trying to resurrect, if possible, some other inhouse PHP web applications we’ve based on the use of Zip in PHP. Pardon us, until tomorrow, while we have a little cry.
… that means we can back up a “peer based” solution such as talked about with Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial (ie. done as a user is surfing the net with some PHP of ours) methodology should it fail. We think we have an occasionally failing one as far as the tidy up of zipped up inhouse slideshows goes. It could be to do with a search engine crawling operation, we have not found out for sure, but we’ve decided to write our own …
PHP … via …
crontab
curl
… based independent tidying up procedure we’ll run once an hour via crontab record …
for ($i=0; $i<sizeof($lines); $i++) {
$lines[$i]=explode("\n", $lines[$i])[0];
if (file_exists(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) {
if (('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) == '38794') {
if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}
exec("unzip -l " . $lines[$i] . " | grep '.jpg' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | cut -f4 -d' ' | grep '-' > " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
if (file_exists("slideshow_zero.txx")) {
$sublines=file(dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
for ($j=0; $j<sizeof($sublines); $j++) {
$sublines[$j]=explode(" ", explode("\n", $sublines[$j])[0])[0];
$fis=explode("slideshow_0.zip", $lines[$i])[0] . $sublines[$j];
if (file_exists($fis)) {
$md=filemtime($fis);
if ($md) {
if ((time() - $md) > 1200) {
if (file_exists("slideshow_zero.kkk")) {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "rm -f " . $fis . "\n");
} else {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", "rm -f " . $fis . "\n");
}
}
}
}
}
}
} else if (1 == 3) {
if (file_exists("slideshow_zero.kkk")) {
file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
} else {
file_put_contents("slideshow_zero.kkk", "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
}
}
}
}
if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}
if (file_exists("slideshow_zero.txt")) {
unlink("slideshow_zero.txt");
}
if (file_exists("slideshow_zero.kkk")) {
unlink("slideshow_zero.kkk");
}
//echo $htmlis;
exit;
?>
… as that “ahhhhhhhh, what a relief” reliever of tension running the RJM Programming website. The subtext is, our inode limits are a concern!
We think another lesson here is that PHP can be a good alternative to scripting languages such as Korn Shell to create “operational” procedures, especially when you consider that curl means it can be like writing your “surfing the net” type of PHP (slideshow_zero.php) work.
it is information we do not want everyone to be able to see (easily, shall we say) … and in the sense that …
the report is stored away from RJM Programming’s “public_html” folder (ie. its Apache/PHP/MySql “Document Root”) is good … but even with today’s work …
hidden from everybody who does not have access to the RJM Programming’s web server … but …
the administrator of the RJM Programming’s web server (yoo hoo!) wants a mechanism to view the report that does not involve some “arcane procedure” each time to view it
… and so we decided that because …
the administrator of the RJM Programming's web server = the administrator of this blog
… we’d like to organize a system that latches onto that “security footing” and only show a “broom emoji button” (🧹 🧹) way to access the report when the administrator of this blog is logged in. We can do this by amending our Twenty Ten theme’s good ol’ header.php as per (where the “function mlater” you may recall from the days of WordPress Blog Email Post Collaboration Ajax Image Tutorial) …
<?php
$fns="36";
function doisr() {
global $fns;
$inmb="";
if (('' . get_current_user_id()) != '0' && ('' . get_current_user_id()) == '1') {
if (file_exists('/tmp/slideshow_cleanup.txt')) {
$fns="24";
$inmb="<a style=font-size:24px; title='Inhouse Slideshow Tidy Up Report' onclick=\"var iswo=window.open('','_blank','top=100,left=100,height=600,width=730'); iswo.document.write('<html><head><title>Inhouse Slideshow Tidy Up Report</title></head><body><pre>" . str_replace("\n","<br>",file_get_contents('/tmp/slideshow_cleanup.txt')) . "</pre></body></html>'); \">🧹</a> ";
}
}
return str_replace("'","' + String.fromCharCode(39) + '",$inmb);
}
?>
… PHP affects some (PHP writes) Javascript below …
<?php
function mlater() {
if (1 == 1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i)) {
if (dbihis == '') { dbihis=document.body.innerHTML; }
var xstih=document.getElementById('site-title').innerHTML;
if (xstih.indexOf("up" + "top") == -1) {
document.getElementById('site-title').innerHTML+='<?php echo doisr(); ?>' + '<a id="avs" style="text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" href=# onmouseover="getVisualSynopsis(event);" onmouseout="yehbut();" ontouchstart="getVisualSynopsis(event);" ontouchend="yehbut();" onclick=" uptop(); " title="... you can wait for the long hover functionality about Visual Synopsis (Slideshows)">🎦</a> <a style="cursor:pointer;text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" onclick="diffphpfix(this);" title="Code Difference Functional Links">📖</a> <a style="cursor:pointer;text-decoration:none;font-size:36px;" onclick="popselid();" title="Filter Content via Div ID">➗</a> <a style="cursor:pointer;text-decoration:none;visibility:hidden;font-size:<?php global $fns; echo $fns; ?>px;" title="Blog post contents reduced to summary" id="eds" onclick="pre_details_summary();">➖</a>' + printscreen(0);
if (document.URL.indexOf("visualsynopsis=") != -1) document.getElementById('avs').click();
}
}
}
use zip files to “scrunch up” a series of image files into the one zip file … for the vast majority of time … but when asked to, by a user …
unzip the image files when required by a user wanting to see them … and then …
tidy up, after some delay in time
… but we want to design a PHP way to independently tidy up as a backup mechanism. And we say, with PHP code, that if such files have been on the web server longer than ten minutes, this PHP callable slideshow_cleanup.php code …
<?php
// slideshow_cleanup.php
// RJM Programming
// May, 2022
The recent Inhouse Slideshow Mobile Tutorial did not satisfy all the “mobile usability” tests performed by the “Google Crawl” algorithm, failing on “Content wider than screen”, and you can read some background to this with Google Crawl Viewport Geographicals Tutorial. And so we try some refinements here today, with an idea to control on mobile platforms the max-width CSS property of the document.body of a Inhouse Slideshow webpage, which made up the URLs failing this test at the Google Search Console.
We were reading this great and useful link, thanks, and decided to see whether this stopping of scrolling in X on mobile platform versions of the Inhouse Slideshow webpages gels better with Google Search Console “Google Crawl” Mobility Usability algorithms.
Yet again, deployment of these changes is similar to that last time, and the times before that, as per …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
In a “going off to the right table row of cells” arrangement like this, what are some considerations that improve the user experience (of our inhouse slideshows) for mobile platform users?
turn the “@” link into an “emoji button” as per ➡ ( ➡ )
for both mobile and non-mobile, we’ve decided …
UTF-8 meta …
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<style>
td { vertical-align:top; }
</style>
change the h4 element to be h2 to help with legibility
iOS (ie. iPad and iPhone) PDF iframe elements have known scrolling issues, which we decided to bypass by opening these PDF creations in a new webpage window
Deployment of these changes is similar to that last time, and the times before that, as per …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
Exif Slideshow … and the new, as of today’s work …
PDF Slideshow
… that little bit different in that a PDF Slideshow occupies just the one table cell (rather than the many horizontal cells of the other display modes) and the resultant embedded PDF data vertically scrolls when multiple image slides are involved.
This new option also adds onto this “Inhouse Slideshow” functionality the chance to download and keep a PDF representation of that slideshow to your local system. Perhaps this makes this be of interest to you?!
The changedform_creator.php‘s live run is what gets integrated into the “Inhouse Slideshow” “sisterhood”. We say “sisterhood” because this “Inhouse Slideshow” is designed as a single PHP codefile “hived off” to a lot of other web server folders as their default “index.php” web browser default webpage in a “peer to peer” feeling arrangement. Such an arrangement asks a bit of the deployment arrangements, and we’ve talked about this before (with underlying links pointing to today’s work, should you be interested) …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
But when we say “Unit testing completed” above, we need to fill you in on a Fpdf issue we came across during unit testing of our changes. We were getting a …
FPDF Error: Not a JPEG file
… Fpdf error message choosing the new “PDF Slideshow” option on some, but not all, “Inhouse Slideshow” address bar URLs. And so the online research began as per …
… almost getting us there to a solution (and as far as the last link goes “that was before we posted the suggestion below”). Then we took one of the error messages at its word …
FPDF error: Not a JPEG file: ../Mac/Linux_drutil-238of.jpg
… and independently looked into the issue via Linux (or macOS command line) file command …
# cd $HOME/public_html/Mac
# ls -l Linux_dr*
-rw-r--r-- 1 owner group 724353 Oct 29 08:00 Linux_drutil-238of.jpg
-rw-r--r-- 1 owner group 132707 Oct 29 08:00 Linux_drutil-239of.jpg
-rw-r--r-- 1 owner group 109595 Oct 29 08:00 Linux_drutil-240of.jpg
# file Linux_drutil-238of.jpg
Linux_drutil-238of.jpg: PNG image data, 1280 x 800, 8-bit/color RGBA, non-interlaced
# file Linux_drutil-239of.jpg
Linux_drutil-239of.jpg: JPEG image data, JFIF standard 1.01
#
… when the penny dropped (about our (macOS) Paintbrush slideshow slide creation habits)! We quote our entry into “php – FPDF error: Not a JPEG file: http://10.11.201.93:81/webdocc/uploaded/tes3.jpg – Stack Overflow” …
Have found that constructing slideshows with Paintbrush on a MacBook Pro for years have sometimes been saving what “file jpeg_filename.jpg” determines is a PNG, as a JPEG, which is not the end of the world as far as the browsers go rendering this. Within FPDF’s fpdf.php I fixed my own shortcomings that were resulting in “FPDF Error: Not a JPEG file” via the kludgy “if($a[2]==3) { return $this->_parsepng($file); }” additional codeline below …
… and this change to Fpdf’s fpdf.php fixed the issue in our case for a lot of our previously erroneous “PDF Slideshow” displays of “Inhouse Slideshows”.
PDF Slideshow and Form Creation Helper Primer Tutorial
Our recent work involving the great Fpdf creator of PDF files when we presented Ajax FormData Object No Body PHP PDF Tutorial has got us starting on a new PDF (PHP) web application we are starting out thinking will help with …
online forms (probably via thinking in terms of Fpdf open source programmers like Rick van Buuren and Clément Lavoillotte‘s excellent HTML table rendering ideas) via HTML table intermediate user interactions … and …
slideshows
… but we will not be surprised if the project branches out into other ideas. We’ll see over time.
We hope you come along for the trip starting with a bit of a proof of concept form_creator.php‘s live run for you to try, where we allow you to enter (and be able to change) some HTML table code (if that’s what you end up with?!) in a pink HTML textarea element, and that will become PDF should you click the underlying HTML form’s yellow submit button.
Hope to see you for tomorrow’s PDF writing developments here.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
… we can add two more dropdown modus operandi options for …
Video
Animated GIF
… feeding it through to a changedlatest draft cowsay.php media creator via slides via ffmpeg inhouse talent, called by our inhouse slideshow external Javascript helper …
function changeto(tvis) {
if (tvis.toLowerCase().indexOf('video') == 0) {
document.getElementById('divcowpf').innerHTML+='<input type=hidden name=fromindex id=fromindex value=y></input>';
document.getElementById('vlist').click();
document.getElementById('mycowifr').style.display='block';
document.getElementById('mycowifr').style.visibility='hidden';
document.getElementById('mycowifr').style.height='1px';
//document.getElementById('mycowifr').scrollIntoView();
//location.href='#mycowifr';
setTimeout(function(){ document.getElementById('mycowifr').scrollIntoView(); }, 8000);
} else if (tvis.toLowerCase().indexOf('animated gif') == 0) {
document.getElementById('divcowpf').innerHTML+='<input type=hidden name=fromindex id=fromindex value=y></input>';
document.getElementById('aglist').click();
document.getElementById('mycowifr').style.display='block';
document.getElementById('mycowifr').style.visibility='hidden';
document.getElementById('mycowifr').style.height='1px';
//document.getElementById('mycowifr').scrollIntoView();
//location.href='#mycowifr';
setTimeout(function(){ document.getElementById('mycowifr').scrollIntoView(); }, 8000);
} else if (tvis.toLowerCase().indexOf('exif') == 0) {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?exif=y');
} else {
location.href=posturl(document.URL.split('#')[0].replace(/pdf\=/g, 'pdTf=') + '&exif=y');
}
} else if (tvis.toLowerCase().indexOf('pdf') == 0) {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?pdf=y');
} else {
location.href=posturl(document.URL.split('#')[0].replace(/exif\=/g, 'exTif=') + '&pdf=y');
}
} else if (tvis.toLowerCase().indexOf('emoji') == 0) {
//var borderis=prompt('Please enter comma separated HTML decimal entity(s) for your Emoji Border to slideshow. Can use an Emoji Menu entry.', '');
var bbsuffix=' Optionally append &[text|image]css=[CSSstyle] to change styling. Optionally justify some text via &[ul|uc|ur|ml|[mc]|mr|bl|bc|br]text=[someText%0AsecondLine] to change styling. Eg. ' + String.fromCodePoint(127958) + '&css=opacity:0.9;&textcss=font-size:20px;&ultext=Hello%0AThere ';
borderblurb='Please enter comma separated HTML decimal entity(s) for your Emoji Border to slideshow. Can use an Emoji Menu entry (eg. control-command-space for macOS or Mac OS X, logo key + . (period) for Windows, control+space for iOS, top left + for Android keyboard). ' + bbsuffix;
var borderis=prompt(borderblurb, '');
var emojiy='', emojisuffix='';
if (borderis == null) {
borderis='';
} else if (borderis.indexOf('&') != -1) {
if (borderis.split('&')[0].trim() == '') {
emojisuffix=encodeURIComponent(borderis.replace(/\%23[cC][iI][rR][cC][lL][eE]/g, '#circle').replace(/\%23[eE][lL][lL][iI][pP][sS][eE]/g, '#ellipse').replace(/\%23[tT][eE][xX][tT]/g, '#text').replace(/\%23[lL][iI][nN][eE]/g, '#line').replace(/\%23[pP][oO][lL][yY][lL][iI][nN][eE]/g, '#polyline').replace(/\%23[pP][oO][lL][yY][gG][oO][nN]/g, '#polygon').replace(/\%23/g, encodeURIComponent('%23')).replace(/\%23/g, encodeURIComponent('%23')).replace(/\%0a/g, encodeURIComponent('%0A')).replace(/\%0A/g, encodeURIComponent('%0A'))); //.replace(/\&/g,'%26').replace(/\=/g,'%3D');
borderis='';
} else {
emojisuffix=encodeURIComponent(borderis.replace(borderis.split('&')[0], '').replace(/\%23[cC][iI][rR][cC][lL][eE]/g, '#circle').replace(/\%23[eE][lL][lL][iI][pP][sS][eE]/g, '#ellipse').replace(/\%23[tT][eE][xX][tT]/g, '#text').replace(/\%23[lL][iI][nN][eE]/g, '#line').replace(/\%23[pP][oO][lL][yY][lL][iI][nN][eE]/g, '#polyline').replace(/\%23[pP][oO][lL][yY][gG][oO][nN]/g, '#polygon').replace(/\%23/g, encodeURIComponent('%23')).replace(/\%23/g, encodeURIComponent('%23')).replace(/\%0a/g, encodeURIComponent('%0A')).replace(/\%0A/g, encodeURIComponent('%0A'))); //.replace(/\&/g,'%26').replace(/\=/g,'%3D');
borderis=postbb(borderis.split('&')[0]);
}
} else {
borderis=postbb(borderis.split('&')[0]);
}
if ((borderis + emojisuffix) != '') { emojiy='emoji=' + encodeURIComponent(borderis) + emojisuffix; }
if (emojiy != '') {
if (document.URL.indexOf('?') == -1) {
location.href=posturl(document.URL.split('#')[0] + '?' + emojiy);
} else {
location.href=posturl(document.URL.split('#')[0].replace(/emoji\=/g, 'emojTi=') + '&' + emojiy);
}
}
} else {
if (document.URL.indexOf('exif=') != -1 || document.URL.indexOf('pdf=') != -1) {
location.href=posturl(document.URL.split('#')[0].replace(/exif\=/g, 'exTif=').replace(/pdf\=/g, 'pdTf='));
} else {
location.href=posturl(document.URL.split('#')[0] + '&eHuhxif=y');
}
}
}
… approach we have used successfully recently did not work here. Anyway, deprecated or non-existant it doesn’t matter, we decided to resort to good ol’ PHP exec methodologies in a new “inhouse slideshow” (featuring in a changed example PHP inhouse slideshow creator web application) call …
if (file_exists($zipisis)) {
$items = glob($hereis . "*[-_][0-9]*of.[jJgGpP][pPiInN]*");
foreach ($items as $key => $val) {
$alreadythere=true;
}
}
if (!function_exists("zip_entry_read")) {
function zip_entry_read($zip_read_output, $zip_entry_len) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output, $gzip_entry_len;
return 'pork';
}
}
if (!function_exists("zip_entry_filesize")) {
function zip_entry_filesize($zip_read_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_entry_filename;
return 'pork';
}
}
if (!function_exists("zip_read")) {
function zip_read($zip_oben_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}
if (!function_exists("zip_open")) {
function zip_open($zip_filename) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_filename;
$gzip_filename=$zip_filename;
$gzip_number=0;
$gzip_open_handle='pork';
return 'pork';
}
}
if (!function_exists("zip_entry_name")) {
function zip_entry_name($zip_read_output) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_read_output;
return 'pork';
}
}
if (!function_exists("zip_entry_open")) {
function zip_entry_open($zip_open_handle, $zip_read_output, $inmode) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle, $gzip_read_output;
return 'pork';
}
}
if (!function_exists("zip_close")) {
function zip_close($zip_open_handle) {
global $gzip_filename, $gzip_number, $gzip_log_text, $gzip_open_handle;
return 'pork';
}
}
… as a first draft. We have much more to do trying to resurrect, if possible, some other inhouse PHP web applications we’ve based on the use of Zip in PHP. Pardon us, until tomorrow, while we have a little cry.
… that means we can back up a “peer based” solution such as talked about with Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial (ie. done as a user is surfing the net with some PHP of ours) methodology should it fail. We think we have an occasionally failing one as far as the tidy up of zipped up inhouse slideshows goes. It could be to do with a search engine crawling operation, we have not found out for sure, but we’ve decided to write our own …
PHP … via …
crontab
curl
… based independent tidying up procedure we’ll run once an hour via crontab record …
for ($i=0; $i<sizeof($lines); $i++) {
$lines[$i]=explode("\n", $lines[$i])[0];
if (file_exists(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) {
if (('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) == '38794') {
if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}
exec("unzip -l " . $lines[$i] . " | grep '.jpg' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/^ /s///g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | sed '/ /s// /g' | cut -f4 -d' ' | grep '-' > " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
if (file_exists("slideshow_zero.txx")) {
$sublines=file(dirname(__FILE__) . DIRECTORY_SEPARATOR . "slideshow_zero.txx");
for ($j=0; $j<sizeof($sublines); $j++) {
$sublines[$j]=explode(" ", explode("\n", $sublines[$j])[0])[0];
$fis=explode("slideshow_0.zip", $lines[$i])[0] . $sublines[$j];
if (file_exists($fis)) {
$md=filemtime($fis);
if ($md) {
if ((time() - $md) > 1200) {
if (file_exists("slideshow_zero.kkk")) {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "rm -f " . $fis . "\n");
} else {
exec("rm -f " . $fis); //file_put_contents("slideshow_zero.kkk", "rm -f " . $fis . "\n");
}
}
}
}
}
}
} else if (1 == 3) {
if (file_exists("slideshow_zero.kkk")) {
file_put_contents("slideshow_zero.kkk", file_get_contents("slideshow_zero.kkk") . "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
} else {
file_put_contents("slideshow_zero.kkk", "# " . ('' . filesize(str_replace("slideshow_0.zip", "index.php", $lines[$i]))) . " is not 38794 " . str_replace("slideshow_0.zip", "index.php", $lines[$i]) . "\n");
}
}
}
}
if (file_exists("slideshow_zero.txx")) {
unlink("slideshow_zero.txx");
}
if (file_exists("slideshow_zero.txt")) {
unlink("slideshow_zero.txt");
}
if (file_exists("slideshow_zero.kkk")) {
unlink("slideshow_zero.kkk");
}
//echo $htmlis;
exit;
?>
… as that “ahhhhhhhh, what a relief” reliever of tension running the RJM Programming website. The subtext is, our inode limits are a concern!
We think another lesson here is that PHP can be a good alternative to scripting languages such as Korn Shell to create “operational” procedures, especially when you consider that curl means it can be like writing your “surfing the net” type of PHP (slideshow_zero.php) work.
it is information we do not want everyone to be able to see (easily, shall we say) … and in the sense that …
the report is stored away from RJM Programming’s “public_html” folder (ie. its Apache/PHP/MySql “Document Root”) is good … but even with today’s work …
hidden from everybody who does not have access to the RJM Programming’s web server … but …
the administrator of the RJM Programming’s web server (yoo hoo!) wants a mechanism to view the report that does not involve some “arcane procedure” each time to view it
… and so we decided that because …
the administrator of the RJM Programming's web server = the administrator of this blog
… we’d like to organize a system that latches onto that “security footing” and only show a “broom emoji button” (🧹 🧹) way to access the report when the administrator of this blog is logged in. We can do this by amending our Twenty Ten theme’s good ol’ header.php as per (where the “function mlater” you may recall from the days of WordPress Blog Email Post Collaboration Ajax Image Tutorial) …
<?php
$fns="36";
function doisr() {
global $fns;
$inmb="";
if (('' . get_current_user_id()) != '0' && ('' . get_current_user_id()) == '1') {
if (file_exists('/tmp/slideshow_cleanup.txt')) {
$fns="24";
$inmb="<a style=font-size:24px; title='Inhouse Slideshow Tidy Up Report' onclick=\"var iswo=window.open('','_blank','top=100,left=100,height=600,width=730'); iswo.document.write('<html><head><title>Inhouse Slideshow Tidy Up Report</title></head><body><pre>" . str_replace("\n","<br>",file_get_contents('/tmp/slideshow_cleanup.txt')) . "</pre></body></html>'); \">🧹</a> ";
}
}
return str_replace("'","' + String.fromCharCode(39) + '",$inmb);
}
?>
… PHP affects some (PHP writes) Javascript below …
<?php
function mlater() {
if (1 == 1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i)) {
if (dbihis == '') { dbihis=document.body.innerHTML; }
var xstih=document.getElementById('site-title').innerHTML;
if (xstih.indexOf("up" + "top") == -1) {
document.getElementById('site-title').innerHTML+='<?php echo doisr(); ?>' + '<a id="avs" style="text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" href=# onmouseover="getVisualSynopsis(event);" onmouseout="yehbut();" ontouchstart="getVisualSynopsis(event);" ontouchend="yehbut();" onclick=" uptop(); " title="... you can wait for the long hover functionality about Visual Synopsis (Slideshows)">🎦</a> <a style="cursor:pointer;text-decoration:none;font-size:<?php global $fns; echo $fns; ?>px;" onclick="diffphpfix(this);" title="Code Difference Functional Links">📖</a> <a style="cursor:pointer;text-decoration:none;font-size:36px;" onclick="popselid();" title="Filter Content via Div ID">➗</a> <a style="cursor:pointer;text-decoration:none;visibility:hidden;font-size:<?php global $fns; echo $fns; ?>px;" title="Blog post contents reduced to summary" id="eds" onclick="pre_details_summary();">➖</a>' + printscreen(0);
if (document.URL.indexOf("visualsynopsis=") != -1) document.getElementById('avs').click();
}
}
}
use zip files to “scrunch up” a series of image files into the one zip file … for the vast majority of time … but when asked to, by a user …
unzip the image files when required by a user wanting to see them … and then …
tidy up, after some delay in time
… but we want to design a PHP way to independently tidy up as a backup mechanism. And we say, with PHP code, that if such files have been on the web server longer than ten minutes, this PHP callable slideshow_cleanup.php code …
<?php
// slideshow_cleanup.php
// RJM Programming
// May, 2022
The recent Inhouse Slideshow Mobile Tutorial did not satisfy all the “mobile usability” tests performed by the “Google Crawl” algorithm, failing on “Content wider than screen”, and you can read some background to this with Google Crawl Viewport Geographicals Tutorial. And so we try some refinements here today, with an idea to control on mobile platforms the max-width CSS property of the document.body of a Inhouse Slideshow webpage, which made up the URLs failing this test at the Google Search Console.
We were reading this great and useful link, thanks, and decided to see whether this stopping of scrolling in X on mobile platform versions of the Inhouse Slideshow webpages gels better with Google Search Console “Google Crawl” Mobility Usability algorithms.
Yet again, deployment of these changes is similar to that last time, and the times before that, as per …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
In a “going off to the right table row of cells” arrangement like this, what are some considerations that improve the user experience (of our inhouse slideshows) for mobile platform users?
turn the “@” link into an “emoji button” as per ➡ ( ➡ )
for both mobile and non-mobile, we’ve decided …
UTF-8 meta …
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<style>
td { vertical-align:top; }
</style>
change the h4 element to be h2 to help with legibility
iOS (ie. iPad and iPhone) PDF iframe elements have known scrolling issues, which we decided to bypass by opening these PDF creations in a new webpage window
Deployment of these changes is similar to that last time, and the times before that, as per …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
Exif Slideshow … and the new, as of today’s work …
PDF Slideshow
… that little bit different in that a PDF Slideshow occupies just the one table cell (rather than the many horizontal cells of the other display modes) and the resultant embedded PDF data vertically scrolls when multiple image slides are involved.
This new option also adds onto this “Inhouse Slideshow” functionality the chance to download and keep a PDF representation of that slideshow to your local system. Perhaps this makes this be of interest to you?!
The changedform_creator.php‘s live run is what gets integrated into the “Inhouse Slideshow” “sisterhood”. We say “sisterhood” because this “Inhouse Slideshow” is designed as a single PHP codefile “hived off” to a lot of other web server folders as their default “index.php” web browser default webpage in a “peer to peer” feeling arrangement. Such an arrangement asks a bit of the deployment arrangements, and we’ve talked about this before (with underlying links pointing to today’s work, should you be interested) …
the changedindex.php new “inhouse slideshow” presentation supervisor (exemplified by this live run link) reading of a slideshow_0.zip zip file … was done in …
But when we say “Unit testing completed” above, we need to fill you in on a Fpdf issue we came across during unit testing of our changes. We were getting a …
FPDF Error: Not a JPEG file
… Fpdf error message choosing the new “PDF Slideshow” option on some, but not all, “Inhouse Slideshow” address bar URLs. And so the online research began as per …
… almost getting us there to a solution (and as far as the last link goes “that was before we posted the suggestion below”). Then we took one of the error messages at its word …
FPDF error: Not a JPEG file: ../Mac/Linux_drutil-238of.jpg
… and independently looked into the issue via Linux (or macOS command line) file command …
# cd $HOME/public_html/Mac
# ls -l Linux_dr*
-rw-r--r-- 1 owner group 724353 Oct 29 08:00 Linux_drutil-238of.jpg
-rw-r--r-- 1 owner group 132707 Oct 29 08:00 Linux_drutil-239of.jpg
-rw-r--r-- 1 owner group 109595 Oct 29 08:00 Linux_drutil-240of.jpg
# file Linux_drutil-238of.jpg
Linux_drutil-238of.jpg: PNG image data, 1280 x 800, 8-bit/color RGBA, non-interlaced
# file Linux_drutil-239of.jpg
Linux_drutil-239of.jpg: JPEG image data, JFIF standard 1.01
#
… when the penny dropped (about our (macOS) Paintbrush slideshow slide creation habits)! We quote our entry into “php – FPDF error: Not a JPEG file: http://10.11.201.93:81/webdocc/uploaded/tes3.jpg – Stack Overflow” …
Have found that constructing slideshows with Paintbrush on a MacBook Pro for years have sometimes been saving what “file jpeg_filename.jpg” determines is a PNG, as a JPEG, which is not the end of the world as far as the browsers go rendering this. Within FPDF’s fpdf.php I fixed my own shortcomings that were resulting in “FPDF Error: Not a JPEG file” via the kludgy “if($a[2]==3) { return $this->_parsepng($file); }” additional codeline below …
… and this change to Fpdf’s fpdf.php fixed the issue in our case for a lot of our previously erroneous “PDF Slideshow” displays of “Inhouse Slideshows”.
PDF Slideshow and Form Creation Helper Primer Tutorial
Our recent work involving the great Fpdf creator of PDF files when we presented Ajax FormData Object No Body PHP PDF Tutorial has got us starting on a new PDF (PHP) web application we are starting out thinking will help with …
online forms (probably via thinking in terms of Fpdf open source programmers like Rick van Buuren and Clément Lavoillotte‘s excellent HTML table rendering ideas) via HTML table intermediate user interactions … and …
slideshows
… but we will not be surprised if the project branches out into other ideas. We’ll see over time.
We hope you come along for the trip starting with a bit of a proof of concept form_creator.php‘s live run for you to try, where we allow you to enter (and be able to change) some HTML table code (if that’s what you end up with?!) in a pink HTML textarea element, and that will become PDF should you click the underlying HTML form’s yellow submit button.
Hope to see you for tomorrow’s PDF writing developments here.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.