Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Dealing with long signatures
Spinball's Avatar
Spinball
Join Date: Feb 2002
Posts: 705

 

Telford, England
Show Printable Version Email this Page Subscription
Spinball Spinball is offline 08-01-2004, 10:00 PM

Hi Folks,
I don't know if you consider SQL tips as hacks, but if so then please accept the following for vB 3.x.
We have a problem on our forum with people putting in rediculously long signatures. Some of these look ok, though, as the occasional responsible people are using only a few carriage returns and make use of the [size] tag to make their signature text smaller.

This SQL script is very simple but for people not accustomed to SQL, it might be useful. It doesn't deal with carriage returns (yet) but does deal with otherwise lengthy signatures by wrapping a size tag round them but ONLY if the user hasn't used a size tag already :

PHP Code:
update usertextfield set signature concat('[size=1]',signature,'[/size]'where signature not like '%[size%' and length(signature) > 100
This only changes signatures containing over 100 characters. Obviously you can change the 100 to any figure. Some of our members have signatures over 400 characters in size. At least if the text is small it doesn't take up a whole page.
Reply With Quote
  #12  
Old 10-11-2004, 09:31 AM
Abe Babe's Avatar
Abe Babe Abe Babe is offline
 
Join Date: Sep 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I finally got it working, I typed my post too soon ... but I tried again with your code and it worked fine. I compared it to the other code I had come across elsewhere and they were missing the px [just had the numeric value]. I guess Mozilla can recognize that and IE cannot. I should have picked that up myself, but I always get frustrated with CSS and miss the little things. Thanks for your help!

Abe Babe...
Reply With Quote
  #13  
Old 10-11-2004, 12:12 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mmm... strictly speaking... this is not a hack at all.
Reply With Quote
  #14  
Old 10-11-2004, 08:40 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope its a template mod. I posted this ay vBt a long time ago. Back in the vB2 days.
Reply With Quote
  #15  
Old 10-15-2004, 11:15 PM
Reverend Reverend is offline
 
Join Date: Mar 2002
Location: England
Posts: 206
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the postbit mod Live Wire.Works a treat.

Is there anyway to apply this to the User CP and the profile page. Its a bit confusing for some of our members when their "oversized" sigs are displayed in full in their User CP,and profile pages,but are then chopped in the postbit.
Reply With Quote
  #16  
Old 10-16-2004, 02:21 AM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would just edit the appropeaite template and add the same thing where you find the signature variable.
Reply With Quote
  #17  
Old 10-16-2004, 03:09 PM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another approach is to let the users decide what's too long and what's not

https://vborg.vbsupport.ru/showthread.php?t=69897

bejetta wrote the vb2 original hack and I transposed it to vb3. The vb3 install file includes the text of the original hack.
Reply With Quote
  #18  
Old 10-16-2004, 08:22 PM
Spinball's Avatar
Spinball Spinball is offline
 
Join Date: Feb 2002
Location: Telford, England
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Live Wire
I find this more useful, its what i use on my forums. Cuts long sigs out.

HTML Code:
<div style="width: 500px; height: 135px; overflow: hidden;">
				$post[signature]
</div>
While this is an elegant solution, by fixing the size of signatures, for people with shorter signatures, it is counter productive because it unnecessarily uses up screen space.
I tried it and decided not to keep it.
What we need is a way to truncate the signature only if it's bigger than 500x50 or so pixels.
Reply With Quote
  #19  
Old 10-18-2004, 02:09 AM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Spinball
While this is an elegant solution, by fixing the size of signatures, for people with shorter signatures, it is counter productive because it unnecessarily uses up screen space.
I tried it and decided not to keep it.
What we need is a way to truncate the signature only if it's bigger than 500x50 or so pixels.
If there is no signature, there will be no unused screen space.
Reply With Quote
  #20  
Old 10-18-2004, 05:31 AM
Spinball's Avatar
Spinball Spinball is offline
 
Join Date: Feb 2002
Location: Telford, England
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Live Wire
If there is no signature, there will be no unused screen space.
Yes, but if people respond to my request to keeps sigs short, and create sigs like mine at http://www.avforums.com/forums/showt...50#post1224350 then there wil be.
Reply With Quote
  #21  
Old 02-07-2005, 11:43 PM
skinny skinny is offline
 
Join Date: Jan 2002
Location: UK
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I have introduced this on my forum. I guess as has been mentioned, the only problem is that say for instance, I have a max height of 500px, yet some members only have small sigs, there will be quite a bit of blank space underneath their sigs.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:46 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04465 seconds
  • Memory Usage 2,300KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete