Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updates by non techie

Status
Not open for further replies.

maxelcat

Technical User
Oct 19, 2006
79
Hi

I am designing a site for a church that wants to put its weekly notice sheet on the site.

I suppose they could covert to a pdf and I could overwrite the same file every week on their server but that sounds risky to me.

I have seen sites where using a password users can update pages themselves without knowing any xhtml etc? I have no idea how this is achieved - is it a package that they buy, or can it be quite easily coded?

Not looking for long answers here, but some general pointers as to what this process is called and where to find out about it would be very greatefully received.

thanks as ever

Edward
 
If you write an interface that looks similar to the weekly notice sheet with text boxes and text areas for them to fill in the blanks, you can either insert the info in a template file and save it as the notice page, or write the notice page info to a file that the page will read and fill in the blanks when it's viewed.

Lee
 
Best way to do this is a databased admin section. Then you just give the person text fields to fill in and compile the results on the front end dynamically. Very easy to do but you need to do server side programming like php and database with something like mysql.

NATE


Got a question? Search G O O G L E first.
 
For my suggestions, you would need server side scripting, PHP or ASP probably, but the final result wouldn't require any kind of database system. I'd consider that overkill for the task.

Lee
 
Why do you think it's overkill. What I find overkill would be writing a complex system to write to flat files or and xml tree when a database is very easy to do. Setting it up and reading/writing is a cinch. Most hosting packages have mysql included too.

NATE


Got a question? Search G O O G L E first.
 
Most hosting packages have mysql included too.
Yes, but most companies charge extra for this (as does the company in your signature). The cheapest method, for the one dynamic page that the user wants to create, would probably be to find a package without database access and write a simple ASP/PHP script to write out to an XML file.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
The company in my signature is my company. It's not that I charge more for database access per say. It's that I have a cheaper solution for people that don't need as much space or features. I could easily allocate databasing to the cheap one if I wanted to but you also have to take into consideration that alot of people when shopping for hosting don't know what alot of these features are and can get scared off if you promote too much. This is the only reason I did it that way.

Anyway, xml can be clunky though. Why bother writing something to read into a certain section then have to strip it out and re-write it for an update. Databasing makes it so easy to do. I bet I could write a database routine faster than creating an xml one. And I'm talking about from scratch too without using pre-built systems. If someone wanted me to write an xml system I would charge them more to do that than I would to do a mysql solution.

NATE


Got a question? Search G O O G L E first.
 
Sorry, I wasn't having a go at your pricing plans, I was just saying that you can generally get a cheaper package if you don't need database access.

As for speed of writing routines to write to an XML file vs a database I really don't think there is anything in it. Using the server-side language that I most often use (ASP.NET), I don't think there is any difference in the amount of code, nor the time taken to write this code, in reading/writing to an XML vs a database. I'm not sure if this is the case anymore with ASP/PHP though.

I agree that databases are much more beneficial and have more advantages than flat files, however, for what this user wants to do it seems that it would be more expensive and not really needed.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Yes ultimately without a db it's cheaper if you look at the overall picture.

As for price I could set this up for $50. Ever seen:
A webbased WYSIWYG editor that mimics M$ Word. All you have to write is the database part which takes all of about 5-10 minutes to do (if that).

Then he could simply copy and paste the notice sheet into the editor then do some formatting and then hit update. Very very simple to do. I've done it a million times it seems.

NATE


Got a question? Search G O O G L E first.
 
No, I haven't seen that WYSIWYG editor before (I generally use a free ASP.NET one from but yes the principle is the same in that it makes it easier for the front end user. Then, you just grab the data and write it out to the database or XML file.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Don't you have a conflict though writing html code to xml? I'm no xml wizard so I won't pretend to know alot about it. But if you stored html in it or wrote a tag < without closing it, couldn't that potentially crater the system? A database wouldn't care.

NATE


Got a question? Search G O O G L E first.
 
You can encode the HTML before storing it in the XML file.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I am designing a site for a church that wants to put its weekly notice sheet on the site
Perhaps you should consider doing it as a blog? If your hosting plan includes php and mySQL (see discussion above), you can install Wordpress for free and incorporate it into your site.

Users can log in and post their messages using a nice interface, and you don't have to cut any code (well, not much - depending on how much customisation of the front-end you want to do).

By adding different categories of posting - news, bible passage of the week, etc. - you can use it for other types of user-generated content too.

As an example, I've used Wordpress for a site that isn't a traditional blog (though it is perhaps more blog-like than you intend your site to be) at .

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Dear All

Thanks for your input - I have read it all, and looked at the links.

The server does have php and MySQL, so I think I will go down that root - it might be useful for them to have access to previous versions of their newsletter.

Thanks again

Edward
 
While I know this post has already filled it's intended purpose, I have a few thoughts to add to it, as I find the general conversation to be interesting.

I have built pages based on databases, XML files, flat files, and automatic generation of static pages. Databases are not always the best solution, even if they can be the fastest to implement (if thats where your experience lies). However, while having a single good solution to a problem allows you to turn out a site quickly, there are places for other solutions in your toolset as well.

For instance, a few sites ago I wrote a site administration from scratch that used a template file (HTML), a data file (text), and a content generation script to output static HTML files. The purpose of this was to reduce the load time, process utilization, and necessary maintenance of a page to the absolute minimum. The owner would go into the administration tool, make his changes, and the press a save button. The data would be placed in the data file (so that it could be pulled back out for editing later) and then a page was generated from the data file and the template page creating a new static page that overwrote the old version.
The net effect was that the owner saw a little higher processing time (maybe) then if I had simply stored the data in the database, but the site required no database and had a slightly faster load time and higher simultaneous user capability. This means a lot less maintenance for myself, less load on the server, and no worries about tuning the database when traffic grew.

Would this solution be good for all needs? No. In fact he had a section of his site that was fed by a database. I tend to only use databases when there is dynamic content involved. Treating the whole site as dynamic content requires that much more code in the visitor pages. By moving the work of applying occasional verbiage change to the administration tool, it kept the pages simpler and made the processing occur once per change rather than once per visitor per page.

As far as time to develop is concerned, this comes down to experience. It takes me slightly longer to write a PHP page then it does to write an ASP 3.0 page, but that doesn't mean PHP has no place in my toolset. Overall ASP.Net doesn't speed up my development a great deal, but again, there is a place for that in my toolset as well. Just as there are places for different languages or technologies, there are places for different design or implementation methodologies as well. Sometimes it is worth the time to use an opportunity such as this one to explore a new methodology.

 
Remembering what this site is for and the likely amount of traffic I wouldn't bother with XML solutions or anything that will take time to build an admin system.

Have you (the OP) looked at something like Macromedia Contribute? It's a fairly low cost piece of software ($99?) that allows a non technical user to edit and maintain a site with a MS Word style interface.

Once it's set up, which is easy, it is even simpler for someone to maintain the site.

No databases, no server side scripting. Just plain HTML and a cleverly disguised FTP/WYSIWYG editor built from the Dreamweaver engine.



<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
Really interesting and thought provoking post.

What perhaps I didn't explain at the outset is that I am really quite new to this. I consider myseld good with xhtml and css, but pretty basic with asp and php. The churches server has mysql and php on it (but not asp). Your description above sounds exactly like what I want to do, but I don't know where to start (other than use php with MySQL) I realise that this may well be overkill.

That's the issue - where do I start!!!

Thanks again

and here's hoping

Edward
 
If there is just one page that will need to be updated then just build a system that will manage that one page. This is easier than building a system to manage many pages - although this in itself is not that difficult.

You will need to consider:
1. The structure of your database
At it's simplest you would probably want to create a single database table that has columns (fields) for:
[ul]
[li]A unique identifying number[/li]
[li]Page heading[/li]
[li]Page content[/li]
[li]Something to say whether the page is 'on' or 'off'[/li]
[li]Date published[/li]
[/ul]

Be sure to use the correct column types for each. For example, make sure you use a DATE column for the date (sounds obvious I know).

You will then need to learn how to get PHP to connect to and send queries to your database and also how to use the data that gets returned.

On top of this, you will need to consider the adminstration side of things - so you may wish to look at creating a password protected admin section to the site. This will probably involve another database table.

Oh, and don't forget security. You need to be sure that your admin system and database interrogation is secure.

I hope you can now see that, whilst not horribly difficult to do, it IS a bit of work. Especially if you aren't familiar with PHP or MySQL, or any other server side stuff.

It's easy to cobble something together, but it's also very easy to do this and leave huge holes. You don't want holes!


<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
In response to Tarwn,

Yes you are right, what you are referring to is basically like a caching system. I do the same but with a database. Each page connects to the database to get various resources. For those pages that only do one db query then the cache is done on the backend. Once you write the changes to the backend it caches the entire page output into the cache folder then if the cache file exists when the page is called it simply loads that file in then kills the script otherwise it would get info from the db and then write the cache file itself. This is the same for pages that would do multiple queries to get different dynamic content. A simple cache timeout is set and then if the cache file isn't there it creates it with the page output buffer otherwise it calls the cache file for that page as well.

It uses a db which is easy to setup and maintain and it caches, which aids in performance, fast delivery to the browser and low server strain. It's a win win win situation.

NATE


Got a question? Search G O O G L E first.
 
To add onto foamcow's post,

Open a db manager such as phpMyAdmin and put the following into the SQL textarea:
Code:
CREATE TABLE `content` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(100) NOT NULL default '',
  `page` varchar(25) NOT NULL default '',
  `content` mediumtext NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

You can easily add onto that if you need date etc.

Next goto: and download the spaw WYSIWYG editor. Then upload that to your ftp. You will need to read the instructions for configuration but it's easy.

Create yourself a header and footer page with the container html.

Your index.php file would look like this:
Code:
<?php

include ('../mysql_db.php');
include ('spaw_control.class.php');
include ('admin_header.php');

?>

<!-- Begin Admin -->

<form name="spaw" action="update.php" method="post">
<table border="0" cellpadding="0" cellspacing="0" width="550">
	<tr>
	<td colspan="2" align="center">

	<?php

	DB_open();

	if ($_GET["key"] != "1")
		{
		echo '<br><span style="height: 50px; font-weight: bold;">Please select a page to edit!</span>';
		}
	else
		{
		DB_query("SELECT * FROM `content` WHERE id =" . $_GET["id"]);

		while ($DB_result = DB_fetch($DB_query))
			{
			$sw = new SPAW_Wysiwyg('spaw1', stripslashes($DB_result["content"]));
			$sw->show();

			echo '<br>';
			}
		}

	?></td>
	</tr>

	<tr>
	<td align="left">
	<input type="hidden" name="key" value="1">
	<input type="submit" value="Update" <? if ($_GET["key"] != "1") {echo "disabled";} ?> onclick="this.form.target = '_self'; this.form.action = 'update.php'">&nbsp;

	<input type="button" value="Cancel" <? if ($_GET["key"] != "1") {echo "disabled";} ?> onclick="location = 'index.php'"></td>
	<td align="right">
	<select name="id">
	<?php

	DB_query("SELECT * FROM `content`");

	while ($DB_result = DB_fetch($DB_query))
		{ 
			echo "<option value=\"" . $DB_result["id"] . "\"";
			if ($DB_result["id"] == $_GET["id"])
			{
				echo " selected";
				}
			echo ">" . $DB_result["title"] . "</option>\n";
		}

	DB_close();

	?>
	</select>&nbsp;

	<input type="button" value="EDIT" onclick="location = 'index.php?key=1&id=' + this.form.id[this.form.id.selectedIndex].value"></td>
	</tr>
</table>
</form>

<!-- End Admin -->

<?php

include ('admin_footer.php');

?>

Then you need an update page:
Code:
<?php

include ('../mysql_db.php');
include ('admin_header.php');

?>

<!-- Begin Admin -->

<?php

if ($_POST["key"] != "1")
	{
	echo '<h1>Error</h1>

	No page selected for updating. Re-directing. If your browser does not re-direct click <a href="/admin/spaw/index.php">here</a>
	<meta http-equiv="refresh" content="1;url=/admin/spaw/index.php">';
	}
else
	{
	DB_open();

	DB_query("UPDATE `content` SET `content` = '" . addslashes($_POST["spaw1"]) . "' WHERE id ='" . $_POST["id"] . "'");

	DB_close();

	echo '<h1>Content <span style="color: #ff7f00;">Updated</span></h1>

	Content Successfully Updated. Re-directing. If your browser does not re-direct click <a href="/admin/index.php">here</a>
	<meta http-equiv="refresh" content="1;url=/admin/index.php">';
	}

?>

<!-- End Admin -->

<?php

include ('admin_footer.php');

?>

As for security for accessing the admin panel just use .htacess. There is no point writing an elaborate php authorization system for something so simple. It's overkill.

Anyway that should get you going. Good luck. I do realize that php code isn't the greatest. I wrote that years ago when I was still learning it myself but it should be quite easy for you to understand.

NATE


Got a question? Search G O O G L E first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top