Compactor/ECML Plugin patches.: Revision

Some have you may of noticed that when the Compactor or ECML custom markup plugin are enabled that most of the plugins don't work properly. This isn't anything to do with Compactor or ECML but rather the individual plugins page handler functions not working correctly. Below you will find patches for all the plugins I have installed. If you have one that isn't working please let me know and I'll update this list.

Blog

in blog/status/start.php replace the whole blog_page_handler function with

function blog_page_handler($page) {
// The first component of a blog URL is the username
if (isset($page[0])) {
set_input('username',$page[0]);
}
// The second part dictates what we're doing
if (isset($page[1])) {
switch($page[1]) {
case "read":
set_input('blogpost',$page[2]);
@include(dirname(__FILE__) . "/read.php");
return true;
break;
case "friends":
@include(dirname(__FILE__) . "/friends.php");
return true;
break;
}
// If the URL is just 'blog/username', or just 'blog/', load the standard blog index
} else {
@include(dirname(__FILE__) . "/index.php");
return true;
}
return false;
}

Bookmarks

in bookmarks/status/start.php replace the whole bookmarks_page_handler function with

	function bookmarks_page_handler($page) {
// The first component of a bookmarks URL is the username
if (isset($page[0])) {
set_input('username',$page[0]);
}
// The second part dictates what we're doing
if (isset($page[1])) {
switch($page[1]) {
case "read": set_input('guid',$page[2]);
@include(dirname(dirname(dirname(__FILE__))) . "/entities/index.php");
return true;
break;
case "friends": @include(dirname(__FILE__) . "/friends.php");
return true;
break;
case "inbox": @include(dirname(__FILE__) . "/inbox.php");
return true;
break;
case "items": @include(dirname(__FILE__) . "/index.php");
return true;
break;
}
// If the URL is just 'bookmarks/username', or just 'bookmarks/', load the standard bookmarks index
} else {
@include(dirname(__FILE__) . "/index.php");
return true;
}
return false;
}

Kaltura

in mod/kaltura/start.php replace the whole kaltura_video_page_handler function with

function kaltura_video_page_handler($page) {
global $CONFIG;

if (isset($page[0])) {
switch ($page[0]) {
case 'all':
case 'friends':
case 'show':
@include(dirname(__FILE__) . "/searchvideos.php");
return true;
break;
case 'recreateobjects':
@include(dirname(__FILE__) . "/recreateobjects.php");
return true;
break;
default:
@include(dirname(__FILE__) . "/index.php");
return true;
}
}
else {
// If the URL is just 'feeds/username', or just 'feeds/', load the standard feeds index
@include(dirname(__FILE__) . "/index.php");
return true;
}
return false;
}

Messages

in mod/messages/start.php replace the whole messages_page_handler function with

		function messages_page_handler($page) {
// The first component of a messages URL is the username
if (isset($page[0])) {
set_input('username',$page[0]);
}
// The second part dictates what we're doing
if (isset($page[1])) {
switch($page[1]) {
case "read": set_input('message',$page[2]);
@include(dirname(__FILE__) . "/read.php");
return true;
break;
}
// If the URL is just 'messages/username', or just 'messages/', load the standard messages index
} else {
@include(dirname(__FILE__) . "/index.php");
return true;
}
return false;
}

Status

in mod/status/start.php replace the whole status_page_handler function with

		function status_page_handler($page) {
// The first component of a status URL is the username
if (isset($page[0])) {
set_input('username',$page[0]);
}
// The second part dictates what we're doing
if (isset($page[1])) {
switch($page[1]) {
case "read": set_input('statuspost',$page[2]);
@include(dirname(__FILE__) . "/read.php");
return true;
break;
case "friends": // TODO: add friends status page here
break;
}
// If the URL is just 'status/username', or just 'status/', load the standard status index
} else {
@include(dirname(__FILE__) . "/index.php");
return true;
}
return false;
}