Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-25-2007, 04:55 PM
oldlan oldlan is offline
 
Join Date: Jun 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How can I do this?

I am new to vBulletin, and would like to seek help here.

Suppose I have a url in a message.
Quote:
[url="http://www.site1.com"]
, and I would like vBulletin to display the following html code
Quote:
<a href="http://www.site2.com/redirect.php?tid=xx&url=http://www.site1.com">
in stead of the default one
Quote:
<a href="http://www.site1.com">
The
Quote:
http://www.site2.com/redirect.php?tid=xx&url=
is automatically added when people browse this thread. Where the xx here is the thread id.

Please give me some clue on how to do this? At least let me know which file (funciton) I need to look at and do the modification.

Thanks a lot!
Reply With Quote
  #2  
Old 06-25-2007, 05:05 PM
8utt 8utt is offline
 
Join Date: Aug 2004
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I haven't done anything like this for a while but look at the bbcode manager

If you create a custom [url] code it uses this instead of the default one.

So you can put your http://www.site2.com/redirect.php?tid=xx&url= in the code.
Reply With Quote
  #3  
Old 06-25-2007, 05:22 PM
oldlan oldlan is offline
 
Join Date: Jun 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! Can you tell me how can I custom the [url] code? From Admin CP, I think I can only add new BB Code, and there is no option I can edit existing BB code.

Also, I would prefer urls stored in DB are [url="http://www.site1.com"] format, only when people view the thread it adds the http://www.site2.com/redirect.php?tid=xx&url= .
Reply With Quote
  #4  
Old 06-25-2007, 05:35 PM
8utt 8utt is offline
 
Join Date: Aug 2004
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope sorry was talking a load of rubbish there you cannot crate a bbcode that already exists.

Sorry.

Right how cofident are you with altering php files, I'm not at a pc I can test this on, but if you look at the file class_bbcode.php in the includes directory.

Around line 1777 fine

PHP Code:
    function handle_bbcode_url($text$link
This is the function that parses the url

before

PHP Code:
$rightlink trim($link); 
on line 1779 put

PHP Code:
$rightlink "http://www.site2.com/redirect.php?tid=xx&url=$rightlink"
Make a backup of this file in case it doesn't work
Reply With Quote
  #5  
Old 06-25-2007, 05:51 PM
oldlan oldlan is offline
 
Join Date: Jun 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great help 8utt! I am almost there.

But one more trouble is still there, how can I assign the thread id, which is the xx in (tid=xx), to the url? Have any clue?

I really appreciate it.
Reply With Quote
  #6  
Old 06-25-2007, 08:39 PM
8utt 8utt is offline
 
Join Date: Aug 2004
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Again sorry I cannot test this myself but if you put

PHP Code:
$threadinfo[threadid
does this get parsed ?

eg

PHP Code:
$rightlink "http://www.site2.com/redirect.php?tid=$threadinfo[threadid]&url=$rightlink"
Reply With Quote
  #7  
Old 06-26-2007, 01:54 AM
oldlan oldlan is offline
 
Join Date: Jun 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi 8utt! Thanks a lot! That really helps. It works now. :up:
Reply With Quote
  #8  
Old 06-26-2007, 07:08 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just use my hack, vbAnonymizer. No file edits .
Reply With Quote
  #9  
Old 06-26-2007, 05:51 PM
oldlan oldlan is offline
 
Join Date: Jun 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Dismounted, will definitely try the hack.
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:21 PM.


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.04577 seconds
  • Memory Usage 2,243KB
  • Queries Executed 13 (?)
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
  • (5)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete