Better Mod Rewrite Control

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-07-2007, 10:18 PM
New Pligger
 
Join Date: Mar 2007
Posts: 8
I'm not sure how to do it. I'm new to pligg, but some kind of control of friendly urls would be nice.

ie: removing the capability of rewriting the urls such as user profiles and such and keeping only the categories, story titles, out links.

I know its possible and it would be a nice addition.
Reply With Quote
  #2 (permalink)  
Old 04-08-2007, 02:36 AM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,181
so you want to have urlmethod1 for userprofiles, and urlmethod2 for categories and others.
Reply With Quote
  #3 (permalink)  
Old 04-08-2007, 03:19 AM
New Pligger
 
Join Date: Mar 2007
Posts: 8
Yes.
urlmethod1 for userprofiles and other user related links.
urlmethod2 for cats and other important friendly url items.
Reply With Quote
  #4 (permalink)  
Old 04-08-2007, 04:44 AM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,181
in html1.php you'll find a function called getmyurl

just after this code.
PHP Code:
    if ($URLMethod == 2)
    {   
             
//some code here
    

add another if statement
PHP Code:
    if ($URLMethod == 9)
    {   
        If (
$x == "maincategory") {return my_pligg_base."/category/" $var1;}
        If (
$x == "queuedcategory") {return my_pligg_base."/queued/category/" $var1;}
        If (
$x == "discardedcategory") {return my_pligg_base."/discarded/category/" $var1;}
        If (
$x == "editlink") {return my_pligg_base."/story/" $var1 "/edit/";}
        If (
$x == "edit") {return my_pligg_base."/story/" $var1 "/editcomment/" $var2;}
        If (
$x == "user") {return my_pligg_base."/user/view/profile/" $var1;}
        If (
$x == "user_friends") {return my_pligg_base."/user/view/" $var2;}
        If (
$x == "user_add_remove") {return my_pligg_base."/user/view/" $var2"/login/" $var1;}
        If (
$x == "user_add_links") {return my_pligg_base."/user/add/link/" $var1;}
        If (
$x == "user_remove_links") {return my_pligg_base."/user/remove/link/" $var1;}
        If (
$x == "user_inbox") {return my_pligg_base."/inbox";}
        If (
$x == "userblank") {return my_pligg_base."/user/";}
        If (
$x == "user2") {return my_pligg_base."/user/view/" $var2 "/login/" $var1 "/";}
        If (
$x == "index") {return my_pligg_base."/index/";}
        If (
$x == "index_sort") {return my_pligg_base."/index/" $var1 "/".$var2;}
        If (
$x == "search") {return my_pligg_base."/search/" $var1;}
        If (
$x == "login") {return my_pligg_base."/login.php?return=" $var1;}
        If (
$x == "logout") {return my_pligg_base."/login.php?op=logout&return=" $var1;}
        If (
$x == "register") {return my_pligg_base."/register";}
        If (
$x == "submit") {return my_pligg_base."/submit";}
        If (
$x == "story") {return my_pligg_base."/story/" $var1 "/";}
        If (
$x == "storytitle") {return my_pligg_base."/story/title/" $var1 "/";}
        If (
$x == "storycattitle") {return my_pligg_base."/" $var1 "/" $var2 ."/";}
        If (
$x == "out") {return my_pligg_base."/out/" $var1 "/";}
        If (
$x == "outtitle") {return my_pligg_base."/out/" $var1 "/";}
        If (
$x == "root") {return my_pligg_base."/";}
        If (
$x == "upcoming") {return my_pligg_base."/upcoming";}
        If (
$x == "upcoming_sort") {return my_pligg_base."/upcoming/" .$var1."/".$var2;}
        If (
$x == "discarded") {return my_pligg_base."/discarded/";}
        If (
$x == "topusers") {return my_pligg_base."/topusers";}
        If (
$x == "profile") {return my_pligg_base."/profile";}
        If (
$x == "userNoVar") {return my_pligg_base."/user";}
        If (
$x == "loginNoVar") {return my_pligg_base."/login";}
        If (
$x == "rssTime") {return my_pligg_base."/rss2.php?time=" $var1;}
        If (
$x == "about") {return my_pligg_base."/about/".$var1;}
        If (
$x == "rss2") {return my_pligg_base."/rss2/";}
        If (
$x == "rss2user") {return my_pligg_base."/rss2/user/" $var1 "/";}
        If (
$x == "rss2queued") {return my_pligg_base."/rss2/" $var1 "/";}
        If (
$x == "rss2all") {return my_pligg_base."/rss2/" $var1 "/";}
        If (
$x == "rss2category") {return my_pligg_base."/rss2/category" $var1 "/";}
        If (
$x == "rss2search") {return my_pligg_base."/rss2/search" $var1 "/";}
        If (
$x == "trackback") {return my_pligg_base."/trackback/" $var1 "/";}
        If (
$x == "page") {return my_pligg_base."?page=";}
        
//admin functions
        
If ($x == "admin") {return my_pligg_base."/admin";}
        If (
$x == "admin_users") {return my_pligg_base."/admin_users.php";}
        If (
$x == "admin_language") {return my_pligg_base."/module.php?module=admin_language";}
        If (
$x == "admin_categories") {return my_pligg_base."/admin_categories.php";}
        If (
$x == "admin_backup") {return my_pligg_base."/admin_backup.php";}
        If (
$x == "admin_config") {return my_pligg_base."/admin_config.php";}
        If (
$x == "admin_modify") {return my_pligg_base."/story/" $var1 "/modify/main/";}
        If (
$x == "admin_modify_do") {return my_pligg_base."/story/" $var1 "/modify/do" $var2 "/";}
        If (
$x == "admin_modify_edo") {return my_pligg_base."/story/" $var1 "/modify/edo" $var2 "/";}
        If (
$x == "admin_discard") {return my_pligg_base."/story/" $var1 "/modify/discard/";}
        If (
$x == "admin_queued") {return my_pligg_base."/story/" $var1 "/modify/queued/";}
        If (
$x == "admin_published") {return my_pligg_base."/story/" $var1 "/modify/published/";}
        If (
$x == "editcomment") {return my_pligg_base."/story/" $var2 "/editcomment/" $var1;} //leave the . in "./editcomment" because full url should be /story/15/editcomment/2
        
If ($x == "tagcloud") {return my_pligg_base."/tagcloud";}
        If (
$x == "tagcloud_range") {return my_pligg_base."/tagcloud/range/" $var1;}
        If (
$x == "comments") {return my_pligg_base."/comments";}
        If (
$x == "published") {return my_pligg_base."/published";}
        If (
$x == "unpublished") {return my_pligg_base."/unpublished";}
        If (
$x == "tag") {return my_pligg_base."/tag/" $var1;}
        If (
$x == "tag2") {return my_pligg_base."/tag/" $var1 "/" $var2 "/";}
        If (
$x == "live") {return my_pligg_base."/live";}
        If (
$x == "template") {return my_pligg_base."/settemplate";}
        If (
$x == "settemplate") {return my_pligg_base."/settemplate/" .$var1;}            
    } 
at the moment url method 9 is the same as urlmethod 2, so just edit the one you want from urlmethod 1.

For example:
PHP Code:
If ($x == "user") {return my_pligg_base."/user/view/profile/" $var1;} 
changes to
PHP Code:
If ($x == "user") {return my_pligg_base."/user.php?login=" $var1;} 
and then change the urlmethodto 9 in Configure pligg in admin panel
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subdomain Url rewrite. ashishhbti Questions and Comments 0 08-29-2008 04:18 AM
Help for URL rewriting in Isapi Rewrite bluebox Questions and Comments 0 07-16-2008 02:45 AM
Category htaccess mod rewrite output ordering mspainhower Questions and Comments 2 05-13-2007 06:56 PM
Spam Control Options richrf Questions and Comments 3 02-09-2007 10:56 AM
control M characters in files joewee Questions and Comments 0 10-20-2006 11:03 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development