![]() |
Ouch! Thank you, anyway. ;)
|
Someone forgot to make the query for this:
Quote:
|
i would really really like to see the weight check included in here.
|
ok, i did it myself.
the weight check has been imlplemented. |
Quote:
|
Nice hack, but it is very important to limit the number of images allowed in the signiture, otherwise, this hack will be useless !! |
this has nothing to do with this hack, but here is an alternative sig "limiter", one simple template edit:
postbit: <div align="left" style="width:99%;height:125px;overflow:auto;"><nor malfont>$post[signature]</normalfont></div> |
Can all the addons and changes please be compiled into one install file and updated for the the latest version of VB.
|
Quote:
|
How coud i modify this to make it work for images in a post not just in a sig?
|
I just found a problem with this. If sig limits are on (example 400 characters) and the sig is text only, then the system adheres to the 400 character limit. If there are images in the signature, than it ignores the limit, and allows sigs of any length to be posted, so by adding a single image to the sig, the member can override the character limit function.
Anyone have any ideas on this one? |
Hmm, I installed this in 3.03 and it didn't do anything. :(
|
Works perfect in 3.0.1 :)
|
Quote:
Quote:
|
Any way to make it so the images auto-resize if they're too big?
|
I have a question about this hack, say I upload the file 123.jpg and use it as my sig. Your hack approves it becaues it is under the max size. After the image is displayed, I make a larger image and reupload it with same name overwritting 123.jpg. Correct me if I'm wrong but if only the UserCP can check the size again there is no way to limit someone from overwriting the file.
|
Alright, a couple of problems... I uploaded the hack to 3.03, if I try to upload a sig that's too big it gives me the error, but it didn't make any changes to the existing sigs that are too big. Any thoughts on why this is, what I can fix, or what a workaround is so I can get all my users to go change their sigs?
Also, when installing 7thgenCivic.Com's weight limit hack, I was returned the following error when I clicked on Edit Signature: Quote:
Quote:
|
i thinku got some messed up code somewhere. only thing i can suggest as it does work.
btw: only way to make all users comply is to delete everyones sig and make then start over. |
Hi, quick help with this. I attempted to install this hack (my first hack) on a test board. I ran all the queries, added all the phrases, and added the code into profile.php, making sure to use the corrected and updated code, including the image weight option. The admincp options showed up, however, now signatures do not show up in threads at all. I noticed this while checking to see what affect installing the hack would have on an existing sig image that's too big, so I did not check to see if the hack actually limited the size of new sigs. Once I noticed that sigs were't showing up, the very next thing I did was replace the modified profile.php with the backup I made. But even after doing this, sigs still don't show up. What's going on?
Edit: Hmm, upon further testing, it seems that it might be working correctly afterall. I think it was a matter of one signature having an image that's too large, and anothe ID that didn't have a signature to begin with. But it seems I'm having the same issue as dfaonxa above. If I install the image weight code, going into "Edit Signature" returns an error. |
Oops, where's the :slap forehead: smiley? Misread of the image weight mod, didn't notice that where it says,
Code:
find |
Should I be worried that talking to myself is solving all my problems?
So anyway, I got it installed, everything seemed to be working, except the weight limit function didn't seem to be catching things correctly. I left it set at the 35840 bytes that the query given in the mod has. I then attempted to load a sig pic that is about 218kB....and it let me. That seemed odd. So after a bunch of experimenting, I discovered that the remote_file_size function is returning value that's off by a factor of exactly 10. So it thinks my image (which is 223,554 bytes) is only 22,355 bytes (so the actual size, divided by 10). In another test, an image of size 134,154 was only blocked once the limit was set to 13,415 or below. Combing through the function, nothing is jumping out to my untrained eye, but something is definitely wrong. For now, I'm just going to use the work around of changing if (remote_file_size($checkimage) > $vboptions['sigmaxweight']) to if (remote_file_size($checkimage)*10 > $vboptions['sigmaxweight']). I've tested this, and it works. But if anyone would like to debug the function and see where it's losing this factor of 10, be my guest. |
Quote:
The only problem is it ALWAYS makes the signature area that big. Even if its just a couple of words. Probably impossible but any way to do some sort of if statement to check if the signature contains an image? |
I've figured out a solution
disable [img] tags in signatures create a new bb code called sig Title: Signature Image Tag: sig Replacement: <div style="width:500px;height:140px;overflow:hidden;"> <img src="{param}"></div> (change this as you see fit) Example: [sig]http://www.yoursite.net/samplesig.gif[/sig] Description:This is similar to the [img] tag but is used for signatures only. This way only images take up the full space. If someone has a smiley or a short piece of text it wont make the signature area bigger than it needs to be. |
I've modified the hack so that smilies do not count against the limit of number of images in the signature. The way I did it was quick and dirty, I'm sure there's a more elegant solution, but this works and entails just adding one line and modifying one other. I'm still a php novice, so I went with what works. If someone wants to clean it up, be my guest. My solution has 2 steps:
1) In the Quick Sig Image Size Limiter code, find the conditional: Code:
if( count($sigimages[2]) > $vboptions['sigmaximages'] ) Code:
if( (count($sigimages[2])- fetch_character_count($parsedsig, '<img src="http://[your domain]/[your board's root directory]/images/smilies/"'))> $vboptions['sigmaximages'] ) 2) Directly above the line you just modified, add: Code:
require_once('./includes/functions_misc.php'); |
Quote:
|
Code:
vBulletin Message Code:
INSERT INTO `setting` (varname, value, optioncode, displayorder, grouptitle, defaultvalue, advanced, volatile) VALUES ('sigmaxheight', '150', '', 141, 'user', '480', 0, 0); |
Okay i must be doing something wrong... because i followed the instruction to the T ...and its still not working.. meaning it allows me to add limitation to the size height n width..but does not validate it..when members go beyond the size of 500 X 125 ?? why?.. i must be doing something wrong...its still allowing members to have large images in their signitures... :ermm:
|
thanks, I really needed this.
|
Alright, I'm trying to re-implement this hack on 3.0.7, and when I try to run the first query
Quote:
Quote:
|
IF you have installed it on a previous version of vB, you will probably only have to redo the file edits. You are now trying to insert a value into the database that already exit.
|
Anyone tried to use the same code to scan the current signatures and remove any img tags which exceed the limits?
|
All times are GMT. The time now is 10:15 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|