Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-21-2014, 12:37 PM
richy96's Avatar
richy96 richy96 is offline
 
Join Date: Apr 2008
Location: England
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How do I force word wrap for long words?

Hi folks

No doubt this has been asked and answered but I probably am not uing the correct search terms

How do I best prevent users from entering long string of characters like this?


************************************************** ***************

Or at least limit the length they can enter?

Or force a line break when the forum posts are displayed?


Problem I am having is with threads that have long lines of characters, displaying too wide on my mobile version of my site.

See images below, first one is displaying OK, second one is not due to long line of ******* forcing some of the text off the viewport on mobile devices, and also shifting the nav buttons and other screen elements to the right

Cheers
Rich
PS getting image attachments to dynamically resize to mobile screenwidth was a bit of a b^tch but I sorted that one
Attached Images
File Type: jpg stretch1.jpg (60.6 KB, 0 views)
File Type: jpg stretch2.jpg (47.0 KB, 0 views)
Reply With Quote
  #2  
Old 02-21-2014, 12:56 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try using this in the css.

PHP Code:
word-wrap: break-word 
Reply With Quote
  #3  
Old 02-21-2014, 01:56 PM
richy96's Avatar
richy96 richy96 is offline
 
Join Date: Apr 2008
Location: England
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks

I tried that, I set the css property in 'body' and according to firebug my <td> is inheriting the property....... (see attached)

But it did not work, did I do something wrong? I'm only a self-taught (usually the hard way!) amateur

Rich
Attached Images
File Type: jpg wordwrap.jpg (52.7 KB, 0 views)
Reply With Quote
  #4  
Old 02-21-2014, 02:54 PM
richy96's Avatar
richy96 richy96 is offline
 
Join Date: Apr 2008
Location: England
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I also found this property in the ACP (which was already set to 50) and set it to 36... but it did not help either

Number of Characters Before Wrapping Text
If you want posts to automatically insert spaces into long words to make them wrap after a certain number of characters, set the number of characters in the box above.

What's wrong???????????
Reply With Quote
  #5  
Old 02-21-2014, 04:53 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can try these:

word-break: break-all !important;
word-wrap: break-word !important;

Also set this to a lower number like 24 ... "Number of Characters Before Wrapping Text"

.
Reply With Quote
  #6  
Old 02-21-2014, 05:40 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe using something like preg_match_all("/(.)\1{2,}/",$p,$x) in a plugin using the hook newpost_process, that will prevent a character from being entered consecutively 3 times.
Reply With Quote
  #7  
Old 02-21-2014, 05:58 PM
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Posts: 1,255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by richy96 View Post
I also found this property in the ACP (which was already set to 50) and set it to 36... but it did not help either

Number of Characters Before Wrapping Text
If you want posts to automatically insert spaces into long words to make them wrap after a certain number of characters, set the number of characters in the box above.


What's wrong???????????
The code cage? You have an error showing when I visited your site.
Reply With Quote
  #8  
Old 02-21-2014, 06:09 PM
richy96's Avatar
richy96 richy96 is offline
 
Join Date: Apr 2008
Location: England
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code cage??? What's that?

What error asre you seeing? my sites running ok just checked, 43 currently online, 67 registered today (no doubt get more this evening) and 502 visited today...... just a typical day on swapscene really
Reply With Quote
  #9  
Old 02-21-2014, 07:40 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GaryT View Post
The code cage? You have an error showing when I visited your site.
Yep, there's a deprecated error showing as im going through the files and making them compatible with the latest php - thanks for the heads up though
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 10:43 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
  • Page Generation 0.02166 seconds
  • Memory Usage 2,264KB
  • Queries Executed 14 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (3)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete