Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 22

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 02.07.2004, 14:52   #1 (permalink)
Expert Mamber
 
pflegeonline's Avatar
 
Join Date: Apr 2004
Location: Schladming/Graz
Posts: 414
pflegeonline is on a distinguished road
Default SEF-Url Hack!

Hi guys!

I just hacked the SEF-Url's standard in MOSCore!

Urls will now displayed like this:
www.yoursite.com/content/view/39/54/index.html

It can be seen live at http://pflegeonline.pflegenetzwerk.org

And here's the code. Only replace it in your includes/sef.php

greetz
stefan

//edit
modified code in the posting below!!!!!!!!!
edit//
__________________

Last edited by pflegeonline; 03.07.2004 at 23:31. Reason: Code Update
pflegeonline is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 02.07.2004, 15:39   #2 (permalink)
Expert Mamber
 
pflegeonline's Avatar
 
Join Date: Apr 2004
Location: Schladming/Graz
Posts: 414
pflegeonline is on a distinguished road
Default Re: SEF-Url Hack!

Code just updated!

had a few type mistakes!!

sorry for that

greetz
stefan
__________________
pflegeonline is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02.07.2004, 16:19   #3 (permalink)
Junior Mamber
 
lexel's Avatar
 
Join Date: Apr 2004
Posts: 34
lexel is on a distinguished road
Default Re: SEF-Url Hack!

Hey this hack is really cool

thanks
lexel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02.07.2004, 16:22   #4 (permalink)
Expert Mamber
 
pflegeonline's Avatar
 
Join Date: Apr 2004
Location: Schladming/Graz
Posts: 414
pflegeonline is on a distinguished road
Default Re: SEF-Url Hack!

no problem! I wnted it myself, so why don't share!

greetz
stefan
__________________
pflegeonline is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02.07.2004, 16:39   #5 (permalink)
Senior Mamber
 
novocaine's Avatar
 
Join Date: Apr 2004
Location: Hamburg/Germany
Posts: 241
novocaine is on a distinguished road
Default Re: SEF-Url Hack!

What exactly is the aim of this hack except of making a little cosmetics on the URL?

Edit

If you are interested in such URLs you may have a look at this script too as it's a little more advanced (dunno if named anchors are working though).

another tweak on SEF

/Edit
__________________
Visit ThinkMambo - home of TMEdit and XHTMLSuite
WYSIWYG editors for Mambo Open Source
novocaine is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02.07.2004, 17:30   #6 (permalink)
Expert Mamber
 
pflegeonline's Avatar
 
Join Date: Apr 2004
Location: Schladming/Graz
Posts: 414
pflegeonline is on a distinguished road
Default Re: SEF-Url Hack!

What about that ones:

for components:

component/option/com_weblinks.Itemid/4.html

for content:

content/section/1/2/content.html


greetz
stefan


code below:
PHP Code:
<?php
<?php
// $Id: sef.php,v 1.20 2004/04/07 11:56:02 rcastley Exp $
/**
* SEF function
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : [url]http://www.gnu.org/copyleft/gpl.html[/url]
* @version $Revision: 1.20 $
**/

defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

if (
$mosConfig_sef) {
    
$url_array explode("/"$_SERVER['REQUEST_URI']);
    
/*
    Content
    http://www.domain.com/$option/$task/$sectionid/$id/$Itemid/$limit/$limitstart
    */
    
if (in_array("content"$url_array)) {

        
$uri explode("content/"$_SERVER['REQUEST_URI']);
        
$option "content";
        
$_GET['option'] = $option;
        
$_REQUEST['option'] = $option;
        
$pos array_search ("content"$url_array);

        
// $option/$task/$sectionid/$id/$Itemid/$limit/$limitstart
        
if (isset($url_array[$pos+7]) && $url_array[$pos+7]!="") {
            
$task $url_array[$pos+1];
            
$sectionid $url_array[$pos+2];
            
$id $url_array[$pos+3];
            
$Itemid $url_array[$pos+4];
            
$limit $url_array[$pos+5];
            
$limitstart $url_array[$pos+6];
            
$html $url_array[$pos+7];
            
$_GET['task'] = $task;
            
$_REQUEST['task'] = $task;
            
$_GET['sectionid'] = $sectionid;
            
$_REQUEST['sectionid'] = $sectionid;
            
$_GET['id'] = $id;
            
$_REQUEST['id'] = $id;
            
$_GET['Itemid'] = $Itemid;
            
$_REQUEST['Itemid'] = $Itemid;
            
$_GET['limit'] = $limit;
            
$_REQUEST['limit'] = $limit;
            
$_GET['limitstart'] = $limitstart;
            
$_REQUEST['limitstart'] = $limitstart;
            
$QUERY_STRING "option=content&task=$task&sectionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart";
            
// $option/$task/$id/$Itemid/$limit/$limitstart
        
} else if (isset($url_array[$pos+6]) && $url_array[$pos+6]!="") {
            
$task $url_array[$pos+1];
            
$id $url_array[$pos+2];
            
$Itemid $url_array[$pos+3];
            
$limit $url_array[$pos+4];
            
$limitstart $url_array[$pos+5];
            
$html $url_array[$pos+6];
            
$_GET['task'] = $task;
            
$_REQUEST['task'] = $task;
            
$_GET['id'] = $id;
            
$_REQUEST['id'] = $id;
            
$_GET['Itemid'] = $Itemid;
            
$_REQUEST['Itemid'] = $Itemid;
            
$_GET['limit'] = $limit;
            
$_REQUEST['limit'] = $limit;
            
$_GET['limitstart'] = $limitstart;
            
$_REQUEST['limitstart'] = $limitstart;
            
$QUERY_STRING "option=content&task=$task&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart";
            
// $option/$task/$sectionid/$id/$Itemid
        
} else if (!(isset($url_array[$pos+6]) && $url_array[$pos+6]!="") && isset($url_array[$pos+5]) && $url_array[$pos+5]!="") {
            
$task $url_array[$pos+1];
            
$sectionid $url_array[$pos+2];
            
$id $url_array[$pos+3];
            
$Itemid $url_array[$pos+4];
            
$html $url_array[$pos+5];
            
$_GET['task'] = $task;
            
$_REQUEST['task'] = $task;
            
$_GET['sectionid'] = $sectionid;
            
$_REQUEST['sectionid'] = $sectionid;
            
$_GET['id'] = $id;
            
$_REQUEST['id'] = $id;
            
$_GET['Itemid'] = $Itemid;
            
$_REQUEST['Itemid'] = $Itemid;
            
$QUERY_STRING "option=content&task=$task&sectionid=$sectionid&id=$id&Itemid=$Itemid";
            
// $option/$task/$id/$Itemid
        
} else if (!(isset($url_array[$pos+5]) && $url_array[$pos+5]!="") && (isset($url_array[$pos+4]) && $url_array[$pos+4]!="")) {
            
$task $url_array[$pos+1];
            
$id $url_array[$pos+2];
            
$Itemid $url_array[$pos+3];
            
$html $url_array[$pos+4];
            
$_GET['task'] = $task;
            
$_REQUEST['task'] = $task;
            
$_GET['id'] = $id;
            
$_REQUEST['id'] = $id;
            
$_GET['Itemid'] = $Itemid;
            
$_REQUEST['Itemid'] = $Itemid;
            
$QUERY_STRING "option=content&task=$task&id=$id&Itemid=$Itemid";
            
// $option/$task/$id
        
} else if (!(isset($url_array[$pos+4]) && $url_array[$pos+4]!="") && (isset($url_array[$pos+3]) && $url_array[$pos+3]!="")) {
            
$task $url_array[$pos+1];
            
$id $url_array[$pos+2];
            
$html $url_array[$pos+3];
            
$_GET['task'] = $task;
            
$_REQUEST['task'] = $task;
            
$_GET['id'] = $id;
            
$_REQUEST['id'] = $id;
            
$QUERY_STRING "option=content&task=$task&id=$id";
            
// $option/$task
        
} else if (!(isset($url_array[$pos+3]) && $url_array[$pos+3]!="") && (isset($url_array[$pos+2]) && $url_array[$pos+2]!="")) {
            
$task $url_array[$pos+1];
            
$html $url_array[$pos+2];
            
$_GET['task'] = $task;
            
$_REQUEST['task'] = $task;
            
$QUERY_STRING "option=content&task=$task";
        }
        
$_SERVER['QUERY_STRING'] = $QUERY_STRING;
        
$REQUEST_URI $uri[0]."index.php?".$QUERY_STRING;
        
$_SERVER['REQUEST_URI'] = $REQUEST_URI;
    }

    
/*
    Components
    http://www.domain.com/component/$name,$value
    */
    
if (in_array("component"$url_array)) {

        
$uri explode("component/"$_SERVER['REQUEST_URI']);
        
$uri_array explode("."$uri[1]);
        
$QUERY_STRING "";

        foreach(
$uri_array as $value) {
            
$temp explode("/"$value);
            if (isset(
$temp[0]) && $temp[0]!="" && isset($temp[1]) && $temp[1]!="") {
                
$_GET[$temp[0]] = $temp[1];
                
$_REQUEST[$temp[0]] = $temp[1];
                
$QUERY_STRING .= $temp[0]=="option" "$temp[0]=$temp[1]" "&$temp[0]=$temp[1]";
            }
        }

        
$_SERVER['QUERY_STRING'] = $QUERY_STRING;
        
$REQUEST_URI $uri[0]."index.php?".$QUERY_STRING;
        
$_SERVER['REQUEST_URI'] = $REQUEST_URI;
    }
    
// Extract to globals
    
while(list($key,$value)=each($_GET)) $GLOBALS[$key]=$value;
    
// Don't allow config vars to be passed as global
    
include( "configuration.php" );
}

function 
sefRelToAbs$string ) {
    GLOBAL 
$mosConfig_live_site$mosConfig_sef;
    
//echo $string."<br>";

    
if ($mosConfig_sef && substr($string04)!="http") {

        
// Replace all & with &amp;
        
$string str_replace'&amp;''&'$string );
        
$string str_replace'&''&amp;'$string );

        
/*
        Home
        index.php
        */
        
if ($string=="index.php") {
            
$string="";
        }

        
$sefstring "";
        
/*
        Content
        index.php?option=content&task=$task&sectionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart
        */
        
if (eregi("option=content",$string) && !eregi("task=new",$string) && !eregi("task=edit",$string)) {
            
$sefstring .= "content/";
            if (
eregi("&amp;task=",$string)) {
                
$temp split("&amp;task="$string);
                
$temp split("&"$temp[1]);
                
$sefstring .= $temp[0]."/";
            }
            if (
eregi("&amp;sectionid=",$string)) {
                
$temp split("&amp;sectionid="$string);
                
$temp split("&"$temp[1]);
                
$sefstring .= $temp[0]."/";
            }
            if (
eregi("&amp;id=",$string)) {
                
$temp split("&amp;id="$string);
                
$temp split("&"$temp[1]);
                
$sefstring .= $temp[0]."/";
            }
            if (
eregi("&amp;Itemid=",$string)) {
                
$temp split("&amp;Itemid="$string);
                
$temp split("&"$temp[1]);
                
$sefstring .= $temp[0]."/";
            }
            if (
eregi("&amp;limit=",$string)) {
                
$temp split("&amp;limit="$string);
                
$temp split("&"$temp[1]);
                
$sefstring .= $temp[0]."/";
            }
            if (
eregi("&amp;limitstart=",$string)) {
                
$temp split("&amp;limitstart="$string);
                
$temp split("&"$temp[1]);
                
$sefstring .= $temp[0]."/";
            }
            
$string $sefstring."content.html";
        }

        
/*
        Components
        index.php?option=com_xxxx&...
        */
        
if (eregi("option=com_",$string) && !eregi("option=com_user",$string) && !eregi("option=com_registration",$string) && !eregi("task=new",$string) && !eregi("task=edit",$string)) {
            
$sefstring "component/";
            
$temp split("\?"$string);
            
$temp split("&amp;"$temp[1]);
            foreach(
$temp as $key => $value) {
                
$sefstring .= $value.".";
            }

            
$string str_replace'=''/'$sefstring )."html";
        }

        
//echo $mosConfig_live_site."/".$string;
        
return $mosConfig_live_site."/".$string;
    } else {
        return 
$string;
    }

}
?>
__________________

Last edited by pflegeonline; 03.07.2004 at 23:31.
pflegeonline is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03.07.2004, 21:51   #7 (permalink)
Elite Mamber
 
twysm's Avatar
 
Join Date: Apr 2004
Location: /dev/peru/lima
Posts: 1,008
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
Thumbs down Re: SEF-Url Hack!

This Is Not The Original Code That You Originally Posted!!!!!
__________________
www.ezwp.com
www.diginetperu.com
twysm is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03.07.2004, 23:33   #8 (permalink)
Expert Mamber
 
pflegeonline's Avatar
 
Join Date: Apr 2004
Location: Schladming/Graz
Posts: 414
pflegeonline is on a distinguished road
Default Re: SEF-Url Hack!

I modified the code a bit, cause i got some errors before!

The code now is in the the same as used under http://pflegeonline.pflegenetzwerk.org

greetz
stefan
__________________
pflegeonline is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Approval Hack -> no longer working in 1.0.7 TJay Mambo 4.5 'How Do I' Questions 7 29.06.2004 03:54
How to Hack the {mosimage} tag? mdaniels Mambo 4.5 'How Do I' Questions 2 07.06.2004 17:40


All times are GMT +2. The time now is 08:50.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by