vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I force word wrap for long words? (https://vborg.vbsupport.ru/showthread.php?t=308711)

richy96 02-21-2014 12:37 PM

How do I force word wrap for long words?
 
1 Attachment(s)
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 ;)

Seven Skins 02-21-2014 12:56 PM

Try using this in the css.

PHP Code:

word-wrap: break-word 


richy96 02-21-2014 01:56 PM

1 Attachment(s)
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

richy96 02-21-2014 02:54 PM

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???????????

Seven Skins 02-21-2014 04:53 PM

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"

.

Simon Lloyd 02-21-2014 05:40 PM

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.

K4GAP 02-21-2014 05:58 PM

Quote:

Originally Posted by richy96 (Post 2482883)
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.

richy96 02-21-2014 06:09 PM

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 :cool:

Simon Lloyd 02-21-2014 07:40 PM

Quote:

Originally Posted by GaryT (Post 2482928)
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 :)


All times are GMT. The time now is 07:30 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.01749 seconds
  • Memory Usage 1,731KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete