Skip past navigation, straight to the content

Category Archives: Projects

Various projects undertaken by Filipe Fortes.

Introducing Sistr

  • Plane Engine over the midwest

Over the weekend I spent some time seeing if I could replicate the functionality found in the excellent sIFR, using Silverlight instead of Flash. The result is Sistr. For the impatient — here’s a demo test page.

Note: This definitely isn’t ready for a production site, this is an early version for feedback purposes only. There are still plenty of bugs, trust me.

Usage

  1. Download sistr.js and save it to your web server (or reference it directly from this site).
  2. Create a zip file with the font(s) you wish to use. Upload this to your webserver as well (Silverlight will only use fonts that are retrieved via HTTP).
  3. Add the following into your HTML page:
    <script type="text/javascript" src="sistr.js"></script>
  4. In your CSS file, define a new class called sistr-replace (anything that starts with “sistr-” works). Here’s an example:
    .sistr-replace { }
  5. Use the font-family property to set the font name and URL to the font files, enclose them in quotes and separate with the “|” character (e.g. font-family: "Fil's Font|filfont.zip"). Make sure you also specify backup fonts for users who don’t have Silverlight installed, like so:
    .sistr-replace { font-family: "FontName|fonts.zip", Verdana, Arial, Sans-Serif; }
  6. Set the class property on some of your HTML elements to sistr-replace (or whatever else you used) and re-load. For example:
    <h3 class="entry-title sistr-replace">Hello World!</h3>
  7. Your text should now be rendered using Silverlight.

Take a look at the demo test page as well.

Pros & Cons vs. sIFR

Pro:

  • Simpler setup: All you need to do is include the sistr.js file in your page and edit your CSS — you do not need to edit any Silverlight or JavaScript code. sIFR is pretty easy too, but you need the Flash editing program in order to create a SWF file.
  • Support for Transparent Backgrounds: sIFR provides partial support, but it’s not recommended within Firefox (I believe this is an issue with Flash).

Con:

  • Lack of Silverlight Install Base: Silverlight is nowhere near as common as Flash.
  • No protection for Font Files: In order to use a custom font with Silverlight, you have to have the font file available for download on a web server — you cannot embed it or protect it in any way. This means you must use fonts that you either created or are liberally licensed (public domain, etc).
  • Immature: Both Flash and sIFR are much, much more mature than Silverlight and Sistr. There are many bugs that I have not sorted out yet.
  • Many limitations: See below

Known Issues

  • No support for line height: Limitation in Silverlight
  • Must use absolute units for font-size in IE: Due to IE’s lack of a getComputedStyle equivalent.
  • Occasional sizing issues: I think this may be a Silverlight bug, but occasionally text will get cut off in the vertical direction. Not sure how to fix it yet
  • Font size doesn’t respond to user changes: Works fine if you reload though
  • No support for :hover state
  • No support for nested hyperlinks
  • Text selection does not work: Not sure how screen readers react either
  • Cannot support nested bold in Firefox: Works in IE though

Let me know if you find others — or want to help fix bugs!

Top Level Categories Plugin 1.0

There’s a new version of the Top Level Categories plugin. The changes aren’t huge, but they do fix all known issues, including:

  • Will now work correctly with the /%category%/%postname% and %postname% permalink structures (this was the top request).
  • No longer need to manually update the permalink structure on install or uninstall.
  • Fixed incompatibility with some installations of the K2 theme.

If the previous version works well for you, then there is no need to upgrade.

Download

Top Level Categories v1.0 (ZIP file).

Let me know if you encounter any new bugs or issues.

Top Level Categories Plugin 0.1

Introduction

The Top Level Categories plugin allows you to remove the prefix before the URL to your category page. For example, instead of fortes.com/category/work, I use fortes.com/work for the address my “work” category. WordPress doesn’t allow you to have a blank prefix for categories (they insert category/ before the name), this plugin works around that restriction.

Download

Top Level Categories v0.1

Installation

  1. Download top_level_cats.zip, unzip it and save the top_level_cats.php file in your wp-content/plugins directory.
  2. Activate the plugin through your WordPress admin area (See the official documentation if you need more help with this.)
  3. Go to Options -> Permalinks in your options panel and press Update Permalink Structure.
  4. That’s it! Your category links are now changed!

Donate

If you’re feeling generous, go for it:

Notes

I use this plugin in conjunction with the excellent Permalink Redirect Plugin. If you’re using the plugin, you should make sure to fix a simple bug in the program that messes up category feeds. You can do so by adding the following code to the file on line 174 (right before the return $link; line):

        if (is_feed()) {
        	$link = trailingslashit($link) . "feed/";
        }

Known Issues

This plugin will not work if you are using a permalink structure that is only the post name (i.e. /%postname%/ in the options). This is because it creates an ambiguous situation where both categories and individual posts end up with the same URLs. To fix this (if you don’t mind switching your post URLs), switch permalink structure to one of the built-in settings (like Date and Name Based).

Post Levels 1.0.9 (for WordPress 2.0.x)

I’ve gotten a few emails from people that are still running the 2.0.x versions of WordPress (which will apparently be supported until 2010). Due to a boring technical reason, the “User Levels” menu is hidden from the admin section if you use Post Levels 1.1.1 with WordPress 2.0.x.

You can download the release from here: Post Levels 1.0.9

Note that this version lacks features in 1.1.1 — this is due to the new capabilities introduced in WordPress 2.1.

Do not use this plugin if you are running WP 2.1 or greater, your waistline will expand and dogs will no longer like you.

Post Levels 1.1.1

Post Levels 1.1.1 is a bugfix release that will (hopefully) get rid of some of the problems people have been seeing with the 1.1 release.

Download

Post Levels 1.1.1

New Features

  • Use the post teaser as the preview: You can now show the post teaser as the preview for non-logged in users. (requested by Gas)
  • Bug fixes: This release should fix the issues with Ultimate Tag Warrior 3.1415926 (duplicate posts and SQL errors). If you find more, please let me know.

Note: Several people have mentioned that Post Levels is causing their posts to appear in reverse order. I’m unable to duplicate this, so please let me know if it’s still happening in this version.

Post Levels 1.1

The latest version of the Post Levels Plugin is now available.

Download

Post Levels Version 1.1

Installation

  1. Save the post-levels.php file in your wp-content/plugins directory.
  2. Activate the plugin through your WordPress admin area (See the official documentation if you need more help with this.)
  3. Go to the Users section of your admin area, then go to User Levels. Give levels to your users
  4. Make posts private when writing or editing by using the Post Level drop down, and setting the Post Status to Private

New Features

  • Private Pages: Support for private pages, just like posts
  • Previews for Private Posts: This has been requested often — you can now show a preview for your private posts (even shows up in RSS!). The preview can be just the title, or the title and the post excerpt.
  • Private Posts in archive counts: Another frequently-requested item
  • Private posts (usually) show up in category counts: This works in most themes. Let me know if yours doesn’t (make sure you tell me which theme!)
  • No more HTTP Auth: This fixes the issue some people saw with password prompts. I’ll replace this feature in the next version
  • WordPress 2.1 compatibility: Most of the new features don’t work with older versions of WP — sorry.

Donate

If you’re feeling generous, go for it:

Post Levels 1.1b2

For those running WordPress 2.1 already, you can grab Post Levels 1.1b2, which should fix the post-doubling issue and incompatibility with PHP4 people have been seeing. There are no new features in this release.

Update: The final version is now out.

Post Levels 1.1 Beta

In preparation for the upcoming release of WordPress 2.1, I’ve prepared a new version of the Post Levels plugin. I’ll release the final 1.1 once the WordPress 2.1 is released. If you’re running 2.1 already, please let me know if you find any issues.

Download

Post Levels version 1.1b

Installation

  1. Save the post-levels.php file in your wp-content/plugins directory.
  2. Activate the plugin in the WordPress UI

You must be running version 2.1 of WordPress. In theory, it won’t break older versions, but won’t really do much.

New Features

  • Private Pages: You can now have private pages, just like posts
  • Private Posts show up in Archive counts & Next/Prev links: Corrects a long standing bug where private posts weren’t counted. Unfortunately, this bug still affects categories
  • Removed HTTP Auth for private RSS feeds: This didn’t work particularly well for people, it’ll be replaced before the final relase (see below).
  • Other minor fixes …

Upcoming Features

  • RSS for private posts: This time it’ll really work :)
  • Private posts in Category counts: This looks like it’ll require either editing your theme, or using the Sandbox theme.
  • Tell users there are private posts: Allow non-logged in users to know there are hidden posts
  • Category-based level: Set default levels for certain categories
  • Level quick tag: Allow some kind of shortcut for setting the post level

Update: Version 1.1b2 should fix the post doubling and PHP4 issues

Update: Final version available

Next version of Post Levels

It’s been a while since the last release of the Post Levels plugin, I believe it is just about time for a new release.

I’m a selfish developer, so I’m prioritizing based on my needs. Here is what I need for the next version:

  • Non HTTP-auth private RSS feeds: My web host runs PHP in CGI mode, which doesn’t support the HTTP authentication
  • Flickr integration: This will depend on what I can implement with the Flickr API, but I’d like some tighter integration with their contact list and privacy

There are a few features that people have frequently requested as well, I’d like to get the following done:

  • Tell users there are private posts: Frequently requested option, would allow non-logged in users to know there are hidden posts
  • Category-based level: Set default levels for certain categories
  • Level quick tag: Allow some kind of shortcut for setting the post level

Any other requests?

BTW, don’t expect me to have this all coded tomorrow :)

Private Posts in RSS

You can now see links to my private posts in your RSS reader (assuming it supports HTTP authentication — this varies by feed reader).

The feed URL is: http://fortes.com/feed?http_auth=yes (alternatively: http://fortes.com/life/feed?http_auth=yes if you don’t want to see anything but the personal posts)

Your reader should prompt you for your user name and password. Use the same one you would use to log in.

Let me know if you have any issues.

Post Levels 1.0

Version 1.0 of the Post Levels plugin has been released. This is a release for WordPress 2.0, and is not compatible with earlier versions of WordPress.

Download

Post Levels 1.0

Installation Instructions

  1. Save the file post-levels.php in your wp-content/plugins/ directory
  2. Activate the plugin within WordPress in your Plugins section

See the WordPress documentation if you’re having issues installing the plugin.

Upgrade Instructions

If you are upgrading from a previous version of WordPress, you should follow these steps:

  1. Deactivate the Post Levels plugin
  2. Upgrade your WordPress installation to 2.0 (this exercise is left to the reader)
  3. Download post-levels.php, replacing the previous version
  4. Activate the plugin
  5. Click on the new Post Levels Configuration tab in the Plugins admin area:

    The WordPress plugin administrative area, with a menu tab that says 'Post Levels Configuration'

  6. Scroll to the bottom of the page, and check the box labeled Copy user information …, then click Migrate User Levels

    Post Levels administrative UI with a button that says 'Migrate User Levels'

  7. Now go to the Users section in your WordPress admin. Click on the a new User Levels section.

    The WordPress users administrative area, with a menu tab that says 'User Levels''

  8. Confirm that all your user levels are appropriate
  9. You can now go to the Authors & Users section in order to change user permissions as necessary. I recommend changing all non-posting users to “Subscriber”

New Features

Version 1.0 has many frequently-requested features, including:

  • Private posts over RSS: By adding http_auth=yes to the query string of any WordPress URL, you can now use HTTP authentication to get private posts. Since most RSS readers support HTTP authentication, you can attach this query string to your feed URL and see private posts. The amount of data shown in the post is user-configurable: You can show just the title, excerpt, or give the full content.
  • Independent User Level Control: The previous version of Post Levels used WordPress’ built-in user level property. This was a problem for many people because giving a user access to private posts also gave them administrative capabilities. This version assigns levels to users that are completely independent from the WordPress administrative functions.
  • New Adminstrative UI for controlling plugin options: Control options such as the default post level, user level, etc

Post Levels 0.9

I’ve updated the plugin to be compatible with WordPress 2.0 RC3 — if you’re testing WP 2.0, you can download Post Levels 0.9. Let me know if you find any bugs. I’ll release the real version with any bugfixes when WP 2.0 releases.

Partial list of new features in this release:

  • Support for private posts in RSS feeds: Blog readers can use HTTP authentication to read private posts
  • Post and User Level Admin UI
  • Configurable options: New configuration options for features.
  • No more Single Post bug: Yeah, that bug sucked

Note: This plugin is not compatible with previous versions of WordPress. If you try to use it with old versions of WP, it will probably make your tongue green.