The BoardMod Project
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum
BoardMod Support Forum
[ Home | Help | Search | Login | Register ]  

31.07.10 at 09:53:56, Welcome, Guest. Please Login or Register

Choose Language:
Pages: 1 ... 4 5 6 
Shoutbox 5.5 for YaBB 2.4 (Read 15848 times)
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 609



Reply #75 - 06.03.10 at 17:59:31  
Hi DOT-COM,

D0T-C0M wrote on 06.03.10 at 12:50:00:
In forums with "Auto-link URLs? " disabled, if a user copies the url and pastes to his browser does the link with a linebreaked URL still work? With "Auto-link URLs? " enabled does the link work?

Just tested this and when 'Auto-link URLs?' is disabled the link doesn't wrap anyway - this is how it's handled when making normal posts. To test, make a post with a URL with more than 80 characters - when enabled it cuts off as it should, but when disabled you get the full URL. But, yes, when enabled the link does work.

D0T-C0M wrote on 06.03.10 at 12:50:00:
I can live with a manual setting for linebreak but I suggest it would be easier for the average user if you just set the linebreak variable to whatever the admin determines the width of the shoutbox to be?

For example,  If the user chooses 400 for the shoutbox width than make the line break at
$linewrap= $shout_width - (width of the vertical scrollbar if used + width of margins).

It's a nice thought, but I personally think it's best to do it the way that ThM already has - reason being is that 400px isn't as wide as 400 characters (also depending on the character and font size) - if that makes sense...
« Last Edit: 06.03.10 at 22:23:41 by Derek Barnstorm »  
IP Logged
 
D0T-C0M
Hacker God
*****
Offline

Tracadie, New Brunswick, Canada
Posts: 806



Reply #76 - 09.03.10 at 12:21:22  
Derek Barnstorm wrote on 06.03.10 at 17:59:31:
It's a nice thought, but I personally think it's best to do it the way that ThM already has - reason being is that 400px isn't as wide as 400 characters (also depending on the character and font size) - if that makes sense...


I guess I can live with the the manual setting on this.  Anyways regardless I just wanted a way to break long lines of text/url that contain no spaces.

Derek Barnstorm wrote on 06.03.10 at 17:59:31:
Just tested this and when 'Auto-link URLs?' is disabled the link doesn't wrap anyway - this is how it's handled when making normal posts.


This is the problem I am having. I have this setting turn to disabled. So you are saying even with this new linebreak code it still won't wrap in this case?
 
IP Logged
 
ThM
Hacker God
*****
Offline

Germany, Nds., Niedersachsen, Germany
Posts: 535



Reply #77 - 09.03.10 at 16:14:13  
I don't know if i understand all, but when i disabled this option:

Quote:
Auto-link URLs?


and post a link in the shoutbox window i have a linebreak.

Edited:
A new version with some small changes and a linebreak setting is comming soon.


« Last Edit: 09.03.10 at 16:29:27 by ThM »  
IP Logged
 

lb.PNG (8 KB | 13 )
lb.PNG

Greeting ThM
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 609



Reply #78 - 09.03.10 at 17:42:03  
I'm pretty sure that's just wrapping itself to the width of the ShoutBox though, and not through the actual line wrap feature.

Test it with a ridiculously long URL like this that has nowhere to naturally break...

http://thisisaridiculouslylongurlthatshouldruinthelayoutoftheshoutbox.com
 
IP Logged
 
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 609



Reply #79 - 09.03.10 at 22:10:39  
Sorry DOT-COM, I've only just noticed your post...

D0T-C0M wrote on 09.03.10 at 12:21:22:
Derek Barnstorm wrote on 06.03.10 at 17:59:31:
Just tested this and when 'Auto-link URLs?' is disabled the link doesn't wrap anyway - this is how it's handled when making normal posts.


This is the problem I am having. I have this setting turn to disabled. So you are saying even with this new linebreak code it still won't wrap in this case?

Yes, that seems to be the case. There was already a line wrap/break for URLs built into the ShoutBox, but it didn't work because the variable was named wrong. That worked by splitting the URL with spaces like this:

Code:
http://thisisa ridiculouslylo ngurlthatshoul druinthelayout oftheshoutbox.com 


And that did work when 'Auto-link URLs?' was disabled, but I think the way that ThM is doing it now looks and works much better apart from that one problem.

There has got to be a simple fix for it, but I'm not too sure of the best way right now...

Edited:
If you do want to see how the old line wrap worked...

Find this in ShoutDisplay.pl:

Code:
sub my_wrap3 {
$shout_message =~ s~(<.*>)*(\S{0,14})(\S{0,14})?(\S{0,14})?(\S{0,14})?(\S*)?(<.*>)*~$1$2 $3 $4 $5 $6$7~gi;
$shout_message =~ s~(<.*>)?(\S{0,14})(\S{0,14})?(\S{0,14})?(\S{0,14})?(\S*)(<\/\S*>)~$1$2 $3 $4 $5 $6$7~gi;
$shout_message =~ s~\s+~ ~gi;
}

And replace with this:

Code:
sub my_wrap3 {
$message =~ s~(<.*>)*(\S{0,14})(\S{0,14})?(\S{0,14})?(\S{0,14})?(\S*)?(<.*>)*~$1$2 $3 $4 $5 $6$7~gi;
$message =~ s~(<.*>)?(\S{0,14})(\S{0,14})?(\S{0,14})?(\S{0,14})?(\S*)(<\/\S*>)~$1$2 $3 $4 $5 $6$7~gi;
$message =~ s~\s+~ ~gi;
}

Just in case you're interested.




« Last Edit: 09.03.10 at 22:54:36 by Derek Barnstorm »  
IP Logged
 
D0T-C0M
Hacker God
*****
Offline

Tracadie, New Brunswick, Canada
Posts: 806



Reply #80 - 09.03.10 at 23:38:12  
ThM wrote on 09.03.10 at 16:14:13:
I don't know if i understand all, but when i disabled this option:

Code:

Auto-link URLs?



and post a link in the shoutbox window i have a linebreak.


ThM the link you posted had a hyphen (-) and naturally it broke the line there.  Try an ebay link or something link that.
 
IP Logged
 
Pages: 1 ... 4 5 6 
© 2000-2009 by - All rights reserved.

SourceForge.net Logo
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum