Hi, i added to plugin catalog and updated the uri plugin.
Note: this plugin needs some modification into the blog code and apply some patchs, was tested on linux environment if you are on windows need to look for some utility to apply the patchs.
I made the install instructions simple as possible, but any feedback will be helpful.
-- uri plugin for elgg
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/hell-world.xhtml
Tested against elgg v0.8rc2.
=== To install:
== Step 1 - Copy mod/uri to your [elgg_dirroot]/mod/
== Step 2 - In your browser, login as 'news' users and go to:
http://domain/elgg/mod/uri/dbsetup.php
== Step 3 - The populate your uri's, go to:
http://domain/elgg/mod/uri/populate.php
== Step 4 - Modify mod/blog/view_post.php (your elgg will still functional)
- around line 21, the code line:
$post = optional_param('post',0,PARAM_INT);
- comment it and add the line:
//$post = optional_param('post',0,PARAM_INT);
$post = run('mod:uri:getid');
== Step 5 - Modify your .htaccess (your elgg will still functional)
Be carefull on this, replace (or comment) 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
By:
RewriteRule ^[A-Za-z0-9]+\/weblog\/([A-Za-z0-9\.\/_-]+),?([0-9]+)?$ mod/blog/view_post.php?post=$1&commentpage=$2
== Step 6 - Inside mod/uri/patchs are the needed modifications to some files
who show post links. The main patch is for mod/blog/lib/weblogs_posts_view.php
If patchs fail, try apply the modifications by hand.
You can test 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 7 - 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
