Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 2001
Posts: 129
Member
Member
Offline
Joined: Sep 2001
Posts: 129
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):=
=================================================================

$ubbt_lang['TEXT_IMAGEREFERER'] = "http:\/\/upload.turbosport\.co\.uk";

=================
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.
Attachments
101907-AllowDynamicImage.txt (0 Bytes, 50 downloads)

Sponsored Links
Entire Thread
Subject Posted By Posted
Beta-[6.3-6.4] Allow Dynamic Images from Known Referer Turbosport 12/14/2003 10:54 PM
Re: Beta-[6.3-6.4] Allow Dynamic Images from Known Referer JoshPet 12/14/2003 11:32 PM
Re: Beta-[6.3-6.4] Allow Dynamic Images from Known Referer Sapphy 12/15/2003 3:23 PM
Re: Beta-[6.3-6.4] Allow Dynamic Images from Known Referer Gardener 12/16/2003 11:36 AM
Re: Beta-[6.3-6.4] Allow Dynamic Images from Known Referer Turbosport 12/16/2003 6:11 PM
Re: Beta-[6.3-6.4] Allow Dynamic Images from Known Referer Gardener 12/16/2003 7:42 PM
Re: Beta-[6.3-6.4] Allow Dynamic Images from Known Referer Turbosport 12/16/2003 8:26 PM
Re: Beta-[6.3-6.4] Allow Dynamic Images from Known Referer Gardener 12/17/2003 1:30 AM
Re: Beta-[6.3-6.4] Allow Dynamic Images from Known Referer Turbosport 12/17/2003 11:12 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 254
Joined: January 2000
Forum Statistics
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)