vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How can I do this? (https://vborg.vbsupport.ru/showthread.php?t=150618)

oldlan 06-25-2007 04:55 PM

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!

8utt 06-25-2007 05:05 PM

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.

oldlan 06-25-2007 05:22 PM

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

8utt 06-25-2007 05:35 PM

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

oldlan 06-25-2007 05:51 PM

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.

8utt 06-25-2007 08:39 PM

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"


oldlan 06-26-2007 01:54 AM

Hi 8utt! Thanks a lot! That really helps. It works now. :up:

Dismounted 06-26-2007 07:08 AM

Just use my hack, vbAnonymizer. No file edits :).

oldlan 06-26-2007 05:51 PM

Thanks Dismounted, will definitely try the hack.


All times are GMT. The time now is 07:25 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.01214 seconds
  • Memory Usage 1,734KB
  • 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
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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