Members: 10,140
Threads: 38,830
Posts: 159,367
Online: 40

Newest Member: Xoote


Old 24.10.2004, 03:40   #1
m2k
Senior Mamber
 
m2k's Avatar
 
Join Date: Sep 2004
Posts: 221
m2k is on a distinguished road
Default 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.
m2k is offline   Reply With Quote
Sponsored Links
Old 24.10.2004, 04:46   #2
m2k
Senior Mamber
 
m2k's Avatar
 
Join Date: Sep 2004
Posts: 221
m2k is on a distinguished road
Default Re: 404 Sef

Alpha 3 released. Updated so index2.php is handled properly. This should fix print, pdf, and RSS problems.
m2k is offline   Reply With Quote
Old 24.10.2004, 05:54   #3
twysm
Elite Mamber
 
twysm's Avatar
 
Join Date: Apr 2004
Location: /dev/peru/lima
Posts: 1,007
twysm can only hope to improve
Send a message via ICQ to twysm Send a message via MSN to twysm Send a message via Yahoo to twysm
Default 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
__________________
www.ezwp.com
www.diginetperu.com
twysm is offline   Reply With Quote
Old 24.10.2004, 08:41   #4
m2k
Senior Mamber
 
m2k's Avatar
 
Join Date: Sep 2004
Posts: 221
m2k is on a distinguished road
Default 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.
m2k is offline   Reply With Quote
Old 24.10.2004, 21:04   #5
twysm
Elite Mamber
 
twysm's Avatar
 
Join Date: Apr 2004
Location: /dev/peru/lima
Posts: 1,007
twysm can only hope to improve
Send a message via ICQ to twysm Send a message via MSN to twysm Send a message via Yahoo to twysm
Default 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.
__________________
www.ezwp.com
www.diginetperu.com
twysm is offline   Reply With Quote
Old 24.10.2004, 22:00   #6
dcabbar
Junior Mamber
 
Join Date: Oct 2004
Posts: 25
dcabbar is on a distinguished road
Default 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).
dcabbar is offline   Reply With Quote
Old 24.10.2004, 22:02   #7
dcabbar
Junior Mamber
 
Join Date: Oct 2004
Posts: 25
dcabbar is on a distinguished road
Default 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...
dcabbar is offline   Reply With Quote
Old 24.10.2004, 22:11   #8
m2k
Senior Mamber
 
m2k's Avatar
 
Join Date: Sep 2004
Posts: 221
m2k is on a distinguished road
Default 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($titleENT_COMPAT'UTF-8')));

Thanks for the feedback! Keep it coming!
m2k is offline   Reply With Quote
Old 24.10.2004, 22:18   #9
dcabbar
Junior Mamber
 
Join Date: Oct 2004
Posts: 25
dcabbar is on a distinguished road
Default 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.
dcabbar is offline   Reply With Quote
Old 24.10.2004, 22:18   #10
m2k
Senior Mamber
 
m2k's Avatar
 
Join Date: Sep 2004
Posts: 221
m2k is on a distinguished road
Default Re: 404 Sef

Quote:
Originally Posted by dcabbar
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...
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?
m2k is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SEF / Cloaking / Redirect / Custom 404 module idea mkoenigs Mambo 5.0 Wishlist 3 27.11.2004 01:47
Using AkoComment with SEF milek Mambo 4.5 'How Do I' Questions 0 17.08.2004 16:50
Sef alphanostrum Mamboreport Dokus & Tips 6 17.05.2004 06:39
SEF issues with Apache 1.3.27 danews Mambo 4.5 Bugs 8 25.04.2004 19:06


All times are GMT +2. The time now is 16:25.

Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.