|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using breaks in scripts
Can I get away without using <BR> in order to make a new row of writing in scripts? As I'm sending out instructions for someone to add a news article and to drop it directly into the source code. Only, they don't know much about scripts. I don't want to be telling them to be adding script as they go, such as <BR>. Is there a much easier way of getting round this? Is there something I can add somewhere else in the script so they don't have to do anything? If anyone can help me out, I would be very happy! Cheers.
This is what part of the scripting will look like when they have to write the news in: <DIV ID="TXTOBJ7D7C35012C31C1" STYLE=" position:absolute; top:269px; left:213px; width:382px; height:34px; z-index:19;"> <DIV style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; FONT-SIZE: 10pt; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 1px; COLOR: #000000; FONT-FAMILY: Arial; BACKGROUND-COLOR: transparent; BORDER-RIGHT-WIDTH: 0px" link=#2f48ae> <FONT style="FONT-SIZE: 10pt"><P align=left> <FONT style="FONT-SIZE: 9pt" face=Arial color=#000000 style="font-size=10.0pt"> *****************TYPE YOUR NEWS HERE*********** </FONT> </DIV> </DIV> </BODY> </HTML> |
|
#2
|
|||
|
|||
|
Why don't you just it even more simple?
You could create a script which loads news messages from a database or a file. If you choose for a file, this could be an example: Code:
2007-12-11|New website online!|Today we are glad to announce the new version of our website with a lot of new features! <a href='afile.php?read=more'>Read more..</a> 2007-12-12|Server maintenance|Because of the the increasing popularity of our website we'll have to do some maintenance in order to keep our website stable The script should separate news messages from eachother and convert the line endings \r (mac), \r\n (windows) or \n (linux) to <br> tags. And split the news parts where the "|" is, for example in PHP you could do it with the explode() function. You could probably also create a script which lets the user easily enter news messages (e.g. using <textarea></textarea>) and convert the <br> tags to newlines. |
|
#3
|
|||
|
|||
|
The ideal would maybe be a CMS. But that may not be feasible, or you might just have a very basic site right now. The person above me described using a text area to take inputs and add any required formatting tags to the basic text.
A quick look on google turned up this website: textfixer.com/tools/convert-line-breaks-br.php which will do the above for you, if you don't like the idea of doing it yourself. I'm sure if you had a poke around you could find something out there that did more advanced formatting than just paragraphs and breaks. Try searching for 'convert text into html' or something like that. That is all of course, if you don't feel like doing something yourself with databases or PHP or the like. |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > Using breaks in scripts |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|