Mod Name / Version: Allow Dynamic Images from Known Referer
Description: Allow Dynamic Images from Known Referer, files containing question marks in the url are dissallowed by threads, some sites protect thier bandwidth with a redirection script this hack allows the known refer's images to be marked up.
Working Under: UBB.Threads 6.3-6.4
Mod Status: Beta
Any pre-requisites: None
Author(s): Turbosport
Date: 12/14/03
Credits: Clint Gaskin
Files Altered: /lang/englis/generic.php
ubbt.inc.php
New Files: None
Database Altered: No
Info/Instructions: Allow dynamic images from known referer
Clint Gaskin December 2003 V1.0 for T6.4
================================================================= In Generic php add this (changing details to match your domain):= =================================================================
================= in ubbt.inc.php:= =================
Find:
// --------------------- // Convert image markup if ($config['allowimages']) { if (!preg_match("/(\[IMG\]|\[{$ubbt_lang['TEXT_IMAGE']}\])(.*?)(\?|"|')(.*?)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i",$Body)) { $Body = preg_replace("/(\[IMG\]|\[{$ubbt_lang['TEXT_IMAGE']}\])http([^\[]*)(\.gif|\.jpg|\.png)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i","<img src="http\\2\\3">",$Body); } }
Add this below it:
// --------------------- // Convert dynamic image markup from known referer if ($config['allowimages']) { if (preg_match("/(\[IMG\]{$ubbt_lang['TEXT_IMAGEREFERER']}|\[{$ubbt_lang['TEXT_IMAGE']}\]{$ubbt_lang['TEXT_IMAGEREFERER']})(.*?)(|"|')(.*?)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i",$Body)) { $Body = preg_replace("/(\[IMG\]|\[{$ubbt_lang['TEXT_IMAGEREFERER']}\])http([^\[]*)(\.gif|\.jpg|\.png)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i","<img src="http\\2\\3">",$Body); } }
Disclaimer: Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.