28, May 2012

Output formatting - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  PHP Whois script (Moderator: Olaf)
Topic: Output formatting
« previous next »
Pages: [1] Print

Author Topic: Output formatting  (Read 1840 times)
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« on: Apr 04, 2007, 03:00:44 pm »

I've noticed that the formatting for the output when you do "all info" seems to pretty much wrap everything on one line.  I checked the code and it seems to try to use nl2br() to convert new line characters into html breaks.  However, when viewing the output with either the nl2br() function or not, the output is the same.  I'm going to look into seeing if the data can be better formatted at the time of retrieval from the remote server when I get some free time, but I wanted some feedback incase this is only happening to me.

Whois Search page: http://www.betoglou.com/index.php?option=com_content&task=view&id=26&Itemid=79

I'm not sure if maybe Joomla might have something to do with it as well.
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: Apr 04, 2007, 08:32:29 pm »

Some template systems - like smarty for instance - are parsing the output. For example they can remove \n character.

Maybe that's the case with you too.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« Reply #2 on: Apr 04, 2007, 08:54:10 pm »

I added a <br> when the code was getting retrieved.

whois_class.php changed a line in the get_domain_info() function from

Code:
$this->info .= $val;

to

Code:
$this->info .= $val."<br>";

This adds a break in the output when it gets displayed.  The only problem is, this data gets retrieved in an array, and the array breaks paragraphs at odd places some times, like in the middle of a sentence.

I'll see if I can scrub the array some more to throw in a check or two so it doesn't do that.

The normal behavior actually has it printing the information all on one line whether seen from Joomla via an IFRAME or directly accessing the script.  Adding the <br> in that location at least makes it easier to read.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Apr 04, 2007, 09:05:39 pm »

you can place an extra enter into the code maybe that will help...

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6347
Tags : search results whois search nl2br() Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  PHP Whois script (Moderator: Olaf)
Topic: Output formatting
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 08:25:51 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.