vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Modifying [attach] (https://vborg.vbsupport.ru/showthread.php?t=116097)

weeno 05-19-2006 05:42 PM

Modifying [attach]
 
I'm trying to consolidate attachments onto one server. Instead of my attachments being on forums.xyz.com, I am putting them on att.xyz.com.

Now, for the most part, this was easily done by changing the templates to point to the specific server.

That worked out, but the one remaining issue is that the [attach] BBcode still links to attachments to the forums.xyz.com url.

I was looking to change this, but found out that attach is hard coded in the php files. I could change it manually, but this makes it more difficult to upgrade in the future. I looked into patching/extending the bbcode via the plug in system, but it doesn't appear that easy for this particular tag. [attach] is apparently handled by [img] which doesn't appear to use the same call-back functions.

Anyone have any ideas how to accomplish this in the most maintinence free-way?

arn

Logikos 05-20-2006 07:25 AM

I know from experiace that this can't be done without editing the files.

weeno 05-20-2006 03:30 PM

Ok... well, I guess I'll just do it. It's a small change. here it is in case anyone needs to do it in the future:

In includes/class_bbcode.php

find:

Quote:

function handle_bbcode_img($bbcode, $do_imgcode, $has_img_code = false)
right after

Quote:

$bbcode = preg_replace($search, $replace, $bbcode);
add:

Quote:

$bbcode=str_replace("forums.xyz.com/attachment.php","att.xyz.com/attachment.php",$bbcode);


All times are GMT. The time now is 03:47 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.01878 seconds
  • Memory Usage 1,710KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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