Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Very simple CMS

  1. #1
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Hey;

    I'm not sure if this would be considered an easy or complex task.
    I am looking for a very simple CMS, that will allow 1 user to log in, upload pictures and post messages.

    Uploading pictures would just involve simple information such as Name of Picture. Then its dispayed as a link on a page, and when click, you can view the image

    Posting messages will just be very simple, just a title, and the name of the user who posted it.

    Obviously MySQL would be supporting this so I would like that too.

    I can do other features but that is the general jist of it. Thanks
    assassingod - vB.org Moderator :ichatsmile:

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    This is a big amount of work. I'm not aware of any simple PHP CMS like this out there.

    Maybe the best way to proceed is to read up a bit at http://www.php.net and begin coding it yourself. When you run into specific problems (like database schema design, database access, etc.) post them back to this thread, and we can then help you build it.

    That would probably also be the best learning experience for you.

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Actually it's mostly easy, except for the file uploading which is insanely tedious to code.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    I mean a big amount of work for someone to just put together for him.

    It involves creating a database schema with at least 2 tables (pics and messages) and at least 3 php pages (login, pic manager, and message manager).

    You're right that it's mostly easy work, though. Maybe someone who's good with PHP and MySQL will do it for him

    I can offer a start on the database schema:

    Code:
    CREATE TABLE message (
        id int(11) NOT NULL auto_increment,
        username varchar(255) NOT NULL,
        title varchar(255) NOT NULL,
        content text NOT NULL,
        date_created datetime DEFAULT NOW(),
        PRIMARY KEY (id)
    )
    
    -- I added the foreign key "message_id" to the image table
    -- in case you want images related to messages
    
    CREATE TABLE image (
        id int(11) NOT NULL auto_increment,
        message_id int(11) UNSIGNED NOT NULL REFERENCES message(id),
        name varchar(255) NOT NULL,
        src varchar(255) NOT NULL,
        date_uploaded datetime DEFAULT NOW(),
        PRIMARY KEY (id)
    )

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Here are some queries to go with the schema:
    PHP Code:
    $get_messages_query "
        SELECT username, title
        FROM message
        ORDER BY date_created"
    ;

    $get_message_query "
        SELECT
            message.username,
            message.title,
            message.content,
            image.name,
            image.src
        FROM message
            INNER JOIN image ON image.message_id = message.id
            WHERE message.id = 
    $message_id
        ORDER BY image.date_uploaded"
    ;

    $add_message_query "
        INSERT INTO message (username, title, content)
        VALUES ('
    $username', '$title', '$content')";

    $add_image_query "
        INSERT INTO image(message_id, name, src)
        VALUES (
    $message_id, '$name', '$src')";

    $delete_message_query "
        DELETE FROM image WHERE message_id = 
    $message_id;
        DELETE FROM message WHERE id = 
    $message_id";

    $delete_iamge_query "
        DELETE FROM image WHERE id = 
    $image_id"
    I think those'll work

  7. #6
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Originally posted by transio
    This is a big amount of work. I'm not aware of any simple PHP CMS like this out there.

    Maybe the best way to proceed is to read up a bit at http://www.php.net and begin coding it yourself. When you run into specific problems (like database schema design, database access, etc.) post them back to this thread, and we can then help you build it.

    That would probably also be the best learning experience for you.
    Yes - I didn't think there would be many takers of the project. Thank you for the advice. It's not so much the php but mysql, i've only started properly understanding it.

    Originally posted by transio
    I mean a big amount of work for someone to just put together for him.

    It involves creating a database schema with at least 2 tables (pics and messages) and at least 3 php pages (login, pic manager, and message manager).

    You're right that it's mostly easy work, though. Maybe someone who's good with PHP and MySQL will do it for him

    I can offer a start on the database schema:
    Thank you for the schema, i will have play with with the other schema you gave me

    Also, the image & message feature's are seperate thing

    Thanks again for the help, i'll have some more attempts at my lil' project.
    assassingod - vB.org Moderator :ichatsmile:

  8. #7
    Junior Member Colicab's Avatar
    Join Date
    Apr 2003
    Posts
    15
    Member #
    1112
    why not write yourself a simple script for news, and a seperate one for file uploading, then create a simple log in and require it for both files.. (soz im only 3 months into php)

  9. #8
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Because I need MySQL at the backand. Otherwise the image wont be stored in the database.
    assassingod - vB.org Moderator :ichatsmile:

  10. #9
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Ok, if the tables aren't going to be related, try something like this:
    Code:
    CREATE TABLE message (
        id int(11) NOT NULL auto_increment,
        username varchar(255) NOT NULL,
        title varchar(255) NOT NULL,
        content text NOT NULL,
        date_created datetime NOT NULL DEFAULT NOW(),
        PRIMARY KEY (id)
    )
    
    CREATE TABLE image (
        id int(11) NOT NULL auto_increment,
        name varchar(255) NOT NULL,
        src varchar(255) NOT NULL,
        date_uploaded datetime NOT NULL DEFAULT NOW(),
        PRIMARY KEY (id)
    )
    And for your queries:
    PHP Code:
    //Gets a list of messages from the database
    $get_messages_query "SELECT username, title
        FROM message
        ORDER BY date_created"
    ;

    //Gets a specific message from the database
    $get_message_query "SELECT username, title, content
        FROM message
        WHERE message.id = 
    $message_id
        ORDER BY image.date_uploaded"
    ;

    //Adds a message to the database
    $add_message_query "INSERT INTO message (username, title, content) 
        VALUES ('
    $username', '$title', '$content')";

    //Deletes a message from the database
    $delete_message_query "DELETE FROM message WHERE id = $message_id";

    //Gets all images from the database
    $get_images_query "SELECT name, src
        FROM image
        ORDER BY date_uploaded"
    ;

    //Adds an image to the database
    $add_image_query "INSERT INTO image(name, src) 
        VALUES ('
    $name', '$src')";

    //Deletes an image from the database
    $delete_image_query "DELETE FROM image WHERE id = $image_id"

  11. #10
    Junior Member Colicab's Avatar
    Join Date
    Apr 2003
    Posts
    15
    Member #
    1112
    what i said could all be done via mysql


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:41 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com