1 eblog Aug 06, 2004 23:06
3 eblog Aug 07, 2004 01:41
isaac wrote:
Well, yeah... It's displaying a text file. That's how they display.
huh ? .txt files displays without lines breaks ?
When my browser displays that file :
http://turtle.ee.ncku.edu.tw/openwebmail/doc/readme.txt
I see the line breaks and it's quite an easy to read document,
so I don't understand what you meant.
How can I keep the line breaks in the skin ?
Better like this ?
<?php echo url_add_param(get_bloginfo('blogurl'),'disp=extratext');?>
The file is remote for now but at the end both the file and the skin will be on the same server.
4 s7uar7 Aug 07, 2004 02:31
When you use an include, all it does is add the text to the source exactly as it is in the file. Carriage returns and blank lines are ignored in html, which is why you use the <br> tag to start a new line. Someone cleverer than me could possibly write a function to substitute a blank line with <br><br>, or else you'll need to save the file in html format.
5 isaac Aug 07, 2004 09:42
<?php
switch($disp)
{
case 'extratext':
echo '<pre>';
include("http://www.domain.com/extratext.txt");
echo '</pre>';
break;
}
?>
6 eblog Aug 07, 2004 11:43
Excellent ! thanks !
7 isaac Aug 09, 2004 08:08
Just another FYI:
You could also wrap it in any element that had the "white-space:pre" CSS property applied to it. The PRE tag has this by default. (PRE stands for PRE-formatted - i.e., "I already formatted this in the source, just spit it out as-is.")
Well, yeah... It's displaying a text file. That's how they display.
Why are you linking to the staticurl, and not to the regular url? (Better yet, use the add_param function.)
By the way, including a remote file based on the url parameter can be HIGHLY insecure. Make sure you're careful!