PHP Classes

Simple PHP Blog without a Database: Display blog articles on Web pages

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 101 All time: 9,798 This week: 24Up
Version License PHP version Categories
simple_blog 1.0GNU Lesser Genera...5PHP 5, Graphics, Blogs
Description 

Author

This package can display blog articles on Web pages.

It provides an article class that can generate HTML to display a blog article on a Web page.

Blog article pages may also display images using a separate class.

Picture of Guillermina Gonjon
Name: Guillermina Gonjon <contact>
Classes: 4 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 1x

 

Example

<?php
require_once("./images.class.php");
require_once(
"./article.class.php");

class
blog extends article{
   
    public
$article;
    public
$blog;
   
    function
createBlog($titles, $images, $contents, $authors, $dates)
    {
       
$counter = 0; // Start a counter
       
       
foreach($titles as $title)
        {
           
$this->blog[$counter] = parent::buildArticle($title, $images[$counter], $contents[$counter], $authors[$counter], $dates[$counter]);
           
           
$counter++; // Increment
       
}
       
        return
$this->blog;

    }
   
}
$titles = array("first Title","Second Title","Third Title");
$images = array(array("position"=>"center","image"=>"myimage.jpg","location"=>"img","caption"=>"myimage"),
        array(
"position"=>"myimage","image"=>"myimage.jpg","location"=>"img","caption"=>"myimage"),
        array(
"position"=>"myimage","image"=>"myimage.jpg","location"=>"img","caption"=>"myimage"));
$contents = array("Content this is the contentContent this is the contentContent this is the contentContent this is the content",
       
"Second Content this is the contentContent this is the contentContent this is the content",
       
"Third Content this is the contentContent this is the content");
$authors = array("Guillermina Gonjon","Guillermina Manon","Third Author");
$dates = array(date("Y,d,m"),date("Y,d,m"),date("Y,d,m"),date("Y,d,m"));

$newblog = new blog();
$blog = $newblog->createBlog($titles, $images, $contents, $authors, $dates);
echo
'<pre>';print_r($newblog);print_r($blog);echo '</pre>';

?>


Details

simple_blog

Simple article blog

gmanon


  Files folder image Files (13)  
File Role Description
Files folder imageimg (1 file)
Files folder imageincludes (2 files)
Files folder imagelibrary (4 files)
Files folder imagetemplate (1 file, 2 directories)
Accessible without login Plain text file index.php Aux. Auxiliary script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Data Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:101
This week:0
All time:9,798
This week:24Up