eXtend SEF for Mambo 4.6 and above
FAQ's
- Why did you make this component?
- Does eXtend SEF support Components,
Modules, and Templates?
- What format do the URL aliases have to be in?
- I am getting a parse error: unexpected
T_CLASS in {something}/public_html/includes/sef.php on line 1 when
trying to install the component.
- When I click on a page navigation link (i.e. 'next' or page
'2) it links to a bogus page and the URL looks like http://www.myhomepage.com/content//1/10/10/10/,
is this a bug in your component?
- If I create my own component will it be compatible with eXtend
SEF? How can I pass some data as querystring ? For example, I may have
to pass some data as querystring like:
index.php?option=com_showtimes&day=monday&week=25
- Jreviews bug-fix for eXtendSEF (user submitted) |
Why did you make this component?
Just a little history... I used to use SEF Advance,
like many Mambo users, but as you may know Sakic (the developer of SEF Advance)
is a Joombla developer and as of version 4.6 he has decided to no longer support
Mambo. Luckily he was kind enough to make the SEF Advance compatible with 4.6,
but he warned that he will no longer support Mambo versions above 4.5 and that
he "can not guarantee all functionality or give support for this version 4.6 Mambo".
Reliant on the aliasing features of SEF Advance, I decided to write my own
solution to better SEF in Mambo before SEF Advance becomes totally obsolete.
Another issue I had with SEF Advance is that it is a product. I felt that, in order to have a solution that is a real benefit to the Mambo community, this component must be Open Source. This is the only way to guarantee that this much needed addition to Mambo survives whether or not I am supporting it in the unforeseeable future.
Does eXtend SEF support Components, Modules, and Templates?
Yes it should support Components, Modules, and Templates as long as they include the sefRelAbs() function in their links as described in the FAQ on Component development below.
What format do the URL aliases have to be in?
They can be in any legal URL format as long as they begin with a slash. Some
examples of legal alias strings include:
/
/home
/home/
|
/home.html
/home.php
/home.asp
|
/home/nextDir/nextDir
/home/nextDir/nextDir/
/home/nextDir/nextDir.html |
I am getting a parse error: unexpected T_CLASS
in {something}/public_html/includes/sef.php on line 1 when trying to install the component.
Users in the past who have run into this difficulty have reported that the
trouble comes when they try to do a manual install, i.e. unzipping the tarball
on their local hard drive and then uploading the local unzipped version. Therefore:
1.
It is highly
recommended that the user install eXtend SEF via upload from the tarball file
using the universal installer.
2.
After installing the user should move the unpacked version of the sef.php
file found in the components/com_extend_sef/ directory
found on their server to the /includes/ directory, rather than using a copy that
was unzipped locally on their hard drive.
The theory is that certain unzipping applications are reformatting the the
sef.php file in such a way as it becomes difficult to parse by PHP.
When I click on a page navigation link (i.e. 'next' or page '2) it
links to a bogus page and the URL looks like http://www.myhomepage.com/content//1/10/10/10/,
is this a bug in your component?
Actually, this is not a bug in eXtend SEF but a known bug in Mambo 4.6.1.
It is a problem with the page navigation function, rather than a problem
with Mambo SEO or eXtend SEF. For details on this bug please visit:
http://forum.mamboserver.com/showthread.php?t=88379
The fix is fairly simple. Go to line 96 in /includes/pageNavigation.php and
comment out the preg_replace() line in the writePagesLinks function it should
fix the problem.
For example :
replace:
function writePagesLinks( $link ) {
// clean link - could be better filtered
in rewrite
// stops XSS
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/phpInputFilter/class.inputfilter.php');
$iFilter = new InputFilter( null, null, 1, 1 );
$link = trim( $iFilter->process( $link ) );
$link = preg_replace("/(task.*?)&/i", "", $link);
with:
function writePagesLinks( $link ) {
// clean link - could be better filtered
in rewrite
// stops XSS
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/phpInputFilter/class.inputfilter.php');
$iFilter = new InputFilter( null, null, 1, 1 );
$link = trim( $iFilter->process( $link ) );
//$link = preg_replace("/(task.*?)&/i", "", $link);
If I create my own component will it be compatible with eXtend SEF?
How can I pass some data as querystring ?
For example, I may have to pass some data as querystring like:
index.php?option=com_showtimes&day=monday&week=25
In order to make a component that works with eXtend SEF the component needs
to be integrated into Mambo's built-in SEF. There is really nothing special
that needs to be done to components to make them compatible with Mambo, you
just have to pass your links to the Mambo SEF using the sefRelToAbs() function.
This turns urls like:
index.php?option=com_showtimes&day=monday&week=25
to:
/component/option, com_showtimes/day,monday/week,25/
to do this in your component pass all of your links to the sefRelToAbs() function.
The function will return an SEF version of the link. For example, instead of:
echo 'index.php?option=com_showtimes&day=monday&week=25';
you would put:
echo sefRelToAbs('index.php?option=com_showtimes&day=monday&week=25');
If your SEF is turned off then this function has no effect on the links.
Getting and posting data is the same whether or not the SEF is turned-on.
Just the URL format looks different to the end user. Likewise, if you alias
the sef url then the parameters will be hidden altogether. It is recommended
that you don't add aliases to the links to your components until you are finished
developing it and it is ready to deploy.
for more on developing components, I have found the following tutorials useful
in the past:
http://www.devbay.com/Articles/Mambo/Mambo_Component_Tutorial/
http://www.moxleystratton.com/article/mambo-components
- Jreviews bug-fix for eXtendSEF (user submitted)
Apparently as of this postin (12/12/2007) Jreviews is still integrating into Mambo CMS and as a result there are a few bugs that make eXtendSEF and Jreviews incompatible. The source of the problem is that $Itemid is not getting
handled with Jreviews. This is a change that needs made in Mambo's
index.php:
/** Get the component handler */
require_once( $configuration->rootPath() . '/includes/cmtclasses.php' );
$c_handler =& mosComponentHandler::getInstance();
$c_handler->startBuffer();
if (!$urlerror AND $path = $mainframe->getPath( 'front' )) {
$menuhandler =& mosMenuHandler::getInstance();
$ret = $menuhandler->menuCheck($Itemid, $option, $task, $gid);
$menuhandler->setPathway($Itemid);
if ($ret || $option == "com_jreviews") { // JREVIEWS MODIFICATION
require ($path);
} else
mosNotAuth();
}
|