Singpolyma

Archive for January, 2006

Archive for January, 2006

XOXO Blog Templates

Posted on

This is a list of all known XOXO Blog Format (and hAtom) compatible blog templates. Hackers/designers are encouraged to improve on them, but please try to keep them Valid XOXO. I would also ask that new templates/template improvements be sent back to me so I can list them here for others to use.

See notes on Blogger and hAtom.

New Blogger

  • Singpolyma Templates for the new Blogger — A set of New Blogger templates that are all XOXO Blog Format (and hAtom) compatible and have anywhere from no extra features to larger hacks implemented on them.

Blogger Classic

  • Singpolyma Templates — A set of Blogger Classic templates that are all XOXO Blog Format (and hAtom) compatible and have anywhere from no extra features to larger hacks implemented on them.

New Inline Comments Form

Posted on

See this page for a similar hack for the new version of Blogger.

This hack does not work with Blogger BETA.

After considerable use and some feedback from both users and implementors I have redone my inline comments form hack. The new hack should be simpler, cleaner, and XHTML-valid. Previous implementors will have to remove the old hack before continuing.

You might also wish to check out the asynchronous version of this hack 🙂

This hack is now coComment-compatible.

  1. Word verification for comments must be turned off (to do this go to the ‘comments’ tab in your blog settings, scroll to ‘Show word verification for comments?’ and select ‘No’)
  2. Turn comment posting by anonymous users on (to do this go to the ‘comments’ tab in your blog settings, scroll to ‘Who Can Comment?’ and select ‘Anyone’)
  3. Insert the following code into the <head> section of your blog template :
    <script type=”text/javascript”>
    //<![CDATA[

    function toggleitem(postid,linkid,newtxt,displaytype) {
    if(!displaytype) {displaytype = ‘block’;}
    var whichpost = document.getElementById(postid);
    if (whichpost.style.display != “none”) {
    whichpost.style.display = “none”;
    } else {
    whichpost.style.display = displaytype;
    }
    if(linkid) {
    var lnk = document.getElementById(linkid);
    lnk.href = “javascript:toggleitem(‘”+postid+”‘,'”+linkid+”‘,'”+lnk.innerHTML+”‘);”;
    lnk.innerHTML = newtxt;
    }
    }

    //]]>
    </script>

  4. Replace the <$BlogItemCreate$> tag with the following code:
    <!– COMMENT FORM –>
    <ItemPage>
    <script type=”text/javascript”>

    var blogTool = “Blogger”;
    var blogURL = “<$BlogURL$>/”;
    var blogTitle = “<$BlogTitle$>”;
    var postURL = “<$BlogItemPermalinkUrl$>”;
    var postTitle = “<BlogItemTitle><$BlogItemTitle$></BlogItemTitle>”;
    var commentAuthorFieldName = “anonName”;
    var commentAuthorLoggedIn = “false”;
    var commentFormID = “cformtag<$BlogItemNumber$>”;
    var commentTextFieldName = “postBody”;
    var commentButtonName = “post”;
    var cocomment_force = false;

    </script>

    <script type=”text/javascript” src=”http://www.cocomment.com/js/cocomment.js </script>
    </ItemPage>
    <ItemPage><a href=”javascript:toggleitem(‘cform’);”>Post a Comment</a>
    <div style=”display:block;” id=”cform”></ItemPage>
    <MainOrArchivePage><a href=”javascript:toggleitem(‘cform<$BlogItemNumber$>’);”>Post a Comment</a>
    <div style=”display:none;” id=”cform<$BlogItemNumber$>”></MainOrArchivePage>
    <form action=”http://www.blogger.com/login-comment.do onsubmit=”isSubmit=true;” method=”post”><div>
    <input type=”hidden” name=”blogID” value=”<$BlogID$>” />
    <input type=”hidden” name=”postID” value=”<$BlogItemNumber$>” />
    <div>
    <h2 class=”sidebar-title form-title”><label class=”cbody”>Leave your comment </label></h2>
    <h2 class=”sidebar-title”> You can use some HTML tags, such as <b> &lt;b&gt;, &lt;i&gt;, &lt;a&gt; </b> </h2>
    <textarea name=”postBody” class=”comment” rows=”8″ cols=”40″></textarea>
    <h2 class=”sidebar-title identity”> Choose an identity </h2>
    <div>
    <div>
    <input type=”radio” name=”iden” value=”Blogger” checked=”checked” onchange=”toggleitem(‘cfo<$BlogItemNumber$>’);” />
    <label> Your Blogger display name </label>
    </div>
    <div>
    <input type=”radio” name=”iden” value=”Other” onchange=”toggleitem(‘cfo<$BlogItemNumber$>’);” />
    <label>Other</label>
    <div style=”display:none;” id=”cfo<$BlogItemNumber$>”>
    <table style=”margin-left: 4em;” cellpadding=”0″ cellspacing=”0″>
    <tr> <td colspan=”2″ style=”padding-top:.4em;position:relative;left:-4em;” align=”left”> These fields are optional, but I would appreciate it if you filled them out. </td></tr>
    <tr> <td> <label> Name </label> </td>
    <td> <div class=”errorbox-good”> <input type=”text” name=”anonName” value=”” maxlength=”100″ class=”text” /> </div> </td> </tr>
    <tr> <td> <label> Your web page </label> </td>
    <td> <div class=”errorbox-good”> <input type=”text” name=”anonURL” value=”” maxlength=”100″ class=”text” /> </div> </td> </tr>
    </table>
    </div>
    </div>
    <div class=”diff-user”> Or you can sign in <a href=”http://www.blogger.com/login.g?r=http%3A%2F%2Fwww.blogger.com%2Fcomment.g%3FblogID%3D;$BlogID$>%26postID%3D<$BlogItemNumber$>”> as a different user</a>.</div>
    </div>
    </div>
    <div class=”errorbox-good”> </div>
    <p class=”buttons”>
    <input style=”margin-right:.3em” name=”post” value=”Publish Your Comment” class=”publish” onclick=”isSubmit=true;” type=”submit” tabindex=”2″ />
    <input value=”Preview” type=”submit” name=”preview” onclick=”isSubmit=true;” tabindex=”3″ />
    </p>
    </div></form>
    </div>
    <!– END COMMENT FORM –>

  5. Save your template and republish your blog

XOXO Developer’s Resources

Posted on

This is a collection of code resources and APIs for developers looking to work with XOXO in their scripts/applications. There isn’t much here yet, but the list will grow over time.

PHP
On some of these, the comments may state that attributes of the first node are considered to be metadata for the entire outline. This is actually up to the developer and the format of XOXO being parsed as there is nothing in the code to facilitate/enforce it.

  • Outline Classes [GPL] — A set of PHP4 and PHP5 comatible classes for both parseing and creating outline data, including XOXO, OPML, hAtom, JSON, and arbitrary XML.

The following, deprecated APIs, have been replaced by the Outline Classes

  • xoxo2array [GPL] — pass in any string containing XOXO data and it will return a nested array of the results. String indexes are considered attributes, numeric indexes are subnodes.
  • array2xoxo [GPL] — takes an array of the type returned by xoxo2array and returns an XOXO string of the data. It will also work with simple arrays.
  • There are also other APIs for working with this array type (for conversion purposes, etc)

Python

Java

  • XOXOWriter.java [Apache 2.0] — Contains two (overloaded) functions, makeXOXO and toXOXO, that create XOXO data from Lists and create XOXO documents from XOXO data, respectively
  • XOXOParser.java [Apache 2.0] — Contains a class definition for objects that parse XOXO data into themselves

! HAPPY NEW YEAR !

Posted on

How was your’n? Stayed up allll the night did we. The whole station (which now consists of Bromans, us, and Aunt Metchtild — hoyts coming in for a week starting today, crosses too) and the Ezels got together in the dorm for an all nighter. We had pizza and pizza and LOTS of pizza (don’t ask me how many pieces I ate, I lost count), then snacked for the rest of the night (food keeps you awake). We played UNO Attack for quite awhile (hours and many rounds). It’s just like UNO — only with different special cards and a card-launcher instead of a draw pile (the card launcher sometimes launches 5 instead of the normal drawing one — ouch!). Then we watch The Incredibles, which, incidentally, is an awesome movie 😀 I had watched it (it’s mine, got for Christmas) with my family last week, but the Bromans and Ezels hadn’t seen it. Emme Ezel is soooooo cute 😀 I love babies, hehe, luvluvluv 😀 hmmm…. not much else going on around here — although there might be when the Hoyts get here this afternoon, one never does know.

There was actually something else I was going to say… but I forget what it was… besides that Dan had to go to NDJ with dad today for dental work (cavity he) and won’t be back for a week… I know there was something else…. ah, well… until next time 🙂