Landing Page WordPress Tags Primer Tutorial

Landing Page WordPress Tags Primer Tutorial

Landing Page WordPress Tags Primer Tutorial

We’re hooking into our crontab/curl PHP overnight arrangements regarding Recent Posts to add in …

  • a once a day creation of a web server “tag cloud” HTML file … derived via …
  • WordPress blog widget “Tags” content

… that creates on the RJM Programming “Landing Page” a toggling arrangement between …

  • this new “tag cloud” content in an iframe “onload” event populating of a global variable divtc … within the Landing Page Javascript …

    var divtc='';

    function anticheckd(iois) {
    document.getElementById('divtagcloud').innerHTML='';
    }

    function checkd(iois) {
    if (iois != null) {
    var aconto = (iois.contentWindow || iois.contentDocument);
    if (aconto != null) {
    if (aconto.document) { aconto = aconto.document; }
    if (aconto.body != null) {
    divtc=aconto.body.innerHTML;
    if (divtc.indexOf(' class="tagcloud"') != -1) {
    setTimeout(divtctoggler, 8000);
    } else {
    document.getElementById('divtagcloud').innerHTML='';
    }
    }
    }
    }
    }

    function divtctoggler() {
    if (divtc != '') {
    if (document.getElementById('divtagcloud').innerHTML == '' || document.getElementById('divtagcloud').innerHTML.indexOf('<iframe ') != -1) {
    document.getElementById('topi').style.display='none';
    document.getElementById('divtagcloud').style.transformOrigin="30% 10%"; //zoom="0.75";
    document.getElementById('divtagcloud').style.transform="scale(0.5)"; //zoom="0.75";
    document.getElementById('divtagcloud').innerHTML=divtc;
    } else {
    document.getElementById('divtagcloud').innerHTML='';
    document.getElementById('topi').style.display='block';
    }
    setTimeout(divtctoggler, 15000);
    }
    }

    … supporting the new HTML …

    <div id=divtagcloud><iframe style='display:none;' onerror='anticheckd(this);' onload='checkd(this);' src='//www.rjmprogramming.com.au/PHP/divtagcloud.html'></iframe></div>

    … with …
  • existing Google Chart Pie Chart example of use

… in its “div widget” within the Landing Page HTML. As far as the crontab/curl PHP goes the changed recent-posts-2.php does its job of populating …

… via …

<?php

$classtagcloud=file_get_contents("//www.rjmprogramming.com.au/ITblog/?p=14234");
$classtags=explode('<div class="tagcloud"', str_replace("http:","",str_replace("https:","",$classtagcloud)));
if (sizeof($classtags) > 1) {
file_put_contents(dirname(__FILE__) . '/divtagcloud.html', str_replace('<a ','<a target=_blank ','<html><body><div class="tagcloud"' . explode('</div>', $classtags[1])[0] . '</div></body></html>'));
}

?>

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Tutorials and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>