Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
Change [URL] tag in vB to additional link information? Details »»
Change [URL] tag in vB to additional link information?
Version: , by Pulsorock Pulsorock is offline
Developer Last Online: Jan 2011 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 06-12-2002 Last Update: Never Installs: 0
 
No support by the author.

Hello,
I want to modify the code that links to external links on my vB. I think what I need to modify is the [URL] tag. But where can I do this?
For example if a user place a link to www.yahoo.com I want it to change it automatically to www.domain.com/redir.php?url=www.yahoo.com

Show Your Support

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

Comments
  #2  
Old 06-12-2002, 07:37 PM
scsa20's Avatar
scsa20 scsa20 is offline
 
Join Date: Mar 2002
Location: Mars
Posts: 458
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

more then likely, that tag is in the admin/functions.php file.

anyone, please correct me if I'm wrong...anyways...in admin/functions.php, look for

PHP Code:
return "<a href=\"$righturl\" target=\"_blank\">".str_replace('\"''"'$hyperlink)."</a>" 
and replace it with

PHP Code:
return "<a href=\"www.domain.com/redir.php?url=$righturl\" target=\"_blank\">".str_replace('\"''"'$hyperlink)."</a>" 
like I said, I don't know if it's that you change or something else...sorry for not being more of a help
Reply With Quote
  #3  
Old 06-13-2002, 01:51 AM
Pulsorock Pulsorock is offline
 
Join Date: Oct 2001
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks.... I'll try it.
Reply With Quote
  #4  
Old 06-13-2002, 02:11 PM
Pulsorock Pulsorock is offline
 
Join Date: Oct 2001
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It worked fine....
But unfortunately when is on a link that passes more than one variable thru the URL the redirect doesn't work as it supposed.
For example it works great like this:
www.domain.com/redirect.php?url=http://www.yahoo.com or www.domain.com/redirect.php?url=http://google.yahoo.com/bin/query?p=pulsorock
but if the link refer has more than one variable in the URL like this: www.domain.com/redirect.php?url=http://google.yahoo.com/bin/query?p=pulsorock&hc=0&hs=0
it doesn't work, because when the other variable is called in the URL by the "&" my redirect script thinks is another variable and doesn't count it as the whole URL. The redirected URL by the script is http://google.yahoo.com/bin/query?p=pulsorock instead of the whole URL that is http://google.yahoo.com/bin/query?p=pulsorock&hc=0&hs=0.
Here is the part of my script that generates the redirect, maybe someone can tell me what can I do to fix this.
PHP Code:
<?
$link_url = $url;

//Here goes the code that inserts the url to mysql//

header("Location: ".$link_url);
exit;
?>
Thanks
Reply With Quote
  #5  
Old 06-13-2002, 08:16 PM
scsa20's Avatar
scsa20 scsa20 is offline
 
Join Date: Mar 2002
Location: Mars
Posts: 458
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

okey, I think I know what you need to do....do a search for the following in the same file you just edit..

PHP Code:
$righturl "http://$righturl"
and remove the http:// so it'll look like:

PHP Code:
$righturl "$righturl"
then replace:

PHP Code:
//one of them your useing, pic which one your using now
//old one...the non edited one I mean
return "<a href=\"$righturl\" target=\"_blank\">".str_replace('\"''"'$hyperlink)."</a>"
//new one...the one that you probly replace from what I told you on the other post
return "<a href=\"www.domain.com/redir.php?url=$righturl\" target=\"_blank\">".str_replace('\"''"'$hyperlink)."</a>" 
and replace whatever one with:

PHP Code:
return "<a href=\"http://www.domain.com/redir.php?url=$righturl\" target=\"_blank\">".str_replace('\"''"'$hyperlink)."</a>" 
it should work now
Reply With Quote
Reply

Thread Tools

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 02:40 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.03779 seconds
  • Memory Usage 2,248KB
  • Queries Executed 20 (?)
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
  • (7)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete