A few things come together for todayโs user experience (UX) inspired tutorial whereby โฆ
- we build on yesterdayโs WordPress Is Mentioned By Code Download Navigation Tutorial changes involving the Code Download Table and the GET parameter calling methods, but this time come at it from a styling perspective that would have been referenced with PHP Blog Summary Follow Up Tutorial โฆ so we โฆ
- change the PHP that creates the HTML for displaying the Code Download Table, and that is accessed by our web server at RJM Programming using the Crontab/Curl โdynamic duoโ (we often look at) โฆ that uses โฆ
- changes to Javascript jQuery code to dynamically change CSS (we were last talking about with Javascript jQuery More Filtering Tutorial) โฆ sometimes mimicing โฆ
- CSS Complex Selector functionality (weโve last talked about with WordPress Blog Complex Selectors Tutorial), but via the use of jQuery methods like parent() and siblings() methods โฆ and only being called, as for yesterdayโs scenario, where โฆ
- the window.document.hashtag property contains โGETMEโ (a navigation approach we were last exploring with Navigation Scrolling Trapping Image Tutorial some time back)
โฆ to make what we are doing stand out more for the user, who may โswimโ in a large table devoid of any styling to focus their attention.
Weโll leave you with modified PHP, that writes out the HTML Code Download Table manipulator, you could call getmelistphp and which changed in thisway to make the Code Download Table be more usercentric with its presentation of hashtagged calls linking a WordPress Blog Posting at this blog with a particular piece of software code of interest in our Code Download Table.
Hope you try this functionality out for yourself.
Previous relevant WordPress Is Mentioned By Code Download Navigation Tutorial is shown below.
Weโre following up on some recent WordPress navigation logic today, that we started with WordPress Is Mentioned By Navigation Primer Tutorial as shown below, for blog posting relationships between โฆ
- A blog posting being referred to โฆ back, optionally, as a link, to โฆ
- A blog posting that mentioned that blog posting currently being viewed
โฆ and looking at this premise, it stands to reason that as helpful as this concept looks on paper, if a regular reader expects a recent posting be referred to by others โhot off the pressโ theyโd be expecting quite a lot, and though what they get in this scenario โฆ
Sadly, this tutorial is not mentioned by any others, yet
โฆ probably does a good job tweaking them to the dilemma of โhot off the pressโ being โtoo recent to be referred toโ it still remains a disappointment, perhaps. So, thinking a tad laterally on this, what is going to help out here will be to particularize the scenario for what we do around here โฆ and am sorry if this annoys, but we are showing a line of thinking here โฆ and allow for Blog Posts that contain the word โGETMEโ โฆ our favourite code download mechanism around here โฆ to add a โCode Download Tableโ dropdown option, that if selected will lob the user directly onto the RJM Programming Code Download Table entry for the first โGETMEโ file link found in that blog posting. This additional scouring of the MySql database, that utilizes the SQL UNION operator (the โadding an extra clause or paragraphโ SQL operator, we like to think of it as) with its query, will not be relevant to all unmentioned blog postings, but it will help those that talk about software coding, which is quite a few.
That functionality had us looking back at how the Code Download Table was constructed in terms of its hashtagging when we discussed PHP Blog Summary Follow Up Tutorial. In this way, we had a first try at โฆ
- โฆ using the hashtagging for a date โฆ as you see with these changes to is_mentioned_byphp at the left hand column of the Code Download Table โฆ did a couple of unit tests seeing the first one work, the second one work if you take it a day back, and the third one not work at all, at which point it tweaked with us that the date in the Code Download Table is a date reflected by the software code fileโs modified date, not the WordPress Blog Posting publication date, that we can derive off our amended query โฆ so that being less friendly than we envisaged we end up โฆ
- โฆ using the very interesting hashtagging that particularizes the filename, where the read file extension (minus all the โGETMEโ and โ-โโs and โ_โโs that is) is taken out of the prefix to the hashtag, and made into a suffix โฆ like โanalogue_clock.-GETMEhtmlโ for Analogue Clock Timezone Tutorial that is exemplified in todayโs tutorial
picture and as you can see the changes for at this is_mentioned_byphp link
So it panned out to make this happen the original Code Download Table code did not need any tweaking, not good olโ WordPress TwentyTen theme header.php โฆ just is_mentioned_byphp โฆ but we hope you try out clicking some โWhite Right Pointing Indexโ emoji โฆ
โฆ at this WordPress blog sometime soon.
Did you know?
What gives with the &tsp=[someBigNumber] GET parameter โฆ like is yellow highlighted in todayโs tutorialpicture โฆ in the โCode Download Tableโ lookup URLs? This is so that we end up with different URLs each time a user accesses this functionality. This is because web browsers often try to help you out with speeding up your browsing, and use the web browser cache to โregurgitateโ a previously visited URL should that have happened since the last clearing of any web browser cache, to โslapโ the cache version quickly on the screen. But we donโt want any โslappingโ to go on around our functionality today, and a way to force the web browser to reconsider the real lookup, and go back to the real web server again for data, is to make your URL be unique. A curiosity here you can try is to use something like a local MAMP (for Mac or EasyPHP for Windows) local web server to, for an image file called image.jpg that is put into the Apache web serverโs Document Root โฆ
- see the image in your favoured web browser with the URL //localhost:8888/image.jpg โฆ then โฆ
- change that image somehow with an image editor โฆ and โฆ
- refresh, or revisit the image with the URL //localhost:8888/image.jpg โฆ and youโll probably see the cached web server version โฆ unless you havenโt got web browser caching going โฆ so amend this to โฆ
- revisit the image with the URL //localhost:8888/image.jpg?random=7456536 โฆ and this time we think youโll see the amended image that happened with your image editing โฆ and yes, you can add GET parameters to your URLs even for image URLs (often, most helpfully with image URLs, actually)
Previous relevant WordPress Is Mentioned By Navigation Primer Tutorial is shown below.
Weโve written some new WordPress navigation logic today, for blog posting relationships between โฆ
- A blog posting being referred to โฆ back, optionally, as a link, to โฆ
- A blog posting that mentioned that blog posting currently being viewed
โฆ done, because we see that it is not only the โverticalโ type linking of blog postings into a โthreadโ that helps understanding โฆ we hope โฆ but also to jump around among commonalities between concepts (like โhorizontalโ โdegrees of separationโ), perhaps. This functionality involves MySql database queries, and is best suited to a user clicks something (rather than pre-emptive content loading) to reach the functionality so that our database query has a post title to work with, and also so that every blog post does not overload the web server with a query ahead of time whose work may not be accessed anyway. The something that is clicked is an HTML a tag whose โlookโ is an Emoji.
We also wrote a proof of concept, before applying that proof of concept live. To us, a โproof of conceptโ is not much use if it is as involved as what it is trying to prove, and in todayโs scenario we did a proof of concept for two scenarios, that being โฆ
- a blog posting that was referred to by others โฆ and โฆ
- a blog posting that wasnโt โฆ doh! โฆ but if you donโt change something about the โlook of thingsโ youโll confuse the user as to whether the web application just took notice of their click (via the onclick event) โฆ so this is of mild importance, but we grant you that it is not as important as the first scenarioโs workings
We quite often adopt a proof of concept scenario which tests the workings of a child (often in an HTML iframe element), in this case, PHP server side, piece of code, by introducing a simplified and pared down parent, in this case HTML piece of code. At the end of successful testing you are left with a good, and close to totally suitable child piece of code, to slot into the functionality of the real and live parent code.
That proof of concept was definitely a good โunit testingโ thing to do, but nevertheless, donโt feel overconfident as you go live โฆ living with other real โgoings onโ on the live website are things to consider, and test โฆ it took us half an hour to iron out these types of issues.
The other good thing to have on your side is a Web Inspector like on Safari, similar to the Firefox Firebug web inspector we tend to go on and on and on and on and on and on about at this blog. Weโre giving you a Safari rest on that today, and we want to show you an โearly daysโ view โฆ
โฆ in the proof of concept help that the Safari Web Inspector gave us, delving in under the called (by HTML parent) PHPโs actions. This type of information makes server side programming, like you do with PHP, that much easier โฆ much easier than ideas where you write out web server files, with information, for your own benefit, or the other one we often like, during testing, is to write information out to top.document.title or perhaps to an alert box or to use console.log (on the debugging window, down the bottom).
Youโll never guess where we made this change to our WordPress TwentyTen themed blog? Give up โฆ yes, good olโ header.php changed in the bold Javascript new function way below โฆ
function is_mentioned_by() {
var zspare,xspare,xxspare,ximb,xpspana=docgetclass("entry-title", "h2");
for (ximb=0; ximb<xpspana.length; ximb++) {
xxspare=xpspana[ximb].innerHTML.replace('</a>','').split('>');
xspare=xxspare[eval(-1 + xxspare.length)];
zspare=xspare.toLowerCase().replace(String.fromCharCode(35), "").replace(".", "").replace(".", "").replace(".", "").replace("+", "").replace("+", "").replace("'", "").replace('%27','').replace(/\//g, "").replace(/,/g, "").replace("---","-").replace("---","-").replace(/--/g,"-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-");
if (document.body.innerHTML.indexOf('d' + zspare) == -1) xpspana[ximb].innerHTML+=' <div style="display:inline;" id=d' + zspare + '><a style="display:inline;text-decoration:none; border:2px solid yellow;" onclick=" document.getElementById(this.id.replace(String.fromCharCode(116),String.fromCharCode(105))).src=' + "'" + '//www.rjmprogramming.com.au/PHP/is_mentioned_by.php?title=' + encodeURIComponent(xspare) + "'" + '; " title="' + (xspare) + ' is mentioned by ..." id=t' + zspare + '>☞</a><iframe style=display:none; id=i' + zspare + ' src=></iframe></div>';
}
xpspana=docgetclass("entry-title", "h1");
for (ximb=0; ximb<xpspana.length; ximb++) {
xxspare=xpspana[ximb].innerHTML.replace('</a>','').split('>');
xspare=xxspare[eval(-1 + xxspare.length)];
zspare=xspare.toLowerCase().replace(String.fromCharCode(35), "").replace(".", "").replace(".", "").replace(".", "").replace("+", "").replace("+", "").replace("'", "").replace('%27','').replace(/\//g, "").replace(/,/g, "").replace("---","-").replace("---","-").replace(/--/g,"-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-").replace(" ","-");
if (document.body.innerHTML.indexOf('d' + zspare) == -1) xpspana[ximb].innerHTML+=' <div style="display:inline;" id=d' + zspare + '><a style="display:inline;text-decoration:none; border:2px solid yellow;" onclick=" document.getElementById(this.id.replace(String.fromCharCode(164),String.fromCharCode(151))).src=' + "'" + '//www.rjmprogramming.com.au/PHP/is_mentioned_by.php?title=' + encodeURIComponent(xspare) + "'" + '; " title="' + (xspare) + ' is mentioned by ..." id=t' + zspare + '>☞</a><iframe style=display:none; id=i' + zspare + ' src=></iframe></div>';
}
}
โฆ called by โฆ
<body onload=" checkonl(); setTimeout(initpostedoncc, 3000); widgetcon(); precc(); courseCookies(); cookie_fonts(); is_mentioned_by(); " <?php body_class(); ?>>
Team that with some new PHP source code you could call is_mentioned_byphp and you have todayโs new WordPress blog TwentyTen theme โIs Mentioned Byโ functionality.
The proof of concept parent HTML was is_mentioned_byhtml for your perusal.
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.