php forum
php mysql forum
php mysql smarty
 
Topic Options
#274846 - 06/11/04 02:37 AM Finished-[6.4] Post Image Limit v1.0.0
PaNTerSan Offline
Journeyman

Registered: 03/19/04
Posts: 122
Loc: EU, Slovenia

   Finished-[6.4] Post Image Limit v1.0.0 to Del.icio.us Add to del.icio.us
  Digg Finished-[6.4] Post Image Limit v1.0.0 Digg it
Mod Name / Version: Post Image Limit v1.0.0<br /><br />Description: This trivial mod allows you to control number of images users put in their posts. All images are counted: graemlins, image code tags and html <img src> tag. <br /><br />Working Under: UBB.Threads 6.4 <br /><br />Mod Status: Finished <br /><br />Any pre-requisites: None. <br /><br />Author(s): PaNTerSan <br /><br />Date: 06/11/04 <br /><br />Credits: Astaran for guidance <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /> <br /><br />Files Altered: config.inc.php, ubbt.inc.php <br /><br />New Files: None. <br /><br />Database Altered: NO <br /><br />Info/Instructions: See below.<br /> <br /><br />Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /><br />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. <br /><br />My notes:<br />[*]When using my instructions, use some board that supports ubbCode and make copy&paste instructions to a post - then use magic: preview <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br /><br /><br />Feature suggestions & improvements:<br />[*]None.<br /><br /><br /><br />History<br /> 2004.06.11 PaNTerSan - 1.0.0 Original coding started<br /><br /><br /><br />Installation Steps<br /><br /><br />______________________________________________________________________________<br />[:"purple"] Code changes [/] <br /><br />[*][:"green"] File[/]<br />config.inc.php<br /><br />[:"red"]At the end add[/]<br />
Code:
<br />$config['maxImages'] = '5';     // maximum number of immages in a post<br />
<br />Set value to your desires <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />[*][:"green"] File[/]<br />ubbt.inc.php<br /><br />[:"blue"]Find in do_markup[/] <br />
Code:
<br />                $Body = preg_replace("/(\[IMG\]|\[{$ubbt_lang['TEXT_IMAGE']}\])http([^\[]*)\.(gif|jpg|png)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i", "&lt;img src=\"http\\2.\\3\"&gt;", $Body);              <br />
<br /> <br />[:"red"]Replace with[/]<br />
Code:
<br />                $Body = preg_replace("/(\[IMG\]|\[{$ubbt_lang['TEXT_IMAGE']}\])http([^\[]*)\.(gif|jpg|png)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i", "&lt;img src=\"http\\2.\\3\"&gt;", $Body);              <br />                <br />                $images = preg_match_all("/img src/", $Body, $out, PREG_SET_ORDER);<br />                if ( $config['maxImages'] &lt; $images ){<br />                    $msg = "You can only have {$config['maxImages']} images in your post";<br />                    $this-&gt;not_right($msg, $Cat);<br />                }<br />
<br />Note: I am also using Astaran's signature restriction <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /><br /><br />[*]End Code changes


Attachments
114993-Post Image Limit v1.0.0.zip (5 downloads)


Top
#274847 - 06/11/04 03:14 AM Re: Finished-[6.4] Post Image Limit v1.0.0 [Re: Brandon Long]
PaNTerSan Offline
Journeyman

Registered: 03/19/04
Posts: 122
Loc: EU, Slovenia
_________________________
Kind regards,
PaNTerSan

Top


Moderator:  Ian_W 
Top Posters Last 30 Days
AllenAyres 12
Gizmo 10
S7ARBVCK 2
blaaskaak 2
Cambridge 1
Murphdog 1
MattUK 1
Who's Online
0 Registered (), 23 Guests and 9 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
[7.3.1] add search to showmembers page
by blaaskaak
Today at 04:50 AM
BeyondCompare v3.00
by blaaskaak
09/05/08 02:46 PM
Noob - need help, or a reality check!
by Gizmo
09/04/08 03:21 AM
Here I am! Rock me like a Hurricane!
by AllenAyres
09/02/08 03:05 PM
[7.x] Generic Page Outside of forum directory
by Gizmo
08/30/08 05:43 PM
Team UBBDev Rides Again!
by Gizmo
08/28/08 11:45 PM
Multiple Identity Detector
by MattUK
08/28/08 04:10 PM
New Mods
[7.3.1] add search to showmembers page
by blaaskaak
Today at 04:50 AM
Installing FlashChat with 7.3
by Paug
08/23/08 12:14 AM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.2.1] - Naked shoutbox
by sirdude
08/17/07 10:36 PM
[7.x] Generic Page Outside of forum directory
by
01/14/07 10:58 PM
Newest Members
veedubb8, twentyseven, Claus1, welcomeback1, Paug
13327 Registered Users

 

 

 
fusionbb message board php hacks