Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
User MOD Rewrite Details »»
User MOD Rewrite
Version: 1.00, by altsounds altsounds is offline
Developer Last Online: Dec 2014 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 05-22-2005 Last Update: Never Installs: 24
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 05-31-2005, 05:13 PM
altsounds altsounds is offline
 
Join Date: Dec 2004
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jolten
This is sort of overkill. There are two ways to access user profiles built in, ID and username.

the parameter for id is member.php?u=Userid
the parameter for username is member.php?getinfo&username=username

You do not need to mod rewrite it.
There is a lot of call for people just be able to do sitename/username . You have to understand that most users of websites want to direct link to their profiles but have no idea how. This little hack makes people linking to their profiles and sharing it with friends that much easier.
Reply With Quote
  #23  
Old 06-20-2005, 09:24 AM
blueuniverse blueuniverse is offline
 
Join Date: Jul 2004
Location: UK
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ##############  -->
ABOVE add

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 -->
Note - edited it to add the $vboptions[bburl] suggested by nexialys. Thanks.

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.
Reply With Quote
  #24  
Old 06-21-2005, 02:06 PM
altsounds altsounds is offline
 
Join Date: Dec 2004
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice add on ed. I have already done this on my site but for those that haven't this is of course beneficial.
Reply With Quote
  #25  
Old 06-21-2005, 02:12 PM
nexialys
Guest
 
Posts: n/a
Default

YOURBOARDURLHERE can be replaced by : $vboptions[bburl] ... that's the goal of that variable!
Reply With Quote
  #26  
Old 06-21-2005, 06:05 PM
blueuniverse blueuniverse is offline
 
Join Date: Jul 2004
Location: UK
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I edited it to include that. Thanks
Reply With Quote
  #27  
Old 07-10-2005, 02:34 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #28  
Old 07-15-2005, 08:05 PM
altsounds altsounds is offline
 
Join Date: Dec 2004
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #29  
Old 07-20-2005, 02:26 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #30  
Old 07-20-2005, 03:08 AM
KTBleeding's Avatar
KTBleeding KTBleeding is offline
 
Join Date: Feb 2004
Location: Tooele, UT
Posts: 756
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #31  
Old 07-20-2005, 03:58 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:11 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08257 seconds
  • Memory Usage 2,305KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete