REM State

10 Feb

3.1.0 Beta 4 Beta 5

And to make up for the late post today, here’s another release. :)

This release integrates the fix for bug 37 that just went into 3.0.12, and also fixes bug 34, which is probably more important to the IE7-users in the crowd. I still think that IE’s behavior is broken, but my code will work both ways now regardless.

Edited to add…

I botched beta 4; it works fine in IE7, but not in Firefox because of a stupid little mistake. I’ve fixed the problem and tagged a new release. Sorry for the false start!

Download In Series 3.1.0 Beta 5.

9 Responses to “3.1.0 Beta 4 Beta 5”

  1. AvatarAlan
    1

    when there is no series, you want the widget to return without printing anything.

    so amend widget_series_toc function as

    if(!empty($toc) && is_single()) {
    $output = $args['before_widget'];
    $output .= $args['before_title'] . $options['title'] . $args['after_title'];
    $output .= $toc;
    $output .= $args['after_widget'];
    }
    echo $output;

    Reply to this comment.
  2. AvatarQuandary
    2
    Author Comment

    Nope, the current code is exactly correct. The before/after_widget text needs to be output even if there is no ToC to be printed; otherwise, the final HTML output may be broken (specifically, if the ToC widget is the only widget in the sidebar, you’ll get <ul></ul>, which won’t pass validation). Thanks, though. ;)

    Reply to this comment.
  3. AvatarIskwew
    3

    Hi and thanks for a neat plugin. I downloaded the previous version, though. But here are som thoughts on what you might put into the next version:

    1. Series on pages. What would be nice is to have a static page for each series, with just the table of content and some comments.

    2. A table of content page which should be numbered 0, since it is not part of the actual series.

    3. Posibility to add some posts which are related to the series, but more like appendixes, or material for further reading.

    Regards,
    Iskwew

    Reply to this comment.
  4. AvatarQuandary
    4
    Author Comment

    The first item you mentioned is covered by bug 29. The second and third items probably are a single feature, i.e., “related posts” that aren’t actually part of the content of the series proper. It’s a valid ask, but I’m going to have to ponder on what a good author experience would look like, as well as what a good reader experience would be. I’ve filed bug 39 to cover this.

    Thanks!

    Reply to this comment.
  5. AvatarSteve
    5

    Re: Alan’s post about the widget.

    I understand where he’s coming from. I’ve built several themes with boxes, borders, whatever, around sidebar widgets. If the widget shows up and is empty, it looks ugly.

    Unfortunately, you can’t depend on users being intelligent enough to not put the widget in until there’s a series.

    So - conditionally register the widget and its control. If there is no series, there is no widget.

    BTW - great work on this. I used the earlier one but abandoned it because it didn’t work as expected and I didn’t have time to screw with it. Thanks for picking up the ball and running with this. It’s a good plugin and more useful than the rest.

    Reply to this comment.
  6. AvatarQuandary
    6
    Author Comment

    Hey Steve,

    I prefer to blame the system for being stupid before blaming users. ;)

    Conditional registration is a thought that had not occurred to me, and it’s a novel idea, but I think it could be confusing and potentially harmful. Specifically, I can envision:

    • Users reporting the fact that the widget is not available as a bug
    • Users not using the series widget, because it’s not immediately available after installation
    • Users creating a series, adding the widget, then deciding they didn’t want that series… at which point, we’re in a broken state (unregistered widget on the sidebar).

    What I can do is make it so that the widget will still output its header, even when there’s no content. Given the header, I think that most folks will know “hey, that spot’s empty because I don’t have any series yet; maybe I should go write one, or take that widget out.” :)

    Reply to this comment.
  7. AvatarSteve
    7

    Right you are…you have different considerations when writing a plugin for general consumption vs. a custom, like I usually do.

    BTW, if the series went away, so would the widget registration so your point #3 shouldn’t be a problem. The widget would disappear, although all the options would still be in the db - much the same as deactivating a plugin without removing the widget first.

    The other two reasons, though, are enough arguments against doing it as I suggested.

    And duh - having a blank sidebar widget would certainly be an indication to take it out, wouldn’t it? LOL

    Another BTW - if you use the get_args($args) function, you have available all of the arguments as vars, i.e., $before_widget, $before_title, etc. rather than having to get them from the array. Just a little easier, IMHO.

    Reply to this comment.
  8. AvatarQuandary
    8
    Author Comment

    BTW, if the series went away, so would the widget registration so your point #3 shouldn’t be a problem. The widget would disappear, although all the options would still be in the db - much the same as deactivating a plugin without removing the widget first.

    Eeeeh… I’d have to test that. The scenario I’m envisioning is that the user has only the Series List widget installed, and then removes their only post… then their sidebar either reverts to the default (and stays that way), or switches between the default sidebar and the custom/widget sidebar (depending on if they add a new series). You may very well be technically correct; in any case, I have to commend you for a very interesting way to solve the problem. :)

    Another BTW - if you use the get_args($args) function, you have available all of the arguments as vars, i.e., $before_widget, $before_title, etc. rather than having to get them from the array. Just a little easier, IMHO.

    get_args() isn’t a PHP or WordPress-defined function; I assume you mean extract($args). I concur that explicit array references are not as pretty as nice, succinct variable references. However, from a clarity and defensive coding standpoint, I much prefer explicit array references. Specifically, someone reading the code knows where the variable came from (clarity), and you won’t accidentally overwrite your local variables if your caller decides to add new values to the array (security). Yes, you can tell extract() to not clobber existing variables (it’s not the default), but you still pollute your namespace — as soon as some schmuck decides to use an uninitialized variable, you have a potential vulnerability in your code. :)

    I really appreciate you taking the time to go through the code base and give your thoughts; please feel free to get in touch with me via e-mail if you’d like to discuss anything else. I can always use more help!

    Reply to this comment.
  9. AvatarAlan
    9

    Just so you know where i was coming from, the vast majority of posts on the blog i run are not in a series - but for the series we DO have, it is important to have a ToC. An empty ToC widget does mess things up though. Fortunately i’ve written my own plugin that allows me to show the widget only when

    is_single() && InSeries::adv_CurrentSeries($post->ID)

    Cheers for the plugin - wouldn’t be without it.

    Reply to this comment.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Comment Preview:

© 2008 REM State | Entries (RSS) and Comments (RSS)

Global Positioning System Gazettewordpress logo