{"id":37662,"date":"2018-04-25T03:01:45","date_gmt":"2018-04-24T17:01:45","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=37662"},"modified":"2018-04-25T10:44:34","modified_gmt":"2018-04-25T00:44:34","slug":"wordpress-blog-posting-generic-misspelling-fix-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-posting-generic-misspelling-fix-tutorial\/","title":{"rendered":"WordPress Blog Posting Generic Misspelling Fix Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/wordpress_generic_misspelling_fix.pdf\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"WordPress Blog Posting Generic Misspelling Fix Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/old_new_4.jpg\" title=\"WordPress Blog Posting Generic Misspelling Fix Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">WordPress Blog Posting Generic Misspelling Fix Tutorial<\/p><\/div>\n<p>Let&#8217;s start out as &#8220;devil&#8217;s advocate&#8221; for today&#8217;s WordPress Generic Misspelling Fix project, that has a large amount of synergy with the &#8220;content&#8221; emphasis of <a title='WordPress Blog Posting Thread Content Summary Tutorial' href='#wpbptcst'>WordPress Blog Posting Thread Content Summary Tutorial<\/a>.<\/p>\n<p>What are some things to beware of when applying any generic replacement logic for a [fromText] to [toText] scenario &#8230;<\/p>\n<ul>\n<li>if you are not willing to directly check for all mentions of [fromText] that will be replaced consider &#8230;\n<ol>\n<li>will be case sensitive, and if the misspelling starts a sentence any fully lowercase entry will not find these<\/li>\n<li>any genuine misspelling you are fixing some absolute URL may have misspelled the same way, and you then create a broken link<\/li>\n<li>you meant to misspell<\/li>\n<\/ol>\n<\/li>\n<li>is it worth the bother, or with only a few finds, wouldn&#8217;t it be better to visit every case &#8230; the motive for today&#8217;s interest to us did not fit into this category &#8230; we had about 20 misspellings of &#8220;featurng&#8221; (see, we deliberately misspelt, but luckily the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/wordpress_generic_misspelling_fix.pdf\" title=\"Click picture\">PDF slideshow<\/a> was from earlier on in the day versus on a rerun we could add a preceeding space to this one, probably &#8230; get what we mean though?!)  &#8230; curious, <a style=text-decoration:underline;cursor:pointer; title='Pros and Cons' onclick=\"location.href='#howso';\">huh<\/a>?<\/li>\n<li>can it appear within the proper syntax of the &#8220;outerHTML&#8221; parts of the underlying HTML, and by changing it, you &#8220;break&#8221; some HTML that was previous working<\/li>\n<\/ul>\n<p>So if you are still here interested, what approach are we using here?  We are going to construct some MySql SQL via PHP to &#8230;<\/p>\n<ul>\n<li>access the WordPress MySql database via a connection &#8230;<br \/>\n<code><br \/>\n $hostname = 'database_hostname';<\/p>\n<p> \/*** mysql username ***\/<br \/>\n $username = 'mysql_username';<\/p>\n<p> \/*** mysql ***\/<br \/>\n $password = 'mysql_username_password';<\/p>\n<p> $dbname = 'database_name';<br \/>\n $link = mysql_connect($hostname, $username, $password);<br \/>\n if (!$link) {<br \/>\n    die('Could not connect: ' . mysql_error());<br \/>\n }<\/p>\n<p> mysql_select_db($dbname);<br \/>\n<\/code>\n<\/li>\n<li>query the database for a <i>list of blog postings and their content<\/i> &#8230;<br \/>\n<code><br \/>\n<i> $res = mysql_query(\"SELECT t1.ID, t1.post_title, t1.post_content<br \/>\nFROM \" . $dbname . \".wps_posts t1<br \/>\nWHERE t1.post_content LIKE '%\" . $from . \"%' and t1.post_status in ('publish','future')\");<br \/>\n if ($res == 0) {<br \/>\n  echo(\"&lt;b&gt;Error \" . mysql_errno() . \": \" . mysql_error() . \"&lt;\/b&gt;\");<br \/>\n } else if (mysql_num_rows($res) == 0) {<br \/>\n  echo(\"&lt;b&gt;Query executed successfully&lt;\/b&gt;\");<br \/>\n } else {<br \/>\n while (($r_array = mysql_fetch_row($res))) {<br \/>\n    mysql_select_db($dbname);<br \/>\n  if (!isset($_GET['commit'])) {<br \/>\n    $reptxt .= \"UPDATE \" . $dbname . \".wps_posts SET post_content=replace(post_content,'\" . $from . \"','\" . $to  . \"') WHERE ID=\" . $r_array[0] . \" and post_title='\" . $r_array[1] . \"' and '\" . $sdate . \"'='\" . $sdate . \"'\\n\";<br \/>\n    if ($tablestr == \"\") {<br \/>\n      $tablestr=\"&lt;h1&gt;Commit to the WordPress Blog Checkbox Changes found going from '\" . $from . \"' to '\" . $to . \"'&lt;\/h1&gt;&lt;br&gt;&lt;table border=20&gt;&lt;tbody id=mytbody&gt;&lt;tr&gt;&lt;th style=width:10%;&gt;Title&lt;\/th&gt;&lt;th style=width:10%;&gt;Okay for this Change?&lt;\/th&gt;&lt;th style=width:300px;&gt;Look 4.1.1&lt;\/th&gt;&lt;\/tr&gt;&lt;\/tbody&gt;&lt;\/table&gt;&lt;br&gt;&lt;form method=GET action=.\/old_new_wp_misspellings.php&gt;&lt;input type=hidden name=astringthatislikeanapplicationpassword value=y&gt;&lt;\/input&gt;&lt;input type=hidden name=from value='\" . $from . \"'&gt;&lt;\/input&gt;&lt;input type=hidden name=to value='\" . $to . \"'&gt;&lt;\/input&gt;&lt;input type=hidden name=commit id=commit value=',\"; <br \/>\n    } <br \/>\n    $tablestr.=$r_array[0] . $cdel;<br \/>\n    $tablestr=str_replace(\"&lt;\/tr&gt;&lt;\/tbody&gt;&lt;\/table&gt;&lt;br&gt;&lt;form method=\", \"&lt;\/tr&gt;&lt;tr&gt;&lt;td&gt;\" . $r_array[1] . \"&lt;\/td&gt;&lt;td&gt;&lt;input onchange=\\\"document.getElementById('commit').value=document.getElementById('commit').value.replace(',\" . $r_array[0] . \",',',');\\\" type=checkbox checked&gt;&lt;\/input&gt;&lt;\/td&gt;&lt;td style=width:300px;&gt;&lt;!--div style='overflow:hidden; -ms-transform: scale(0.2, 0.2); -webkit-transform: scale(0.2, 0.2); transform: scale(0.2, 0.2);'--&gt;&lt;details&gt;&lt;summary&gt;Reveal WordPress 4.1.1 Look '\" . $from . \"' to '\" . $to  . \"' proposed changes ...&lt;\/summary&gt;\" . str_replace($from,$to,$r_array[2]) . \"&lt;\/details&gt;&lt;!--\/div--&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;\/tbody&gt;&lt;\/table&gt;&lt;br&gt;&lt;form method=\", $tablestr);<\/p>\n<p>  <\/i>} else if (strpos((\",\" . urldecode($_GET['commit']) . \",\"),(\",\" . $r_array[0] . \",\")) !== false) {<br \/>\n    mysql_query(\"UPDATE \" . $dbname . \".wps_posts SET post_content=<a target=_blank title='MySql SQL replace function information' href='https:\/\/dev.mysql.com\/doc\/en\/replace.html'>replace<\/a>(post_content,'\" . $from . \"','\" . $to  . \"') WHERE ID=\" . $r_array[0] . \" and post_title='\" . $r_array[1] . \"'\");<br \/>\n  <i>}<\/i><br \/>\n    mysql_select_db($dbname);<br \/>\n }<br \/>\n <i>if ($reptxt != \"\" &#038;&#038; !isset($_GET['commit'])) {<br \/>\n    file_put_contents(\"old_new_wp_misspellings.txt\", $reptxt);<br \/>\n    $tablestr.=\"'&gt;&lt;\/input&gt;&lt;input type=submit value='Commit to the SQL Relevant to Checkboxes Below' style=background-color:yellow;&gt;&lt;\/input&gt;&lt;\/form&gt;&lt;br&gt;&lt;textarea cols=80 rows=100&gt;\" . $reptxt . \"&lt;\/textarea&gt;\";<br \/>\n    <b>echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body&gt;\" . $tablestr . \"&lt;\/body&gt;&lt;\/html&gt;\";<\/b><br \/>\n <\/i>} else if (isset($_GET['commit'])) {<br \/>\n    if (file_exists(\"old_new_wp_misspellings.txt\")) unlink(\"old_new_wp_misspellings.txt\");<br \/>\n    echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body&gt;&lt;p&gt;Commit to MySql database done.&lt;\/p&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n <i>}<\/i><br \/>\n}<br \/>\n mysql_close($link);<br \/>\n<\/code>\n<\/li>\n<li>includes the <b>step to<\/b> present that HTML data gathered to the user &#8230; the checkboxes of which and view of the blog content of which helps them decide whether to click the yellow button to &#8230;<\/li>\n<li>perform (<i>commit<\/i>) the database changes to the WordPress MySql database <b>informing the user<\/b> &#8230;<br \/>\n<code><br \/>\n<i> $res = mysql_query(\"SELECT t1.ID, t1.post_title, t1.post_content<br \/>\nFROM \" . $dbname . \".wps_posts t1<br \/>\nWHERE t1.post_content LIKE '%\" . $from . \"%' and t1.post_status in ('publish','future')\");<br \/>\n if ($res == 0) {<br \/>\n  echo(\"&lt;b&gt;Error \" . mysql_errno() . \": \" . mysql_error() . \"&lt;\/b&gt;\");<br \/>\n } else if (mysql_num_rows($res) == 0) {<br \/>\n  echo(\"&lt;b&gt;Query executed successfully&lt;\/b&gt;\");<br \/>\n } else {<br \/>\n while (($r_array = mysql_fetch_row($res))) {<br \/>\n    mysql_select_db($dbname);<\/i><br \/>\n  if (!isset($_GET['commit'])) {<br \/>\n    $reptxt .= \"UPDATE \" . $dbname . \".wps_posts SET post_content=replace(post_content,'\" . $from . \"','\" . $to  . \"') WHERE ID=\" . $r_array[0] . \" and post_title='\" . $r_array[1] . \"' and '\" . $sdate . \"'='\" . $sdate . \"'\\n\";<br \/>\n    if ($tablestr == \"\") {<br \/>\n      $tablestr=\"&lt;h1&gt;Commit to the WordPress Blog Checkbox Changes found going from '\" . $from . \"' to '\" . $to . \"'&lt;\/h1&gt;&lt;br&gt;&lt;table border=20&gt;&lt;tbody id=mytbody&gt;&lt;tr&gt;&lt;th style=width:10%;&gt;Title&lt;\/th&gt;&lt;th style=width:10%;&gt;Okay for this Change?&lt;\/th&gt;&lt;th style=width:300px;&gt;Look 4.1.1&lt;\/th&gt;&lt;\/tr&gt;&lt;\/tbody&gt;&lt;\/table&gt;&lt;br&gt;&lt;form method=GET action=.\/old_new_wp_misspellings.php&gt;&lt;input type=hidden name=astringthatislikeanapplicationpassword value=y&gt;&lt;\/input&gt;&lt;input type=hidden name=from value='\" . $from . \"'&gt;&lt;\/input&gt;&lt;input type=hidden name=to value='\" . $to . \"'&gt;&lt;\/input&gt;&lt;input type=hidden name=commit id=commit value=',\"; \/\/ . $r_array[0] . \",\"; \/\/ . \"'&gt;&lt;\/input&gt;&lt;input type=submit value=Commit&gt;&lt;\/input&gt;&lt;\/form&gt;\";<br \/>\n    }<br \/>\n    $tablestr.=$r_array[0] . $cdel;<br \/>\n    $tablestr=str_replace(\"&lt;\/tr&gt;&lt;\/tbody&gt;&lt;\/table&gt;&lt;br&gt;&lt;form method=\", \"&lt;\/tr&gt;&lt;tr&gt;&lt;td&gt;\" . $r_array[1] . \"&lt;\/td&gt;&lt;td&gt;&lt;input onchange=\\\"document.getElementById('commit').value=document.getElementById('commit').value.replace(',\" . $r_array[0] . \",',',');\\\" type=checkbox checked&gt;&lt;\/input&gt;&lt;\/td&gt;&lt;td style=width:300px;&gt;&lt;!--div style='overflow:hidden; -ms-transform: scale(0.2, 0.2); -webkit-transform: scale(0.2, 0.2); transform: scale(0.2, 0.2);'--&gt;&lt;details&gt;&lt;summary&gt;Reveal WordPress 4.1.1 Look '\" . $from . \"' to '\" . $to  . \"' proposed changes ...&lt;\/summary&gt;\" . str_replace($from,$to,$r_array[2]) . \"&lt;\/details&gt;&lt;!--\/div--&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;\/tbody&gt;&lt;\/table&gt;&lt;br&gt;&lt;form method=\", $tablestr);<\/p>\n<p>  } else <i>if (strpos((\",\" . urldecode($_GET['commit']) . \",\"),(\",\" . $r_array[0] . \",\")) !== false) {<br \/>\n    mysql_query(\"UPDATE \" . $dbname . \".wps_posts SET post_content=replace(post_content,'\" . $from . \"','\" . $to  . \"') WHERE ID=\" . $r_array[0] . \" and post_title='\" . $r_array[1] . \"'\");<br \/>\n  }<\/i><br \/>\n    mysql_select_db($dbname);<br \/>\n }<br \/>\n if ($reptxt != \"\" &#038;&#038; !isset($_GET['commit'])) {<br \/>\n    file_put_contents(\"old_new_wp_misspellings.txt\", $reptxt);<br \/>\n    $tablestr.=\"'&gt;&lt;\/input&gt;&lt;input type=submit value='Commit to the SQL Relevant to Checkboxes Below' style=background-color:yellow;&gt;&lt;\/input&gt;&lt;\/form&gt;&lt;br&gt;&lt;textarea cols=80 rows=100&gt;\" . $reptxt . \"&lt;\/textarea&gt;\";<br \/>\n    echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body&gt;\" . $tablestr . \"&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n } else <i>if (isset($_GET['commit'])) {<br \/>\n    if (file_exists(\"old_new_wp_misspellings.txt\")) unlink(\"old_new_wp_misspellings.txt\");<br \/>\n    <b>echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body&gt;&lt;p&gt;Commit to MySql database done.&lt;\/p&gt;&lt;\/body&gt;&lt;\/html&gt;\";<\/b><br \/>\n }<\/i><br \/>\n}<br \/>\n mysql_close($link);<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<p> &#8230; except that, here at rjmprogramming.com.au we join two databases, the complication of which we&#8217;ll spare you, though you can see a bit of it by perusing today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/wordpress_generic_misspelling_fix.pdf\" title=\"Click picture\">PDF slideshow<\/a>.<\/p>\n<p id='howso'>Now let&#8217;s talk about categories of misspellings &#8230;<\/p>\n<ul>\n<li>oneoffs &#8230; not suitable for this hammer blow to a peanut problem, today<\/li>\n<li>systematic &#8230; misspelling via user errors or <a style=text-decoration:underline;cursor:pointer; title='Pros and Cons' onclick=\"location.href='#howsotwo';\">some other reason<\/a> &#8230; more likely to be candidates for today&#8217;s generic replacement approach<\/li>\n<\/ul>\n<p id='howsotwo'>Here at this blog we often have a &#8220;thread of blog postings&#8221; approach to our presentation.  In other words, we build a story out of its parts and create a thread of a story as we go along, often starting a thread or subthread with a &#8220;Primer&#8221; tutorial.  You may rest assured the Search Engines do not like the repetition of this content, please be aware.  We need it, with our style of blogging to come upon some subject matter in parts.  However, in this scenario, a misspelling in a &#8220;Primer&#8221; tutorial can cause havoc, and think a &#8220;Primer&#8221; tutorial must have had &#8220;featurng&#8221;, and it has propogated through about twenty other blog postings until we finally &#8220;bit the bullet&#8221; and wrote this PHP\/MySql tool for WordPress Generic Misspelling Fixes today.<\/p>\n<p>We can&#8217;t show you our exact PHP code today, but we can show you a one database one post table scenario PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/old_new_wp_misspellings.php_GETME\" title=\"old_new_wp_misspellings.php\">old_new_wp_misspellings.php<\/a> for your perusal, and perhaps download.<\/p>\n<p>You can also see this play out at WordPress 4.1.1&#8217;s <a target=_blank  href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-posting-generic-misspelling-fix-tutorial\/'>WordPress Blog Posting Generic Misspelling Fix Tutorial<\/a>.<\/p>\n<hr \/>\n<p id='wpbptcst'>Previous relevant <a target=_blank title='WordPress Blog Posting Thread Content Summary Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-posting-thread-content-summary-tutorial\/'>WordPress Blog Posting Thread Content Summary Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/?detailssummary=y\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"WordPress Blog Posting Thread Content Summary Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/detailssummary_more.jpg\" title=\"WordPress Blog Posting Thread Content Summary Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">WordPress Blog Posting Thread Content Summary Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='WordPress Blog Posting Content Summary Primer Tutorial' href='#wpbpcspt'>WordPress Blog Posting Content Summary Primer Tutorial<\/a> used the <a target=_blank title='blank title='Reveal tutorials here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/reveal'>reveal<\/a> HTML5 &#8220;stars&#8221; &#8230;<\/p>\n<ul>\n<li><a target=_blank title='HTML details tag information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_details.asp'>details<\/a> tag &#8230; and its nested &#8230;<\/li>\n<li><a target=_blank title='HTML summary tag information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_details.asp'>summary<\/a><\/li>\n<\/ul>\n<p> &#8230; to allow for &#8220;scrunched up&#8221; presentations of multiple blog posts so really only had huge impactive use with the <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/?detailssummary=y\">WordPress Blog document root index.php<\/a> call of it, where several of the latest blog postings are shown to the user.  However, in the way we go about it here, we construct these &#8230;<\/p>\n<blockquote>\n<p>\nBlog Posting Threads\n<\/p>\n<\/blockquote>\n<p> &#8230; that call on and contain blog postings related to it (from the recent past, usually, but doesn&#8217;t have to be).  These &#8220;lead in&#8221; blog postings are presented in full separated from the new blog posting content by our home (CSS) styled &#8230;<\/p>\n<p><code><br \/>\n&lt;hr \/&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; horizontal rule elements.  Today, we make use of that &#8220;habit&#8221; we have to introduce new &#8230;<\/p>\n<ul>\n<li><a target=_blank title='HTML details tag information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_details.asp'>details<\/a> tag &#8230; and its nested &#8230;<\/li>\n<li><a target=_blank title='HTML summary tag information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_details.asp'>summary<\/a><\/li>\n<\/ul>\n<p> &#8230; &#8220;pairings&#8221; to scrunch these up, when the user has decided to generally &#8220;scrunch up&#8221; (though we are going to think about doing it all the time after seeing what it&#8217;s like, for a while).<\/p>\n<p>Not much new here, you might say, but there is something new about what we do navigation wise in these scenarios.  We have another &#8220;habit&#8221; with our blog posting creations for these &#8220;blog posting threads&#8221;.  Invariably, we&#8217;re pretty sure, we provide within the new blog posting, an HTML <a target=_blank title='HTML strike tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_a.asp'>a<\/a> hashtagging link (eg. #wpbpcspt to get to blog posting &#8220;thread&#8221; member below, often &#8220;yesterday&#8217;s&#8221;).  We want it to be that if the user uses one of these <a target=_blank title='HTML strike tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_a.asp'>a<\/a> hashtagging links that causes any (new) &#8220;closed&#8221; details\/summary &#8220;guardians against verbosity&#8221; to open up.  How is that done?  We maintain a global &#8230;<\/p>\n<ol>\n<li><code><br \/>\nvar nohlist=\";\";<br \/>\n<\/code><br \/>\n &#8230; which gets to be accessed and used in a new Javascript function &#8230;\n<\/li>\n<li><code><br \/>\nfunction checknohlist() {<br \/>\n  if (('' + location.hash).indexOf('#') != -1) {<br \/>\n    if (nohlist.indexOf(';#' + location.hash.split('#')[1] + ';') != -1) {<br \/>\n      document.getElementById('ds_' + location.hash.split('#')[1]).setAttribute('open', true);<br \/>\n      nohlist=nohlist.replace(';#' + location.hash.split('#')[1] + ';',';');<br \/>\n    }<br \/>\n  }<br \/>\n  if (nohlist.replace(';','') != '') setTimeout(checknohlist, 3000);<br \/>\n}<br \/>\n<\/code><br \/>\n &#8230; using the hashtagging &#8220;flagger&#8221; <a target=_blank title='Javascript window.location.hash information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/prop_loc_hash.asp'>location.hash<\/a> &#8230; the bits of a URL after and including the # character, as relevant &#8230; that is hashtagging, to us &#8230; and this new function is now used in amended function from yesterday <b><i>as per<\/i><\/b> &#8230;\n<\/li>\n<li><code><br \/>\nfunction details_summary(mou) {<br \/>\n  var other_bits=[], hrother_bits=[]<b>, ihrb=0, fb='', fbids=[], thatidis='', hrp=''<\/b>;<br \/>\n  var dbitssare=document.body.innerHTML.split('&lt;div class=\"entry-content\"&gt;');<br \/>\n  var dbitseare=document.body.innerHTML.split('&lt;div class=\"entry-utility\"&gt;');<br \/>\n  if (document.URL.indexOf('detailssummary=') != -1 || mou != 0) {<br \/>\n    if (dbitssare.length &gt; 1 &#038;&#038; dbitssare.length == dbitseare.length) {<br \/>\n      var dbih=document.body.innerHTML, idbih=1;<br \/>\n      for (var idb=0; idb&lt;dbitssare.length; idb++) {<br \/>\n        if (('' + dbitssare[eval(1 + idb)]).indexOf('&lt;p&gt;') != -1) {<br \/>\n        if (('' + dbitssare[eval(1 + idb)]).split('&lt;p&gt;')[idbih].split('&lt;\/p&gt;')[0] == '') {<br \/>\n          if (('' + dbitssare[eval(1 + idb)]).split('&lt;p&gt;').length &gt;= eval(1 + eval(idbih))) {<br \/>\n            idbih++;<br \/>\n          }<br \/>\n        }<br \/>\n        dbih=dbih.replace('&lt;div class=\"entry-content\"&gt;','&lt;details class=\"gendetails\" title=\"Click me to toggle open\/close ... ' + ('' + dbitssare[eval(1 + idb)]).split('&lt;p&gt;')[idbih].split('&lt;\/p&gt;')[0].replace(\/\\'\/g,'`').replace(\/\\\"\/g,'`').replace(\/\\&gt;\/g,'&gt;').replace(\/\\&lt;\/g,'&lt;') + '\"&gt;&lt;summary&gt;&lt;\/summary&gt;&lt;div title=\"entry-content\" class=\"entry-content\"&gt;');<br \/>\n        } else {<br \/>\n        dbih=dbih.replace('&lt;div class=\"entry-content\"&gt;','&lt;details class=\"gendetails\" title=\"Click me to toggle open\/close\"&gt;&lt;summary&gt;&lt;\/summary&gt;&lt;div title=\"entry-content\" class=\"entry-content\"&gt;');<br \/>\n        }<br \/>\n        <b>if (document.URL.indexOf('andmorehr=') != -1 || 1 == 1) {<br \/>\n         other_bits=dbih.split('&lt;div title=\"entry-content\" class=\"entry-content\"&gt;');<br \/>\n         hrother_bits=other_bits[eval(-1 + other_bits.length)].split('&lt;div class=\"entry-utility\"&gt;')[0].split('&lt;hr ');<br \/>\n         hrp='&lt;hr ';<br \/>\n         for (ihrb=1; ihrb&lt;hrother_bits.length; ihrb++) {<br \/>\n           if (hrother_bits[ihrb].indexOf('&lt;\/p&gt;') != -1 &#038;&#038; hrother_bits[ihrb].indexOf('If this was interesting you may be interested') == -1) {<br \/>\n                thatidis='';<br \/>\n                fb=hrp + hrother_bits[ihrb].split('&gt;')[0] + '&gt;';<br \/>\n                fbids=(hrp + hrother_bits[ihrb]).split(fb)[1].split('&lt;\/p&gt;')[0].split('&lt;p id=\"');<br \/>\n                if (fbids.length &lt;= 1) {<br \/>\n                  fbids=(hrp + hrother_bits[ihrb]).split(fb)[1].split('&lt;\/p&gt;')[0].split(\"&lt;p id='\");<br \/>\n                  if (fbids.length &gt; 1) {<br \/>\n                    thatidis=fbids[1].split(\"'\")[0];<br \/>\n                  }<br \/>\n                } else {<br \/>\n                  thatidis=fbids[1].split('\"')[0];<br \/>\n                }<br \/>\n                if (nohlist.replace(';','') == '' &#038;&#038; thatidis != '') {<br \/>\n                  <i>setTimeout(checknohlist, 3000);<\/i><br \/>\n                }<br \/>\n                if (thatidis != '') {<br \/>\n                  nohlist+='#' + thatidis + ';';<br \/>\n                  dbih=dbih.replace((hrp + hrother_bits[ihrb]), (fb + '&lt;details id=\"ds_' + thatidis + '\" class=\"innerdetails\" title=\"Click me to toggle open\/close\"&gt;&lt;summary&gt;' + (hrp + hrother_bits[ihrb]).split(fb)[1].split('&lt;\/p&gt;')[0] + '&lt;\/p&gt;&lt;\/summary&gt;' + (hrp + hrother_bits[ihrb]).split((hrp + hrother_bits[ihrb]).split('&lt;\/p&gt;')[0] + '&lt;\/p&gt;')[1] + '&lt;\/details&gt;'));<br \/>\n                } else {<br \/>\n                  dbih=dbih.replace((hrp + hrother_bits[ihrb]), (fb + '&lt;details class=\"innerdetails\" title=\"Click me to toggle open\/close\"&gt;&lt;summary&gt;' + (hrp + hrother_bits[ihrb]).split(fb)[1].split('&lt;\/p&gt;')[0] + '&lt;\/p&gt;&lt;\/summary&gt;' + (hrp + hrother_bits[ihrb]).split((hrp + hrother_bits[ihrb]).split('&lt;\/p&gt;')[0] + '&lt;\/p&gt;')[1] + '&lt;\/details&gt;'));<br \/>\n                }<br \/>\n           }<br \/>\n           hrp='&lt;hr ';<br \/>\n         }<br \/>\n        }<\/b><br \/>\n        dbih=dbih.replace('&lt;div class=\"entry-utility\"&gt;','&lt;\/details&gt;&lt;div title=\"entry-utility\" class=\"entry-utility\"&gt;');<br \/>\n      }<br \/>\n      document.body.innerHTML=dbih;<br \/>\n    }<br \/>\n    if (document.URL.indexOf('detailssummary=') != -1 &#038;&#038; mou == 0) {<br \/>\n    document.getElementById(\"eds\").innerHTML = \"&amp;#10133;\";<br \/>\n    document.getElementById(\"eds\").title = \"Open up blog posting contents now\";<br \/>\n    document.getElementById(\"eds\").style.visibility='visible';<br \/>\n    }<br \/>\n  } else if (mou == 0 &#038;&#038; dbitssare.length &gt; 1 &#038;&#038; dbitssare.length == dbitseare.length) {<br \/>\n    document.getElementById(\"eds\").style.visibility='visible';<br \/>\n  }<br \/>\n}<br \/>\n<\/code>\n<\/li>\n<\/ol>\n<p>So if you try today&#8217;s <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/?detailssummary=y\">live run<\/a> and &#8220;motor down&#8221; to one of the &#8220;blog posting threads&#8221; we have &#8230; and a lot are &#8230; you&#8217;ll see those new details\/summary pairings &#8220;guarding against verbosity&#8221; unless you use some of those hashtagging links into these &#8220;lead in&#8221; blog posting thread submembers, or if you click the details element yourself.<\/p>\n<hr \/>\n<p id='wpbpcspt'>Previous relevant <a target=_blank title='WordPress Blog Posting Content Summary Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-posting-content-summary-primer-tutorial\/'>WordPress Blog Posting Content Summary Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/?detailssummary=y\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"WordPress Blog Posting Content Summary Primer Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/detailssummary.jpg\" title=\"WordPress Blog Posting Content Summary Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">WordPress Blog Posting Content Summary Primer Tutorial<\/p><\/div>\n<p>We really like <a target=_blank title='WordPress.org ... your hosting' href='http:\/\/www.wordpress.org'>WordPress<\/a>.org for the basis of this blog&#8217;s design (and recognize <a target=_blank title='WordPress.org ... your hosting' href='http:\/\/www.wordpress.com'>WordPress.com<\/a> as a great idea for those not wanting to host their own Apache\/PHP\/MySql domain).  And am sure you would not be surprised that I am not alone.  Take a read of the excellent <a target=_blank title='WordPress information' href='https:\/\/websitebuilder.org\/resources\/amazing-facts-you-probably-dont-know-about-wordpress\/'>WordPress information<\/a> by <a target=_blank title='Websitebuilder.org ... thanks to Josh Wardini' href='http:\/\/www.websitebuilder.org'>Websitebuilder.org<\/a> and, reading closely, you&#8217;ll see how popular this blogging platform is, and mention of a number of famous people using it.<\/p>\n<p>I&#8217;ve never had much trouble with WordPress, so, not all the time, but occasionally, I tweak it.  For this, we suggest, as WordPress would, to use their <a target=_blank title='WordPress Codex' href='https:\/\/codex.wordpress.org'>Codex<\/a> PHP (with MySql) coding advice, and on a personal level, though, you&#8217;ll see, reading this blog, that we also like the direct approach of, mainly, changing the header.php PHP code that sits in, for our case of a theme called TwentyTen (&#8220;twentyten&#8221; in lowercase) &#8230;<\/p>\n<p><code><br \/>\n[documentRootOfWordPressWebsite]\/wp-content\/themes\/twentyten\/<br \/>\n<\/code><\/p>\n<p>Today&#8217;s tweak of header.php relates to a matter dear to our hearts.  The desire to cater for mobile users with small screens, yet not be dumbing blog posting content down just for the sake of it.  Today we channel just about our favourite <a target=_blank title='blank title='Reveal tutorials here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/reveal'>reveal<\/a> based idea you can read more about at <a target=_blank title='HTML5 Details Summary Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-details-summary-primer-tutorial\/'>HTML5 Details Summary Primer Tutorial<\/a> to harness the goodies that came with <a target=_blank title='HTML5 information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/HTML5'>HTML5<\/a> in the form of the &#8230;<\/p>\n<ul>\n<li><a target=_blank title='HTML details tag information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_details.asp'>details<\/a> tag &#8230; and its nested &#8230;<\/li>\n<li><a target=_blank title='HTML summary tag information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_details.asp'>summary<\/a><\/li>\n<\/ul>\n<p>Implementing this in header.php went like this &#8230;<\/p>\n<ol>\n<li>added <b>into<\/b> &#8230;<br \/>\n<code><br \/>\n&lt;body onload=\" changeasfordownload();  if (cafd == cafd) { cafd=0; } else { cafd=true; }  checkonl(); setTimeout(initpostedoncc, 3000); widgetcon(); precc(); courseCookies();  cookie_fonts(); is_mentioned_by(); calendar_pass(); prejustshow(); <b>details_summary(0);<\/b>\"&gt;<br \/>\n<\/code>\n<\/li>\n<li>added a new <b>emoji button<\/b> up near the top &#8230;<br \/>\n<code><br \/>\n    document.getElementById('site-title').innerHTML+='&lt;a id=\"avs\" style=\"text-decoration:none;\" 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)\"&gt;&amp;#127910;&lt;\/a&gt;&nbsp;&lt;a style=\"cursor:pointer;text-decoration:none;\" onclick=\"popselid();\" title=\"Filter Content via Div ID\"&gt;&amp;#10135;&lt;\/a&gt;<b>&nbsp;&lt;a style=\"cursor:pointer;text-decoration:none;visibility:hidden;\" title=\"Blog post contents reduced to summary\" id=\"eds\" onclick=\"pre_details_summary();\"&gt;&amp;#10134;&lt;\/a&gt;<\/b>' + printscreen(0);<br \/>\n<\/code>\n<\/li>\n<li>then added these <b>two new Javascript functions<\/b> to suit those events defined above &#8230;<br \/>\n<code><br \/>\n<b><br \/>\nfunction pre_details_summary() {<br \/>\n  var idos=0,dos=[];<br \/>\n  if (('' + document.getElementById(\"eds\").title) == 'Blog post contents reduced to summary') {<br \/>\n  if (document.body.innerHTML.indexOf('&lt;summary&gt;&lt;\/summary&gt;') == -1) {<br \/>\n    details_summary(1);<br \/>\n  } else {<br \/>\n    dos=document.getElementsByTagName('details');<br \/>\n    for (idos=0; idos&lt;dos.length; idos++) {<br \/>\n     if (dos[idos].className == \"gendetails\") {<br \/>\n      dos[idos].removeAttribute('open');<br \/>\n     }<br \/>\n    }<br \/>\n  }<br \/>\n  document.getElementById(\"eds\").innerHTML = \"&amp;#10133;\";<br \/>\n  document.getElementById(\"eds\").title = \"Open up blog posting contents now\";<br \/>\n  } else {<br \/>\n    dos=document.getElementsByTagName('details');<br \/>\n    for (idos=0; idos&lt;dos.length; idos++) {<br \/>\n     if (dos[idos].className == \"gendetails\") {<br \/>\n      dos[idos].setAttribute('open', true);<br \/>\n     }<br \/>\n    }<br \/>\n  document.getElementById(\"eds\").innerHTML = \"&amp;#10134;\";<br \/>\n  document.getElementById(\"eds\").title = \"Blog post contents reduced to summary\";<br \/>\n  }<br \/>\n}<\/p>\n<p>function details_summary(mou) {<br \/>\n  var dbitssare=document.body.innerHTML.split('&lt;div class=\"entry-content\"&gt;');<br \/>\n  var dbitseare=document.body.innerHTML.split('&lt;div class=\"entry-utility\"&gt;');<br \/>\n  if (document.URL.indexOf('detailssummary=') != -1 || mou != 0) {<br \/>\n    if (dbitssare.length &gt; 1 &#038;&#038; dbitssare.length == dbitseare.length) {<br \/>\n      var dbih=document.body.innerHTML, idbih=1;<br \/>\n      for (var idb=0; idb&lt;dbitssare.length; idb++) {<br \/>\n        if (('' + dbitssare[eval(1 + idb)]).indexOf('&lt;p&gt;') != -1) {<br \/>\n        if (('' + dbitssare[eval(1 + idb)]).split('&lt;p&gt;')[idbih].split('&lt;\/p&gt;')[0] == '') {<br \/>\n          if (('' + dbitssare[eval(1 + idb)]).split('&lt;p&gt;').length &gt;= eval(1 + eval(idbih))) {<br \/>\n            idbih++;<br \/>\n          }<br \/>\n        }<br \/>\n        dbih=dbih.replace('&lt;div class=\"entry-content\"&gt;','&lt;details class=\"gendetails\" title=\"Click me to toggle open\/close ... ' + ('' + dbitssare[eval(1 + idb)]).split('&lt;p&gt;')[idbih].split('&lt;\/p&gt;')[0].replace(\/\\'\/g,'`').replace(\/\\\"\/g,'`').replace(\/\\&gt;\/g,'&gt;').replace(\/\\&lt;\/g,'&lt;') + '\"&gt;&lt;summary&gt;&lt;\/summary&gt;&lt;div title=\"entry-content\" class=\"entry-content\"&gt;');<br \/>\n        } else {<br \/>\n        dbih=dbih.replace('&lt;div class=\"entry-content\"&gt;','&lt;details class=\"gendetails\" title=\"Click me to toggle open\/close\"&gt;&lt;summary&gt;&lt;\/summary&gt;&lt;div title=\"entry-content\" class=\"entry-content\"&gt;');<br \/>\n        }<br \/>\n        dbih=dbih.replace('&lt;div class=\"entry-utility\"&gt;','&lt;\/details&gt;&lt;div title=\"entry-utility\" class=\"entry-utility\"&gt;');<br \/>\n      }<br \/>\n      document.body.innerHTML=dbih;<br \/>\n    }<br \/>\n    if (document.URL.indexOf('detailssummary=') != -1 &#038;&#038; mou == 0) {<br \/>\n    document.getElementById(\"eds\").innerHTML = \"&amp;#10133;\";<br \/>\n    document.getElementById(\"eds\").title = \"Open up blog posting contents now\";<br \/>\n    document.getElementById(\"eds\").style.visibility='visible';<br \/>\n    }<br \/>\n  } else if (mou == 0 &#038;&#038; dbitssare.length &gt; 1 &#038;&#038; dbitssare.length == dbitseare.length) {<br \/>\n    document.getElementById(\"eds\").style.visibility='visible';<br \/>\n  }<br \/>\n}<br \/>\n<\/b><br \/>\n<\/code>\n<\/ol>\n<p>Of course, this is most of benefit when you are <a target=_blank title='WordPress blog' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?detailssummary=y'>not already honing in on the one WordPress blog posting<\/a>, but there&#8217;s more fun to come, we reckon!<\/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='#d35544' onclick='var dv=document.getElementById(\"d35544\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/wordpress\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35544' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\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='#d35569' onclick='var dv=document.getElementById(\"d35569\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/hashtag\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35569' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\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='#d37662' onclick='var dv=document.getElementById(\"d37662\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mysql\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d37662' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s start out as &#8220;devil&#8217;s advocate&#8221; for today&#8217;s WordPress Generic Misspelling Fix project, that has a large amount of synergy with the &#8220;content&#8221; emphasis of WordPress Blog Posting Thread Content Summary Tutorial. What are some things to beware of when &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-posting-generic-misspelling-fix-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,202,299,452,2537,576,827,932,970,972,1182,1186,1867,1270,1456],"class_list":["post-37662","post","type-post","status-publish","format-standard","hentry","category-database","category-elearning","category-tutorials","tag-blog","tag-checkbox","tag-database-2","tag-form","tag-generic","tag-html","tag-mysql","tag-php","tag-post","tag-posting","tag-spelling","tag-sql","tag-substitution","tag-thread","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37662"}],"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=37662"}],"version-history":[{"count":22,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37662\/revisions"}],"predecessor-version":[{"id":37692,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37662\/revisions\/37692"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=37662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=37662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=37662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}