You are here: Re: [PHP] Site Design Strategy « PHP « IT news, forums, messages
Re: [PHP] Site Design Strategy

Posted by "Mark Cain" on 06/04/05 01:35

Here is what I use:

The "articles" (non-technical user supplied content is stored in a database
e.g. mySQL with a table named something like article_content). The table
has columns such as

CREATE TABLE article_content (
id int(11) NOT NULL auto_increment,
page_name varchar(35) NOT NULL default '',
side char(1) NOT NULL default '',
position int(2) NOT NULL default '0',
title varchar(35) NOT NULL default '',
leader_length int(11) NOT NULL default '0',
creation_time datetime NOT NULL default '0000-00-00 00:00:00',
last_edit datetime NOT NULL default '0000-00-00 00:00:00',
editor int(11) NOT NULL default '0',
content longtext NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

Each user is assigned a security level in a user database that grants them
access (table name something like 'editors')

Each article has an "hidden" (no decoration) editor's link at the end of the
article. It could be the last word, the final punctuation, or a graphic.
When you click the editor's link the user is challenged against the user
name and password in the database and appropriate data stuffed into
sessions.

Once authentication is complete the article content is delivered for editing
via a JavaScript CMS such as xinha or tinymce.

Upon completion of editing, the content is stuffed back into the database.

The "template" for all the website is as follows:

require('/home/pathtofile/phplib/class.articles.php');
require('/home/pathtofile/pieces/header.txt');
require('/home/pathtofile/pieces/column1.txt');
require('/home/pathtofile/pieces/column2.txt');
get_article("L");
require('/home/pathtofile/pieces/column3.txt');
get_article("R");
require('/home/pathtofile/pieces/footer.txt');

The function get_article() pulls the content from the database for the
referring page (e.g index.html) where the page_name matches the referrer and
the side matches L or R. I use position to rank the articles on the page.
A page with lower position (e.g. 1) gets displayed first and then any "2"
articles, then "3", etc. I use the "0" as a 'non published' indicator which
allows an editor to work on an article and then hide it until the right time
or to repost a recurring article at certain times..

Works wonderfully well and elevates my perceived status to that of near
genius!

Here is a link to see it in action or at least to see the finished content.
The entire web site is maintained by non-technical volunteers and they have
populated hundreds of articles on dozen of pages.
:
http://www.southshorechurch.com/index.htl?php_gen

If you need more info or functions to make this work, let me know.

Hope this helps,

Mark Cain

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация