Flexsoft Posted March 4, 2021 Share Posted March 4, 2021 Hi guys I'm planning to create a CMS using by PHP and MySQL Any Suggestions Thank you Quote Link to comment Share on other sites More sharing options...
Cloud_Geek Posted June 2, 2021 Share Posted June 2, 2021 Creating a CMS is not so easy but if you are really keen of accepting challenges then you should follow the following steps: Create the database Create the articles database table Make a configuration file Build the Article class Write the front-end index.php script Write the back-end admin.php script Create the front-end templates Create the back-end templates Create the stylesheet and logo image. Quote Link to comment Share on other sites More sharing options...
Strider64 Posted June 2, 2021 Share Posted June 2, 2021 (edited) I personally design the CMS first by that I mean I do a mock-up of what I visualize what the CMS is going to look like by creating a static HTML page with CSS. That way I know how it's going to look like and the setup of the PHP. Here's a visual description on what I'm trying to get at: (Obviously this is after the PHP being added) <?php foreach ($cms as $record) { ?> <article class="cms" itemscope itemtype="http://schema.org/Article"> <header itemprop="articleBody"> <div class="byline" itemprop="author publisher" itemscope itemtype="http://schema.org/Organization"> <img itemprop="image logo" class="logo" src="assets/images/img-logo-004.png" alt="website logo"> <h2 itemprop="headline" class="title"><?= $record['heading'] ?></h2> <span itemprop="name" class="author_style">Created by <?= $record['author'] ?> on <time itemprop="dateCreated datePublished" datetime="<?= htmlspecialchars(CMS::styleTime($record['date_added'])) ?>"><?= htmlspecialchars(CMS::styleDate($record['date_added'])) ?></time></span> </div> <img itemprop="image" class="article_image" src="<?php echo htmlspecialchars($record['image_path']); ?>" <?= getimagesize($record['image_path'])[3] ?> alt="article image"> </header> <p><?= nl2br($record['content']) ?></p> </article> <?php } ?> The main thing to take away from all of this is the naming of the variables as they are consistent to the database table: create table cms ( id int auto_increment primary key, user_id int null, author varchar(160) null, page varchar(255) default 'index' null, thumb_path varchar(255) null, image_path varchar(255) null, Model varchar(255) null, ExposureTime varchar(255) null, Aperture varchar(255) null, ISO varchar(255) null, FocalLength varchar(255) null, heading varchar(60) null, content text collate utf8_unicode_ci null, date_updated datetime null, date_added datetime null ); I would start off using procedural PHP when creating the first CMS and it still can be very robust. A lot of planning beforehand can save a lot of headaches later on. Didn't realize this was an old thread as I'm still waking up. 😁 Edited June 2, 2021 by Strider64 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.