Skip to content

Instantly share code, notes, and snippets.

@PeeHaa
Created July 9, 2012 12:53
Show Gist options
  • Save PeeHaa/3076330 to your computer and use it in GitHub Desktop.
Save PeeHaa/3076330 to your computer and use it in GitHub Desktop.
Blogging software

Blogging system

I hate myself for reinventing the wheel, but I like building stuff myself ;-)

Comments

It should be possible to save and retrieve comments using different storage mechanisms:

  • GitHub repo / gists
  • Database (PDO)
  • XML Files

Functionality of comments:

  • Post comment
  • Edit comment
  • Moderation
  • Replying to comments
  • URL shortener
  • Gravatars

Info of comments:

  • Timestamp
  • Message
  • User / Emailaddress / null
  • Article identifier

Formatting of posts:

  • Markdown
  • Plaintext
  • HTML (check against whitelist of tags)

Storage

  • self hosted
  • disqus
  • login by: name, social media (fb, twitter, g+) or anonymous

Articles

  • Title
  • Timestamp
  • Intro (optional)
  • Message
  • Identifier
  • Tags
  • Article preview

Router

Routes config formats:

  • array
  • yaml
  • xml

ATOM feed

@PeeHaa
Copy link
Author

PeeHaa commented Jul 10, 2012

Paginator interface

<?php
/**
 * Provides a paginator
 *
 * PHP version 5.3
 *
 * @category   Yadeo
 * @package    Paginator
 * @author     Pieter Hordijk <info@pieterhordijk.com>
 * @copyright  Copyright (c) 2012 Pieter Hordijk
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    1.0.0
 */
namespace Yadeo;

/**
 * Provides a paginator
 *
 * @category   Yadeo
 * @package    Paginator
 * @author     Pieter Hordijk <info@pieterhordijk.com>
 */
interface Paginator
{
    /**
     * Gets the current selected page
     *
     * @return int The current selected page
     */
    public function getCurrentPage();

    /**
     * Gets the total number of items
     *
     * @return int The total number of items
     */
    public function getItemCount();

    /**
     * Gets the window size of the paginator. The window size is the number of displayed pages in the paginator
     * E.g. when there are more pages they will be trimmed and displayed as ... or something like that
     *
     * @return int The size of the window
     */
    public function getWindowSize();
}

@PeeHaa
Copy link
Author

PeeHaa commented Jul 10, 2012

Formatable interface

<?php
/**
 * Provides the Formatable interface. Classes which have the option to format text should implement this interface
 *
 * PHP version 5.3
 *
 * @category   Yadeo
 * @package    Format
 * @author     Pieter Hordijk <info@pieterhordijk.com>
 * @copyright  Copyright (c) 2012 Pieter Hordijk
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    1.0.0
 */
namespace Yadeo\Format;

/**
 * Provides the Formatable interface. Classes which have the option to format text should implement this interface
 *
 * @category   Yadeo
 * @package    Format
 * @author     Pieter Hordijk <info@pieterhordijk.com>
 */
interface Formatable
{
    /**
     * Sets the parserengine used to parse data
     */
    public function setParser(\Yadeo\Format\Parser $parser);

    /**
     * Parses text
     *
     * @param string $data The data to be parsed
     *
     * @return string The parsed data
     */
    public function parse($data);
}

@PeeHaa
Copy link
Author

PeeHaa commented Jul 11, 2012

calendar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment