“Bootstrap Blogifier” Documentation by “Kent Elchuk” v1.1


“BootstrapBlogifier”

Created: 29/11/2016
By: Kent Elchuk
Email: kent@lampload.com

Thank you for purchasing Bootstrap Blogifier. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!


Table of Contents

  1. Start
  2. Changelog
  3. Overview
  4. Usage
  5. Customization
  6. CSS Styling
  7. Credits
  8. Licenses

B) Changelog - top

v1.1 December 10 2016

Altered Sidebar code to find and replace hyphens. Altered odd-ends.css to make sidebar heading font size smaller.

v1.0 November 2016

First release of Bootstrap Blogifier


C) Overview - top

Easy to use login and access script. Multiple user and user level access. Comes with templates that can be used right away. Can write html / css / js into templates for those with access and those for public.

Features


D) Usage - top

The simple setup takes only minutes!

  1. Unzip the file.
  2. Move the installation to the desired folder.
  3. Setup a Database. The examples uses the name login_script, but, yours can be any name you want. After that, locate the sql file that is included in the root folder and import it into the database. This can be imported into your database within seconds using phpMyAdmin.
  4. Option A: Easy Installation. Open the installation folder (ie) example.com/installation. Fill in the simple fields and Submit. Delete folder.
  5. Option B: Manual Installation. Open config/_pdo.php and change the user and password for the login_script database. Or, open up the installation folder. Remember to remove the installation folder whether you use it or not. At this point, you can also rename htaccess.txt to .htaccess.

    Note that if you want to use SEF urls, you may need to set custom paths near line 16 in the .htaccess file. As of now, it uses the path phpcart. If you are using a subdirectory, you can just change phpcart to whatever name you are using. If you are using this in the root folder, ie) example.com then you can comment lines 16 and 17 and uncomment lines 18 and 19.
HTML Structure

Congratulations, you now have an up and running installation.


E) Customization - top

The template contains various css files located within the css folder.

The blog component can be fine tuned by changing the css file shown below.

Add Bootstrap Blogifier To Any Website

This tutorial shows how this can be done. The template used in this exercise is Porto, one of the best selling HTML templates of all time. For instructional purposes, the blog is folder is added to the root folder. Thus, a page like example.com is the site and example.com/blog is the blog.

  1. Copy the desired blog file into the blog folder. This file will replace blog/index.php. Make sure to rename or backup the last blog/index.php file because some code needs to be moved to the new file.
  2. <?php
    include("includes/defines.inc.php");
    include("includes/sessions.inc.php");
    include("includes/Classes/AccessLevel.php");
    include("includes/auth_check.inc.php");
    
    //if (isset($status) && !is_array($status) && $status === 1) {
    ?>;
            <?php
    /*} else {*/
    ?>
            <?php
    include("includes/Classes/General.php");
    ?>
  3. Copy CSS links from head of old file to new file
      
    
                
  4. Copy Javascript links from head of old file to new file
     
            
    
            
  5. Change the css and js links so they go to the right directory; which in this case is down one. Thus, '../' is added to the path. But, do not change the path from the previous changes you just made in the previous 2 steps.
  6. Copy and paste the code from the old file to the new file. This code will be the main content on the page and will replace the old code. You may need to adjust the first line with 'class="col-md-9"'. For example, if you move it to a full page blog it could be col-md-12.
    <?php if (!class_exists('General')) { include("includes/Classes/General.php"); } $command_sef = "SELECT sef from blog_sef"; $result_sef = $PDO->prepare($command_sef); $result_sef->execute(); while ($row = $result_sef->fetch(PDO::FETCH_ASSOC)) { if ($row['sef'] == 0) { $sef = false; //header("location: blog-no-sef.php"); } else { $sef = true; } } ?>
    " method="post">
    <?php if (ISSET($_GET['title'])) { $title = htmlspecialchars($_GET['title'], ENT_QUOTES, "utf-8"); } else { $title = "PhpBlogifierNew"; } if (isset($_POST['mysubmit'])) { $cat = $_POST['cat_id']; $post = true; $srch = $_POST['srch']; $srch_title = str_replace(" ", "-", $srch); $catid = $_POST['cat_id']; } else { $cat = false; $post = false; $srch = false; $srch_title = false; $catid = false; } include("includes/functions/myFunctions.php"); $blog_array = fetch_blogs($PDO, $cat, $post, $srch, $srch_title, $catid, $sef); $array_count = count($blog_array); $count = 0; while (list($key, $row) = each($blog_array)) { $count = $count + 1; $entry_title = str_replace("-", " ", $row['title']); $imageUrl = new General($PDO); $url = $imageUrl->getImageUrlAlt($PDO, $row['blog_id']); ?>
    <?php $useImage = $imageUrl->useImage($PDO, $row['blog_id']); if ($useImage == '1'){ ?>
    <?php ?> <?php echo $url['alt']; ?>
    <?php }else{ ?>
    <?php } ?> <?php if ($sef == true) { ?> "<?php echo html_entity_decode( '>' ); ?>

    <?php echo htmlentities( stripslashes($entry_title) ) . html_entity_decode('</a>'); ?>

    <?php } else { ?>

    <?php echo htmlentities( stripslashes($entry_title) ) . html_entity_decode('</a>');?>

    <?php } ?>

    <?php $text = strip_tags($row['notes']); $new = trim($text); echo substr($new, 0, 325); ?> ...

    <?php } if ($array_count <= 0) { echo "No blog entries yet."; } ?>
  7. Add any custom css as required. For example, when this code was transfered to Porto theme, the code below was added to make the margins for each blog post more precise.
     .blog-box{margin-bottom:20px !important}
  8. The next step is to make single.php look like the mother template. So, backup the file and save the desired template file as single.php. For my example, I took the blog-full-width.html file from the Porto theme and moved the entire html code into the single.php file.
  9. Reopen the previous single.php file because code must be moved to the new file.
  10. Copy all code from the top of the old file until you hit the DOCTYPE tag
                    <?php
    include("includes/defines.inc.php");
    include("includes/sessions.inc.php");
    include("includes/Classes/AccessLevel.php");
    include("includes/auth_check.inc.php");
    
    $command_sef = "SELECT sef from blog_sef";
    $result_sef = $PDO->prepare($command_sef);
    $result_sef->execute();
    
    while ($row = $result_sef->fetch(PDO::FETCH_ASSOC)) {
        if ($row['sef'] == 1) {
            $sef = true;
            $blogId = null;
            //header("location: blog.php");
        } else {
            $sef = false;
            $blog_id = htmlspecialchars($_GET['blogid'], ENT_QUOTES, 'utf-8');
            $blogId = (int)$blog_id;
        }
    }
    
    //if (isset($status) && !is_array($status) && $status === 1) {
    ?>
                    <?php
    /*} else {*/
    ?>
                    <?php
    include("includes/Classes/General.php");
    
    if (ISSET($_GET['title'])) {
        $title = htmlspecialchars($_GET['title'], ENT_QUOTES, "utf-8");
    } else {
        if (ISSET($_GET['blogid'])) {
            $getTitle = new General($PDO);
            $title = $getTitle->getBlogTitle($PDO, htmlspecialchars($_GET['blogid'], ENT_QUOTES, "utf-8"));
    
        } else {
            $title = "PhpBlogifierNew";
        }
    }
    
    if (isset($_GET['id'])) {
        $myidfortitle = htmlspecialchars($_GET['id'], ENT_QUOTES, "utf-8");
    }
    
    include("includes/functions/myFunctions.php");
    
    $blog_array = fetch_blog($PDO, $title, $sef, $blogId);
    $array_count = count($blog_array);
    ?>
                
  11. Copy title tag from old file and replace in new file.
    <?php echo str_replace("-", " ", $title); ?>
  12. Change all css and js links to the proper folder. Again, the files are in the root folder so '../' is added to all paths for files and links.
  13. Make sure to copy link for odd-ends.css too.
  14. Copy main code from old file to new file. The block is shown below.
                    
    <?php $count = 0; while (list($key, $row) = each($blog_array)) { $count = $count + 1; $entry_title = str_replace("-", " ", $row['title']); $imageUrl = new General($PDO); $url = $imageUrl->getImageUrlAlt($PDO, $blogId); ?>
    <?php $useImage = $imageUrl->useImage($PDO, $blogId); /*if ($useImage == '1'){ ?>
    <?php ?> <?php echo $url['alt']; ?>
    <?php }else{ */?>
    <?php // } ?>

    <?php echo htmlentities( stripslashes($entry_title) ) . html_entity_decode('</a>'); ?>

    <?php $text = $row['notes']; $new = trim($text); echo $new; ?>
    <?php $command_disqus = "SELECT comments FROM blog_sef"; $result_disqus = $PDO->prepare($command_disqus); $result_disqus->execute(); $row = $result_disqus->fetch(PDO::FETCH_ASSOC); if ($row['comments'] == '1') { include("includes/comments.inc.php"); ?> <?php } ?>
    <?php } if ($array_count <= 0) { echo "No blog entries yet."; } ?>

F) CSS Styling - top

The template contains various css files located within the css folder.

The blog component can be altered by changing the css file shown below.


G) Credits - top

I've used the following images, icons or other files as listed.


Once again, thank you so much for purchasing this PHP script. As I said at the beginning, I'd be glad to help you if you have any questions relating to this theme. No guarantees, but I'll do my best to assist. If you have a more general question relating to the PHP script on Codecanyon, you might consider visiting the forums and asking your question in the "Item Discussion" section.


H) Licenses - top

I've used the following images, icons or other files as listed.


Once again, thank you so much for purchasing this PHP script. As I said at the beginning, I'd be glad to help you if you have any questions relating to this theme. No guarantees, but I'll do my best to assist. If you have a more general question relating to the PHP script on Codecanyon, you might consider visiting the forums and asking your question in the "Item Discussion" section.

Kent Elchuk

Go To Table of Contents