From 4fc479666fcac71b37170dca46d971cda3401dfe Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Thu, 16 Mar 2006 07:47:37 +0000 Subject: [PATCH] rmoved batchpublish in lib, add new entry link on top --- blog/lib.php | 47 ++++++++++------------------------------------- 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/blog/lib.php b/blog/lib.php index cdbbb3a5ed..3aef6a1fc8 100755 --- a/blog/lib.php +++ b/blog/lib.php @@ -150,27 +150,6 @@ function blog_print_html_formatted_entries(&$blogFilter, $filtertype, $filtersel // First let's see if the batchpublish form has submitted data $post = data_submitted(); - if (!empty($post->batchpublish)) { //make sure we're processing the edit form here -// print_object($post); //debug - foreach ($post as $key => $publishto) { - if ($key != 'batchpublish') { - $useridandentryid = explode('-', $key); - $userid = $useridandentryid[0]; - $entryid = $useridandentryid[1]; - $bloginfo = new BlogInfo($userid); - $blogentry = $bloginfo->get_blog_entry_by_id($entryid); - if ($blogentry->entryPublishState != $publishto) { - if (!$blogentry->set_publishstate($publishto)) { - echo 'Entry "'. $blogentry->entryTitle .'" could not be published.'; - } else { - if ($error = $blogentry->save()) { - echo 'New publish setting for entry "'. $blogentry->entryTitle .'" could not be saved. ERROR:'. $error.':
'; - } - } - } - } - } - } $morelink = '
  '; // show personal or general heading block as applicable @@ -188,6 +167,15 @@ function blog_print_html_formatted_entries(&$blogFilter, $filtertype, $filtersel // show page next/previous links if applicable print_paging_bar($blogFilter->get_viewable_entry_count(), $blogpage, $bloglimit, $blogFilter->baseurl, 'blogpage'); print ''; + + if (blog_isLoggedIn()) { + //the user's blog is enabled and they are viewing their own blog + $addlink = '
'; + $addlink .= $blogFilter->get_complete_link($CFG->wwwroot .'/blog/edit.php', get_string('addnewentry', 'blog')); + $addlink .='
'; + echo $addlink; + } + if (isset($blogEntries) ) { $count = 0; @@ -198,17 +186,6 @@ function blog_print_html_formatted_entries(&$blogFilter, $filtertype, $filtersel if (!$count) { print '
'. get_string('noentriesyet', 'blog') .'

'; - if (blog_isLoggedIn()) { - $morelink = '
  '; - $morelink .= $blogFilter->get_complete_link('get_complete_link($CFG->wwwroot .'/blog/edit.php', get_string('addnewentry', 'blog')); } print $morelink.'
'."\n"; @@ -224,11 +201,7 @@ function blog_print_html_formatted_entries(&$blogFilter, $filtertype, $filtersel } $output = '
'. get_string('noentriesyet', 'blog') .'

'; - - if (blog_isLoggedIn()) { - //the user's blog is enabled and they are viewing their own blog - $output .= $blogFilter->get_complete_link($CFG->wwwroot .'/blog/edit.php', get_string('addnewentry', 'blog')); - } + print $output; unset($blogFilter->filtered_entries); } -- 2.39.5