The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
User MOD Rewrite Details »» | |||||||||||||||||||||||||
This is a pretty simple hack but is designed so that you can access members profiles quickly and / or your members can have an easy link to pass around for their user profile.
STEP 1: If you don't have one already create a file named .htaccess in your forums root directory. STEP 2: Paste the following code within that file: ## Altsounds.com Member re-write Hack Version1 ## All music fans should check out altsounds.com for lots of free music to listen to!! # turn the Apache MOD_REWRITE engine on RewriteEngine On # this first rule will catch the "blank" entry into the # Forums directory, taking the user to the main forum page - change as appropriate RewriteRule ^$ hangout.php # this next entry will catch everything else and pass # it to the member.php engine for processing in # the "member" section RewriteRule (^[-_A-Za-z0-9\ ]*$) member.php?&username=$1 That's it! My main forum page is hangout.php. So you should change that within the code above to whatever your forum main page is (usually index.php). Now all your members links to their profile is {link to forum}/{username} or {link to forum}/{userid} e.g. in my websites case http://hangout.altsounds.com/altsounds or will take you directly to the username "altsounds" user profile. If no profile is available (i.e. a member is not registered) you will get the appropriate error message. Simple but cool. Hope you all enjoy. Show Your Support
|
Comments |
#22
|
|||
|
|||
Quote:
|
#23
|
|||
|
|||
Just to make things even easier for the members (something that is needed on my boards, you can add a link to their profile on the main usercp page). This is what suited me best, but I thought it might be wortwhile posting it here so some of you guys could possibly make use of it.
Anyway, it's just a simple template edit. Go to the template USERCP. Then do the following. Find Code:
<!-- ############## SUBSCRIBED THREADS ############## --> Code:
<!-- Start modrewrite usercp add - by ed --> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tbody id="collapseobj_usercp_proflink" style="$vbcollapse[collapseobj_usercp_proflink]"> <tr> <td class="alt1"><strong>Link to profile: </strong><a href="$vboptions[bburl]/$bbuserinfo[username]">$vboptions[bburl]/$bbuserinfo[username]</a></td> </tr> </tbody> </table> <br /> <!-- End modrewrite usercp add - by ed --> Also, it should be noted that the bit of code there only works when you do the username mod_rewrite. If you did the userid mod_rewrite then replace $bbuserinfo[username] with $bbuserinfo[userid]. I haven't tested that, but I'm pretty sure it should work. |
#24
|
|||
|
|||
Nice add on ed. I have already done this on my site but for those that haven't this is of course beneficial.
|
#25
|
|||
|
|||
YOURBOARDURLHERE can be replaced by : $vboptions[bburl] ... that's the goal of that variable!
|
#26
|
|||
|
|||
Ok, I edited it to include that. Thanks
|
#27
|
||||
|
||||
There's a bug, gang. The username is working. The userid isn't. It's going to a user not found page because it can't find a user with a number name.
Amy |
#28
|
|||
|
|||
Thanks for letting me know Amy. The userid thing was added by another user, not me. My original was specifically so that you could do username.
|
#29
|
||||
|
||||
The UserID works for me, as does the member name. This is very neat.. the only thing I didn't like was the trailing slash, but I'll just get used to it!
@Amy: Could it be something with your mod_rewrite? |
#30
|
||||
|
||||
Pretty cool mod..
I did notice a problem though. If a user has a "." in their name, it will not work. I'm pretty sure this is an obvious error.. Would there happen to be a fix for this at all? |
#31
|
||||
|
||||
I also noticed that if the user has a space in their name, it doesn't work. A %20 is added in its place... and won't work.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|