|
|
Members: 10,140
Threads: 38,830
Posts: 159,367
Online: 40
Newest Member:
Xoote |
|
|
|
 |
 |
|
 |
24.10.2004, 03:40
|
#1
|
|
Senior Mamber
Join Date: Sep 2004
Posts: 221
|
404 Sef
Alpha 2 has been released. The database is back. (More in the gregmacian style for those familiar with that thread) I have purposely made it compatible with the Redirection_Manager project found at http://mamboforge.net/projects/redirection/ If you install the Redirection_Manager component you will have a limited interface to review the database. You should also be able to add your own "special" urls for customized redirection using the Redirection Manager interface.
All documented bugs from the tracker section have been fixed, BUT, I think it might still have some internationalization problems.
Feedback can now go here, vice the gregmac thread.
|
|
|
24.10.2004, 04:46
|
#2
|
|
Senior Mamber
Join Date: Sep 2004
Posts: 221
|
Re: 404 Sef
Alpha 3 released. Updated so index2.php is handled properly. This should fix print, pdf, and RSS problems.
|
|
|
24.10.2004, 05:54
|
#3
|
|
Elite Mamber
Join Date: Apr 2004
Location: /dev/peru/lima
Posts: 1,007
|
Re: 404 Sef
Thanks a lot m2k for this great addon!  is it mandatory to use Redirection component? btw why dont you create a component 'com_sef' and integrate the Redirection component? it migth be a good idea, so it will be easier to install and manage urls.
Im getting an error:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/ezwp/public_html/demo/includes/database.php on line 328
|
|
|
24.10.2004, 08:41
|
#4
|
|
Senior Mamber
Join Date: Sep 2004
Posts: 221
|
Re: 404 Sef
Thanks!
No, it is not mandatory to use the redirection component, but if you choose not to make sure that you manually create the required table. The benefit of using it is that it adds some management features. Although at the moment, phpMyAdmin provides more flexibilty.
In regards to the error, perhaps you should enable debug in some of functions to provide more clues. A url to view the site to see error might be useful too.
To enable debug for a function, find the line
debug=0
and change it to
debug=1
I'd try it in sefGetTitles first.
The error you quoted means a lookup for some piece of data failed, but it's pretty vague since the line number is in database.php not sef.php.
|
|
|
24.10.2004, 21:04
|
#5
|
|
Elite Mamber
Join Date: Apr 2004
Location: /dev/peru/lima
Posts: 1,007
|
Re: 404 Sef
Quote:
|
Originally Posted by m2k
Thanks!
No, it is not mandatory to use the redirection component, but if you choose not to make sure that you manually create the required table. The benefit of using it is that it adds some management features. Although at the moment, phpMyAdmin provides more flexibilty.
In regards to the error, perhaps you should enable debug in some of functions to provide more clues. A url to view the site to see error might be useful too.
To enable debug for a function, find the line
debug=0
and change it to
debug=1
I'd try it in sefGetTitles first.
The error you quoted means a lookup for some piece of data failed, but it's pretty vague since the line number is in database.php not sef.php.
|
Here is the demo link: http://demo.ezwp.com/ its a fresh mambo install, ive changed debug=0 to debug=1. The same results.
|
|
|
24.10.2004, 22:00
|
#6
|
|
Junior Mamber
Join Date: Oct 2004
Posts: 25
|
Re: 404 Sef
I debugged this a bit more, and here is the info:
The error is propagated from sef.php for the banner component, at line: 311:
$database->loadObject( $row );
And, it happens because in the lines above database->SetQuery is called for certain tasks as section, blogsection, category, blogcategory and view.
However, when we load the index.php, the value of $task is: "click" for the banner component (com_banners), hence code is not calling the setQuery for task=click (for the banner component:com_banners). From thereon, even though the query is not set, code is trying to do a loadObject, hence it is failing (I guess).
|
|
|
24.10.2004, 22:02
|
#7
|
|
Junior Mamber
Join Date: Oct 2004
Posts: 25
|
Re: 404 Sef
Furthermore, if mambo is not installed in the root directory, 404SEF is trying to forward to the root directory. What happens is:
say you have mambo at: http://localhost/mambo/index.php, when you click on one of the articles, it forwards the request to http://localhost/index.php instead of http://localhost/mambo/index.php and code is just getting out of mambo for some reason. Do you know how to fix this?
Thanks...
|
|
|
24.10.2004, 22:11
|
#8
|
|
Senior Mamber
Join Date: Sep 2004
Posts: 221
|
Re: 404 Sef
Ok, the problems seems to be with the banner, so here's the fix. We ignore banners, they change frequently so there's no need to make them friendly.
Notice the change in the "if" statment.
PHP Code:
function sefRelToAbs( $string ) {
GLOBAL $mosConfig_live_site, $mosConfig_sef, $database, $SEF_replacement;
GLOBAL $_GET, $_REQUEST;
$debug=0;
if ($mosConfig_sef
&& !eregi("^(([^:/?#]+):)",$string)
&& !strcasecmp(substr($string,0,9),"index.php")
&& !eregi("com_banner",$string)
&& !eregi("task=new",$string)
&& !eregi("task=edit",$string)) {
if ($string=="index.php") return "";
I will post alpha4 later, it will include this fix. Also, if you don't mind, since I do not use French, Swedish, or German, could you test the modification below for me and let me know the results. If they are positive I will include this in alpha4 also. Delete the function titleToLocation and replace it with the code below.
PHP Code:
function unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
// note, this function passes by reference (for compatiblity with array_walk)
function titleToLocation(&$title) {
global $SEF_replacement;
return $title = preg_replace(array("/'/","/[^a-zA-Z0-9\-!.,+()]+/","/(^_|_$)/"),array("",$SEF_replacement,""),unhtmlentities(htmlentities($title, ENT_COMPAT, 'UTF-8')));
}
Thanks for the feedback! Keep it coming!
|
|
|
24.10.2004, 22:18
|
#9
|
|
Junior Mamber
Join Date: Oct 2004
Posts: 25
|
Re: 404 Sef
Yep, this worked
However, I still have the subdirectory problem that I mentioned above... It still does not work if mambo is installed in a subdirectory.
|
|
|
24.10.2004, 22:18
|
#10
|
|
Senior Mamber
Join Date: Sep 2004
Posts: 221
|
Re: 404 Sef
Quote:
|
Originally Posted by dcabbar
|
That seems odd since the since $mosConfig_live_site is set as a global and the return for sefRelToAbs is set to
return $mosConfig_live_site."/".$string;
Do you have this varible set properly?
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 16:25.
|
|
|
|