Jump to content

Recommended Posts

It is quite simple, especially if you have good experience with php. It uses OOP to a small degree. From what I see, he is implementing it all wrong; more just a collection of functions inside a class. Nontheless, good place to start and it's right on topic.

 

The basic logic here is you need to store the data for your current application in a database. Things like categories, page content etc You then create an admin area which allows full control over this. Depending on the complexity of the app, the database could become quite complex in itself. I'd also look at optimal database design (unless the site is already database driven).

Do anyone know the best place I can learn how to create a CMS?

 

If you have a good amount of knowledge on what a CMS is and have the necessary PHP skills then I don't see why you would need a tutorial at all.

It is quite simple, especially if you have good experience with php. It uses OOP to a small degree. From what I see, he is implementing it all wrong; more just a collection of functions inside a class. Nontheless, good place to start and it's right on topic.

 

The basic logic here is you need to store the data for your current application in a database. Things like categories, page content etc You then create an admin area which allows full control over this. Depending on the complexity of the app, the database could become quite complex in itself. I'd also look at optimal database design (unless the site is already database driven).

 

 

This tutorial is a great start.  The only thing I need to know now is how to implement the ability for a user to add and delete photo's.

cms.php

<?php

echo "<form enctype='multipart/form-data' action='upload.php' method='POST'>Choose a file to upload: 
              <input name='uploadedfile' type='file' />
              <input type='submit' value='Upload File' />
            </form>";

$buildhtml = "";
$dirpath = "files/"; 
$dlist = opendir($dirpath); 
while ($file = readdir($dlist)) { 
if (!is_dir("$dirpath/$file")) { 
// assuming that all the files are image files
// when admin click the photo, it will delete the photo
$buildhtml .= "<img src=files/$file onClick='unlink(files/$file);'></img><br>"; 
} 
} 
closedir($dlist); 

if (!empty($buildhtml)) {
echo "Files in Storage</strong></u><p>" . $buildhtml . "</p>";
echo "Click on it to download";
} else {
echo "The directory is <strong>empty</strong>! Upload the files by using the form above.";
}

 

upload.php

<?php
// Created by ZulfadlyAshBurn

header('Refresh: 3; URL=index.php');

// you have to create a folder named files and it should have 777 permissions.
$target_path = "files/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}
?>

 

show.php

<?PHP
// Created by ZulfadlyAshBurn

$buildhtml = "";
$dirpath = "files/"; 
$dlist = opendir($dirpath); 
while ($file = readdir($dlist)) { 
if (!is_dir("$dirpath/$file")) { 
// assuming that all the files are image files
$buildhtml .= "<img src=files/$file></img><br>"; 
} 
} 
closedir($dlist); 

if (!empty($buildhtml)) {
echo "Files in Storage</strong></u><p>" . $buildhtml . "</p>";
echo "Click on it to download";
} else {
echo "The directory is <strong>empty</strong>!";
}

?>

you may want to put this (show.php) file in the main page.

 

as you can see, the cms i add in unlink for the admin to be able to delete the photo but at the show pg, the viewers are only able to see but not delete. you can secure you cms.php with some mysql and php.

 

  • 4 months later...

Had anyone ever used joomla as a CMS? I here it's free.

 

Joomla is only one of many free available CMS systems. Take a look at the offerings on:

 

http://php.opensourcecms.com/scripts/show.php?pagenumber=1

 

Select "Votes Cast (Most to Least)" from the dropdown.

i used this page: http://www.intranetjournal.com/php-cms/ and its probably outdated but taught me all i needed to know to get a basic cms of my own design up and running, again its class based with basic oop ideas

 

i also used the one at css tricks its very good

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.