Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-08-2012, 08:46 PM
Crimm's Avatar
Crimm Crimm is offline
 
Join Date: Feb 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vb:link modification help

I want to change the value of vb:link member to point to an external profile. I understand the syntax: https://www.vbulletin.com/docs/html/...s_syntax_links but what I'd like to do is wherever there is a link to the users' profile, have it point somewhere else.

Example:

Currently it is pointed to: http://mysite.com/member.php?u=1
I would like to change it to: http://mysecondsite/profile.php?u=1

I've tried playing with class_friendly_url and member.php to disable or change the friendly url, but didn't really find a way to change the values spread throughout the installation. I've been searching on and off all day, and decided just to ask.

I've also tried playing with PHP headers and redirects, but that's a bit messy. I'd like to have it change the site url throughout.

I'm on vb 4.1.10

Thanks for your help!
Reply With Quote
  #2  
Old 02-10-2012, 01:22 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You might be able to change includes/class_friendly_url.php and change member.php to profile.php. Or you might try using a replacement variable. But I think the best way would be to find all the links in the templates and change them to what you want them to be (doesn't look like there's a vb:link for profile, so you'd just have to replace it with the url).
Reply With Quote
Благодарность от:
Crimm
  #3  
Old 02-10-2012, 02:33 PM
Crimm's Avatar
Crimm Crimm is offline
 
Join Date: Feb 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for your response. Unfortunately I can't find a way to change domains or subdomains in this case. I did a search for the instances in templates and there were at least 50, and I'm probably missing some, so I can't realistically catch them all.

I'm going to try a replacement variable today, and if that doesn't work then I'm going to set class_friendly_url to point to a dummy PHP file that does the redirect for me.

Thank you for your time!
Reply With Quote
  #4  
Old 02-10-2012, 02:37 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Crimm View Post
Thank you for your response. Unfortunately I can't find a way to change domains or subdomains in this case.
Oops - yeah, I missed the fact that you wanted to link to a different domain.

Another thing you might be able to do is use a .htaccess file to rewrite the url if it has member.php in it (but I don't know enough about that to tell you exactly how to do it).
Reply With Quote
  #5  
Old 02-10-2012, 03:29 PM
Crimm's Avatar
Crimm Crimm is offline
 
Join Date: Feb 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replacement variables took care of it quick, but I have a new question:

How do you use Replacement Variables with "usernames" of everyone on the page? I can do it with one - Example:

Replace: href="member/1-crimm" with href="anotherdomain.com/crimm"

but how can I implement, something like, $bbuserinfo?

Thanks!
Reply With Quote
  #6  
Old 02-10-2012, 03:35 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...I guess you can't, it only does simple replacements. You might want to check out the .htaccess thing, I think it lets you do pattern matching. Or you might be able to do it in a plugin using preg_replace().
Reply With Quote
  #7  
Old 02-10-2012, 03:46 PM
Crimm's Avatar
Crimm Crimm is offline
 
Join Date: Feb 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay I got it working. What I did in basics:

1) Changed class_friendly_url.php to change to a folder I could better control (Not listed in vbulletin anywhere)
2) Changed member.php to ignore friendly urls
3) Change my .htaccess to rewrite/redirect the new folder to the domain where the profile is located

It seems to work well.

Thanks for your time. Maybe I can drop in what I did in the articles section later today
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 07:58 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.07530 seconds
  • Memory Usage 2,221KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (1)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete