php - In osclass change http://domainname/user/profile/1 to http://domainname/username, is it possible? -


hi using osclass , user profile have go url permalink enabled

http://domainname/user/profile/1

is possible view user profile url

http://domainname/username

with simple permalink changes ?or have change code this?

please let me know how it.

first, user id 42, can let user choose username (that's feature in osclass) both these urls point same page:

  • http://domain.com/user/profile/42
  • http://domain.com/user/profile/myowncustomusername

now changing 'user/profile', need head admin, settings > permalinks can change rules used routing/rewriting urls.

you have two problems though:

  1. urls http://domain.com/something used search , category (have nice urls categories). modification mess behavior.
  2. osclass doesn't allow save empty rewrite rule in admin.

i can started think trying change might work need lot of testing , headaches. if ask me, it's not worth hassle.

to deal first problem,

you'll need modify search controller user username something first, before looking category named something.

look in /oc-includes/osclass/controller/search.php around line 78.

to deal second problem,

you change if-block:

if(!osc_validate_text($rewrite_user_profile)) {    $errors += 1; } else {    osc_set_preference('rewrite_user_profile', $rewrite_user_profile); } 

by:

osc_set_preference('rewrite_user_profile', $rewrite_user_profile); 

in file /oc-admin/controller/settings/permalinks.php around line 245.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -