View Full Version : Signature "Line Limiter"
tHe Rk
07-12-2004, 11:10 PM
Hello all,
I have looked everywhere on all the big hack sites and I can NOT find a hack that allows one to limit signatures based on "Lines" rather than characters. I remember having a hack for it in vB2, but can't seem to find one for vB3. I have seen the other hack that is a "pixel" based limiter, and that's not really what I am looking for. Just a simple Sigs cannot exceed 7 Lines. or 10 lines, or 5 or whatever we would decide to choose. Does anyone know how to do this or where to find the hack?
FYI...running 3.0.1 Thanks.
I posted at vb.com and they sound there isn't currently a way to do it, and it has to be hacked. I have looked everywhere including here, and havn't found a hack yet, so I figured I could request one. Thanks!
Berethorn
07-12-2004, 11:14 PM
Great idea! I would guess it should be a fairly easy hack. :)
Andreas
07-12-2004, 11:40 PM
This is what I did on our board several month ago (moreless copy&paste, hope it does work)
Create the following phrase in phrasegroup Front-End Error Messages
varname = sigtoomanylines
text = Your signature can not be longer than $vboptions[maxsiglines] lines.
In vBulletin Options/User Profile Options create the following setting:
varname = maxsiglines
title = Maximum signature lines
description = The maximum number of lines anyone can use in their signature.
default = 4
vBulletin Standard = No
In profile.php FIND
if ($vboptions['maximages'] != 0)
{
require_once('./includes/functions_bbcodeparse.php');
$parsedsig = parse_bbcode($signature, 0, $vboptions['allowsmilies'], 1);
REPLACE that with
if ($vboptions['maxsiglines'] != 0) {
require_once('./includes/functions_misc.php');
require_once('./includes/functions_bbcodeparse.php');
$parsedsig = parse_bbcode($signature, 0, $vboptions['allowsmilies']);
$siglines = 0;
$siglines += fetch_character_count($parsedsig, '<br');
$siglines += fetch_character_count($parsedsig, '<blockquote');
$siglines += fetch_character_count($parsedsig, '<pre');
if ($siglines > $vboptions[maxsiglines]-1) {
$preview = 'true';
eval('$errors[] = "' . fetch_phrase('sigtoomanylines', PHRASETYPEID_ERROR) . '";');
}
}
if ($vboptions['maximages'] != 0)
{
if (!$parsedsig) {
require_once('./includes/functions_bbcodeparse.php');
$parsedsig = parse_bbcode($signature, 0, $vboptions['allowsmilies'], 1);
}
rexlu
07-15-2004, 07:35 AM
excuse me..
How to do the 2nd step?
2. In vBulletin Options/User Profile Options create the following setting:
varname = maxsiglines
title = Maximum signature lines
description = The maximum number of lines anyone can use in their signature.
default = 4
vBulletin Standard = No
You need to turn debug on.
I just get parse errors anyway.
if ($siglines > $vboptions[maxsiglines]-1)) {
Andreas
07-15-2004, 10:22 AM
Remove the 2nd closing bracket, was a typo. Sorry.
rexlu
07-16-2004, 04:26 AM
um.. I still getting error ..
Fatal error: Call to undefined function: fetch_character_count() in /home/nonoboar/public_html/bbs/profile.php on line 1333
Andreas
07-16-2004, 10:46 AM
Oops! Didn't notice that I required functions_misc earlier in profile.php, so this is missing here:
Put
require_once('./includes/functions_misc.php');
after the first if-condition.
Boofo
07-16-2004, 01:35 PM
Will this work with any other sig limiting hacks like the image size limiter released a while back? Or will they end up fighting with one another? ;)
Andreas
07-16-2004, 01:46 PM
Well ... don't really know, but should work.
Just try it ^.^
paulyy
07-17-2004, 02:52 AM
I don't understand number 2, or how to turn debug on?
Can someone explain this a little better please.
assassingod
07-17-2004, 07:45 AM
To turn on Debug Mode, open includes/config.php and find:
$cookieprefix = 'bb';
Beneath that, add
// Debug Mode, 1 on 0 off
$debug = '1';
I suggest turning this off when you're finished as well.
royals
07-17-2004, 08:29 AM
Is there a way to put in a maximum image size if images are allowed in signature? That would be WONDERFUL!
paulyy
07-17-2004, 04:30 PM
Thanks Assassingod :)
paulyy
07-17-2004, 04:56 PM
This code stops the viewing of sigantures completely?
EDIT: Nevermind yes it does
tHe Rk
07-17-2004, 06:17 PM
This is what I did on our board several month ago (moreless copy&paste, hope it does work)
Create the following phrase in phrasegroup Front-End Error Messages
varname = sigtoomanylines
text = Your signature can not be longer than $vboptions[maxsiglines] lines.
In vBulletin Options/User Profile Options create the following setting:
varname = maxsiglines
title = Maximum signature lines
description = The maximum number of lines anyone can use in their signature.
default = 4
vBulletin Standard = No
In profile.php FIND
if ($vboptions['maximages'] != 0)
{
require_once('./includes/functions_bbcodeparse.php');
$parsedsig = parse_bbcode($signature, 0, $vboptions['allowsmilies'], 1);
REPLACE that with
if ($vboptions['maxsiglines'] != 0) {
require_once('./includes/functions_misc.php');
require_once('./includes/functions_bbcodeparse.php');
$parsedsig = parse_bbcode($signature, 0, $vboptions['allowsmilies']);
$siglines = 0;
$siglines += fetch_character_count($parsedsig, '<br');
$siglines += fetch_character_count($parsedsig, '<blockquote');
$siglines += fetch_character_count($parsedsig, '<pre');
if ($siglines > $vboptions[maxsiglines]-1) {
$preview = 'true';
eval('$errors[] = "' . fetch_phrase('sigtoomanylines', PHRASETYPEID_ERROR) . '";');
}
}
if ($vboptions['maximages'] != 0)
{
if (!$parsedsig) {
require_once('./includes/functions_bbcodeparse.php');
$parsedsig = parse_bbcode($signature, 0, $vboptions['allowsmilies'], 1);
}
I also have NO IDEA how to do #2??? :ermm:
Andreas
07-17-2004, 06:38 PM
Turn on Debug mode, go into that Options Page and Create the Setting.
I think "How do I create a new setting" should be added to vB.org FAQ (if it is not already there), as this is a common task ;)
paulyy
07-17-2004, 07:01 PM
On the first page of this thread assassingod explains how to do it ;)
I also got it working on my forum, so if you need a hand PM me :)
Illuvatar
08-14-2004, 02:55 AM
* Illuvatar bows low!
KirbyDE.....you so rock!!
This has been a pain in my side since version 2.0!! lol
The old sig hack was easily worked around by not using line breaks, and what you did works a charm!! :)
I wish I could click installed! :p
Lion's Heart
08-14-2004, 03:56 AM
I also have NO IDEA how to do #2???
Open Config.php
After ?>
Add Debug=1;
do follow
In vBulletin Options/User Profile Options create the following setting:
varname = maxsiglines
title = Maximum signature lines
description = The maximum number of lines anyone can use in their signature.
default = 4
vBulletin Standard = No
I had no problem following all the steps but it's not limiting signatures to two lines for me. I logged into one of our test accounts and was able to place several sentences in that account's signature (no carriage returns) that far exceeded two lines, which is the limit I set in the new profile option. Can someone help me figure it out please? :nervous:
Andreas
01-11-2005, 07:13 PM
Well, if there are no line-breaks it is just one line - even if it is displayed in more then 1 line on your screen (which just means that it is not wide enough ;))
Or in other words: It is not possible to determine which text length is "one line", as this depends on screen width.
The only way would to specify what "one line" shold be is to specify that it should be max. xx characters.
But one has to keep in mind that if this is based on a 1024x768 resolution, it will be much less then "one line" for somebody using 1600x1200 for example.
Well, if there are no line-breaks it is just one line - even if it is displayed in more then 1 line on your screen (which just means that it is not wide enough ;))
Or in other words: It is not possible to determine which text length is "one line", as this depends on screen width.
The only way would to specify what "one line" shold be is to specify that it should be max. xx characters.
But one has to keep in mind that if this is based on a 1024x768 resolution, it will be much less then "one line" for somebody using 1600x1200 for example.
And on top of it all the character count does include vb code. So formatting text such as [ and color= and url= and font=squiggly and such are all included, cheating the true displayed character count.
*Sigh* I wish I could find a reasonble solution to this.
Andreas
01-11-2005, 08:08 PM
Well, one could strip the code before checking the length :)
Andreas
01-11-2005, 08:18 PM
$length = vbstrlen(strip_bbcode($input, true))
Great! Where would I place that?
Illuvatar
01-12-2005, 02:18 AM
Yea...I've ran into the same issue. :( Without a character count restriction, you can cut and paste a whole paragraph into the siggy and get away with it. lol
We currently have our character limit set to 500, and we may have to go smaller.
Kirby, I have a thought that perhaps you can help with. Could this be applied to the existing setup for the signature character limit feature in vB3? That way I could place a character limit that would count only the true characters and ignore vBcode. Is it possible to place this same code somewhere to have that effect in the character count?
This little mod combined with this one (https://vborg.vbsupport.ru/showthread.php?t=60354) is a very good thing :).
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.