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
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/42http://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:
- urls
http://domain.com/somethingused search , category (have nice urls categories). modification mess behavior. - 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
Post a Comment