{"id":43694,"date":"2019-02-19T03:01:42","date_gmt":"2019-02-18T17:01:42","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=43694"},"modified":"2019-03-13T12:49:13","modified_gmt":"2019-03-13T02:49:13","slug":"wordpress-highlight-lookups-plugin-cookies-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-highlight-lookups-plugin-cookies-tutorial\/","title":{"rendered":"WordPress Highlight Lookups Plugin Cookies Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/plugin_cookies.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"WordPress Highlight Lookups Plugin Cookies Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/\/plugin_cookies.jpg\" title=\"WordPress Highlight Lookups Plugin Cookies Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">WordPress Highlight Lookups Plugin Cookies Tutorial<\/p><\/div>\n<p>The recent <a title='WordPress Highlight Lookups Plugin Tutorial' href='#wphlpt'>WordPress Highlight Lookups Plugin Tutorial<\/a> presented a static 8 option list of absolute URLs to navigate to, nuanced by the highlighted text of the user on a webpage of this blog.  Our aim today is to loosen that &#8220;static&#8221; restrictiveness, and allow both &#8230;<\/p>\n<ul>\n<li>within a session in a web browser &#8230; and between, that is for an &#8230;<\/li>\n<li>intersession scenario with the same web browser<\/li>\n<\/ul>\n<p> &#8230; remember and recall any user defined absolute URL arrangement.  Being as this <i>URL#Title<\/i> represents a pretty small amount of data, we are going to use <a target=_blank title='Cookie information from w3schools' href='http:\/\/www.w3schools.com\/js\/js_cookies.asp'>HTTP Cookies<\/a>, and Javascript (client) HTTP Cookie &#8230;<\/p>\n<ul>\n<li>creation of<\/li>\n<li>recall of<\/li>\n<li>removal of<\/li>\n<\/ul>\n<p> &#8230; functionalities to allow the user to click a <i>+<\/i> button to add a new absolute URL of their choosing, or a <i>&#8211;<\/i> button to remove all such user defined absolute URLs (controlled by HTTP Cookies).<\/p>\n<p>The <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-content\/plugins\/rjmprogramming-multi-lookup.php--GETME\" title=\"plugins\/rjmprogramming-multi-lookup.php\">changed PHP<\/a> <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-content\/plugins\/rjmprogramming-multi-lookup.php--GETME\" title=\"plugins\/rjmprogramming-multi-lookup.php\">rjmprogramming-multi-lookup.php<\/a> plugin <b>code becomes<\/b> &#8230;<\/p>\n<p><code><br \/>\n&lt;?php<br \/>\n\/**<br \/>\n * @package Rjmprogramming_Multi_Lookup<br \/>\n * @version 1.6<br \/>\n *\/<br \/>\n\/*<br \/>\nPlugin Name: Rjmprogramming Multi Lookup<br \/>\nDescription: Float various lookup button links to Wikipedia, Google, Free Dictionary for highlighted text of a blog webpage.<br \/>\nAuthor: Robert James Metcalfe<br \/>\nVersion: 1.6<br \/>\nAuthor URI: http:\/\/www.rjmprogramming.com.au\/<br \/>\n*\/<br \/>\n<br \/>\n\/\/ We need some Javascript to respond to highlights<br \/>\nfunction rjmprogramming_multi_js() {<br \/>\n<br \/>\n\techo \"&lt;div id='phfloater'&gt;&lt;\/div&gt;<br \/>\n<br \/>\t<br \/>\n\t&lt;script type='text\/javascript'&gt;<br \/>\nvar phight=' ';<br \/>\n<b>var cbackc='';<br \/>\nvar cookcnt=0;<br \/>\nvar cookblank=' ';<br \/>\nvar zoharr=[];<\/b><br \/>\n<br \/>\nfunction plfhlater() {<br \/>\n   var aswq=document.getElementsByTagName(\\\"a\\\");<br \/>\n   for (var iaswq=0; iaswq&lt;aswq.length; iaswq++) {<br \/>\n     if (aswq[iaswq].innerHTML == 'Long hover help available.') {<br \/>\n       aswq[iaswq].innerHTML='Highlighting and long hover help.';<br \/>\n       aswq[iaswq].title+=' ... also note that Highlighting Webpage Contents allows for Wikipedia, Google Translate, Free Dictionary and Google Search functionalities to appear';<br \/>\n     }<br \/>\n   }<br \/>\n}<br \/>\n<br \/>\n<b>function cookiePutHVal(indv) {<br \/>\n    var expireDate = new Date();<br \/>\n    var opis='';<br \/>\n    expireDate.setMonth(expireDate.getMonth()+6);<br \/>\n    expireDate.setDate(expireDate.getDate()-1);<br \/>\n    if (indv == '') {<br \/>\n      cookcnt=0;<br \/>\n      cbackc='';<br \/>\n      document.cookie = 'linktoothers' + '=' + cbackc + ';expires=' + expireDate.toGMTString();<br \/>\n    } else {<br \/>\n    var pvalis=prompt('Enter absolute URL prefix#Title ... where two blank Title prefix replaces value blanks for - and one blank Title prefix replaces value blanks for +', '');<br \/>\n    if (pvalis == null) { pvalis=''; }<br \/>\n    if (pvalis.indexOf('\/\/') != -1) {<br \/>\n          var otit='Other Link';<br \/>\n          if (pvalis.indexOf('#') != -1) {<br \/>\n            otit=pvalis.split('#')[1].trim();<br \/>\n          }<br \/>\n          if (pvalis.split('#')[1].indexOf('  ') == 0) {<br \/>\n            opis=phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');<br \/>\n            document.getElementById('phfloater').innerHTML+='&lt;b&gt;' + otit + ' &lt;a style=\\\"inline-block;\\\" href=\\\"' + pvalis.split('#')[0].trim() + '\\\" title=\\\"' + pvalis.split('#')[0].trim() + '\\\" target=_blank onmouseover=\\\"this.href=this.title + hopis(String.fromCharCode(45));\\\" ontouchstart=\\\"this.href=this.title + hopis(String.fromCharCode(45));\\\" id=b_phfloater_' + cookcnt + '&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n          } else if (pvalis.split('#')[1].indexOf(' ') == 0) {<br \/>\n            opis=phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');<br \/>\n            document.getElementById('phfloater').innerHTML+='&lt;b&gt;' + otit + ' &lt;a style=\\\"inline-block;\\\" href=\\\"' + pvalis.split('#')[0].trim() + '\\\" title=\\\"' + pvalis.split('#')[0].trim() + '\\\" target=_blank onmouseover=\\\"this.href=this.title + hopis(String.fromCharCode(43));\\\" ontouchstart=\\\"this.href=this.title + hopis(String.fromCharCode(43));\\\" id=b_phfloater_' + cookcnt + '&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n          } else {<br \/>\n            document.getElementById('phfloater').innerHTML+='&lt;b&gt;' + otit + ' &lt;a style=\\\"inline-block;\\\" href=\\\"' + pvalis.split('#')[0].trim() + '\\\" title=\\\"' + pvalis.split('#')[0].trim() + '\\\" target=_blank onmouseover=\\\"this.href=this.title + encodeURIComponent(phight);\\\" ontouchstart=\\\"this.href=this.title + encodeURIComponent(phight);\\\" id=b_phfloater_' + cookcnt + '&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n          }<br \/>\n     if (cbackc != '') {<br \/>\n      document.cookie = 'linktoothers' + '=' + cbackc + '|' + encodeURIComponent(pvalis) + ';expires=' + expireDate.toGMTString();<br \/>\n     } else {<br \/>\n      cbackc=encodeURIComponent(pvalis);<br \/>\n      document.cookie = 'linktoothers' + '=' + encodeURIComponent(pvalis) + ';expires=' + expireDate.toGMTString();<br \/>\n     }<br \/>\n     cookcnt++;<br \/>\n    }<br \/>\n    }<br \/>\n}<br \/>\n<br \/>\nfunction cookieHVal(cName) {<br \/>\n  if (document.cookie != '') {<br \/>\n   var tCookie=document.cookie.split('; ');<br \/>\n   for (var j=0; j&lt;tCookie.length; j++) {<br \/>\n    if (cName == tCookie[j].split('=')[0]) {<br \/>\n      return decodeURIComponent(tCookie[j].split('=')[1]);<br \/>\n    }<br \/>\n   }<br \/>\n  }<br \/>\n  return '';<br \/>\n}<br \/>\n<br \/>\nfunction hopis(inop) {<br \/>\n  return hight.replace(\/\\ \/g, inop);<br \/>\n}<\/b><br \/>\n<br \/>\nfunction plookforhighlight() {<br \/>\n  var usualdelay=2000, oRange=null, oRect=null, s_top='0px', s_left='5px', fourhundred=300, isfx='0';<br \/>\n  if (phight == ' ') {<br \/>\n    setTimeout(plfhlater, 5000);<br \/>\n    phight='';<br \/>\n    <b>cbackc=cookieHVal('linktoothers');<br \/>\n    if (cbackc != '') {<br \/>\n      zoharr=cbackc.split('|');<br \/>\n    }<\/b><br \/>\n  }<br \/>\n  setTimeout(plookforhighlight, usualdelay);<br \/>\n  var xsel=window.getSelection().toString();<br \/>\n  if (xsel.length == 0) {<br \/>\n    try {<br \/>\n    xsel=document.selection.createRange().htmlText;<br \/>\n    xsel=xsel.replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ');<br \/>\n    xsel=xsel.replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ');<br \/>\n    } catch(ertw) {<br \/>\n    xsel='';<br \/>\n    }<br \/>\n  } else {<br \/>\n    xsel=xsel.replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ');<br \/>\n    xsel=xsel.replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ');<br \/>\n    if (xsel != phight && xsel != '') {<br \/>\n     oRange = window.getSelection().getRangeAt(0); \/\/get the text range<br \/>\n     oRect = oRange.getBoundingClientRect();<br \/>\n     s_top = ('' + oRect.top).replace('px','') + 'px';<br \/>\n     s_left = ('' + oRect.left).replace('px','') + 'px';<br \/>\n     if (s_top != '0px') {<br \/>\n        fourhundred=eval('' + s_top.replace('px',''));<br \/>\n        s_top='0px';<br \/>\n        var dse='', dde='';<br \/>\n        if (document.scrollingElement) {<br \/>\n          if (document.scrollingElement.scrollTop) {<br \/>\n            dse=('' + document.scrollingElement.scrollTop);<br \/>\n          }<br \/>\n        }<br \/>\n        if (document.documentElement) {<br \/>\n          if (document.documentElement.scrollTop) {<br \/>\n            dde=('' + document.documentElement.scrollTop);<br \/>\n          }<br \/>\n        }<br \/>\n        if (dse != '') {<br \/>\n          fourhundred+=eval('' + dse.replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else if (dde != '') {<br \/>\n          fourhundred+=eval('' + dde.replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else if (('' + window.scrollY) != '') {<br \/>\n          fourhundred+=eval('' + ('' + window.scrollY).replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else if (('' + window.pageYOffset) != '') {<br \/>\n          fourhundred+=eval('' + ('' + window.pageYOffset).replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else {<br \/>\n          isfx=('' + document.body.scrollTop).replace('px','');<br \/>\n          if (isfx.replace('0','') == '') {<br \/>\n            isfx=('' + document.scrollingElement.scrollTop).replace('px','');<br \/>\n            if (isfx.replace('0','') == '') {<br \/>\n               isfx=('' + window.scrollY).replace('px','');<br \/>\n               if (isfx.replace('0','') == '') {<br \/>\n                  isfx=('' + window.pageYOffset).replace('px','');<br \/>\n               }<br \/>\n            }<br \/>\n          }<br \/>\n        }<br \/>\n        fourhundred+=120;<br \/>\n     }<br \/>\n    }<br \/>\n  }<br \/>\n  if (xsel != phight && xsel != '') {<br \/>\n    phight=xsel;<br \/>\n    if (s_top == '0px') { s_top = ('' + eval(fourhundred + eval('' + isfx))) + 'px'; }<br \/>\n    if (document.getElementById('phfloater')) {<br \/>\n      if (document.getElementById('phfloater').innerHTML == '') {<br \/>\n        document.getElementById('phfloater').style.position='absolute';<br \/>\n        document.getElementById('phfloater').style.top=s_top;<br \/>\n        document.getElementById('phfloater').style.left=s_left;<br \/>\n        document.getElementById('phfloater').style.zIndex='85';<br \/>\n        document.getElementById('phfloater').style.backgroundColor='rgba(0,255,165,0.9)';<br \/>\n        document.getElementById('phfloater').style.border='1px solid purple';<br \/>\n        document.getElementById('phfloater').style.padding='2px 2px 2px 2px';<br \/>\n        document.getElementById('phfloater').style.display='block';<br \/>\n        document.getElementById('phfloater').innerHTML='&lt;b&gt;Wikipedia &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/wikipedia.org\/wiki\/Main_Page\\\" title=\\\"\/\/wikipedia.org\/wiki\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'_'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'_'\\\" + ');\\\" id=b_phfloater_wikipedia&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Google Translate &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/translate.google.com\\\" title=\\\"\/\/translate.google.com\/#view=home&op=translate&sl=auto&tl=en&text=\\\" target=_blank onmouseover=\\\"this.href=this.title + encodeURIComponent(phight);\\\" ontouchstart=\\\"this.href=this.title + encodeURIComponent(phight);\\\" id=b_phfloater_google_translate&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Free Dictionary &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.thefreedictionary.com\/\\\" title=\\\"\/\/www.thefreedictionary.com\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');\\\" id=b_phfloater_free_dictionary&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Google Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.google.com\/\\\" title=\\\"\/\/www.google.com\/search?q=\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');\\\" id=b_phfloater_google_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Tag Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/\\\" title=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/tag\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');\\\" id=b_phfloater_tag_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Category Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/\\\" title=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/category\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');\\\" id=b_phfloater_category_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Tag First Word Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/\\\" title=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/tag\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ').replace(' + \\\"'-','\/?wopenall='\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ').replace(' + \\\"'-','\/?wopenall='\\\" + ');\\\" id=b_phfloater_tag_first_word_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Posting Title Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.rjmprogramming.com.au\/itblog\/match\/mapper.php\\\" title=\\\"\/\/www.rjmprogramming.com.au\/itblog\/match\/mapper.php?pm=\\\" target=_blank onmouseover=\\\"this.href=this.title + encodeURIComponent(phight);\\\" ontouchstart=\\\"this.href=this.title + encodeURIComponent(phight);\\\" id=b_phfloater_posting_title_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        <b>if (zoharr.length &gt;= 1) {<br \/>\n         for (var ioharr=0; ioharr&lt;zoharr.length; ioharr++) {<br \/>\n          otit='Other Link ' + eval(1 + ioharr);<br \/>\n          if (zoharr[ioharr].indexOf('#') != -1) {<br \/>\n            otit=zoharr[ioharr].split('#')[1].trim();<br \/>\n          }<br \/>\n          if (zoharr[ioharr].split('#')[1].indexOf('  ') == 0) {<br \/>\n            opis=phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');<br \/>\n            document.getElementById('phfloater').innerHTML+='&lt;b&gt;' + otit + ' &lt;a style=\\\"inline-block;\\\" href=\\\"' + zoharr[ioharr].split('#')[0].trim() + '\\\" title=\\\"' + zoharr[ioharr].split('#')[0].trim() + '\\\" target=_blank onmouseover=\\\"this.href=this.title + hopis(String.fromCharCode(45));\\\" ontouchstart=\\\"this.href=this.title + hopis(String.fromCharCode(45));\\\" id=b_phfloater_' + cookcnt + '&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n          } else if (zoharr[ioharr].split('#')[1].indexOf(' ') == 0) {<br \/>\n            opis=phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');<br \/>\n            document.getElementById('phfloater').innerHTML+='&lt;b&gt;' + otit + ' &lt;a style=\\\"inline-block;\\\" href=\\\"' + zoharr[ioharr].split('#')[0].trim() + '\\\" title=\\\"' + zoharr[ioharr].split('#')[0].trim() + '\\\" target=_blank onmouseover=\\\"this.href=this.title + hopis(String.fromCharCode(43));\\\" ontouchstart=\\\"this.href=this.title + hopis(String.fromCharCode(45));\\\" id=b_phfloater_' + cookcnt + '&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n          } else {<br \/>\n            document.getElementById('phfloater').innerHTML+='&lt;b&gt;' + otit + ' &lt;a style=\\\"inline-block;\\\" href=\\\"' + zoharr[ioharr].split('#')[0].trim() + '\\\" title=\\\"' + zoharr[ioharr].split('#')[0].trim() + '\\\" target=_blank onmouseover=\\\"this.href=this.title + encodeURIComponent(phight);\\\" ontouchstart=\\\"this.href=this.title + encodeURIComponent(phight);\\\" id=b_phfloater_' + cookcnt + '&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n          }<br \/>\n          cookcnt++;<br \/>\n         }<br \/>\n        }<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;&lt;input title=\\\"Add your own into HTTP Cookies\\\" type=button onclick=cookiePutHVal(cookblank); value=+&gt;&lt;\/input&gt;&nbsp;&lt;input title=\\\"Remove all HTTP Cookie URLs\\\" type=button onclick=cookiePutHVal(cookblank.trim()); value=-&gt;&lt;\/input&gt;&lt;\/b&gt;&lt;br&gt;';<\/b><br \/>\n      } else {<br \/>\n        document.getElementById('b_phfloater_wikipedia').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_google_translate').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_free_dictionary').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_google_search').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_tag_search').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_category_search').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_tag_first_word_search').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_posting_title_search').innerHTML=phight;<br \/>\n        <b>if (cookcnt &gt; 0) {<br \/>\n          for (var icook=0; icook&lt;cookcnt; icook++) {<br \/>\n            document.getElementById('b_phfloater_' + icook).innerHTML=phight;<br \/>\n          }<br \/>\n        }<\/b><br \/>\n        document.getElementById('phfloater').style.top=s_top;<br \/>\n        document.getElementById('phfloater').style.left=s_left;<br \/>\n        document.getElementById('phfloater').style.display='block';<br \/>\n      }<br \/>\n    }<br \/>\n  } else if (xsel == '') {<br \/>\n    if (document.getElementById('phfloater')) {<br \/>\n      document.getElementById('phfloater').style.display='none';<br \/>\n    }<br \/>\n    phight='';<br \/>\n  }<br \/>\n}<br \/>\n<br \/>\nplookforhighlight();<br \/>\n<br \/>\n\t&lt;\/script&gt;<br \/>\n\t\";<br \/>\n}<br \/>\n<br \/>\nadd_action( 'wp_footer', 'rjmprogramming_multi_js' );<br \/>\n<br \/>\n?&gt;<br \/>\n<\/code><\/p>\n<hr>\n<p id='wphlpt'>Previous relevant <a target=_blank title='WordPress Highlight Lookups Plugin Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-highlight-lookups-plugin-tutorial\/'>WordPress Highlight Lookups Plugin 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\/rjmprogramming-multi-lookup.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"WordPress Highlight Lookups Plugin Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/rjmprogramming-multi-lookup.jpg\" title=\"WordPress Highlight Lookups Plugin Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">WordPress Highlight Lookups Plugin Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='WordPress Highlight Lookups Tutorial' href='#wphlt'>WordPress Highlight Lookups Tutorial<\/a> showed us &#8230;<\/p>\n<ul>\n<li>functionality to link highlighted text to Wikipedia, Google, Free Dictionary and other inhouse links via the TwentyTen theme&#8217;s wp-contents\/themes\/twentyten\/header.php &#8230; and today, the lesson is that any functionality you do that way can also be attended to via &#8230;<\/li>\n<li>functionality to link highlighted text to Wikipedia, Google, Free Dictionary and other inhouse links via an inhouse plugin called &#8220;Rjmprogramming Multi Lookup&#8221; (NB: it is good to &#8220;manufacture&#8221; a unique plugin name here)<\/li>\n<\/ul>\n<p> &#8230; the significant issue being to pick a suitable Hook and associated unique PHP function name to use.  What Hook works for us, here, with this functionality?   Well, it is optional, and independent, so why not load it in to work at <a target=_blank title='Useful advice' href='https:\/\/developer.wordpress.org\/reference\/hooks\/wp_footer\/'>the wp_footer Hook as explained below<\/a> &#8230;<\/p>\n<blockquote cite='https:\/\/developer.wordpress.org\/reference\/hooks\/wp_footer\/'><p>\ndo_action( &#8216;wp_footer&#8217; )<br \/>\nPrints scripts or data before the closing body tag on the front end.\n<\/p><\/blockquote>\n<p> &#8230; just before the &lt;\/body&gt; where we can <b>HTML<\/b> and <i>Javascript<\/i> let it (within PHP <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-content\/plugins\/rjmprogramming-multi-lookup.php_GETME\">rjmprogramming-multi-lookup.php<\/a>) &#8230;<\/p>\n<p><code><br \/>\n&lt;?php<br \/>\n\/**<br \/>\n * @package Rjmprogramming_Multi_Lookup<br \/>\n * @version 1.6<br \/>\n *\/<br \/>\n\/*<br \/>\nPlugin Name: Rjmprogramming Multi Lookup<br \/>\nDescription: Float various lookup button links to Wikipedia, Google, Free Dictionary for highlighted text of a blog webpage.<br \/>\nAuthor: Robert James Metcalfe<br \/>\nVersion: 1.6<br \/>\nAuthor URI: http:\/\/www.rjmprogramming.com.au\/<br \/>\n*\/<br \/>\n<br \/>\n\/\/ We need some Javascript to respond to highlights<br \/>\nfunction rjmprogramming_multi_js() {<br \/>\n<br \/>\n\techo \"<b>&lt;div id='phfloater'&gt;&lt;\/div&gt;<\/b><br \/>\n<br \/>\t<br \/>\n\t&lt;script type='text\/javascript'&gt;<br \/>\n<i>var phight=' ';<br \/>\n<br \/>\nfunction plfhlater() {<br \/>\n   var aswq=document.getElementsByTagName(\\\"a\\\");<br \/>\n   for (var iaswq=0; iaswq&lt;aswq.length; iaswq++) {<br \/>\n     if (aswq[iaswq].innerHTML == 'Long hover help available.') {<br \/>\n       aswq[iaswq].innerHTML='Highlighting and long hover help.';<br \/>\n       aswq[iaswq].title+=' ... also note that Highlighting Webpage Contents allows for Wikipedia, Google Translate, Free Dictionary and Google Search functionalities to appear';<br \/>\n     }<br \/>\n   }<br \/>\n}<br \/>\n<br \/>\nfunction plookforhighlight() {<br \/>\n  var usualdelay=2000, oRange=null, oRect=null, s_top='0px', s_left='5px', fourhundred=300, isfx='0';<br \/>\n  if (phight == ' ') {<br \/>\n    setTimeout(plfhlater, 5000);<br \/>\n    phight='';<br \/>\n  }<br \/>\n  setTimeout(plookforhighlight, usualdelay);<br \/>\n  var xsel=window.getSelection().toString();<br \/>\n  if (xsel.length == 0) {<br \/>\n    try {<br \/>\n    xsel=document.selection.createRange().htmlText;<br \/>\n    xsel=xsel.replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ');<br \/>\n    xsel=xsel.replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ');<br \/>\n    } catch(ertw) {<br \/>\n    xsel='';<br \/>\n    }<br \/>\n  } else {<br \/>\n    xsel=xsel.replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ');<br \/>\n    xsel=xsel.replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ');<br \/>\n    if (xsel != phight && xsel != '') {<br \/>\n     oRange = window.getSelection().getRangeAt(0); \/\/get the text range<br \/>\n     oRect = oRange.getBoundingClientRect();<br \/>\n     s_top = ('' + oRect.top).replace('px','') + 'px';<br \/>\n     s_left = ('' + oRect.left).replace('px','') + 'px';<br \/>\n     if (s_top != '0px') {<br \/>\n        fourhundred=eval('' + s_top.replace('px',''));<br \/>\n        s_top='0px';<br \/>\n        var dse='', dde='';<br \/>\n        if (document.scrollingElement) {<br \/>\n          if (document.scrollingElement.scrollTop) {<br \/>\n            dse=('' + document.scrollingElement.scrollTop);<br \/>\n          }<br \/>\n        }<br \/>\n        if (document.documentElement) {<br \/>\n          if (document.documentElement.scrollTop) {<br \/>\n            dde=('' + document.documentElement.scrollTop);<br \/>\n          }<br \/>\n        }<br \/>\n        if (dse != '') {<br \/>\n          fourhundred+=eval('' + dse.replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else if (dde != '') {<br \/>\n          fourhundred+=eval('' + dde.replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else if (('' + window.scrollY) != '') {<br \/>\n          fourhundred+=eval('' + ('' + window.scrollY).replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else if (('' + window.pageYOffset) != '') {<br \/>\n          fourhundred+=eval('' + ('' + window.pageYOffset).replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else {<br \/>\n          isfx=('' + document.body.scrollTop).replace('px','');<br \/>\n          if (isfx.replace('0','') == '') {<br \/>\n            isfx=('' + document.scrollingElement.scrollTop).replace('px','');<br \/>\n            if (isfx.replace('0','') == '') {<br \/>\n               isfx=('' + window.scrollY).replace('px','');<br \/>\n               if (isfx.replace('0','') == '') {<br \/>\n                  isfx=('' + window.pageYOffset).replace('px','');<br \/>\n               }<br \/>\n            }<br \/>\n          }<br \/>\n        }<br \/>\n        fourhundred+=120;<br \/>\n     }<br \/>\n    }<br \/>\n  }<br \/>\n  if (xsel != phight && xsel != '') {<br \/>\n    phight=xsel;<br \/>\n    if (s_top == '0px') { s_top = ('' + eval(fourhundred + eval('' + isfx))) + 'px'; }<br \/>\n    if (document.getElementById('phfloater')) {<br \/>\n      if (document.getElementById('phfloater').innerHTML == '') {<br \/>\n        document.getElementById('phfloater').style.position='absolute';<br \/>\n        document.getElementById('phfloater').style.top=s_top;<br \/>\n        document.getElementById('phfloater').style.left=s_left;<br \/>\n        document.getElementById('phfloater').style.zIndex='85';<br \/>\n        document.getElementById('phfloater').style.backgroundColor='rgba(0,255,165,0.9)';<br \/>\n        document.getElementById('phfloater').style.border='1px solid purple';<br \/>\n        document.getElementById('phfloater').style.padding='2px 2px 2px 2px';<br \/>\n        document.getElementById('phfloater').style.display='block';<br \/>\n        document.getElementById('phfloater').innerHTML='&lt;b&gt;Wikipedia &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/wikipedia.org\/wiki\/Main_Page\\\" title=\\\"\/\/wikipedia.org\/wiki\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'_'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'_'\\\" + ');\\\" id=b_phfloater_wikipedia&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Google Translate &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/translate.google.com\\\" title=\\\"\/\/translate.google.com\/#view=home&op=translate&sl=auto&tl=en&text=\\\" target=_blank onmouseover=\\\"this.href=this.title + encodeURIComponent(phight);\\\" ontouchstart=\\\"this.href=this.title + encodeURIComponent(phight);\\\" id=b_phfloater_google_translate&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Free Dictionary &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.thefreedictionary.com\/\\\" title=\\\"\/\/www.thefreedictionary.com\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');\\\" id=b_phfloater_free_dictionary&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Google Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.google.com\/\\\" title=\\\"\/\/www.google.com\/search?q=\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'+'\\\" + ');\\\" id=b_phfloater_google_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Tag Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/\\\" title=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/tag\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');\\\" id=b_phfloater_tag_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Category Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/\\\" title=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/category\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ');\\\" id=b_phfloater_category_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Tag First Word Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/\\\" title=\\\"\/\/www.rjmprogramming.com.au\/ITblog\/tag\/\\\" target=_blank onmouseover=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ').replace(' + \\\"'-','\/?wopenall='\\\" + ');\\\" ontouchstart=\\\"this.href=this.title + phight.replace(\/\\ \/g,' + \\\"'-'\\\" + ').replace(' + \\\"'-','\/?wopenall='\\\" + ');\\\" id=b_phfloater_tag_first_word_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('phfloater').innerHTML+='&lt;b&gt;Posting Title Search &lt;a style=\\\"inline-block;\\\" href=\\\"\/\/www.rjmprogramming.com.au\/itblog\/match\/mapper.php\\\" title=\\\"\/\/www.rjmprogramming.com.au\/itblog\/match\/mapper.php?pm=\\\" target=_blank onmouseover=\\\"this.href=this.title + encodeURIComponent(phight);\\\" ontouchstart=\\\"this.href=this.title + encodeURIComponent(phight);\\\" id=b_phfloater_posting_title_search&gt;' + phight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n      } else {<br \/>\n        document.getElementById('b_phfloater_wikipedia').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_google_translate').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_free_dictionary').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_google_search').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_tag_search').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_category_search').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_tag_first_word_search').innerHTML=phight;<br \/>\n        document.getElementById('b_phfloater_posting_title_search').innerHTML=phight;<br \/>\n        document.getElementById('phfloater').style.top=s_top;<br \/>\n        document.getElementById('phfloater').style.left=s_left;<br \/>\n        document.getElementById('phfloater').style.display='block';<br \/>\n      }<br \/>\n    }<br \/>\n  } else if (xsel == '') {<br \/>\n    if (document.getElementById('phfloater')) {<br \/>\n      document.getElementById('phfloater').style.display='none';<br \/>\n    }<br \/>\n    phight='';<br \/>\n  }<br \/>\n}<br \/>\n<br \/>\nplookforhighlight();<br \/>\n<br \/>\n\t&lt;\/script&gt;<br \/>\n\t\";<br \/>\n}<\/i><br \/>\n<br \/>\nadd_action( 'wp_footer', 'rjmprogramming_multi_js' );<br \/>\n<br \/>\n?&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; and be placed into the wp-contents\/plugins folder for our <a target=_blank title='Blog' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/'>blog<\/a>.<\/p>\n<p>It&#8217;s <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/rjmprogramming-multi-lookup.jpg\">green<\/a>!  What happened to the orange of yesterday?  Well, we don&#8217;t want both methods to run, but along the way proved they could.  So what we did with that header.php code was to change &#8230;<\/p>\n<p><code><br \/>\nfunction lookforhighlight() {<br \/>\n  var usualdelay=2000, oRange=null, oRect=null, s_top='0px', s_left='5px', fourhundred=300, isfx='0';<br \/>\n  if (hight == ' ') {<br \/>\n    setTimeout(lfhlater, 5000);<br \/>\n    hight='';<br \/>\n  }<br \/>\n  setTimeout(lookforhighlight, usualdelay);<br \/>\n  \/\/ ... blah blah<br \/>\n  }<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; <b>to<\/b> &#8230;<\/p>\n<p><code><br \/>\nfunction lookforhighlight() {<br \/>\n  var usualdelay=2000, oRange=null, oRect=null, s_top='0px', s_left='5px', fourhundred=300, isfx='0';<br \/>\n  if (hight == ' ') {<br \/>\n    setTimeout(lfhlater, 5000);<br \/>\n    hight='';<br \/>\n  }<br \/>\n  <b>if (!document.getElementById('phfloater')) {<\/b><br \/>\n  setTimeout(lookforhighlight, usualdelay);<br \/>\n  \/\/ ... blah blah<br \/>\n  }<br \/>\n  <b>}<\/b><br \/>\n}<br \/>\n<\/code><\/p>\n<hr>\n<p id='wphlt'>Previous relevant <a target=_blank title='WordPress Highlight Lookups Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-highlight-lookups-tutorial\/'>WordPress Highlight Lookups 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\/wordpress_highlight.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"WordPress Highlight Lookups Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress_highlight.jpg\" title=\"WordPress Highlight Lookups Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">WordPress Highlight Lookups Tutorial<\/p><\/div>\n<p>We\u2019re back at WordPress TwentyTen theme header.php change methodologies to implement some new WordPress functionality like yesterday\u2019s <a title='WordPress Plugin Primer Tutorial' href='#wpppt'>WordPress Plugin Primer Tutorial<\/a> in that highlighted text of a webpage is used (except that we&#8217;ve now opened it up to the non-admin WordPress blog webpages), but this time presenting an overlayed floating set of hyperlink options linking to &#8230;<\/p>\n<ul>\n<li>Wikipedia<\/li>\n<li>Google Translate<\/li>\n<li>Free Dictionary<\/li>\n<li>Google Search<\/li>\n<li>Tag Search<\/li>\n<li>Category Search<\/li>\n<li>Tag First Word Search<\/li>\n<li>Posting Title Search<\/li>\n<\/ul>\n<p>As far as header.php code goes we add this Javascript &#8230;<\/p>\n<p>&lt;script type=&#8217;text\/javascript&#8217;&gt;<br \/>\n<code><br \/>\nvar hight=' ';<br \/>\n<br \/>\nfunction lfhlater() {<br \/>\n   var aswq=document.getElementsByTagName(\"a\");<br \/>\n   for (var iaswq=0; iaswq&lt;aswq.length; iaswq++) {<br \/>\n     if (aswq[iaswq].innerHTML == 'Long hover help available.') {<br \/>\n       aswq[iaswq].innerHTML='Highlighting and long hover help.';<br \/>\n       aswq[iaswq].title+=' ... also note that Highlighting Webpage Contents allows for Wikipedia, Google Translate, Free Dictionary and Google Search functionalities to appear';<br \/>\n     }<br \/>\n   }<br \/>\n}<br \/>\n<br \/>\nfunction lookforhighlight() {<br \/>\n  var usualdelay=2000, oRange=null, oRect=null, s_top='0px', s_left='5px', fourhundred=300, isfx='0';<br \/>\n  if (hight == ' ') {<br \/>\n    setTimeout(lfhlater, 5000);<br \/>\n    hight='';<br \/>\n  }<br \/>\n  setTimeout(lookforhighlight, usualdelay);<br \/>\n  var xsel=window.getSelection().toString();<br \/>\n  if (xsel.length == 0) {<br \/>\n    try {<br \/>\n    xsel=document.selection.createRange().htmlText;<br \/>\n    xsel=xsel.replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ');<br \/>\n    xsel=xsel.replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ');<br \/>\n    } catch(ertw) {<br \/>\n    xsel='';<br \/>\n    }<br \/>\n  } else {<br \/>\n    xsel=xsel.replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ').replace(String.fromCharCode(10),' ');<br \/>\n    xsel=xsel.replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ').replace(String.fromCharCode(13),' ');<br \/>\n    if (xsel != hight && xsel != '') {<br \/>\n     oRange = window.getSelection().getRangeAt(0); \/\/get the text range<br \/>\n     oRect = oRange.getBoundingClientRect();<br \/>\n     s_top = ('' + oRect.top).replace('px','') + 'px';<br \/>\n     s_left = ('' + oRect.left).replace('px','') + 'px';<br \/>\n     if (s_top != '0px') {<br \/>\n        fourhundred=eval('' + s_top.replace('px',''));<br \/>\n        s_top='0px';<br \/>\n        var dse='', dde='';<br \/>\n        if (document.scrollingElement) {<br \/>\n          if (document.scrollingElement.scrollTop) {<br \/>\n            dse=('' + document.scrollingElement.scrollTop);<br \/>\n          }<br \/>\n        }<br \/>\n        if (document.documentElement) {<br \/>\n          if (document.documentElement.scrollTop) {<br \/>\n            dde=('' + document.documentElement.scrollTop);<br \/>\n          }<br \/>\n        }<br \/>\n        if (dse != '') {<br \/>\n          fourhundred+=eval('' + dse.replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else if (dde != '') {<br \/>\n          fourhundred+=eval('' + dde.replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else if (('' + window.scrollY) != '') {<br \/>\n          fourhundred+=eval('' + ('' + window.scrollY).replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else if (('' + window.pageYOffset) != '') {<br \/>\n          fourhundred+=eval('' + ('' + window.pageYOffset).replace('px',''));<br \/>\n          isfx='0';<br \/>\n        } else {<br \/>\n          isfx=('' + document.body.scrollTop).replace('px','');<br \/>\n          if (isfx.replace('0','') == '') {<br \/>\n            isfx=('' + document.scrollingElement.scrollTop).replace('px','');<br \/>\n            if (isfx.replace('0','') == '') {<br \/>\n               isfx=('' + window.scrollY).replace('px','');<br \/>\n               if (isfx.replace('0','') == '') {<br \/>\n                  isfx=('' + window.pageYOffset).replace('px','');<br \/>\n               }<br \/>\n            }<br \/>\n          }<br \/>\n        }<br \/>\n        fourhundred+=100;<br \/>\n     }<br \/>\n    }<br \/>\n  }<br \/>\n  if (xsel != hight && xsel != '') {<br \/>\n    hight=xsel;<br \/>\n    if (s_top == '0px') { s_top = ('' + eval(fourhundred + eval('' + isfx))) + 'px'; }<br \/>\n    if (document.getElementById('hfloater')) {<br \/>\n      if (document.getElementById('hfloater').innerHTML == '') {<br \/>\n        document.getElementById('hfloater').style.position='absolute';<br \/>\n        document.getElementById('hfloater').style.top=s_top;<br \/>\n        document.getElementById('hfloater').style.left=s_left;<br \/>\n        document.getElementById('hfloater').style.zIndex='87';<br \/>\n        document.getElementById('hfloater').style.backgroundColor='rgba(255,165,0,0.9)';<br \/>\n        document.getElementById('hfloater').style.border='1px solid purple';<br \/>\n        document.getElementById('hfloater').style.padding='2px 2px 2px 2px';<br \/>\n        document.getElementById('hfloater').style.display='block';<br \/>\n        document.getElementById('hfloater').innerHTML='&lt;b&gt;Wikipedia &lt;a style=\"inline-block;\" href=\"\/\/wikipedia.org\/wiki\/Main_Page\" title=\"\/\/wikipedia.org\/wiki\/\" target=_blank onmouseover=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'_'\" + ');\" ontouchstart=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'_'\" + ');\" id=b_hfloater_wikipedia&gt;' + hight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('hfloater').innerHTML+='&lt;b&gt;Google Translate &lt;a style=\"inline-block;\" href=\"\/\/translate.google.com\" title=\"\/\/translate.google.com\/#view=home&op=translate&sl=auto&tl=en&text=\" target=_blank onmouseover=\"this.href=this.title + encodeURIComponent(hight);\" ontouchstart=\"this.href=this.title + encodeURIComponent(hight);\" id=b_hfloater_google_translate&gt;' + hight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('hfloater').innerHTML+='&lt;b&gt;Free Dictionary &lt;a style=\"inline-block;\" href=\"\/\/www.thefreedictionary.com\/\" title=\"\/\/www.thefreedictionary.com\/\" target=_blank onmouseover=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'+'\" + ');\" ontouchstart=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'+'\" + ');\" id=b_hfloater_free_dictionary&gt;' + hight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('hfloater').innerHTML+='&lt;b&gt;Google Search &lt;a style=\"inline-block;\" href=\"\/\/www.google.com\/\" title=\"\/\/www.google.com\/search?q=\" target=_blank onmouseover=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'+'\" + ');\" ontouchstart=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'+'\" + ');\" id=b_hfloater_google_search&gt;' + hight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('hfloater').innerHTML+='&lt;b&gt;Tag Search &lt;a style=\"inline-block;\" href=\"\/\/www.rjmprogramming.com.au\/ITblog\/\" title=\"\/\/www.rjmprogramming.com.au\/ITblog\/tag\/\" target=_blank onmouseover=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'-'\" + ');\" ontouchstart=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'-'\" + ');\" id=b_hfloater_tag_search&gt;' + hight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('hfloater').innerHTML+='&lt;b&gt;Category Search &lt;a style=\"inline-block;\" href=\"\/\/www.rjmprogramming.com.au\/ITblog\/\" title=\"\/\/www.rjmprogramming.com.au\/ITblog\/category\/\" target=_blank onmouseover=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'-'\" + ');\" ontouchstart=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'-'\" + ');\" id=b_hfloater_category_search&gt;' + hight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('hfloater').innerHTML+='&lt;b&gt;Tag First Word Search &lt;a style=\"inline-block;\" href=\"\/\/www.rjmprogramming.com.au\/ITblog\/\" title=\"\/\/www.rjmprogramming.com.au\/ITblog\/tag\/\" target=_blank onmouseover=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'-'\" + ').replace(' + \"'-','\/?wopenall='\" + ');\" ontouchstart=\"this.href=this.title + hight.replace(\/\\ \/g,' + \"'-'\" + ').replace(' + \"'-','\/?wopenall='\" + ');\" id=b_hfloater_tag_first_word_search&gt;' + hight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n        document.getElementById('hfloater').innerHTML+='&lt;b&gt;Posting Title Search &lt;a style=\"inline-block;\" href=\"\/\/www.rjmprogramming.com.au\/itblog\/match\/mapper.php\" title=\"\/\/www.rjmprogramming.com.au\/itblog\/match\/mapper.php?pm=\" target=_blank onmouseover=\"this.href=this.title + encodeURIComponent(hight);\" ontouchstart=\"this.href=this.title + encodeURIComponent(hight);\" id=b_hfloater_posting_title_search&gt;' + hight + '&lt;\/a&gt;&lt;\/b&gt;&lt;br&gt;';<br \/>\n      } else {<br \/>\n        document.getElementById('b_hfloater_wikipedia').innerHTML=hight;<br \/>\n        document.getElementById('b_hfloater_google_translate').innerHTML=hight;<br \/>\n        document.getElementById('b_hfloater_free_dictionary').innerHTML=hight;<br \/>\n        document.getElementById('b_hfloater_google_search').innerHTML=hight;<br \/>\n        document.getElementById('b_hfloater_tag_search').innerHTML=hight;<br \/>\n        document.getElementById('b_hfloater_category_search').innerHTML=hight;<br \/>\n        document.getElementById('b_hfloater_tag_first_word_search').innerHTML=hight;<br \/>\n        document.getElementById('b_hfloater_posting_title_search').innerHTML=hight;<br \/>\n        document.getElementById('hfloater').style.top=s_top;<br \/>\n        document.getElementById('hfloater').style.left=s_left;<br \/>\n        document.getElementById('hfloater').style.display='block';<br \/>\n      }<br \/>\n    }<br \/>\n  } else if (xsel == '') {<br \/>\n    if (document.getElementById('hfloater')) {<br \/>\n      document.getElementById('hfloater').style.display='none';<br \/>\n    }<br \/>\n    hight='';<br \/>\n  }<br \/>\n}<br \/>\n<\/code><br \/>\n&lt;\/script&gt;<\/p>\n<p>&#8230; called by the <b>changed HTML snippet<\/b> as below &#8230;<\/p>\n<p><code><br \/>\n&lt;body onload='<b>lookforhighlight();<\/b>  postcalendar(); changeasfordownload();  if (cafd == cafd) { cafd=0; } else { cafd=true; }  checkonl(); setTimeout(initpostedoncc, 3000); widgetcon(); precc(); courseCookies();  cookie_fonts(); is_mentioned_by(); calendar_pass(); prejustshow(); details_summary(0);  '&gt;<br \/>\n<b>&lt;div id=\"hfloater\"&gt;&lt;\/div&gt;<\/b><br \/>\n<\/code><\/p>\n<hr>\n<p id='wpppt'>Previous relevant <a target=_blank title='WordPress Plugin Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-plugin-primer-tutorial\/'>WordPress Plugin 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\/wordpress_plugin_simple.gif\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"WordPress Plugin Primer Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress_plugin_simple.gif\" title=\"WordPress Plugin Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">WordPress Plugin Primer Tutorial<\/p><\/div>\n<p>Normally we make changes to this TwentyTen themed WordPress blog by changing that theme&#8217;s wp-content\/themes\/twentyten\/header.php file.  But today we show you how to write the PHP code needed to write a <a target=_blank title='WordPress.org' href='http:\/\/www.wordpress.org'>WordPress.org<\/a> admin login <a target=_blank title='Plugin information from Wikipedia' href='https:\/\/en.wikipedia.org\/wiki\/Plug-in_(computing)'>plugin<\/a> to create a hyperlink to a Wikipedia page regarding any text you have highlighted on your WordPress admin area webpage.<\/p>\n<p>We thank &#8230;<\/p>\n<ul>\n<li><a target=_blank title='Codex' href='https:\/\/codex.wordpress.org\/'>WordPress Codex<\/a><\/li>\n<li><a target=_blank title='Writing a Plugin' href='https:\/\/codex.wordpress.org\/Writing_a_Plugin'>WordPress Codex &#8220;Writing a Plugin&#8221;<\/a><\/li>\n<li><a target=_blank title='Plugin API' href='https:\/\/codex.wordpress.org\/Plugin_API'>WordPress Codex &#8220;Plugin API&#8221;<\/a><\/li>\n<li><a target=_blank title='Hello Dolly plugin' href='https:\/\/wordpress.org\/plugins\/hello-dolly\/'>Hello Dolly plugin<\/a><\/li>\n<\/ul>\n<p> &#8230; and we think you should read &#8230;<\/p>\n<ul>\n<li><a target=_blank title='WordPress Codex Hooks' href='https:\/\/developer.wordpress.org\/reference\/hooks\/'>Hooks<\/a><\/li>\n<li><a target=_blank title='WordPress Codex Actions' href='https:\/\/codex.wordpress.org\/Glossary#Action'>Actions<\/a><\/li>\n<li><a target=_blank title='WordPress Codex Filters' href='https:\/\/codex.wordpress.org\/Glossary#Filter'>Filters<\/a><\/li>\n<li><a target=_blank title='WordPress Codex Pluggable Functions' href='https:\/\/codex.wordpress.org\/Plugin_API#Pluggable_Functions'>Pluggable Functions<\/a><\/li>\n<li><a target=_blank title='WordPress Codex Plugins directory' href='https:\/\/codex.wordpress.org\/Function_Reference\/plugin_dir_url'><b>Plugins directory<\/b><\/a><\/li>\n<\/ul>\n<p>For us, with our very simple <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-content\/plugins\/rjmprogramming-wikipedia-lookup.php_GETME\">rjmprogramming-wikipedia-lookup.php<\/a> plugin, we only needed the one piece of PHP to sit in the current WordPress <b>wp-content\/plugins<\/b> directory, and then immediately be accessible to the WordPress blog admin area\u2019s Plugins -&gt; Activate option &#8230;<\/p>\n<p><code><br \/>\n&lt;?php<br \/>\n\/**<br \/>\n * @package Rjmprogramming_Wikipedia_Lookup<br \/>\n * @version 1.6<br \/>\n *\/<br \/>\n\/*<br \/>\nPlugin Name: Rjmprogramming Wikipedia Lookup<br \/>\nDescription: Float a Wikipedia lookup link for highlighted text of an admin webpage.<br \/>\nAuthor: Robert James Metcalfe<br \/>\nVersion: 1.6<br \/>\nAuthor URI: http:\/\/www.rjmprogramming.com.au\/<br \/>\n*\/<br \/>\n<br \/>\n\/\/ This creates the Wikipedia lookup hyperlink<br \/>\nfunction rjmprogramming_wikipedia_lookup() {<br \/>\n\t$wikipedia_page = \"Wikipedia Main Page\";<br \/>\n\techo '&lt;a target=\"_blank\" title=\"Wikipedia lookup of ...\" onmouseover=\"var xsel=' .<br \/>\n\t  \"''\" . '; xsel=window.getSelection().toString(); if (xsel.length == 0) {' .<br \/>\n\t  ' xsel=document.selection.createRange().htmlText;' .<br \/>\n\t  ' } if (xsel.length != 0) { this.innerHTML=xsel; this.href=' . \"'\" . '\/\/wikipedia.org\/wiki\/' .<br \/>\n\t  \"'\" . ' + xsel.replace(\/\\ \/g,' . \"'\" . '_' . \"'\" . '); } \" ontouchstart=\"var xsel=' .<br \/>\n\t  '; xsel=window.getSelection().toString(); if (xsel.length == 0) {' .<br \/>\n\t  ' xsel=document.selection.createRange().htmlText; }' .<br \/>\n\t  ' if (xsel.length != 0) { this.innerHTML=xsel; this.href=' . \"'\" . '\/\/wikipedia.org\/wiki\/' . \"'\" .<br \/>\n\t  ' + xsel.replace(\/\\ \/g,' . \"'\" . '_' . \"'\" . '); } \" id=\"rjmprogramming_wikipedia_lookup\"' .<br \/>\n\t  ' href=\"\/\/wikipedia.org\/wiki\/Main_Page\"&gt;' . $wikipedia_page . '&lt;\/a&gt;';<br \/>\n}<br \/>\n<br \/>\n\/\/ Now we set that function up to execute when the admin_notices action is called<br \/>\nadd_action( 'admin_notices', 'rjmprogramming_wikipedia_lookup' );<br \/>\n<br \/>\n\/\/ We need some CSS to position the hyperlink<br \/>\nfunction rjmprogramming_wikipedia_css() {<br \/>\n\t\/\/ This makes sure that the positioning is also good for right-to-left languages<br \/>\n\t$x = is_rtl() ? 'left' : 'right';<br \/>\n<br \/>\n\techo \"<br \/>\n\t&lt;style type='text\/css'&gt;<br \/>\n\t#rjmprogramming_wikipedia_lookup {<br \/>\n\t\tfloat: $x;<br \/>\n\t\tpadding-$x: 15px;<br \/>\n\t\tpadding-top: 5px;<br \/>\n\t\tmargin: 0;<br \/>\n\t\tfont-size: 11px;<br \/>\n\t}<br \/>\n\t&lt;\/style&gt;<br \/>\n\t\";<br \/>\n}<br \/>\n<br \/>\nadd_action( 'admin_footer', 'rjmprogramming_wikipedia_css' );<br \/>\n<br \/>\n?&gt;<br \/>\n<\/code><\/p>\n<p>We hope this is of interest to you.<\/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='#d43582' onclick='var dv=document.getElementById(\"d43582\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/plugin\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d43582' 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='#d43592' onclick='var dv=document.getElementById(\"d43592\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/highlight\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d43592' 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='#d43618' onclick='var dv=document.getElementById(\"d43618\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/php\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d43618' 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='#d43694' onclick='var dv=document.getElementById(\"d43694\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/cookies\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d43694' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The recent WordPress Highlight Lookups Plugin Tutorial presented a static 8 option list of absolute URLs to navigate to, nuanced by the highlighted text of the user on a webpage of this blog. Our aim today is to loosen that &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-highlight-lookups-plugin-cookies-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":[12,14,37],"tags":[151,174,1860,264,2349,2736,2101,932,956,997,2024,1254,1319,1324,1325,1456],"class_list":["post-43694","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-blog","tag-button","tag-cookie","tag-cookies","tag-highlight","tag-http-cookie","tag-intersession","tag-php","tag-plugin","tag-programming","tag-session","tag-text","tag-tutorial","tag-twentyten","tag-twentyten-theme","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/43694"}],"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=43694"}],"version-history":[{"count":5,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/43694\/revisions"}],"predecessor-version":[{"id":44114,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/43694\/revisions\/44114"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=43694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=43694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=43694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}