Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Admin/StaticGenerator.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -172,6 +172,7 @@ static function GenCategoryGadget(){
global $addonPathData;

$categories = SimpleBlogCommon::AStrToArray( 'categories' );
$post_drafts = SimpleBlogCommon::AStrToArray('drafts');

ob_start();
echo '<ul>';
Expand All@@ -183,7 +184,13 @@ static function GenCategoryGadget(){
}

$posts = SimpleBlogCommon::AStrToArray('category_posts_'.$catindex);
foreach($posts as $key => $post_id){
if( isset($post_drafts[$post_id]) ){
unset($posts[$key]);
}
}
$sum = count($posts);

if( !$sum ){
continue;
}
Expand DownExpand Up@@ -218,13 +225,16 @@ static function GenArchiveGadget(){

//get list of posts and times
$list = SimpleBlogCommon::AStrToArray( 'post_times' );
$post_drafts = SimpleBlogCommon::AStrToArray('drafts');
if( !count($list) ) return;

//get year counts
$archive = array();
foreach($list as $post_id => $time){
if( !isset($post_drafts[$post_id]) ){
$ym = date('Y-m',$time); //year&month
$archive[$ym][] = $post_id;
}
}


Expand Down