Example #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>';
     }
 }
Example #2
0
 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+
 }
 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();
     }
 }
Example #4
0
 function __construct($args)
 {
     SimpleBlogCommon::Init();
     $search_obj = $args[0];
     $blog_label = common::GetLabelIndex('special_blog');
     $post_ids = SimpleBlogCommon::AStrToArray('str_index');
     foreach ($post_ids as $id) {
         $post = SimpleBlogCommon::GetPostContent($id);
         if (!$post) {
             continue;
         }
         $title = $blog_label . ': ' . str_replace('_', ' ', $post['title']);
         $content = str_replace('_', ' ', $post['title']) . ' ' . $post['content'];
         SimpleBlogCommon::UrlQuery($id, $url, $query);
         $search_obj->FindString($content, $title, $url, $query);
     }
 }