- Saved searches
- Use saved searches to filter your results more quickly
- License
- technosmarter/modern-blog-cms-in-php-and-mysql
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- Very Simple CMS In PHP MYSQL (Free Download)
- TLDR – QUICK SLIDES
- TABLE OF CONTENTS
- BAREBONES CMS
- STEP 1) CONTENT DATABASE TABLE
- STEP 2) CMS CONTENT LIBRARY
- STEP 3) UPDATE CONTENT PAGE
- STEP 4) DISPLAY CONTENT PAGE
- DOWNLOAD & NOTES
- SUPPORT
- EXAMPLE CODE DOWNLOAD
- EXTRA BITS & LINKS
- MORE IMPROVEMENT IDEAS
- HOW ABOUT MULTIPLE PAGES?
- LINKS & REFERENCES
- TUTORIAL VIDEO
- THE END
- Leave a Comment Cancel Reply
- Search
- Breakthrough Javascript
- Socials
- About Me
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
The modern blog contains latest features and lightweight structure . We have designed and developed a complete modern blog in PHP and MYSQL database .
License
technosmarter/modern-blog-cms-in-php-and-mysql
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Modern blog CMS in PHP with MYSQL database | Three column blog CMS in PHP
The modern blog contains the latest features and a lightweight structure. We have designed and developed a complete modern blog in PHP and MYSQL database. Three column blog CMS is used to present data in three columns. The first column is for the left sidebar, the second column is for the blog post description and the third column is for the right sidebar. There are two sidebars in this blog system in PHP with a MYSQL database.
Features of the blog management system
1. Designed and Responsive blog in PHP – The design of the blog should be attractive and very lightweight . We have designed blog with very lightweight CSS, JS files to reduce size of the page . The blog page opens faster than click process.PHP blog has more beneficial if you see the blog speed . We have designed blog using bootstrap to make a blog responsive . You can open this PHP blog on any device like- Desktop, mobile , tables , small or big size screen .
2. Three column blog CMS in PHP | 3 column blog – As you know that , three column blogs are more popular than simple blog . We have designed three column blog using bootstrap responsive classes.
3. Blog top and sticky Primary header – We have designed two header. First header for pages and second header for blog categories.
4. Posts with All posts page – Posts visible on Home page or if you want to check all posts then click on view all and check all posts page with pagination .
5. Categories and Subcategories – Categories are more important to separate content in different topics.
6. Recent posts- You can check recent posts on home page and in sidebar .
7. Blog top posts in PHP | Trending posts — Top posts are known as trending posts on blog portal.
8. Blog tags in PHP – Tags play important role for blog . We have created tags system in PHP with MYSQL database .
9. Blog post viewer – The blog post viewer should be readable and attractive.
10. Blog Social Share buttons (Icons) using PHP – Social share buttons (Icons) is used to increase SEO ranking. Anyone can share posts on social sites.
11. Custom blog link copier – We have created a customer link copier using PHP and JS
12. Blog Related posts using PHP match – The related post module is used to show the related posts to the content.
13. Admin panel – We have developed admin panel for customization of blog posts and pages .
14. Blog User management- Admin can new user and edit or delete user .
15. Blog Posts – Admin can upload image , link image , design text , align text , justify text , colors and more using text editor .
16.Embed video – This is another features of blog — Admin can embed Youtube videos to display and play video . 17.Blog categories and subcategories – Admin can create new blog categories and sub-categories. 18. Media – Admin can upload , delete and reuse images . 19. Blog page management – Admin can create pages with text editor , edit pages and delete pages .
20. Blog Theme color customizer – Admin can change theme color. 21. Social Links – Admin can set social links. 22. Post Limit – A post limit is another advance feature of blog using PHP and MYSQL database.
23. Blog Additional Settings in PHP – The name additional indicates that you can add extra css , css link , js , js link or ads code inside head , header , below title left sidebar, right sidebar , below content , footer and before closing body tag .
24 . Blog General settings – The general setting is essential part to start blogging on this PHP blog web application . Here , you can change blog title , URL, about , tags for SEO purpose , contact email to receive emails etc .
25. SEO friendly blog in PHP – We have developed this blog with SEO friendly URLs like – Blog posts URLs , blog categories URLs, blog tags URLs etc .
26. Sitemap –
27. Code snippet – Code snippet is another feature of blog by which programmer can display highlighted code inside post .
28 .Blog Searching system –
28. 404 page –
29. No coding required – If you don’t have any coding skills or you are not from coding background then don’t worry . This is really simple to install and use without any coding .
30. Simple installer – As we have discussed above this is modern blog web application in PHP , you can install buy simple form . Just fill out the details and done.
We have created a simple installer with this blog system in PHP. You can easily install a blog system on the local server or live server.
- First , get Modern blog CMS in PHP with MYSQL database | PHP blog scripts zip file.You can watch the complete demo from there.
- Extract the zip file and upload it to your server.
- Create a database and open the blog URL in your browser.
- You will see an installation form. Fill up the details like — host, database name, database password, and database username.
- Create an admin user and that’s it . You can contact for installation support for modern blog system in PHP.
Modern blog CMS system in PHP
Very Simple CMS In PHP MYSQL (Free Download)
Welcome to a quick tutorial on how to create a simple content management system (CMS) with PHP and MYSQL. Looking to challenge yourself or just want a really simple CMS for your current project? Well, an actual example will better explain things. Let us walk through one in this guide – Read on!
TLDR – QUICK SLIDES
TABLE OF CONTENTS
BAREBONES CMS
All right, let us now get started with the barebones CMS in PHP and MYSQL.
STEP 1) CONTENT DATABASE TABLE
CREATE TABLE `contents` ( `id` bigint(20) NOT NULL, `title` varchar(255) NOT NULL, `text` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ALTER TABLE `contents` ADD PRIMARY KEY (`id`), ADD KEY `title` (`title`), ADD FULLTEXT KEY `text` (`text`); ALTER TABLE `contents` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
Yep, this one should be very straightforward, we need a table to store the title and content of the pages. Just a small note here though, the title and text are indexed – ADD KEY `title` and ADD FULLTEXT KEY `text` . This indexing will take up a little more disk space but greatly improves the search performance.
STEP 2) CMS CONTENT LIBRARY
pdo = new PDO( "mysql:host=".DB_HOST.";dbname=".DB_NAME.";charset=".DB_CHARSET, DB_USER, DB_PASSWORD, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC ]); > // (B) DESTRUCTOR - CLOSE DATABASE CONNECTION function __destruct () < $this->pdo = null; $this->stmt = null; > // (C) HELPER - RUN SQL QUERY function query ($sql, $data=null) : void < $this->stmt = $this->pdo->prepare($sql); $this->stmt->execute($data); > // (D) SAVE CONTENT function save ($title, $text, $id=null) < if (is_numeric($id)) < $sql = "REPLACE INTO `contents` (`id`, `title`, `text`) VALUES (. )"; $data = [$id, $title, $text]; >else < $sql = "INSERT INTO `contents` (`title`, `text`) VALUES (. )"; $data = [$title, $text]; >$this->query($sql, $data); return true; > // (E) LOAD CONTENT function load ($id) < $this->query("SELECT * FROM `contents` WHERE `id`=?", [$id]); return $this->stmt->fetch(); > // (F) SEARCH CONTENT function search ($search) < $this->query("SELECT * FROM `contents` WHERE `title` LIKE ? OR `text` LIKE ?", ["%$search%", "%$search%"]); return $this->stmt->fetchAll(); > > // (G) DATABASE SETTINGS - CHANGE THESE TO YOUR OWN! define("DB_HOST", "localhost"); define("DB_NAME", "test"); define("DB_CHARSET", "utf8mb4"); define("DB_USER", "root"); define("DB_PASSWORD", ""); // (H) CREATE NEW CONTENT OBJECT $_CMS = new Content();
- (A, B, G) On creating $_CMS = new Content() , the constructor will automatically connect to the database; The destructor closes the connection when the object is destroyed.
- (C) query() A helper function to run an SQL query.
- (D to F) There are only 3 “content functions” here.
- save() To save page contents.
- load() To get the page contents.
- search() Search page contents.
That’s all, feel free to expand and add more of your own functions – Delete content, advanced search, save to HTML file, etc…
STEP 3) UPDATE CONTENT PAGE
save($_POST["title"], $_POST["text"], $id) ? "
" : "// (D) EDIT PAGE $content = $_CMS->load($id); ?> ">- Load TinyMCE (a WYSIWYG editor) from the CDN.
- Self-explanatory. Load the PHP library, but we fix the content ID to $id = 1 in this demo to keep things simple.
- Save the content when the form is submitted.
- HTML form to update the content itself.
That’s all for the essentials behind this “one-page admin”.
STEP 4) DISPLAY CONTENT PAGE
Now that we have some dummy contents in the database, the final step is to output it… This should not be a mystery anymore. We simply use $content = $_CORE->load($id) to fetch and output the contents.
DOWNLOAD & NOTES
Here is the download link to the example code, so you don’t have to copy-paste everything.
SUPPORT
600+ free tutorials & projects on Code Boxx and still growing. I insist on not turning Code Boxx into a «paid scripts and courses» business, so every little bit of support helps.
EXAMPLE CODE DOWNLOAD
Click here for the source code on GitHub gist, just click on “download zip” or do a git clone. I have released it under the MIT license, so feel free to build on top of it or use it in your own project.
EXTRA BITS & LINKS
That’s all for this guide, and here is a small section on some extras and links that may be useful to you.
MORE IMPROVEMENT IDEAS
- Protect 3-save.php . Create a user login system and admin panel – Check out the links below.
- Change 4-load.php to also load different pages, create your own HTML template.
- If you want a “pretty URL system” like WordPress or Drupal, feel free to add a “URL” field in the database. You will also need to work with htaccess , check out the pretty URL link below.
- Add a file manager to your CMS, do a search for “PHP file manager” on the Internet.
HOW ABOUT MULTIPLE PAGES?
- Add a getAll() function in 2-lib.php , SELECT `id`, `title` FROM `contents` .
- Use getAll() to build an admin page that lists all the available content.
- When the administrator clicks on a page in the list, redirect to 3-save.php?id=N .
- The rest should be straightforward. Modify 3-save.php and 4-load.php to load the content with $_GET[«id»] instead.
LINKS & REFERENCES
TUTORIAL VIDEO
THE END
Thank you for reading, and we have come to the end of this guide. I hope that it has helped you with your project, and if you want to share anything with this guide, please feel free to comment below. Good luck and happy coding!
Leave a Comment Cancel Reply
Search
Breakthrough Javascript
Take pictures with the webcam, voice commands, video calls, GPS, NFC. Yes, all possible with Javascript — Check out Breakthrough Javascript!
Socials
About Me
W.S. Toh is a senior web developer and SEO practitioner with over 20 years of experience. Graduated from the University of London. When not secretly being an evil tech ninja, he enjoys photography and working on DIY projects.
Code Boxx participates in the eBay Partner Network, an affiliate program designed for sites to earn commission fees by linking to ebay.com. We also participate in affiliate programs with Bluehost, ShareASale, Clickbank, and other sites. We are compensated for referring traffic.