// 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.':<br />';
- }
- }
- }
- }
- }
- }
$morelink = '<br /> ';
// show personal or general heading block as applicable
// show page next/previous links if applicable
print_paging_bar($blogFilter->get_viewable_entry_count(), $blogpage, $bloglimit, $blogFilter->baseurl, 'blogpage');
print '</div>';
+
+ if (blog_isLoggedIn()) {
+ //the user's blog is enabled and they are viewing their own blog
+ $addlink = '<div align="center">';
+ $addlink .= $blogFilter->get_complete_link($CFG->wwwroot .'/blog/edit.php', get_string('addnewentry', 'blog'));
+ $addlink .='</div>';
+ echo $addlink;
+ }
+
if (isset($blogEntries) ) {
$count = 0;
if (!$count) {
print '<br /><center>'. get_string('noentriesyet', 'blog') .'</center><br />';
- if (blog_isLoggedIn()) {
- $morelink = '<br /> ';
- $morelink .= $blogFilter->get_complete_link('<a href="'. $CFG->wwwroot .'/blog/edit.php', get_string('addnewentry', 'blog'))."\n";
-
- }
- }
-
- //yu: testing code
- if (blog_isLoggedIn()) {
- //the user's blog is enabled and they are viewing their own blog
- $morelink .= $blogFilter->get_complete_link($CFG->wwwroot .'/blog/edit.php', get_string('addnewentry', 'blog'));
}
print $morelink.'<br />'."\n";
}
$output = '<br /><center>'. get_string('noentriesyet', 'blog') .'</center><br />';
-
- 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);
}