vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   vb:link modification help (https://vborg.vbsupport.ru/showthread.php?t=278283)

Crimm 02-08-2012 08:46 PM

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!

kh99 02-10-2012 01:22 PM

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).

Crimm 02-10-2012 02:33 PM

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!

kh99 02-10-2012 02:37 PM

Quote:

Originally Posted by Crimm (Post 2298246)
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).

Crimm 02-10-2012 03:29 PM

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!

kh99 02-10-2012 03:35 PM

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().

Crimm 02-10-2012 03:46 PM

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 :)


All times are GMT. The time now is 11:32 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00951 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete