php forum
php mysql forum
php mysql smarty
 
Page 1 of 2 1 2 >
Topic Options
#269012 - 02/09/04 06:55 AM Finished-[6.3-6.4] Restrict signatures
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Mod Name / Version: Restrict signatures <br /> <br />Description: This hack allows the administrators to restrict the users' signatures via the admin panel. <br />Possible restrictions: <br />- maximum height/width of an image <br />- number of images <br />- max. filesize of the images <br />- max. number of linebreaks <br /> <br />Working Under: UBB.Threads 6.3-6.4 <br /> <br />Mod Status: Finished <br /> <br />Any pre-requisites: none <br /> <br />Author(s): Astaran <br /> <br />Date: 02/09/04 <br /> <br />Credits: My moderators who requested it <br /> <br />Files Altered: changebasic.php, ubbt.inc.php, config.inc.php <br /> <br />New Files: none <br /> <br />Database Altered: no <br /> <br />Info/Instructions: <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.


Attachments
107486-restrict_signature.txt (197 downloads)



Edited by Astaran (02/11/04 04:15 PM)

Top
#269013 - 02/09/04 08:56 AM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
Zackary Offline
Member

Registered: 03/01/01
Posts: 652
Loc: West Fargo, ND USA
Awesome! A must have! No more HUUUUGE sig images on my forums. muahaha <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />Tossing this on my todo list, thanks Astaran! <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />

Top
#269014 - 02/09/04 10:08 AM Re: Finished-[6.3-6.4] Restrict signatures [Re: ]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
I forgot the language strings. Just grab the updated instructions.
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#269015 - 02/09/04 05:30 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
DLWebmaestro Offline
Member

Registered: 08/08/00
Posts: 1753
Loc: California, MD
Has this just plain not worked for anyone? I tested it by entered a sig with a bunch of line breaks, but it allows it.
_________________________
Webmaster
Drumlines.org

Drumlines.org UBBThreads

Top
#269016 - 02/09/04 07:00 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Nice! <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#269017 - 02/10/04 01:47 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: eslmix]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
[]DLWebmaestro said:<br />Has this just plain not worked for anyone? I tested it by entered a sig with a bunch of line breaks, but it allows it. [/]<br /><br />You're right. I fixed it and updated the instructions.<br />Only this row changed:<br /><br /> $sigLines = preg_match_all("/\\n/",$Signature, $outLines);

Top
#269018 - 02/10/04 02:38 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
Great mod!<br /><br />Now all I need to do is write a script to check all the existing ones! <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#269019 - 02/10/04 04:33 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: gailg]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
I already did such a script.<br />It sends out an PM to all users who have a signature that don't fit to the new rules.
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#269020 - 02/10/04 04:43 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Attached you'll find a script that checks all signatures if they match to your rules defined in the config file. <br />If the signature don't fit to the rules, the signature is deleted. Additionally, the user receives an PM with his old signature so that he can changed and reapply it. <br /> <br />Note: Change the Body of the private message and make a Backup of your database first! <br />Rename the attachement to .php and upload it to you ubbthreads main dir. Delete it after execution.


Attachments
107649-sigremove_en.txt (108 downloads)



Edited by Astaran (02/10/04 06:30 PM)

Top
#269021 - 02/10/04 06:17 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
DLWebmaestro Offline
Member

Registered: 08/08/00
Posts: 1753
Loc: California, MD
<img src="http://www.ubbdev.com/forum/images/graemlins/yay.gif" alt="" /> It works now! <img src="http://www.ubbdev.com/forum/images/graemlins/grin.gif" alt="" /> But where is that attached script you were talking about?
_________________________
Webmaster
Drumlines.org

Drumlines.org UBBThreads

Top
#269022 - 02/10/04 06:31 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: eslmix]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Good question.<br />There it is. <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#269023 - 02/10/04 07:40 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
DLWebmaestro Offline
Member

Registered: 08/08/00
Posts: 1753
Loc: California, MD
<img src="http://www.ubbdev.com/forum/images/graemlins/yay.gif" alt="" />
_________________________
Webmaster
Drumlines.org

Drumlines.org UBBThreads

Top
#269024 - 02/11/04 03:44 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: eslmix]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
What is $imageSize = remoteFileSize($imageUrl); ? <br /> <br />Also, I'm getting some $imageUrl errors, its creating: <br /> <br />http://http://www.viperalley
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#269025 - 02/11/04 04:22 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: gailg]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
My fault, I didn't add that to the instructions.<br />Just add this function to your ubbt.inc.php (I updated the instructions to reflect this):<br /><br />function remoteFileSize($remote_file)<br />{<br /> $file = file_get_contents($remote_file);<br /> <br /> return strlen($file);<br />}<br /><br />[]<br />Also, I'm getting some $imageUrl errors, its creating:<br /><br />http://http://www.viperalley [/]<br />Mhh, I just use the standard regexp. Maybe the user entered it that way?
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#269026 - 02/11/04 04:41 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
Keep in mind file_get_contents() only works with PHP 4.3 and later...
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#269027 - 02/11/04 04:56 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: gailg]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Yes, anyone who is using an older version can use this to make it compatible:<br /><br />if (!function_exists("file_get_contents")) {<br /> function file_get_contents($filename, $use_include_path = 0) {<br /> $data = FALSE;<br /> $file = fopen($filename, "rb", $use_include_path);<br /> if ($file) {<br /> while (!feof($file)) $data .= fread($file, 1024);<br /> fclose($file);<br /> }<br /> return $data;<br /> }<br />}
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#269028 - 02/16/04 02:18 AM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
smoknz28 Offline
Enthusiast

Registered: 04/10/03
Posts: 393
Loc: Washington, D.C.
Interesting and a well needed mod! However, it's not working on my site after the applied changes. <br /> <br />I've gone in and created some huge signature images and they are still showing after the mod, changing the height and width, and making a new registered member with it. <br /> <br />Here's what I changed the fields to and it's still allowing huge sigs: <br /> <br />$config['sigMaxImages'] = '1'; <br />$config['sigImageHeight'] = '150'; <br />$config['sigImageWidth'] = '400'; <br />$config['sigImageSize'] = '55000'; <br />$config['sigMaxLines'] = '10';
_________________________
F-Body Hideout
Project Speedy

Top
#269029 - 02/17/04 06:52 AM Re: Finished-[6.3-6.4] Restrict signatures [Re: General_Failure]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Any error messages?<br />What php version are you using?
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#269030 - 02/23/04 03:51 PM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
smoknz28 Offline
Enthusiast

Registered: 04/10/03
Posts: 393
Loc: Washington, D.C.
[]Astaran said:<br />Any error messages?<br />What php version are you using? [/]<br /><br />No, not picking up on visible errors...<br /><br />I'm running PHP version 4.3.3.
_________________________
F-Body Hideout
Project Speedy

Top
#269031 - 03/01/04 07:27 AM Re: Finished-[6.3-6.4] Restrict signatures [Re: -Fusion-]
Bradley Noe Offline
Junior Member

Registered: 07/02/03
Posts: 9
Loc: Kingsport, TN
Hi all,<br />I'm not too familar with php yet (I'm still stuck in the perl days <img src="http://www.ubbdev.com/forum/images/graemlins/mryuck.gif" alt="" /> )but a user reported the following error and it is able to be reproduced by attempting to change the basic profile.<br />
Code:
 <br />Fatal error: Call to undefined function: remotefilesize() in /home/xganon/www/forums/ubbt.inc.php on line 739<br /> 
<br />I am using mysql 4.0.16, php 4.1.2, Redhat ES 2.3(or so).<br />I added the function to the bottom of ubbt.inc.php but stil no go (It was the code for php versions that aren't 4.3)<br /><br />Any ideas?<br />Line 739 of that file is:<br />
Code:
 739 $imageSize = remoteFileSize($imageUrl);<br />            740                    if ($imageSize &gt; $config['sigImageSize']) {<br />                                   741     $this -&gt; not_right ($ubbt_lang['SIGMAX_SIZE'],$Cat);<br />                               

Top
Page 1 of 2 1 2 >


Moderator:  Ian_W 
Who's Online
0 registered (), 25 Guests and 15 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Forum 'Trader Ratings'.
by blaaskaak
11/20/08 08:27 AM
Problems reading a lot of old posts here
by Ruben Rocha
11/18/08 04:33 PM
PhotoPost BB Code Popup
by Iann128
11/15/08 01:24 PM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
Active Topics.
by AllenAyres
11/11/08 02:13 PM
Looking for a simple upload script
by AllenAyres
11/11/08 02:12 PM
New Mods
Forum 'Trader Ratings'.
by McLemore
11/19/08 02:14 PM
[7.4] Keep log of custom title changes
by blaaskaak
10/27/08 07:51 AM
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Newest Members
nick1, Begbie, cenk, MATTO, DougMMcts
13362 Registered Users
Top Posters
AllenAyres 25448
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks