Description: This hack allows the administrators to restrict the users' signatures via the admin panel. Possible restrictions: - maximum height/width of an image - number of images - max. filesize of the images - max. number of linebreaks
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.
Attached you'll find a script that checks all signatures if they match to your rules defined in the config file. 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.
Note: Change the Body of the private message and make a Backup of your database first! Rename the attachement to .php and upload it to you ubbthreads main dir. Delete it after execution.
Interesting and a well needed mod! However, it's not working on my site after the applied changes.
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.
Here's what I changed the fields to and it's still allowing huge sigs:
Hi all, I'm not too familar with php yet (I'm still stuck in the perl days )but a user reported the following error and it is able to be reproduced by attempting to change the basic profile.
Code
<br />Fatal error: Call to undefined function: remotefilesize() in /home/xganon/www/forums/ubbt.inc.php on line 739<br />
I am using mysql 4.0.16, php 4.1.2, Redhat ES 2.3(or so). 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)
[]Astaran said: Have you added the function remoteFileSize as stated in the instructions and the the function that is needed for older php versions? [/]
I must be blind, I added the function for the older php versions but didn't add the function for remoteFileSize, unfortunatly I had installed this before that was added to the instructions and wasn't made aware of it until this weekend. Thanks for the help!
works fine in 6.5, but there are some lines that must be changed manually, as it have been a few small changes in them by Infopop... anyway, kinda logic!
There is something missing in that code, only the first image found is checked for the size and other parameters, all others are not. A for loop is missing so to say.
Also, I found a remote file size check that doesn't download the images to check the filesize but checks the headers instead.
[]Anno said: There is something missing in that code, only the first image found is checked for the size and other parameters, all others are not. A for loop is missing so to say. [/]
how much more difficult would it be to additionally force users to upload their signature images to my server? in a similar fashion as the user avatar's current upload setting.
this way, i could (1) better monitor the content of the images and (2) ensure there's no page drag because a sig image is hosted on a slower server
in addition, i'd also prefer to have a little upload field, too, for the users to upload their sig images (which would help enforce the idea that they'd have to be hosted on my server)
any chance on whippin all this up for the codily handicapped?
I am using 6.3.2 and have gone into the admin panel - edit config settings. Where exactly do I add these variables? There isnt anywhere obvious to put them. can they be added to the php file manually?
Code
##################<br />Open your admin panel -> config settings and add these variables:<br />###################<br /><br />$config['sigMaxImages'] = '1';<br />$config['sigImageHeight'] = '80';<br />$config['sigImageWidth'] = '400';<br />$config['sigImageSize'] = '30720';<br />$config['sigMaxLines'] = '10';
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.