yahoo’s spreadsheet viewer

Ran across a fairly nasty bug in Yahoo’s spreadsheet viewer, the one that lets its users view excel and similar files. I had a file set up with a column of type time, in HH:MM:SS AM/PM format, and what it does with that is show them as 12 AM or 12 PM! I could not figure out why my co-hort (in organizing a seminar) was having such trouble confirming flight arrivals and departures until she showed me what she was doing.

So…if you’re using Yahoo to look at these files, be aware that it has at least this problem. Google’s spreadsheet viewer was fine, MS’s Excel was fine, and OOo’s spread sheet all were fine with this file. And Google and OOo are free (the former with a Google Account, that’s easy enough to sign up for).

So just passing along that warning. Also, sorry about the hiatus, it’s been absolutely crazy at work and then also with this seminar coming up. I should be picking up soon.

del.icio.us:yahoo's spreadsheet viewer  digg:yahoo's spreadsheet viewer

Comments (4)

notes on admin comment reply

OK, I think I’ve got a cut for the next release of Lorelle’s requested plugin. However, I have not had a chance to test this outside of my own system (where it seems to work fine), and so I would love to have any volunteers help check this out on different installations for anything I’ve overlooked.

The basic mechanics are as follows: I coded up a new link “Reply To” for each post, which you all saw in the last cut. In that one the link goes to the post page’s comment reply section, which at least cut out the intervening pages. At one point I realized the Reply To doesn’t need to be added for comments not yet approved (!) so I cleaned that up (see example).

Anyway, now the Reply To link (see example) opens up a small box with a submit button under the comment using javascript (see example). I added code to the edit-comment.php that now handles a submit query. Each “Reply To” opens up its own box/submit button for the owner’s (see example). On submission, it refreshes, staying on this comment management page (see example). Sorry, no ajaxy goodness at this step, perhaps at the next step if I can figure out how to hook into something similar as to what the approve/unapprove links are doing.

There are a few annoying points left, which I’m not entirely sure how addressable they are. For example, once you approve a post, you’ll need to refresh the page to get its Reply To link, since that part of the code is not hooked into the ajax that WP is using to do this. Ideally I’d like to tap into that, I’ll have to poke around some more. I also have a feeling I should be utilizing the Nonce security model as well.

If you’d like to test this out, please comment! I’d feel better if it were tested out on a few more sites before I release it out in the wild…

del.icio.us:notes on admin comment reply  digg:notes on admin comment reply

Comments (6)

creating another plugin: reply to from admin panel

Lorelle at Wordpress blogged about a plugin (or WordPress feature) she wants: the ability to reply directly to a comment from the Admin comments page. When I spotted that, I thought I’d give it a go, because it seems like a short and sweet plugin to have. My first concept of the design is to add a Reply To link that sends you directly to the proper spot on the post page to put in the reply. This does not resolve the “backing up” problem to return to the original Admin page; I will address that in a second version. For now the problem can be worked around simply by opening the reply to link in a new tab and then closing that tab when returning to the admin page. Since all the major browsers now have tab functionality, this seems reasonable.

However, as I looked through Wordpress’ structure, I realised that the anchor, or name for the post comment section of a post is dependent on the name that the theme’s author gave it. In other words, we don’t always know what the name/id of the reply form (comment form) is for a post in a given theme. Mine is #postcomment; the popular ones seemed to be #respond or some variation of #postcomment (including a #postComment). So the first step I need to take is to guarantee that, if a comment is allowed for the post in question, a particular anchor name exists. We’ll use this snippet to do that:


function add_admin_comment_reply_anchor() {
     <a name="admin_comment_reply_anchor"></a>
}
add_action('comment_form', 'add_admin_comment_reply_anchor');

I played around directly with the wp-admin/edit-comments.php file and confirmed that this works (provided the above anchor name exists):


<a href="<?php echo get_permalink($comment->comment_post_ID); ?>#admin_comment_reply_anchor" title="<?php echo $post_title; ?>"><?php _e('Reply to Post') ?></a> 

I tested this by directly editing my edit-comments.php file. Do not do this at home! This is for professionals only! :-) . My point in doing this was to be sure this approach would even work. There’s roadblocks ahead, though: testing this segment is how I realized that the theme is an issue, needing the above anchor hook. At this point, I’d like to note that it would be easy for WordPress to implement this: all they would need to do is add the automatic anchor as I did, and modify the base edit-comments.php file as above. But since we don’t have that, I’ll proceed with how to do the desired tweaking.

At this point, I looked at two existing plugins: Paged Comment Editing and Commenter Spy. I looked at Paged Comment Editing first since it seemed to be the most similar plugin: a plugin that somehow reworked the edit-comments.php. I was especially hoping to discover a useful WordPress hook to add the Reply To link.

But the more I looked through this plugin the less I liked the overall approach. The problem with it is two fold. First of all it’s directly incompatible with any other plugins that might affect edit-comments.php because it basically takes out edit-comments.php, and regenerates it itself. Second, this approach makes it a potential problem if there’s ever a security patch or even just plain upgrade from WordPress involving this file: the plugin will continue to put out the old code preserved within it. I don’t mean to come off completely criticizing this plugin because it’s very clever with how it reaches in and reworks the file. But I decided I didn’t really want to do it this way.

So it was back to Commenter Spy. This one’s not without its pitfalls either, of course. Since it uses javascript to modify the page output on the fly I had originally rejected it because it won’t work if the user has disabled javascript. However, javascript is ubiquitous enough it seems reasonable to use especially given the alternatives above. The premise of this plugin is as follows: Scan through the DOM of the given page, and do a regular expression substitution in order to sneak in the desired new link. So I put together the following snippets:

Define the desired text (and then escape it; since I’m localizing the term, I have no idea what this might become, so I protect it by escaping the text first).


        $admincommenttext = __('View Post');
        $eadmincommenttext = str_replace('/', '\/', preg_quote($admincommenttext));

Plus, define the Reply To to add in:


        $admincommentreply = __('Reply to Post');
        $eadmincommentreply = str_replace('/', '\/', preg_quote($admincommentreply));

Now define the regular expression to search on:


        $ViewPostBaseURLEscaped = "(<a[ \\n\\r]*href=\"([^\"]*)\"([^>]*)>$eadmincommenttext<\/a>)";

With these pieces in place, I can now use the following snippet of javascript:


<script type="text/javascript">
//<![CDATA[

        var links;
        links = document.getElementsByTagName('p');
        for (var i = 0; i < links.length; i++) {
                var curr;
                curr = links[i];
                curr.innerHTML = curr.innerHTML.replace(/<?php echo $ViewPostBaseURLEscaped; ?>/, "$1 | <a  href=\"$2#admin_comment_reply_anchor\" $3><?php echo $eadmincommentreply; ?></a>");
        }

//]]>
</script>

Now, to wrap this all up and to make sure it gets added into the output HTML of the proper page (edit-comments.php), I put the above code into a function called adminCommentReplyModifyViewPostURLs and hooked it in as follows:


/* activate only on correct page */
if (basename($_SERVER['SCRIPT_FILENAME']) === 'edit-comments.php')
{
        add_action('admin_footer', 'adminCommentReplyModifyViewPostURLs');
}

In the next version of this plugin, I would like to change the Reply To link to open up an inline text area for the reply which then adds it in properly, without ever leaving the page. However, I need to dig in more deeply to see how comments are added, so I’ve left this for a future improvement. It would also mean not seeing the full content of the comment being replied to although presumably the admin of the site has already seen that in the email notification. (Perhaps a button to expand the excerpt to a full version and back?)

You might be wondering how do I do this, how do I know what filters to apply, where to look. The answer is really I don’t. I do know that I can add in actions and filters, and I peruse the WordPress Codex site’s list of hooks for anything that looks like it might do the trick. I also browse the various files in the themes and in the wp-admin directories: I actually found the the comment form hook in the theme’s comment.php file. I also look for plugins that do something similar to what I want to do, or at least knock about in the same general area. In this case, I found two, one of which gave me the bulk of my material.

Thank god for GPL ;-)

OK, at this point, I’m using it on my installation and it seems to work. It is, however still fairly rough. I’ve got the download page set up here.

del.icio.us:creating another plugin: reply to from admin panel  digg:creating another plugin: reply to from admin panel

Comments (25)

playing with the new flickr options

Yesterday, flicker gave us two new shiny toys to play with. The big one, collections, has been in demand for a long time, and as a overactive set user, I’m very pleased to see that this is now available. The smaller one allows flickrites to change the layout of their entry page. The choice is fairly limited but I am certainly not complaining.

To change the layout of my “You” page, I went thru the menus: You->Your Account. There is now a new option added to allow me to pick out which layout I wanted. The choices are small images only, small images plus sets (the original default), small images plus collections, medium images only, medium images plus sets, or medium images plus collections. Since I promptly sorted all my sets into collections, I chose the small images plus collections option which worked a treat.

To create collections, use the Organizr. The “Sets” tab is now “Sets and Collections.” It’s all pretty intuitive to use: when I choose to create a new collection, all my sets are displayed to one side, and I can drag and drop (and reorder, etc) sets into the collection.

Sets use a particular picture within the set to create its visual identification; collections use a mosaic of nine pictures to create its visual identification. I believe there are still some bugs with creating the mosaic representations. In several cases, the mosaic insisted on using pictures from one particular set within the collection, instead of a nicely distributed random set. In one case, the pictures chosen are from a set not even in the collection!

Collections are not available to free flickr accounts. This makes sense as free accounts are also limited in the number of sets they can create, as well. However, choosing different layouts is available, with the small/medium pictures + collections options omitted.

The announcement of the new features are up at Flickr’s Blog.

del.icio.us:playing with the new flickr options  digg:playing with the new flickr options

Comments (1)

tinkering with gmail

I should say I was a long time holdout in reading my email on a shell (unix) account. After all, all of the key features being touted on the new web based or GUI based mail readers were available twenty years ago in programs like MH (now nmh) and filters such as Procmail, both programmable and endlessly customizable. I could do back flips and front aerials with my mail while the current crop were oozing their way out of the primordial sludge.

But, I have grudgingly entered the present day world, as Gmail (and Thunderbird, but that’s another topic) have made pretty good gains and I’m not yet prepared to set up my own personal mail server on my own linux box just in order to keep using a text based set of programs which admittedly don’t handle some things such as pictures all that cleanly (although that also meant that I basically never got email viruses).

Gmail Account

For the first three years, Gmail was invite only. Now it’s open to all. Of course, all the good names have been taken ;-)

Security

First of all, for any kind of web browsing of a relatively personal nature, I recommend making sure the session stays within https connections. In grossly simple terms, the “s” on https means the connection is secured from eavesdropping. One simple way to do this is to log in on Gmail from this address: https://mail.google.com which should thereafter retain the secure connection. I like to be absolutely sure of this, though, so on Firefox, I use a simple Greasemonkey script called GmailSecure to enforce the https connection. (It’s also extensible to force secure connections on an array of google related items.) Sorry Opera, IE, or Safari users, I couldn’t find comparable extensions for this (though an Opera widget called Gmail Checker has a feature request for this.

Second of all, as tempting as it might be to aggregate all new items into a feed reader for convenience, do NOT use a public web accessible reader such as Bloglines or GoogleReader to do so! These subscriptions become generally searchable on either service and while the full message can not be displayed, there’s chances that the excerpt will contain enough private information that can be viewed. I came across this security hole last year, and on re-checking Bloglines, I can still find gmail feeds hosted there. I’m at a loss as to why a feed is even offered in Gmail (or at least why not make it an option in the settings and default it off for security?) but since neither Gmail nor Bloglines have taken concrete steps in addressing this issue, I’ll put this warning down. Just don’t do RSS feeds of private email, and if you do, don’t use a public RSS reader to access them — use a personal one on a particular computer for the purpose. Oh, you wanted to be able to access the feed anywhere on the net? Then use Gmail’s web interface already, that’s what it’s for.

Notifications

There’s several ways to have Gmail notifications setup. Gmail itself provides small applets for Windows/Mac. The open source community has created an equivalent for Linux called CheckGmail (which is now available with some distributions, such as Ubuntu, so check the package managers first).

Opera and Firefox have various different widgets and extensions that provide notification. I use the Firefox Gmail Manager which has its own notification system besides much more: see below. Opera’s Gmail Checker is a small and simple widget solely for this purpose. I did not find any for Safari or IE on cursory check.

Favorite Firefox <-> Gmail Extensions

As a Firefox user, I like to search around at Firefox Add-ons for useful extensions. The ones I use are:

  • Gmail Manager This is an essential script to handle multiple Gmail accounts. A small notification in the bottom tray of Firefox can be configured to display the current number of unread messages in the mailbox as well as a way to simply log into each account, with minimal switching around.

  • Gmail Skins Fun to play with; note that some of the choices result in error messages, just uninstall, reinstall and choose a different theme.

  • And of course I use the Firefox extension Greasemonkey. Saved Searches gives me dynamic folders, pretty useful. Hide Gmail Ads allows me to regain valuable real estate on my laptop where every centimeter counts.

Tips and Tricks

  • Use a draft message (start a message and then save it rather than send it anywhere) to do quick file transfers between computers. I save the item into a draft on one computer, and pull it out from my login on another computer. It’s more convenient than emailing it to myself, and few home computers have a permanent IP address for ftp transfer and the like.

  • I also use the drafts for “Notes to self” on particular emails. Sometimes I want to remind myself of things related to an email, and drafts attached to that email serve as a form of post-it notes.

  • Sort everything! Any mailing lists should be slapped with a label and archived. This way I browse mailing lists at my leisure and I’m not distracted by constant incoming email. The only thing that should be popping up in my mail account are important things that I need to attend to relatively quickly. Gmail does provide pretty good filtering and labeling and other options for incoming email.

  • Use the + feature in email addresses. The definition of mailing protocol means that addresses of the form somewhere+identifier@somedomain should be delivered t somewhere@somedomain . Not all mail providers adhere to this, but gmail does, and this can be a trick to sort incoming email from different sources. For example, when I’m forced to use my email address for something that I suspect will spam me later, I can use something like myemail+nyt@gmail.com to see. Since Gmail has reasonable filters, this is perhaps not as useful as it might have been at the start.

  • Google itself lists several pretty cool Gmail related Greasemonkey scripts here; they’re all well worth looking at.

  • There’s plenty of creative ways to divert items to Gmail: feeds can be sent via email through Feedster or Feedburner; that way I could if I chose have a daily weather forecast or my current to-do list emailed to me.

What would I like to see?

Gmail allows multiple email addresses to be forwarded to it, and to “reply” as those emails. However, those emails are still marked in the headers as originating from that particular gmail account. I would like to see it anonymized down to at least only knowing it’s routed through Gmail. Since the extra email addresses in question are verified before being added to Gmail’s list of alternate addresses, I don’t see why that can’t be offered.

Yes, a short list. Well, if it were longer, I wouldn’t be using Gmail in the first place ;-) Most of the time if I want a feature, I can find an extension of some type for it.

Miscellaneous Issues

One of the most annoying consequences of Google having assimilated Blogger is the effect it had on Blogger accounts versus Gmail accounts. I have a different “identity” on Blogger that’s well established, but not connected to my Gmail. Now, both accounts were retained in the merger, but they do not play well together. If I am logged into my Gmail when I encounter a Blogger post I wish to respond to, and I log in my old Blogger account, it logs me out of Gmail. I have not found a good way around this, although I have discovered that logging back to the original Gmail account often leaves the Blogger login available on other Blogger entries that I might respond to.

del.icio.us:tinkering with gmail  digg:tinkering with gmail

Comments (1)

« Previous entries Next Page » Next Page »

Bad Behavior has blocked 288 access attempts in the last 7 days.