Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Forum: Plugins
    In reply to: What does PHP colon (:) do?

    It is also used in a Ternary Operator.

    I personally love ternary operators. They are a little harder to understand at first (at least compared to a simple if-then-else snippet) but they are a great way to cut down some bloat. Example:

    <?php

    echo ($answer ? "blue" : "green");

    //is the same as

    if($answer)
    {
    echo "blue";
    }
    else
    {
    echo "green";
    }

    ?>

    Live Preview will not work when a user is delivered ‘true’ XHMTL (ie. application/xhtml+xml not text/html).

    That is due to the fact that .innerHTML will not work in an XML document.

    Forum: Plugins
    In reply to: Comments: Live Preview

    does it validate?

    Short answer: Yes it does. However, it is valid HTML 4.01 and nothing more.

    Sure you can simply change your doctype to “XHTML 1.0/1.1/whatever”, but the reality is that your browser will not render your pages any different than if it were to have a DOCTYPE of HTML 4.01. For true XHTML to be parsed, a browser must be delivered a Content-Type of application/xhtml+xml. (And no, simply putting content=”application/xhtml+xml; in your meta does not do that.)

    https://www.mozilla.org/docs/web-developer/faq.html#xhtmldiff

    The problem (well it is not really a problem a such – at least outside of XML) with this plugin is that .innerHTML is not a valid DOM attribute in XML documents. Try delivering your pages as ‘true’ XHTML and I guarantee the comment preview will not work. By ‘True XHTML’, I mean pages with not only the correct DOCTYPE, but also the correct Content-Type as delivered by the web server. (This of course only applies to browsers that actually utilise valid XML parsers – i.e. Gecko-based browsers such as mozilla/firefox/galeon/epiphany etc. Otherwise the page will be rendered as ‘tag soup’ anyway.)

    This, of course, should not take anything away from this plugin whatsoever. It is just that I see so many people aiming for XHTML complaince, when in essence all they are really delivering is ‘pretty’ HTML which doesn’t alter the actual parsing of the document in any way.

    movabletripe

    (@movabletripe)

    I have been trying to get this to work myself. I can get it to generate the feeds properly by manually editing the various php feed files to include a few $SERVER[‘PHPSELF’] variables called around the place, but I really don’t want to deviate too far from the original WordPress core in order to future-proof myself.

    Any ideas from the dev team on this one? Or is there a way to over-ride the default bloginfo_rss() function from elsewhere in order to maintain a virgin WordPress installation?

    Adam.
    movabletripe.com

    Forum: Plugins
    In reply to: Google AutoLink
    movabletripe

    (@movabletripe)

    Well I did a similar thing yesterday when I discovered that code, so great minds think alike hey ?? Although I made a few improvements to the javascript, such as making sure the code validates as XHTML 1.1 compliant etc.

    I also made the plugin into one small file. Just upload and activate.

    You can get it from here:

    De-Google WordPress Plugin

    As per usual, no warranties as to its effectiveness, but if you feel like using it, go right ahead.

    Adam.
    movabletripe.com

    I have just made a small change. If no bullet is specified, I was getting stray characters at the start of each list item from the variable $bullet, like:

    &; somelink here

    Simple fix: strip the ‘ & ‘ and ‘ ; ‘ characters from the variable $response like so:

    $pattern[0] = "/div/";
    $pattern[1] = "/\&$bullet\;/";
    $replace[0] = "li";
    $replace[1] = "";
    $response = preg_replace ( $pattern,
    $replace, $response );

    Now all is good in the semantic web ??

Viewing 6 replies - 1 through 6 (of 6 total)