Example #1
0
 /**
  * Output the html for a single blog post
  * Handle comment actions
  */
 function ShowPost()
 {
     if (common::LoggedIn()) {
         gpPlugin_incl('Admin/SimpleBlogPage.php');
         $blog_page = new AdminSimpleBlogPage($this->post_id);
     } else {
         gpPlugin_incl('SimpleBlogPage.php');
         $blog_page = new SimpleBlogPage($this->post_id);
     }
     $blog_page->ShowPost();
 }
Example #2
0
function OnTextChange()
{
    gpPlugin_incl('SimpleBlogCommon.php');
    new SimpleBlogCommon();
    //regenerate the gadget and feed
}
Example #3
0
<?php

defined('is_running') or die('Not an entry point...');
gpPlugin_incl('Admin/Admin.php');
class SimpleBlogComments extends SimipleBlogAdmin
{
    var $dir;
    var $cache = array();
    var $cache_mod = 0;
    function __construct()
    {
        global $page, $addonFolderName;
        parent::__construct();
        $this->dir = SimpleBlogCommon::$data_dir . '/comments';
        $this->GetCache();
        $cmd = common::GetCommand();
        switch ($cmd) {
            case 'delete_comment':
                $this->DeleteComment();
                break;
        }
        $this->ShowRecent();
    }
    function ShowRecent()
    {
        global $langmessage;
        $this->Heading('Admin_BlogComments');
        echo '<table style="width:100%" class="bordered">';
        echo '<tr><th>';
        echo 'Comment';
        echo '</th><th>';
Example #4
0
<?php

defined('is_running') or die('Not an entry point...');
gpPlugin_incl('SimpleBlogCommon.php');
gpPlugin_incl('Admin/SimpleBlogPage.php');
class SimipleBlogAdmin extends AdminSimpleBlogPage
{
    function __construct()
    {
        global $addonFolderName, $page;
        SimpleBlogCommon::Init();
        $page->css_admin[] = '/include/css/addons.css';
        //for hmargin css pre gpEasy 3.6
        $page->head_js[] = '/data/_addoncode/' . $addonFolderName . '/static/admin.js';
        $page->css_admin[] = '/data/_addoncode/' . $addonFolderName . '/static/admin.css';
        //gpPlugin::css('admin.css'); //gpeasy 4.0+
    }
    /**
     * @param string $current
     */
    function Heading($current)
    {
        global $langmessage;
        $options = array('Admin_Blog' => 'Posts', 'Admin_BlogConfig' => $langmessage['configuration'], 'Admin_BlogCategories' => 'Categories', 'Admin_BlogComments' => gpOutput::SelectText('Comments'));
        $links = array();
        foreach ($options as $slug => $label) {
            if ($slug == $current) {
                $links[] = $label;
            } else {
                $links[] = common::Link($slug, $label);
            }
Example #5
0
<?php

defined('is_running') or die('Not an entry point...');
gpPlugin_incl('SimpleBlogCommon.php');
class SimpleBlogCategories
{
    function __construct()
    {
        global $addonPathData;
        SimpleBlogCommon::AddCSS();
        $gadget_file = $addonPathData . '/gadget_categories.php';
        $content = '';
        if (file_exists($gadget_file)) {
            $content = file_get_contents($gadget_file);
        }
        //fix edit links
        if (strpos($content, 'simple_blog_gadget_label')) {
            new SimpleBlogCommon();
            $content = file_get_contents($gadget_file);
        }
        if (empty($content)) {
            return;
        }
        echo '<div class="simple_blog_gadget"><div>';
        echo '<span class="simple_blog_gadget_label">';
        echo gpOutput::GetAddonText('Categories');
        echo '</span>';
        echo $content;
        echo '</div></div>';
    }
}
Example #6
0
 static function inc($file)
 {
     return gpPlugin_incl($file);
 }
<?php

defined('is_running') or die('Not an entry point...');
//gpPlugin_incl('SimpleBlogCommon.php');
gpPlugin_incl('SimpleBlog.php');
class BlogCategories extends SimpleBlog
{
    var $categories = array();
    var $catindex = false;
    var $total_posts = 0;
    function __construct()
    {
        global $page;
        SimpleBlogCommon::Init();
        $this->categories = SimpleBlogCommon::AStrToArray('categories');
        $this->catindex = $this->CatIndex($page->requested);
        if ($this->catindex && isset($this->categories[$this->catindex]) && !SimpleBlogCommon::AStrGet('categories_hidden', $this->catindex)) {
            $this->ShowCategory();
        } else {
            $this->ShowCategories();
        }
    }
    /**
     * Get the category index from the request
     *
     */
    function CatIndex($requested)
    {
        if (isset($_REQUEST['cat'])) {
            return $_REQUEST['cat'];
        }
Example #8
0
 /**
  * Regenerate feed and gadgets
  *
  */
 public static function GenStaticContent()
 {
     gpPlugin_incl('Admin/StaticGenerator.php');
     StaticGenerator::Generate();
 }
<?php

defined('is_running') or die('Not an entry point...');
gpPlugin_incl('SimpleBlogPage.php');
class AdminSimpleBlogPage extends SimpleBlogPage
{
    function ShowPost()
    {
        $cmd = common::GetCommand();
        switch ($cmd) {
            // inline editing
            case 'inlineedit':
                $this->InlineEdit();
                die;
            case 'save_inline':
            case 'save':
                $this->SaveInline();
                break;
                //close comments
            //close comments
            case 'closecomments':
                $this->ToggleComments(true, $this->post_id);
                break;
            case 'opencomments':
                $this->ToggleComments(false, $this->post_id);
                break;
                //commments
            //commments
            case 'delete_comment':
                $this->DeleteComment();
                break;