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

   Finished-[6.3-6.4] Restrict signatures to Del.icio.us Add to del.icio.us
  Digg Finished-[6.3-6.4] Restrict signatures Digg it
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 (193 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 (97 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 
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