Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old February 1st, 2004, 09:25 PM
sarah's Avatar
sarah sarah is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Auckland, New Zealand
Posts: 127 sarah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 32 sec
Reputation Power: 2
Send a message via ICQ to sarah Send a message via AIM to sarah Send a message via Google Talk to sarah
The opposite of *

I have a column on a Nuke site which is getting pushed too wide. The info I'm giving is a domain name and I can put spaces after the . in the name

ie

bots.pcpropertymanager.com
becomes
bots. pcpropertymanager. com

and I don't have my problem, but it looks horrible.

What I'd like is a code to put inplace of the . or just after to tell the browser that it's ok to break now if necessary.

any ideas anyone?

Reply With Quote
  #2  
Old February 2nd, 2004, 05:49 AM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: The opposite of *

you could use preg_replace to strip out spaces:

$string=preg_replace("/ /", "","bots. pcpropertymanager. com");

Reply With Quote
  #3  
Old February 2nd, 2004, 05:56 AM
sarah's Avatar
sarah sarah is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Auckland, New Zealand
Posts: 127 sarah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 32 sec
Reputation Power: 2
Send a message via ICQ to sarah Send a message via AIM to sarah Send a message via Google Talk to sarah
RE: The opposite of *

Sorry, can't have explained properly. I'm putting the spaces in to allow the browser to wrap the text.

What I need is someway of telling the browser that although there aren't spaces it's ok to break the string "here". I've been using spaces because I didn't know a better way.

Reply With Quote
  #4  
Old February 2nd, 2004, 06:05 AM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: The opposite of *

Can you post a link to it? I just want to make sure we are thinking the same thing.

Reply With Quote
  #5  
Old February 2nd, 2004, 06:43 AM
sarah's Avatar
sarah sarah is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Auckland, New Zealand
Posts: 127 sarah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 32 sec
Reputation Power: 2
Send a message via ICQ to sarah Send a message via AIM to sarah Send a message via Google Talk to sarah
RE: The opposite of *

take a look at

http://bots.pcpropertymanager.com/#lv39

I've temporarily put in the normal text and the "spaces" option.

Reply With Quote
  #6  
Old February 2nd, 2004, 07:07 AM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: The opposite of *

cant you just put a <br /> where you want it to wrap at?

Reply With Quote
  #7  
Old February 2nd, 2004, 05:26 PM
sarah's Avatar
sarah sarah is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Auckland, New Zealand
Posts: 127 sarah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 32 sec
Reputation Power: 2
Send a message via ICQ to sarah Send a message via AIM to sarah Send a message via Google Talk to sarah
RE: The opposite of *

In this case yes, but another user may have a long domain name and I don't want to have to be alerted everytime a domain gets added so I can see if it's too long, and where the right place to break is.

Right now I'm not getting many added every day but that could change.

Reply With Quote
  #8  
Old February 2nd, 2004, 07:24 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: The opposite of *

u can use this function to break long words..

php Code:
Original - php Code
  1.  
  2. function break_long_words($text) {
  3.     $max_word_length=40;
  4.     $break="<img width='0' />";
  5.     return preg_replace("~S{$max_word_length}~s", "$0$break", $text);
  6. }


anyway, there is also a better option to insert zero-width-breaking-space, but unfortunately that doesn't work good in IE..

Reply With Quote
  #9  
Old February 11th, 2004, 10:43 AM
Desertsnowman Desertsnowman is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 10 Desertsnowman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: The opposite of *

perhaps you could just hack off the end anr replace the rest with ...

and have the full name desplay as a tooltip ?

php Code:
Original - php Code
  1.  
  2.  
  3. if (strlen($thisdomain) >= 20){
  4.  echo '<span title='.$Domain_Name.'>'.substr($Domain_Name,0,20).'...</span>'; }else{
  5.  echo $Domain_Name; }
  6.  



Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > The opposite of  


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT