Go Back   Pligg Forum > Pligg Development > Pligg Mods
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-07-2007, 09:18 PM
limey limey is offline
New Pligger
 
Join Date: Mar 2007
Posts: 10
Downloads: 5
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Better Mod Rewrite Control

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
Sponsored Links
Check out the New Templates at the Pligg Pro Shop.
  #2 (permalink)  
Old 04-08-2007, 01:36 AM
savant's Avatar
savant savant is offline
Pligg Koder
 
Join Date: Apr 2006
Location: UK
Posts: 1,234
Downloads: 7
Uploads: 0
Thanks: 66
Thanked 210 Times in 151 Posts
so you want to have urlmethod1 for userprofiles, and urlmethod2 for categories and others.
__________________
Anatomy of the Pligg template Help needed
Reply With Quote
  #3 (permalink)  
Old 04-08-2007, 02:19 AM
limey limey is offline
New Pligger
 
Join Date: Mar 2007
Posts: 10
Downloads: 5
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
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, 03:44 AM
savant's Avatar
savant savant is offline
Pligg Koder
 
Join Date: Apr 2006
Location: UK
Posts: 1,234
Downloads: 7
Uploads: 0
Thanks: 66
Thanked 210 Times in 151 Posts
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
__________________
Anatomy of the Pligg template Help needed
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

vB 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
how can i define my own rewrite rules abramelin General Help 1 04-07-2007 09:19 AM
Spam Control Options richrf General Help 3 02-09-2007 09:56 AM
control M characters in files joewee Bug Report 0 10-20-2006 10:03 PM
URL rewrite and variable definition errors rohanpinto Bug Report 3 09-27-2006 05:43 AM


LinkBacks Enabled by vBSEO 3.0.0