Topic: How to change username URL

Hi everyone.

I just installed PunBB 1.4.1.

I did a search but I couldn't find an answer to my question so here we go...

Is it possible to change the username URLs so instead of linking to the user's forum profile it would link to a another site (parent site)?

From this: mysite.com/forum/profile.php?id=9

To this: mysite.com/username

Thanks in advance!

Re: How to change username URL

Use website field in user profile.

Re: How to change username URL

Hi dimkalinux.

Thank you for your reply.

I don't mean adding contact information to a user profile.

What I mean is changing the URL of a username.

For example, if I click on your username I am directed to your profile at punbb.informer.com/forums/user/14166/

I would like to change that url, so instead of landing on your profile I would land on mysite.com/dimkalinux

I know I have to change some code in order to achieve this but I wonder if anyone knows what code to change and where?

Re: How to change username URL

You must excuse my english.. It's not my first language..

If anyone can help me find a solution I'll buy him a few beers (through paypal)..

I don't have much but 50 US dollars should be enough for few beers..

What I´m trying to do can't be that complicated.. It's just that I´m a total noob when it comes to programming...

Re: How to change username URL

And how would you moderate your users, if you can't reach their profile be clicking on their username?

Would the links to mysite.com/username allways be on the same domain (your cms) or every user has link to different domains?

Re: How to change username URL

Hi KeyDog.

To explain a little bit better:

I´m creating a small community site. Let's just call it community.com.

When a user signs up at community.com he gets his own profile page and the direct URL to his profile becomes community.com/username.

The punBB forum is just one feature of this community site and it is located at community.com/forum. I've integrated it so that when a user signs up at community.com an account for him is automatically created in the punBB system as well. And when he signs in at community.com he is automatically signed in into the forums as well. I've removed the register and log in/out links from the punBB menu so all users will have to do that through the parent site (community.com).

What I'm trying to do now is to change the username links in the forums so that they point to the user's profiles at community.com/username. It will always be community.com/ and the only variable will be the username. I think it will be confusing for members if they all have two profiles, one for the parent site and one for the forums.

The answer to how I will moderate the users in the punBB system is that I probably won't have to. If I need to ban them or delete them I will do that through the cms for community.com. Of course it would be good to be able to  see all posts or topics by a user but I suspect that his profile page will still be there, I just won't be able to access it by clicking a link. I believe I'll still be able to access the profile page by using the direct URL. For example: community.com/forum/profile.php?id=9

But how will I know the user's id? When a user signs up at community.com he  is assigned an id. And since he is also created in the forums automatically he is assigned the same id there. I can see the user's id in the cms for community.com and I can even create a link there to the user's profile page in the forums.

It would be great if the punBB system could automatically use avatars/profile pictures from user's profiles at community.com but I believe I'm getting ahead of myself,  especially since my knowledge is quite limited in the programming era.

Re: How to change username URL

Okay thanks,

Did you check this post

Try and contact pepak

Let us know how and if you get along...

Re: How to change username URL

Thanks man!

I will check it out..

Re: How to change username URL

I realized that the URL doesn't have to be community.com/username because community.com/id also works.

So I ended up using mod rewrite in .htaccess located in /forum. Works perfectly..

RewriteCond %{QUERY_STRING} ^id=([0-9]*)$
RewriteRule ^profile\.php$ http://community.com/%1 [R=302,L]

I can still use direct links to see all posts and topics by a user, like this: community.com/forum/search.php?action=show_user_posts&user_id=id

10

Re: How to change username URL

HighContrast wrote:

I realized that the URL doesn't have to be community.com/username because community.com/id also works.

So I ended up using mod rewrite in .htaccess located in /forum. Works perfectly..

RewriteCond %{QUERY_STRING} ^id=([0-9]*)$
RewriteRule ^profile\.php$ http://community.com/%1 [R=302,L]

I can still use direct links to see all posts and topics by a user, like this: community.com/forum/search.php?action=show_user_posts&user_id=id

Good stuff, thanks for the update....