Closed Thread Icon

Preserved Topic: Maintaining a Site Problem... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=20987" title="Pages that link to Preserved Topic: Maintaining a Site Problem... (Page 1 of 1)" rel="nofollow" >Preserved Topic: Maintaining a Site Problem... <span class="small">(Page 1 of 1)</span>\

 
WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-18-2001 01:10

I have a site which will be pretty content intensive.

The bad news is that most people who will be placing content will be HTML illiterate.

The content will be sent to a database via a form (as I am thinking now)... but I don't know exactly how to have it set up.

With simple content there are a lot of different tags to know, <h1> <h2>, etc <ol> <ul> <dl> <li> <p> <br> <b> <i> <u> special characters and it goes on and on. I can not really expect these people to learn this stuff, and with the amount of information being promised there is no way I could do it on my own as I have other things to do. I don't want to be a web master.

Does anyone have any ideas on how to handle this?

I have a couple but not sure how feasible. One that I thought might would would be to use a rich text format, and parse that for the web, because I would think most people able to use WordPad.

I am planning on using PHP and MySQL for the project, any and all ideas would be appreciated.

-mage-

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-18-2001 02:16

Really this isn't as hard as you would think.

The biggies are line breaks and paragraphs I do a regular expression to sub out line breaks with break tags

Personally I would put a little key of the basic tags on the page



Walking the Earth like Kane

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-18-2001 02:52

Smart thinking...

So you think that line break is the only thing needed?

Then just a key for the other stuff?

-mage-

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 06-18-2001 04:16

Greymatter handles it pretty nicely:

Type your post into a big textarea,
single line break -> <BR>
double line break -> </P><P>

and he gives some nice keyboard shortcuts:
ctrl+shift+A inserts an anchor tag
ctrl+shift+B wraps the selected text in <B></B>
ctrl+shift+I and U do the predictable things.

DmS
Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 06-18-2001 10:05

I did it this way, (unfortunatley IE5 only) It's a straight HTML page with a bunch of forms, write in a form, highlight it w the mouse and click the formatting link.

code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Adminpage for IE5...</title>
<script language=javascript>

function hiliteToBold(txtArea){
txtAreaName = txtArea.name;
txtRange = document.all[txtAreaName].createTextRange();
txtContainer = txtRange.parentElement().name;

objRange = document.selection.createRange();
hiliteTxt = objRange.text;
toBoldTxt = "<B>" + hiliteTxt + "</B>";

if(hiliteTxt != ""){
objRange.text = toBoldTxt;
}
}

function hiliteToItalic(txtArea){
txtAreaName = txtArea.name;
txtRange = document.all[txtAreaName].createTextRange();
txtContainer = txtRange.parentElement().name;

objRange = document.selection.createRange();
hiliteTxt = objRange.text;
toItalicTxt = "<I>" + hiliteTxt + "</I>";

if(hiliteTxt != ""){
objRange.text = toItalicTxt;
}
}

function hiliteToPara(txtArea){
txtAreaName = txtArea.name;
txtRange = document.all[txtAreaName].createTextRange();
txtContainer = txtRange.parentElement().name;

objRange = document.selection.createRange();
hiliteTxt = objRange.text;
toParaTxt = "<P>" + hiliteTxt + "</P>";

if(hiliteTxt != ""){
objRange.text = toParaTxt;
}
}
function hiliteToFont_11(txtArea){
txtAreaName = txtArea.name;
txtRange = document.all[txtAreaName].createTextRange();
txtContainer = txtRange.parentElement().name;

objRange = document.selection.createRange();
hiliteTxt = objRange.text;
toFont_11_Txt = "<FONT style='font-size: 11pt;'>" + hiliteTxt + "</FONT>";

if(hiliteTxt != ""){
objRange.text = toFont_11_Txt;
}
}
function hiliteToFont_12(txtArea){
txtAreaName = txtArea.name;
txtRange = document.all[txtAreaName].createTextRange();
txtContainer = txtRange.parentElement().name;

objRange = document.selection.createRange();
hiliteTxt = objRange.text;
toFont_12_Txt = "<FONT style='font-size: 12pt;'>" + hiliteTxt + "</FONT>";

if(hiliteTxt != ""){
objRange.text = toFont_12_Txt;
}
}
function hiliteToFont_14(txtArea){
txtAreaName = txtArea.name;
txtRange = document.all[txtAreaName].createTextRange();
txtContainer = txtRange.parentElement().name;

objRange = document.selection.createRange();
hiliteTxt = objRange.text;
toFont_14_Txt = "<FONT style='font-size: 14pt;'>" + hiliteTxt + "</FONT>";

if(hiliteTxt != ""){
objRange.text = toFont_14_Txt;
}
}

function hiliteToMailto(txtArea){
txtAreaName = txtArea.name;
txtRange = document.all[txtAreaName].createTextRange();
txtContainer = txtRange.parentElement().name;

objRange = document.selection.createRange();
hiliteTxt = objRange.text;
toMailto = '<a href="mailto:' + hiliteTxt + '">' + hiliteTxt + '</a>';

if(hiliteTxt != ""){
objRange.text = toMailto;
}
}

function hiliteToExternLink(txtArea){
txtAreaName = txtArea.name;
txtRange = document.all[txtAreaName].createTextRange();
txtContainer = txtRange.parentElement().name;

objRange = document.selection.createRange();
hiliteTxt = objRange.text;
toExternLink = '<a href="' + hiliteTxt + '" target="_blank">' + hiliteTxt + '</a>';

if(hiliteTxt != ""){
objRange.text = toExternLink;
}
}

</script>

</head>

<body>
<form action="">
<table width="600" border="0" cellspacing="10" cellpadding="0" align="left">
<tr valign="top">

<td width="150">Choose area for updating/editing</td>
<td width="300">
<select name="siteArea">
<option value="1" selected>- Choose area - </option>
<option value="2">Conference info</option>
<option value="3">Miscallenous</option>
<option value="4">Register</option>
<option value="5">blah 1</option>
<option value="6">blah 2</option>
<option value="7">blah 3</option>
</select>
</td>

<td width="150">Choose here first</td>
</tr>
<tr valign="top">

<td>Heading</td>
<td>
<input type="text" name="txtHeading">
</td>
<td> </td>
</tr>
<tr valign="top">

<td>Maintext</td>
<td><textarea cols="30" rows="15" name="txtMainText"></textarea></td>
<td><br>
<a href="#" onClick="javascript:hiliteToBold(txtMainText);">Bold</a><br>
<a href="#" onClick="javascript:hiliteToItalic(txtMainText);">Italic</a><br>
<a href="#" onClick="javascript:hiliteToPara(txtMainText);">Paragraph</a><br>
<a href="#" onClick="javascript:hiliteToFont_11(txtMainText);">11 pt</a><br>
<a href="#" onClick="javascript:hiliteToFont_12(txtMainText);">12 pt</a><br>
<a href="#" onClick="javascript:hiliteToFont_14(txtMainText);">14 pt</a><br>
<a href="#" onClick="javascript:hiliteToMailto(txtMainText);">MailTo</a><br>
<a href="#" onClick="javascript:hiliteToExternLink(txtMainText);">http-link</a><br>
</td>
</tr>
<tr valign="top">

<td>Add external link</td>
<td>
http:// <input type="text" name="extLink1"><br>
http:// <input type="text" name="extLink2"><br>
http:// <input type="text" name="extLink3"><br>
http:// <input type="text" name="extLink4"><br>
</td>

<td>(no [url=http://)</td>]http://)</td>[/url]
</tr>
<tr valign="top">

<td>Add img (size: height 100px , width 100px)</td>
<td><input type="file" name="fileImage" accept="image/jpeg,image/gif"></td>

<td>(Only .jpg or .gif format)</td>
</tr>
<tr valign="top">

<td>Attach a file</td>
<td><input type="file" name="fileDocument" accept="application/msword,application/pdf"></td>

<td>(Only .doc or .pdf format)</td>
</tr>
<tr valign="top">

<td>Save info</td>
<td><input type="submit" value="Spara"></td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>



Have fun/Dan



[This message has been edited by DmS (edited 06-18-2001).]

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-18-2001 22:05

Looks nice... I will keep that in mind as well thanks for the input.

-mage-

DmS
Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 06-20-2001 11:30

If you combine the JavaScript with this php snippet as you save the info in the db you'll handle linbreaks ie convert them to <br> tags as well.

The info from the textfield comes to the page that populates the db in form of variables, in this case $txtMainText so, you do like this before you use it in the sql:

code:
$txtMainText = nl2br($txtMainText );



This way you save all linebreaks as <br> tags in the db.
//Dan

Drakkor
Maniac (V) Inmate

From: Seatte, Warshington, USA
Insane since: Dec 2000

posted posted 06-20-2001 19:19

I think the subroutine that replaces carrage returns with <BR> is a good idea, I use it on one of my pages. For the more difficult tags like ordered and unordered lists, font size, headings, anchors etc... just have some buttons set up on your form that will insert that stuff for the user.

For instance, they want to enter an anchor. Have a 'insert link' button on your page and when it is pressed it brings up a dialog box that asks for the url and the text. Really pretty easy to implement if you plan.

Cheers



-It never hurts to always be right-

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-20-2001 19:38

Cool, thanks for all the help every body

-mage-

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-20-2001 21:03

@#$!!

and I went and wrote a reg exp to swap out my line breaks.
I should have known PHP had a built in function


Walking the Earth like Kane

« BackwardsOnwards »

Show Forum Drop Down Menu