Chyrp v2.0 RC3 out!

The third release candidate for v2.0 is out. Download here. As usual, read the README for upgrading instructions if you don’t know them already. (tl;dr: disable modules, overwrite junk, run upgrade.php, enable modules, run upgrade.php again.)

What’s new?

  • Stronger Model backend. Implemented has_many, belongs_to, and has_one relations between models. This is done using the magic get PHP method. So, for example, $visitor->group()->name is now $visitor->group->name. The previous method is maintained for backwards compatibility, but will be removed after 2.0 goes final.

  • Added a paginate Twig block syntax, for paginating over arrays or arrays of placeholder‘d Models.

    Usage:

    {% paginate loopvar in perpage source as targarvar %}

$loopvar.title

{% endpaginate %}

  • loopvar is the variable used within the paginate loop.

  • perpage is how many per page.

  • source is the source array.

  • targetvar is the var to set in the main scope, e.g. $targetvar.next_link

    • Enhanced keyword searching:
  • Searching post attributes, e.g. name:Google for searching for a link named “Google”

  • Multi-word searches, e.g. source:"Albert Einstein"

    • Rewrote the Tagginator module to use the post_attributes table and YAML.
  • You can also view posts by multiple tags, e.g. http://example.com/tag/tag1+tag2+tag3/.

    • Comments module now uses the has_many Model relationship with Post.

    • Added a list_notate function that turns an array into "foo", "bar", and "baz".

    • Replaced our truncate function with the one from CakePHP, which auto-closes HTML tags. Woo!

    • Added standard markup_title and markup_text filters.

    • Added an extensible email function that serves as a mail fallback.

    • Added a now helper that acts as a mask to strtotime, for hotness like now("+1 day").

    • Added a relative_time helper, for things like 10 hours ago. Goes up to millenia. Just in case.

There were also a lot of fixes in this release. I’m not going to list those though, for the sake of my sanity and time. If something was broken for you before and it works now, well, there you go.

I broke my promise of not adding things in this RC again, but as they’re all completely backwards-compatible, I hope you can forgive me. :)

With this RC everything on my to-do list and every Lighthouse ticket is now closed. As such, this should be a much more traditional RC in that no more major features will be added. I’m now working on the new site.