{"id":22727,"date":"2016-06-15T03:01:20","date_gmt":"2016-06-14T17:01:20","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=22727"},"modified":"2016-06-16T10:14:03","modified_gmt":"2016-06-16T00:14:03","slug":"landing-page-cut-to-the-chase-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/landing-page-cut-to-the-chase-primer-tutorial\/","title":{"rendered":"Landing Page Cut to the Chase Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/slideshow.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Landing Page Cut to the Chase Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/cut_to_the_chase.jpg\" title=\"Landing Page Cut to the Chase Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Landing Page Cut to the Chase Primer Tutorial<\/p><\/div>\n<p>A lot of people learning programming are trying to get information quickly, and &#8220;move on&#8221;, shall we say.  While this is all well and good, it might be a &#8220;fob job&#8221; to think that many of us will really learn something well enough for the challenging bits adopting this approach, but there&#8217;s no doubt there are pressures these days to learn more and more, and perhaps come back to things in detail at a later, quieter, date.  Anyway, &#8220;to cut to the chase&#8221; &#8230; chortle, chortle &#8230; this is what today&#8217;s blog post is about!<\/p>\n<p>Let me explain it this way.  Our tutorial blog postings here at RJM Programming always involve a bit of, but not too much, we hope &#8230;<\/p>\n<ol>\n<li>the background to an issue &#8230; that is always preceded by &#8230;<\/li>\n<li>an image or slideshow or web application or game etcetera that is &#8220;the cut to the chase&#8221; part of the blog posting clickable off an image up the top of it (for all but the earliest postings we ever did) &#8230; and for those who get it through a feed (that can summarize the blog posting with words only, perhaps) &#8230;<\/li>\n<li>if we can remember we also always have a link within the blurb of 1 that links to &#8220;the cut to the chase&#8221; that is 2<\/li>\n<\/ol>\n<p> &#8230; and so what you end up with, if you want to objectify it into a &#8220;tutorial-posting&#8221; <a target=_blank title='OOP information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Object-oriented_programming'><i>object<\/i><\/a> perhaps, is two data members, of relevance, that are URLs, that being &#8230;<\/p>\n<ol>\n<li>the URL to the WordPress blog posting tutorial &#8230; and &#8230;<\/li>\n<li>the URL to &#8220;the cut to the chase&#8221; intention of the WordPress blog posting tutorial<\/li>\n<\/ol>\n<p> &#8230; and what we&#8217;re proposing today, is that a lot of users can easily forgo the &#8220;blurb&#8221; and &#8220;cut to the chase&#8221;, perhaps going back to the blurb for a further read should they want to delve further after a &#8220;cut to the chase&#8221; session.<\/p>\n<p>We wanted a way to present this idea on our RJM Programming <a target=_blank title='RJM Programming landing page' href='http:\/\/www.rjmprogramming.com.au'>landing page<\/a>.  There must be a way to add another HTML <a target=_blank href='http:\/\/www.w3schools.com\/tags\/tag_select.asp' title='HTML select tag information from w3schools'>select<\/a> &#8220;dropdown&#8221; element to facilitate this?  Well, yes, that could be done, but we thought it would be better to dedicate another RJM Programming Landing Page &#8220;clone&#8221; webpage that has a &#8220;cut to the chase&#8221; HTML select &#8220;dropdown&#8221; element substituted for its &#8220;listed and clickable&#8221; existing HTML select &#8220;dropdown&#8221; element, and then set it up that either web page can get you to the other &#8220;clone&#8221; web page, and to the user all they &#8220;feel&#8221; is the toggling of the &#8220;dropdown&#8221; data content.<\/p>\n<p>So we just used the term &#8220;data content&#8221;, and that means you need to delve into where the &#8220;data&#8221; is from.  With a WordPress blog, the &#8220;data&#8221; is from a MySql database, and to do anything about any changes here will revolve around involving a server side language like PHP &#8230; no way around that.  So what we do is &#8230;<\/p>\n<ul>\n<li>take existant <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/tutorial_options.php-------GETME' title='RJM Programming tutorial information extractor called by curl and crontab usually'>tutorial_options.php<\/a> (you can read about, last, with <a target=_blank title='Landing Page Mobile Phone Crontab Curl Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/landing-page-mobile-phone-crontab-curl-tutorial\/'>Landing Page Mobile Phone<\/a> <a target=_blank title='Linux or unix crontab information from computerhope' href='http:\/\/www.computerhope.com\/unix\/ucrontab.htm'>Crontab<\/a> <a target=_blank title='Linux or unix curl information from computerhope' href='http:\/\/www.computerhope.com\/unix\/curl.htm'>Curl<\/a> Tutorial and changed for today&#8217;s work in <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/tutorial_options.php-------GETME' title='tutorial_options.php'>this way<\/a>) and tweak its <i>curl<\/i> usage as a new entry in our RJM Programming web server&#8217;s <i>crontab<\/i> (once a day for today&#8217;s task) background processing task list, but with a $_GET[&#8216;index&#8217;] = &#8216;slideshow&#8217; parameter &#8230; to create and update a &#8230;<\/li>\n<li><a target=_blank href='http:\/\/www.rjmprogramming.com.au\/slideshow.html' title='RJM Programming cut to the chase tutorials'>slideshow.html<\/a> with the latest tutorial &#8220;data content&#8221; gleaned via a change to the MySql queries used by tutorial_options.php &#8230; so that, in simplified terms &#8230; without the <i>?index=slideshow<\/i> parameterization &#8230; ie. the original way &#8230; the MySql query looks like &#8230;<br \/>\n<code><br \/>\nSELECT  ID, post_date, <b>post_title, guid,<\/b> DATE_FORMAT(post_date,'%Y%m%d') As pdate, IfNull(post_excerpt, '') As post_excerpt, 'zzz' as bpost_title FROM wps_post WHERE post_status='publish'<b><i><\/i><\/b> and (substr(IfNull(post_excerpt, ''),1,1) &lt; '0' or substr(IfNull(post_excerpt, ''),1,1) &gt; '9') ORDER BY bpost_title, post_date DESC<br \/>\n<\/code><br \/>\n&#8230; and becomes, with the inclusion of <i>?index=slideshow<\/i> parameterization &#8230; to become a <i>crontab<\/i> entry featuring the command<br \/>\n<code><br \/>\ncurl http:\/\/www.rjmprogramming.com.au\/PHP\/tutorial_options.php?index=slideshow<br \/>\n<\/code><br \/>\n &#8230; ie. the new way &#8230;<br \/>\n<code><br \/>\nSELECT  ID, post_date, <b>concat(post_title, ' (Slideshow or Web Application or Game or Image)'), substring(post_content, instr(post_content, 'http'), (instr(post_content, '\"&gt;&lt;img style=') - instr(post_content, 'http'))),<\/b> DATE_FORMAT(post_date,'%Y%m%d') As pdate, IfNull(post_excerpt, '') As post_excerpt, 'zzz' as bpost_title FROM wps_post WHERE post_status='publish'<b><i> and post_content like '%\"&gt;&lt;img style=\"%' and (instr(post_content, '\"&gt;&lt;img style=') - instr(post_content, 'http')) &lt; 100<\/i><\/b> and (substr(IfNull(post_excerpt, ''),1,1) &lt; '0' or substr(IfNull(post_excerpt, ''),1,1) &gt; '9') ORDER BY bpost_title, post_date DESC<br \/>\n<\/code><br \/>\n&#8230; where the PHP variables <b>$ptg<\/b> and  <b><i>$and<\/i><\/b> are populated according to <i>$_GET[&#8216;index&#8217;]<\/i> usage, or not\n<\/ul>\n<p> &#8230; so PHP is used by <i>curl<\/i> and <i>crontab<\/i> to read MySql &#8220;data content&#8221; and rewrite HTML called <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/slideshow.html' title='RJM Programming cut to the chase tutorials'>slideshow.html<\/a> (for &#8220;cut to the chase&#8221; tutorial information) and <a target=_blank title='RJM Programming landing page' href='http:\/\/www.rjmprogramming.com.au\/' title='RJM Programming landing page with tutorial links'>index.html<\/a> (for &#8220;the full blurb&#8221; contextualizing the &#8220;cut to the chase&#8221; with the &#8220;background context&#8221; as a tutorial).<\/p>\n<p>Hopefully, any of the links above suffice to get you to anything you want, should it be of interest in the first place, of course?!  Now that&#8217;s another story!<\/p>\n<p><b><i>Did you know?<\/i><\/b><\/p>\n<p>Our RJM Programming CentOS web server&#8217;s linux environment&#8217;s &#8230;<\/p>\n<p><code><br \/>\ncrontab -e<br \/>\n<\/code><\/p>\n<p> &#8230; edit of its crontab setting records uses the very simple text editor <a target=_blank title='Linux or unix pico information from computerhope' href='http:\/\/www.computerhope.com\/unix\/upico.htm'><i>pico<\/i><\/a> to perform changes.  Coming off any <a target=_blank title='Linux or unix vi information from computerhope' href='http:\/\/www.computerhope.com\/unix\/uvi.htm'><i>vi<\/i><\/a> you&#8217;ve been doing, you&#8217;ll find <i>pico<\/i> as a lot easier, and like driving a manual car you&#8217;ll wonder what to do with the &#8220;clutch&#8221; foot.  You can see a cut down bit of what <i>pico<\/i> looks like at the bottom of today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/cut_to_the_chase.jpg\">tutorial picture<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d22727' onclick='var dv=document.getElementById(\"d22727\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/curl\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d22727' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>A lot of people learning programming are trying to get information quickly, and &#8220;move on&#8221;, shall we say. While this is all well and good, it might be a &#8220;fob job&#8221; to think that many of us will really learn &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/landing-page-cut-to-the-chase-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,12,37],"tags":[151,274,284,299,576,680,707,827,932,1916,997,1866,1186,1319,1339,1345,1411,1418,1456],"class_list":["post-22727","post","type-post","status-publish","format-standard","hentry","category-database","category-elearning","category-tutorials","tag-blog","tag-crontab","tag-curl","tag-database-2","tag-html","tag-landing-page","tag-linux","tag-mysql","tag-php","tag-pico","tag-programming","tag-select","tag-sql","tag-tutorial","tag-unix","tag-url","tag-web-server","tag-webpage","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/22727"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=22727"}],"version-history":[{"count":11,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/22727\/revisions"}],"predecessor-version":[{"id":22779,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/22727\/revisions\/22779"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=22727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=22727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=22727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}