Exemplo n.º 1
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();
 }
Exemplo n.º 2
0
 function __construct()
 {
     global $langmessage;
     parent::__construct();
     $cmd = common::GetCommand();
     switch ($cmd) {
         //regen
         case 'regen':
             SimpleBlogCommon::GenStaticContent();
             message($langmessage['SAVED']);
             break;
             //config
         //config
         case 'save_config':
             if ($this->SaveConfig()) {
                 SimpleBlogCommon::GenStaticContent();
             }
             break;
     }
     $this->Config();
 }
Exemplo n.º 3
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();
 }
Exemplo n.º 4
0
 function __construct()
 {
     global $langmessage, $addonRelativeCode, $addonFolderName, $page;
     parent::__construct();
     $this->categories = SimpleBlogCommon::AStrToArray('categories');
     $cmd = common::GetCommand();
     switch ($cmd) {
         //category commands
         case 'save_categories':
             $this->SaveCategories();
             break;
         case 'new_category':
             $this->NewCategory();
             return;
         case 'save_new_category':
             $this->SaveNewCategory();
             break;
         case 'delete_category':
             $this->DeleteCategory();
             break;
     }
     $this->Heading('Admin_BlogCategories');
     // print all categories and settings
     echo '<form name="categories" action="' . common::GetUrl('Admin_BlogCategories') . '" method="post">';
     echo '<table class="bordered">';
     echo '<tr><th>&nbsp;</th><th>Category</th><th>Number of Posts</th><th>Visible</th><th>Options</th></tr>';
     echo '<tbody class="sortable_table">';
     foreach ($this->categories as $catindex => $catname) {
         echo '<tr><td style="vertical-align:middle">';
         echo '<img src="' . $addonRelativeCode . '/static/grip.png" height="15" width="15" style="padding:2px;cursor:pointer;"/>';
         echo '</td><td>';
         echo '<input type="text" name="cattitle[' . $catindex . ']" value="' . $catname . '" class="gpinput" />';
         echo '</td><td>';
         $astr =& SimpleBlogCommon::$data['category_posts_' . $catindex];
         echo substr_count($astr, '>');
         echo '</td><td>';
         $checked = '';
         if (!SimpleBlogCommon::AStrValue('categories_hidden', $catindex)) {
             $checked = ' checked="checked"';
         }
         echo ' <input type="checkbox" name="catvis[' . $catindex . ']"' . $checked . '/> ';
         echo '</td><td>';
         echo common::Link('Admin_BlogCategories', $langmessage['delete'], 'cmd=delete_category&index=' . $catindex, ' name="postlink" class="gpconfirm" title="Delete this Category?" ');
         echo '</td></tr>';
     }
     echo '</tbody>';
     echo '</table>';
     echo '<p>';
     echo '<input type="hidden" name="cmd" value="save_categories" />';
     echo '<input type="submit" value="' . $langmessage['save_changes'] . '" class="gpsubmit"/>';
     echo ' &nbsp; ';
     echo common::Link('Admin_BlogCategories', 'Add New Category', 'cmd=new_category', ' name="gpabox" ');
     echo '</p>';
     echo '</form>';
     // print all posts
     /*
     if( count($this->itlist) ){
     	echo '<h3 onclick="$(this).next(\'form\').toggle()" style="cursor:pointer">All Blog Posts</h3>';
     	echo '<form name="allposts" action="'.common::GetUrl('Admin_BlogCategories').'" method="post" style="display:none">';
     	echo '<table style="width:100%">';
     	foreach( $this->itlist as $postindex => $postdata ){
     		echo '<tr><td>'.$postdata['title'].' ';
     		echo common::Link('Special_Blog','&#187;','id='.$postindex,'target="_blank"').'</td><td>';
     		echo '<select id="post'.$postindex.'" name="post'.$postindex.'[]" multiple="multiple" class="gpselect">';
     		foreach( $this->categories as $catindex => $catdata){
     			echo '<option value="'.$catindex.'" '.(isset($catdata[$postindex])? 'selected="selected"':'').'>'.$catdata['ct'].'</option>';
     		}
     		echo '</select>';
     		echo '</td></tr>';
     	}
     	echo '</table>';
     	echo '<input name="save_posts" type="submit" value="'.$langmessage['save'].'" class="gpsubmit" />';
     	echo '</form>';
     }
     */
 }