-- uri plugin for elgg 0.1.3
This plugin make the posibility to use custom url's for posts.
For example, if you have a post title like 'Hello World' (with id 12)
the default url is http://.../weblog/12.html
but with this plugin you got http://.../weblog/hello-world
or you can customize to http://.../weblog/post/hello-world.xhtml
Tested against elgg v0.8.
- Upgrading from 0.1.2 see UPGRADE file.
=== To install:
== Step 1 - Copy mod/uri to your [elgg_dirroot]/mod/
== Step 2 - Inside mod/uri/patchs are the needed modifications to some files
who show post links. If patchs fail, try apply the individuals patchs by hand.
You can test the patch like this:
$ cd [your_elgg_dirroot]
$ cat mod/uri/patchs/all_in_one.patch | patch -p1 --dry-run
If no errors or fail, apply the patch:
$ cat mod/uri/patchs/all_in_one.patch | patch -p1
== Step 3 - To populate your uri's, as admin user go to:
http://domain/elgg/mod/uri/populate.php
== Step 4 - Modify your .htaccess (your elgg will still functional)
Be carefull on this, remove the next two lines:
RewriteRule ^[A-Za-z0-9]+\/weblog\/([0-9]+)\.html$ mod/blog/view_post.php?post=$1
RewriteRule ^[A-Za-z0-9]+\/weblog\/([0-9]+)\.html.([0-9]+)$ mod/blog/view_post.php? ->post=$1&commentpage=$2
And add the next two lines at end of weblog rewrite rules, after everyone rewrite rule:
RewriteRule ^[A-Za-z0-9]+\/weblog\/([A-Za-z0-9\.\/_-]+)$ mod/blog/view_post.php?post=$1
RewriteRule ^[A-Za-z0-9]+\/weblog\/([A-Za-z0-9\.\/_-]+),([0-9]+)?$ mod/blog/view_post.php? ->post=$1&commentpage=$2
== Step 5 - Now you can go to http://domain/elgg/weblog/everyone
and see the new fancy links ;)
You can personlize the uri as you want with some limitations, see get_uri function at mod/ ->uri/lib.php
Keywords: friendly url, patch, plugin, uri

Comments
Rolando, thanks for the plugin. I'm running Elgg 0.8 (the final stable release). When I try to apply the all_in_one.patch it fails while trying to patch the mod/blog/lib.php file. I also checked (via --dry-run) that Elgg has no problems applying other patches. Only the lib.php.patch has issues.
Any hints? How should I proceed?
Thanks
Dmitry, if only fails on lib.php, you can ignore them if you aren't using blog keywords (summary, etc).
Rudy, great!... could i see your site?
And, in the next version i'll include support for a couple of plugin, currently i'm tested with forum plugin, i'll add presentation plugin to my todo list and i think calendar and others too.