vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Signature "Line Limiter" (https://vborg.vbsupport.ru/showthread.php?t=67111)

tHe Rk 07-12-2004 11:10 PM

Signature "Line Limiter"
 
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)
  1. Create the following phrase in phrasegroup Front-End Error Messages
    varname = sigtoomanylines
    text = Your signature can not be longer than $vboptions[maxsiglines] lines.
  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
  3. In profile.php FIND
    PHP Code:

    if ($vboptions['maximages'] != 0)
    {
      require_once(
    './includes/functions_bbcodeparse.php');
      
    $parsedsig parse_bbcode($signature0$vboptions['allowsmilies'], 1); 

    REPLACE that with
    PHP Code:

    if ($vboptions['maxsiglines'] != 0) {
      require_once(
    './includes/functions_misc.php');
      require_once(
    './includes/functions_bbcodeparse.php');
      
    $parsedsig parse_bbcode($signature0$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($signature0$vboptions['allowsmilies'], 1);
      } 


rexlu 07-15-2004 07:35 AM

excuse me..

How to do the 2nd step?

Quote:

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

-mk- 07-15-2004 09:36 AM

You need to turn debug on.

I just get parse errors anyway.
Quote:

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
PHP Code:

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 ^.^


All times are GMT. The time now is 02:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01074 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete