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.
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="" />
[]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);
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="" />
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.
<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?
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
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
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';
[]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.
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 />