Esempio n. 1
0
 public function __construct()
 {
     global $page, $langmessage, $addonFolderName;
     SimpleBlogCommon::Init();
     //get the post id
     if ($page->pagetype == 'special_display') {
         $this->post_id = $this->PostID($page->requested);
     }
     if (common::LoggedIn()) {
         $page->admin_links[] = array('Special_Blog', 'Blog Home');
         $page->admin_links[] = array('Admin_Blog', 'New Blog Post', 'cmd=new_form');
         $page->admin_links[] = array('Admin_Blog', 'Configuration');
         $page->admin_links[] = array('Admin_Theme_Content', $langmessage['editable_text'], 'cmd=addontext&addon=' . urlencode($addonFolderName), ' name="gpabox" ');
         $label = 'Number of Posts: ' . SimpleBlogCommon::$data['post_count'];
         $page->admin_links[$label] = '';
         $cmd = common::GetCommand();
         switch ($cmd) {
             //delete
             case 'deleteentry':
             case 'delete':
                 SimpleBlogCommon::Delete();
                 break;
         }
     }
     if ($this->post_id) {
         $this->ShowPost();
         return;
     }
     $this->ShowPage();
     if (common::LoggedIn() && !file_exists(self::$index_file)) {
         echo '<p>Congratulations on successfully installing Simple Blog for gpEasy.</p> ';
         echo '<p>You\'ll probably want to get started by ' . common::Link('Admin_Blog', 'creating a blog post', 'cmd=new_form') . '.</p>';
     }
 }
Esempio n. 2
0
 public function __construct()
 {
     global $langmessage, $page;
     parent::__construct();
     //post request
     if (strpos($page->requested, '/')) {
         $parts = explode('/', $page->requested);
         if ($this->AdminPost($parts[1])) {
             return;
         }
     }
     //general admin
     $cmd = common::GetCommand();
     switch ($cmd) {
         //creating
         case 'save_new':
             $this->SaveNew();
             //will redirect on success
         //will redirect on success
         case 'new_form':
             $this->NewForm();
             return;
             //close comments
         //close comments
         case 'closecomments':
             $this->ToggleComments(true, $_REQUEST['id']);
             break;
         case 'opencomments':
             $this->ToggleComments(false, $_REQUEST['id']);
             break;
             //delete
         //delete
         case 'deleteentry':
             SimpleBlogCommon::Delete();
             break;
     }
     $this->ShowPosts();
 }