July 02
- at 10:43 AM
Chyrp 2.0 final(ly) released!
After months (over a year?) of blood, sweat and the occasional tears (of joy), Chyrp v2.0 final is finally released. To commemorate such a huge release, we have a brand new site written entirely in Chyrp itself - it turns out Chyrp makes a fantastic general-purpose web framework. Huh. The Extend, Discuss, and Progress sections are just modules. Neat, eh?
I’d provide a changelog for this release but it would probably be long enough to fill your hard drive with your browser cache. So, head on Home and either try out a fresh-baked demo or head over to Download to grab it.
A big thank you to everyone who tested the release candidates, betas, and the git repository and reported bugs - this simply could not have happened without you guys.
If you’re not already there, chill out in #chyrp @ irc.freenode.net. All the cool kids are there.
P.S. No images are used on this site, not even the header. For some reason I’m especially proud of that.
June 28
- at 01:03 PM
Little big update
If all goes to plan, Chyrp 2.0 as well as the new site will launch next month.
February 12
- at 01:40 PM
Little update
Version 2.0 is in its final stages, but I’m planning the release to coincide with a new site. When they’re both done they’ll both be released to the masses.
If you’re impatient, feel free to just use the current git repository. Once the site is done that’s where the release will come from, and it’s generally more stable than official releases anyway. It’s not as glamorous as a big pretty 2.0 stamp but it works.
November 01
- at 11:16 AM
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
getPHP method. So, for example,$visitor->group()->nameis now$visitor->group->name. The previous method is maintained for backwards compatibility, but will be removed after 2.0 goes final.Added a
paginateTwig block syntax, for paginating over arrays or arrays ofplaceholder‘d Models.Usage:
{% paginate loopvar in perpage source as targarvar %}
$loopvar.title
{% endpaginate %}
loopvaris the variable used within the paginate loop.perpageis how many per page.sourceis the source array.targetvaris the var to set in the main scope, e.g.$targetvar.next_link- Enhanced keyword searching:
Searching post attributes, e.g.
name:Googlefor searching for a link named “Google”Multi-word searches, e.g.
source:"Albert Einstein"- Rewrote the Tagginator module to use the
post_attributestable and YAML.
- Rewrote the Tagginator module to use the
You can also view posts by multiple tags, e.g.
http://example.com/tag/tag1+tag2+tag3/.Comments module now uses the
has_manyModel relationship with Post.Added a
list_notatefunction that turns an array into"foo", "bar", and "baz".Replaced our
truncatefunction with the one from CakePHP, which auto-closes HTML tags. Woo!Added standard
markup_titleandmarkup_textfilters.Added an extensible
emailfunction that serves as amailfallback.Added a
nowhelper that acts as a mask tostrtotime, for hotness likenow("+1 day").Added a
relative_timehelper, for things like10 hours ago. Goes up tomillenia. 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.
October 12
- at 03:14 PM
Chyrp v2.0 RC2 released!
The second release candidate of Chyrp v2.0 is out now.
A crapton of things have changed between RC1 and now, which technically shouldn’t have been done since it was an RC, but I felt they needed to be addressed and fixed before 2.0 was out. I believe the backend has improved 20-fold. See the README.markdown file for information on upgrading. Users of RC1 will have to run the upgrader as well.
What’s new?
A stronger Route <=> Controller <=> View relationship model.
A smarter Route system of determining which route should be used. Controller callbacks return false if they result in failure and should be chosen at a low priority, allowing the next action to be attempted. The first one that doesn’t return false or the last one attempted will be chosen.
Post attributes and group permissions no longer store XML and YAML in the database.
Group permissions are stored in the “permissions” table, which has been modified to add a group_id column. Stock permissions are stored with a group_id of 0.
Post attributes are now stored in a post_attributes table and grabbed via a SQL LEFT JOIN. This makes searching for posts much more accurate, and means no XML needs to be parsed. Modules/Feathers that store nested post attributes are encouraged to store them as YAML and parse them at the filter_post filter.
- Group-specific post statuses.
More Information
A full log of changes can be found at the 2.0 RC2 commit log.
What’s next?
If no bugs are reported after this point, 2.0 RC2 will be repackaged as v2.0 final. There should not be any more radical changes after this.
Enjoy!
August 28
- at 11:20 PM
Abandonment of by-Feather Post Listing
Update: I went with solution #2, removing the feature entirely. See below for a workaround if you want to still use this feature.
…As it is right now, anyway. Maybe. It all depends on how this post is received and the response to it.
The problems:
The feather viewing route is the single oddball route (excluding post/page viewing). Instead of a simpler /feather/quote1, it’s /quotes. Same goes for /?action=quotes. It seems weird to have such a special spot reserved for such a minor feature.
It takes a special case to tell what we’re trying to do, because the action itself (the first thing after the / in the URL, e.g.
/foo) is never the same.In order for this feature to work, every Feather’s info.yaml file must be parsed on every page load, so that feathers can provide custom plural forms (you wouldn’t want /texts for the “Text” feather). This increases the page load time.
Viewing all of the posts of a feather seems like a very edge case when you consider that we’re lowering the quality of the entire application for it.
The solutions:
Change from /quotes to /feather/quote (/?action=feather&name=quote with dirty URLs).
If you’re currently using the /quotes route exclusively and want to keep it, you could still do it rather easily with custom routes:
# ... routes: quotes: feather;name=quoteRemove it entirely, and have it added via a custom route:
# ... routes: quotes: search;query=feather:quote
Thoughts?
-
I’m using the “Quotes” feather as an example for this post. ↩
July 31
- at 06:29 PM
2.0 RC1 released!
Chyrp version 2.0 release candidate 1 is out! To upgrade, back up your .yaml.php files, overwrite your old install, restore them, update your official modules, and run the upgrader. e51b2b9a58824dd068d8777ec6e97e4d(((more)))
New in this release:
Added
- The Aggregator module is now complete.
- New Custom Routes system that’s much more flexible (more on that here). You can also pass URL arguments like: “/: page;url=my-page”
- Keywords can be used when searching the main site (e.g. author:Alex)
- Module dependencies have been re-implemented
- Feathers can now tell the bookmarklet to select it based on simple logic
- match Twig filter for matching regular expressions
- application/xhtml+xml mimetype support
- Themes can specify their Content-type with a “type” YAML setting
Improved
- Removed a few JS library dependencies (like Interface)
- The session name is no longer based on the site name (you would be kicked out if you renamed your site)
- JS code is much more organized and clean
- database.yaml.php is no longer used; its settings now reside in config.yaml.php
- Cacher module now works properly (doesn’t cancel certain form actions, and doesn’t show a cache if a Flash message is being shown)
- The Bookmarklet is now part of the Admin area
- Chat previewing
- Comment timestamps are now permalinks in the default theme
- More video site support for posting just URLs with the Video feather
- Videos are no longer removed from RSS content (it breaks the spec, but oh well)
- Video feather now uses a scaling method similar to the Photo feather (needs a theme update)
- Page themes are looked for in pages/page.twig first (it is recommended you move it to there in your theme)
- Styling for h1-h6 to the default theme
- Page viewing logic is much smarter
- Textarea auto-growing can be disabled with $(“textarea”).autogrow(“disable”)
- Post XML sanitization is much simpler and less destructive of HTML entities
- The Twig replace filter will take a third argument to determine whether or not to use regular expressions. Off by default.
- Theme->stylesheets() is now extensible
- truncate() handles entities less stupidly
- Added a notification when editing your own group
- When clicking a td with checkboxes in it, toggle the checkboxes.
- Trim whitespace when parsing YAML
- If a source attribute exists on a Photo feather, the image will link to that instead of the full size.
- Increased the size of the help dialogue.
- Don’t send pingbacks for imports
Fixed
- twig_context_[path_to_file] is now named correctly
- Incorrect order of arguments when updating yourself at /controls
- No option being selected when editing a post with selects
- Fixed .htaccess generation in the installer
- Incorrect archive header shown when there is only one year of posts and the user’s viewing /archive/
- Various problems when using $’s and backslashes in anything that’s passed to the database (like posts)
- We no longer use GLOB_BRACE for glob()’ing directories (this was the cause for Theme.php errors on every page on some systems)
- Pages not being filtered
- Upgrader incorrectly converting empty post data
- Upgrader improperly handling UTF-8 characters
- Parsing permissions of groups with no permissions
- Thumbnail script should now correctly scale in all situations
- Searching with clean URLs resulting in dirty URLs being used on the result page
- Various XML-RPC fixes
- Link::set_feed_url()
- Post->next() and Post->prev()
- Added “Uploads Path” setting to the admin
- Cacher module serves feeds as application/atom+xml instead of text/html
- Feeds of certain pages of content now work properly.
- Various CSS fixes in the default theme
- Jittery textarea when typing in the admin in Firefox
- Fixed an ugly error when ASP tags are enabled in the php.ini
- Support for Route->url(‘archive/1969/12/31/’)
- Bulk comment deleting
- Multiline quote sources
- Various pagination dirty URLs being incorrect
- Tags for private/draft/etc. posts are no longer listed in the tag cloud.
- Tweaked the first Twig filter.
- IE6 fixes in the Admin
Miscellaneous
- PDO is now required for SQLite
- Moved *_from_datetime functions to the SQL class
- Removed all backticks from SQL queries
- SQL queries are automatically tablefied
- Added styling for emoticons to the default theme and admin
- javascript_domready and admin_javascript_domready triggers are deprecated and removed.
- Only show stats in the sidebar if debug is on.
July 21
- at 02:12 PM
Documentation Requests
I’d like to get started with documenting Chyrp. Not just the internals, but how it works and why, what its capabilities are, where things are located, etc. We are currently using the wiki system that github provides, and a few articles are already up, but it’s nowhere near finished. What I’d like to know is what documentation you guys want, so I can get that done first and then continue on to littler things.
So, what would you like to have documented?
The current list:
- Twig (you can find a spec sheet in /includes/class/Twig/spec.html to hold you over).
- The variables available to each theme file.
- A list of all required files for a theme and what they are responsible for.
- An overview of the theme structure (interaction between theme files), may fall under the above.
- A list of triggers, with descriptions. (an automated list, sans descriptions, can be found here)
I will add to this list based on comments received on this post (or anything else I think of).
July 20
- at 03:59 AM
New in b5: Improved route flexibility
Rather than using this blog solely for announcing new releases, I think I’ll start posting more details on new features and how the backend of Chyrp works as it evolves. So, we’ll start with a change to the “custom routes” system that I just pushed to the repository last night.
The “routes” setting is a humble little powerhouse residing in /includes/config.yaml.php that is shrouded in mystery to anyone who hasn’t used it when developing a Module. Its original purpose was to allow Modules to easily provide their own routes for when the user has clean URLs on. For example, the Tagginator module adds a tag/(name)/ route setting, which meant “when the visitor goes to /tag/foobar/ in their browser, set the Route->action to ‘tag’ and set $_GET[‘name’] to ‘foobar’”.
Here’s what it looked like:
routes:
- tag/(name)/
This setting was managed by calling Route->add(“tag/(name)/”)1, and Route->remove(“tag/(name)”) to remove it when uninstalling the module.
In beta 5, custom routes go one step further by allowing you to specify an action for any route. For example:
routes: # The beginning and trailing slashes are optional.
tag/(name)/: tag
unfinished: drafts
The first setting is the new form of the same setting from the Tagginator module in b4 and under. The second is a superfluous route I just threw in for an example. unfinished: drafts means “if they’re at /unfinished or /unfinished/, set the Route->action to ‘drafts’”. It essentially “clones” the /drafts/ page to /unfinished/.
If you wanted, you could view tags like /this-is-a-tag/ just by doing this2:
routes:
(name): tag
There isn’t a risk of overriding other pages this way, as every custom route now calls an optional “check_route_[action]” trigger that checks if that Route should be used or not. In this case, a check_route_tag callback was added to the Tagginator module, so if there isn’t a tag at /(name)/ it will tell the Routes parser by returning false, and it will continue trying other routes instead. If there is a tag, it will return true, and the Routes parser will set the Route->action to ‘tag’ and $_GET[‘name’] to ‘this-is-a-tag’.
All of the examples above are only useful to those with “Clean URLs” enabled, but if you have .htaccess support and you have it disabled for some reason, you could just as easily do something like this:
routes:
?action=unfinished: drafts
If you’re a module developer, the only change you’ll have to make is adding a second argument to your Route->add function for the action the path points to.
-
This is the syntax I use when describing things instead of Route::current()->foo(), just for the sake of legibility. Technically I could say $route->foo() but that doesn’t feel right to me as a programmer, since $route isn’t always used. ;) ↩
-
Though you would still have to modify the URLs used in the module and your theme’s sidebar. ↩
July 15
- at 08:29 PM
2.0 beta 4 is out!
Chyrp v2.0 beta 4 is out, bringing us much closer to a quality, stable release. There are new technological improvements all over, and the server requirements have been reduced drastically.
See the README.markdown file for upgrading instructions, especially for you 1.x users. The upgrading method from 1.x is back to the original way of overwriting the old install and running the upgrader. Only, now we have an awesome task-based upgrader (see below) that supports all the way back to the first beta!
What’s new? e51b2b9a58824dd068d8777ec6e97e4d(((more)))
- PDO and DateTime are no longer requirements. Yay! Instead of PDO, you just need either MySQLi, MySQL, or SQLite PHP support.
- Minimum PHP version has been determined as 5.1.3.
- An all-new upgrader that supports upgrading from all the way back to the very first beta.
- The upgrader is now task-based, rather than version-based. Every task that it does checks if it needs to be done, which means that it is both safe to refresh the upgrader and try again until everything is done correctly, and that it is non-destructive.
- The new upgrader is also able to be used by Modules and Feathers, and the Comments and Tagginator modules now use it.
- A brand new theme (you can see it on the site).
- A “Flash” message notification system, a-lá Rails. Messages (warnings, notices, or just messages) are stored in the session until they are displayed. This is a fantastic improvement over the old method of just passing GET values in the URL and checking for them from the theme or wherever.
- New, cleaner directory structure for themes.
- You can now disable XML-RPC.
- Fixed /drafts/.
- Added a SWFUpload module for fancy progressbar in the Audio/Photo feathers.
- Switched YAML parser library to Horde_Yaml.
- Added standard markup_post_title and markup_page_title filters.
- Don’t try $foo->bar() or $foo->getBar() in Twig when using foo[‘bar’].
- WordPress importer fixes/improvements relating to sanitization and utf8.
- Added a few help dialogues to the admin.
- Modules and Feathers no longer use module.php/feather.php, but rather are named after their folder, e.g. /foo_module/foo_module.php.
- Theme->javascripts() and Theme->stylesheets() will also look in /js/ and /css/ now.
- Added depluralize Twig filter.
- Removed the binding, unflexible Theme->list_pages() function. See the new theme for the new way of listing pages recursively.
- Various fixes for viewing a post by /(url).
- Removed the /bookmarklet route.
- Fixed session handling when PHP is set to use SHA-1 for session IDs.
- New Trigger->filter. First argument is the target, which is passed by reference. Second argument is the trigger name (or an array of names to filter on). Every argument after that is an argument for the filter.
- Trigger->call now uses any additional arguments as arguments for the call.
- Added SQL->replace() for REPLACE INTO statements.
- MySQL “strict mode” fixes.
- Theme is now a singleton.
- With the Tags module, you can now use hashtags like #this or #removeme# to tag the post on submit.
- Implemented Guest/User import/export, interoperable with all the other imports to ensure that posts/pages/whatever are attributed to the correct user.
- The Photo feather uses a smaller, lighter, more reliable thumbnailing script that is now included in the core for all Modules/Feathers to use.
- Permissions are stored in the database differently and are now translateable.
- A gazillion bug and l10n fixes. This would be rc1 if not for the new things that need testing.
- Moved importers to the Admin area, and added a MySQL MovableType importer
- Fixed feather tab reordering in Firefox 3
- Moved back to a localized jQuery library instead of using the Google AJAX APIs.
- Feather->submit is now expected to return the new Post object.
- IE7 admin fixes.
- Comments RSS is now Atom and available at /comments_feed. Accessing by /comments_rss will 403 redirect.
- Added a slight tweak to Twig to remove most superfluous empty lines produced by {% if %} blocks and such.
- Added a “Feather” PHP5 interface for all Feathers to “implement”.
- Renamed the Feather class to Feathers, and the Module class to Modules.
- Fixed .htaccess doubleups in some cases during installation.
- Fixed auto-growing textareas in the admin in Safari
- Remove posts whose theme files are missing from the pagination queue (don’t list them in the site anywhere that’s paginated).
July 02
- at 04:21 AM
PDO Exclusivity No More!
I pushed a change tonight that makes the database backend even more flexible. You can now use Chyrp with either of the following (it checks in this order):
This addition is still in testing phases (and the installer won’t let you install with the others yet), but it should solve a lot of problems with users on hosts that do not support PDO.
June 27
- at 01:54 AM
Chyrp 2.0 beta 3.1 out
At the risk of ripping a hole in the space-time continuum by going into decimal places for a beta number, beta version 3.1 is out. It’s a minor release that, uh, makes the installer not break.
June 26
- at 08:27 PM
Chyrp 2.0 beta 3 released!
And this time I have a proper changelog (after the jump). :P
Grab it here.
There should be no upgrade process for those upgrading from older 2.0 betas, aside from overwriting all your files and setting your timezone.
e51b2b9a58824dd068d8777ec6e97e4d(((more)))Changelog
- Added: Now using timezones instead of just offsetting from the server’s time (bad practice). This should also fix the problem of some people’s current time not being in the “What time is it?” list.
- Added: Themes can now provide their own forms for AJAX editing.
- Added: $theme->load() can now use direct paths.
- Added: Another option to Post->update that allows the “updated_at” value to not be updated.
- Added: You can now provide alt-text for the Photo feather.
- Added: /rss as a 301 redirect to /feed
- Added: Model::search now accepts a third argument for options for the instantiated object.
- Added: Modules/Feathers can now provide general help links.
- Added: Post->next() and Post->prev()
- Added: Textareas in the Admin area are now monospaced (bonus: typing \-c-t will replace it with a tab (ironically, I can’t type it or else it’ll be replaced))
- Added: THEME_URL constant.
- Added: Theme->javascripts() now acts like Theme->stylsheets() (scans for .js/.js.php files in the /javascripts/ folder)
- Added: Allow .css.php files to be detected by Theme->stylesheets().
- Added: Smart handling of CSS filenames (e.g. ie.css, ie7.css, ltie6.css, etc., will produce “if” tags)
- Added: Dedicated “caches” directory.
- Added: Paginator now takes a fifth parameter to force the page number.
- Added: admin_head trigger.
Added: Support for init() functions in Feathers/Modules. These are called after all Modules/Feathers are initialized. Necessary when a trigger is called in construct().
Improved: Photo feather’s image_tag_for takes the Post object as the first argument, instead of the Post->filename value. Note: Update your themes and grab the latest Tumblr Pack.
- Improved: Greatly enhanced the WordPress importer to detect problems with the import file and fix them at runtime.
- Improved: XML-RPC support.
- Improved: Moved from .po and [useless] .mo files to .pot files.
- Improved: You can now alter or disable the auto-reloading in the Comments module.
- Improved: AJAX post editing form now replaces the post instead of adding inside of it.
- Improved: Installer and error page UIs.
- Improved: Error detecting/handling in the installer.
- Improved: Moved just about every date/time representation to strftime (better for l10n).
- Improved: Went over the Comments module for a quality check, removed some cruft.
- Improved: A few DOM/JavaScript cleanups/fixes (loader overlay now uses the correct width/height)
- Improved: Appearance of editing comments in the Admin area.
- Improved: Uploader names files more logically now (foo.jpg, foo-2.jpg, foo-3.jpg, etc.)
- Improved: Tumblr importer.
- Improved: Route detection/parsing.
- Improved: Updated the Bookmarklet.
- Improved: Twig spec.
- Improved: Paginator->next() and Paginator->prev() now return Paginator objects, making them stackable.
Improved: Feather::respondTo()’s $function argument is now optional and defaults to the trigger name.
Fixed: Some incorrect comment counts (only happens on local hosts; it would count denied comments)
- Fixed: “Cannot decode raw data” in some browsers.
- Fixed: Individual post’s comments RSS.
- Fixed: “Empty XML” for PHP versions < 5.2.3.
- Fixed: Admin area on Windows-based hosts.
- Fixed: Incorrect value for $updated in feeds resulting in incorrect ID tags.
- Fixed: Spaces in tags.
- Fixed: pinned not being an integer in Post::update, resulting in some weird sorting behaviour.
- Fixed: Aliased Trigger responders conflicting with eachother if they’re both trigger names.
- Fixed: “date_shown” not being set for Paginated whatnots.
- Fixed: THEME_DIR is now affected by theme previewing.
- Fixed: zlib.output_compression conflicting with ob_gzhandler.
- Fixed: Twig select filter.
- Fixed: Some JS in plugins.js was packed; converted to minified.
- Fixed: Handling of common double-extensions in the uploader.
- Fixed: “Page” and “Bookmarklet” nav elements being draggable.
- Fixed: Don’t auto-expand input fields in More Options.
- Fixed: Looking for the wrong filename for a Twig file when viewing a post.
- Fixed: Importing Comments/Tags from WordPress.
Fixed: Theme::list_pages() weird behaviour when using it twice on the same page.
Removed: $action variable; now resides in Route->action
- Removed: $private and $enabled_feathers variables; now reside in Post.
- Removed: info() function on all Models.
- Removed: Post::feather_class()
June 12
- at 07:59 PM
v2.0 beta 2 released
A few more bugs were found after the 2.0 release, and I didn’t want to keep “quietly updating” the 2.0 beta 1 file, so 2.0 beta 2’s here. A whopping two hours after initial release. :P
There are no database changes in 2.0 beta 2, just overwrite your old files with the new. Also, one thing was left out of the 1.1.x → 2.0 upgrader accidentally - you’ll want to rename your “rss_posts” setting to “feed_items” in your config file (or just set it in Admin).
Fixed:
- XML-RPC
- Extend → Themes warnings
- Upgrader now sets Config::$feed_items
Also, tip: /rss is now /feed (2.0 uses Atom, using “rss” as the URL makes no sense), everywhere, so if you use FeedBurner you’ll want to update it.
- at 07:12 PM
Tiny fix for Extend → Themes
If you installed Chyrp 2.0 and were greeted with some ugly errors under Extend → Themes in the Admin area, re-download and replace your /includes/controllers/Admin.php with the one in the archive. Sorry.
Also, I’ve fixed the Tags & Comments module upgraders, so do the same for them with their /upgrade/1.x_2.0.php files.