Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> A Simple Way To Maintain Many Webpages Without A Cms
True2Earn
post May 1 2006, 09:12 PM
Post #1


Advanced Member
*******

Group: Members
Posts: 141
Joined: 25-April 06
Member No.: 22,477



Here is a very simple way to maintain many webpages without using a content management system (CMS). One of the advantages to this is you can change templates very easily. Your article would be in a separate file, for an example we'll create a file called my_page_article.php

CODE
<?
$PageTitle = "My Page";
$articleDescription = "This is my page";
$articleTitle = "All about my page";
$articleKeywords = "my page";
$articleBody  ='<strong>Welcome to my page.<br>
This is <a href="http://www.google.com" target="_blank">Google</a>!</strong>';
?>

Next, we design a template and enter our variables where we want them. As an example and to save space, here is a very plain template. For our article above we'll name it my_page.php

CODE
<? include ("article.php"); ?>
<html>
<head>
<title><? echo "$pageTitle"; ?></title>
<META NAME="description" CONTENT="<? echo "$pageDescription"; ?>">
<META NAME="keywords" CONTENT="<? echo "$articleKeywords"; ?>">
<META NAME="revisit-after" CONTENT="7 days">
<META NAME="robots" CONTENT="index, follow">
<META NAME="rating" content="general">
<META NAME="distribution" content="global">
</head>
<body>
<p><? echo $articleTitle; ?></p>
<p><? echo $articleBody; ?></p>
</body>
</html>

Such a simple template system as the above can be expanded upon to use mySQL to store all the info instead of the first file listed above. But, for a quick and dirty way of getting a large number of pages up in a short time, this works pretty well.

But now you're probably saying, "ok, now I have 100 pages all ready to upload. What about an index page?" No problem! We'll make the index.php like this

CODE
<? $indexTitle = "My Page Index";
$pageDescription = "This is my page index";
$pageKeywords = "my page,my index';

$articleTitle1 = "My 1st Article";
$articleLink2 = "my_article_1.php;
$articleDecrip_1 = "Learn all about apples and oranges";

$articleTitle2 = "My 2nd Article";
$articleLink2 = "my_article_2.php;
$articleDecrip_2 = "Learn all about peaches and pears";

$articleTitle3 = "My 3rd Article";
$articleLink2 = "my_article_3.php;
$articleDecrip_2 = "Learn all about rocks and rolls";

<html>
<head>
<title><? echo "$indexTitle"; ?></title>
<META NAME="description" CONTENT="<? echo "$pageDescription"; ?>">
<META NAME="keywords" CONTENT="<? echo "$pageKeywords"; ?>">
<META NAME="revisit-after" CONTENT="7 days">
<META NAME="robots" CONTENT="index, follow">
<META NAME="rating" content="general">
<META NAME="distribution" content="global">
</head>
<body>
<a href="<? echo $articleLink1 ?>"><? echo $articleTitle1; ?><br>
<? echo $articleDescription1; ?><br><br>
<a href="<? echo $articleLink2 ?>"><? echo $articleTitle2; ?><br>
<? echo $articleDescription2; ?><br><br>
<a href="<? echo $articleLink3 ?>"><? echo $articleTitle3; ?><br>
<? echo $articleDescription3; ?><br><br>
<!-- you can add more pages by doing this -->
<a href="index.php">1</a> - <a href="index-2.php">2</a> - <a href="index-3.php">3</a>
</body>
</html>

and there's your template/guideline for making an index page for all your articles.
Go to the top of the page
 
+Quote Post
Bradley
post May 16 2006, 08:23 PM
Post #2


Newbie [Level 2]
**

Group: Members
Posts: 25
Joined: 16-May 06
Member No.: 23,733



Looks good though some people dont like to use single quotes will have to slash their double quotes (EX: " will be \") which you will have to do if you use the code from my_page_article.php
CODE
$articleBody  ='<strong>Welcome to my page.<br>
This is <a href="http://www.google.com" target="_blank">Google</a>!</strong>';

The easisest and most user friendly way would to have the information they want as the body to be stored in a MySQL database. Then just retrieve the data and set it as $articleBody and it'd work just as great but with no hassle smile.gif.
Go to the top of the page
 
+Quote Post
hujtec
post May 30 2006, 12:48 AM
Post #3


Newbie [Level 1]
*

Group: Members
Posts: 12
Joined: 29-May 06
Member No.: 24,489



Yes this is a nice solution. But please think about it for a second. Is it really worth the time and effort? That method could be viable if your time costs nothing. In any other case you are better off using mysql. God forbid that your site would be successful and would become bigger in size. Who would administer all that content I do not know.
Still - a nice exercise in clean design.
Go to the top of the page
 
+Quote Post
truefusion
post May 30 2006, 02:19 AM
Post #4


Ephesians 6:10-17
Group Icon

Group: [MODERATOR]
Posts: 1,868
Joined: 22-June 05
From: The World of Gentoo
Member No.: 8,528
T17 GFX Crew



If you think about it. This is like manual-CMS. Nice planned-out alternative, though. May be useful for many.
Go to the top of the page
 
+Quote Post
bapplay
post May 30 2006, 02:42 PM
Post #5


Newbie
*

Group: Members
Posts: 3
Joined: 30-May 06
Member No.: 24,522



QUOTE(True2Earn @ May 1 2006, 03:12 PM) *

Here is a very simple way to maintain many webpages without using a content management system (CMS). One of the advantages to this is you can change templates very easily. Your article would be in a separate file, for an example we'll create a file called my_page_article.php

CODE
<?
$PageTitle = "My Page";
$articleDescription = "This is my page";
$articleTitle = "All about my page";
$articleKeywords = "my page";
$articleBody  ='<strong>Welcome to my page.<br>
This is <a href="http://www.google.com" target="_blank">Google</a>!</strong>';
?>

Next, we design a template and enter our variables where we want them. As an example and to save space, here is a very plain template. For our article above we'll name it my_page.php

CODE
<? include ("article.php"); ?>
<html>
<head>
<title><? echo "$pageTitle"; ?></title>
<META NAME="description" CONTENT="<? echo "$pageDescription"; ?>">
<META NAME="keywords" CONTENT="<? echo "$articleKeywords"; ?>">
<META NAME="revisit-after" CONTENT="7 days">
<META NAME="robots" CONTENT="index, follow">
<META NAME="rating" content="general">
<META NAME="distribution" content="global">
</head>
<body>
<p><? echo $articleTitle; ?></p>
<p><? echo $articleBody; ?></p>
</body>
</html>

Such a simple template system as the above can be expanded upon to use mySQL to store all the info instead of the first file listed above. But, for a quick and dirty way of getting a large number of pages up in a short time, this works pretty well.

But now you're probably saying, "ok, now I have 100 pages all ready to upload. What about an index page?" No problem! We'll make the index.php like this

CODE
<? $indexTitle = "My Page Index";
$pageDescription = "This is my page index";
$pageKeywords = "my page,my index';

$articleTitle1 = "My 1st Article";
$articleLink2 = "my_article_1.php;
$articleDecrip_1 = "Learn all about apples and oranges";

$articleTitle2 = "My 2nd Article";
$articleLink2 = "my_article_2.php;
$articleDecrip_2 = "Learn all about peaches and pears";

$articleTitle3 = "My 3rd Article";
$articleLink2 = "my_article_3.php;
$articleDecrip_2 = "Learn all about rocks and rolls";

<html>
<head>
<title><? echo "$indexTitle"; ?></title>
<META NAME="description" CONTENT="<? echo "$pageDescription"; ?>">
<META NAME="keywords" CONTENT="<? echo "$pageKeywords"; ?>">
<META NAME="revisit-after" CONTENT="7 days">
<META NAME="robots" CONTENT="index, follow">
<META NAME="rating" content="general">
<META NAME="distribution" content="global">
</head>
<body>
<a href="<? echo $articleLink1 ?>"><? echo $articleTitle1; ?><br>
<? echo $articleDescription1; ?><br><br>
<a href="<? echo $articleLink2 ?>"><? echo $articleTitle2; ?><br>
<? echo $articleDescription2; ?><br><br>
<a href="<? echo $articleLink3 ?>"><? echo $articleTitle3; ?><br>
<? echo $articleDescription3; ?><br><br>
<!-- you can add more pages by doing this -->
<a href="index.php">1</a> - <a href="index-2.php">2</a> - <a href="index-3.php">3</a>
</body>
</html>

and there's your template/guideline for making an index page for all your articles.

nice
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Making A Simple Signature With Adobe Photoshop(3)
  2. Simple Sig Tutorial(24)
  3. Php Mod Rewrite Tutorial(3)
  4. Simple C File Handling In Action(3)
  5. Watermark Your Image With Simple Php Script(34)
  6. A Simple Preg_replace Help Please.(1)
  7. Simple Is Beter - The Future Of Computers?(3)
  8. What Is God?(52)
  9. Simple Javascript And Password System(6)
  10. Dialup Users Double Your Connection Speed(6)
  11. need a good and simple php-nuke tutorial(17)
  12. Msgbox(17)
  13. How To: Make A Simple Php Site(21)
  14. How To Take A Screen Shot Of Your Desktop.(22)
  15. Simple Cms To Internet Marketing(2)
  1. How To Make A Decent Forum(8)
  2. Php Simple Login Tutorial(63)
  3. How Often Do You Use Css?(7)
  4. Verifying Your Email Address(0)
  5. We Are Destined To Be Borg-like, Yet Maintain Individuality?(3)
  6. Pci Simple Communications Controller / Multimedia Audio Controller(5)
  7. A Simple Php Captcha - Image Validation(21)
  8. A Simple Cms?(6)
  9. A Simple Attack System(0)
  10. Simple Stylesheet Tutorial(2)
  11. How To Make A Very Simple Wap Site(40)
  12. Simple Php Login And Registration System(10)
  13. Simple User System(19)
  14. One Click Copy And Paste To Clipboard(5)
  15. Simple Scripts In Html And Javascript(7)


 



- Lo-Fi Version Time is now: 26th July 2008 - 09:37 AM