$schema['cache_block']['description']='Cache table for the Block module to store already built blocks, identified by module, delta, and various contexts which may change the block, such as theme, locale, and caching mode defined for the block.';
$result=db_query("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (".db_placeholders($rids).") OR r.rid IS NULL) ORDER BY b.weight, b.module",$rids);
// Confirm that the block was moved to the proper region.
$this->assertText(t('The block settings have been updated.'),t('Block successfully moved to %region_name region.',array('%region_name'=>$region['name'])));
// Confirm that the block is being displayed.
$this->assertText(t($block['title']),t('Block successfully being displayed on the page.'));
// Confirm that the box was found at the proper region.
@@ -165,25 +165,28 @@ function _blog_post_exists($account) {
}
/**
* Implementation of hook_block().
* Implementation of hook_block_list().
*/
functionblog_block_list(){
$block['recent']['info']=t('Recent blog posts');
return$block;
}
/**
* Implementation of hook_block_view().
*
* Displays the most recent 10 blog titles.
*/
functionblog_block($op='list',$delta=''){
functionblog_block_view($delta=''){
global$user;
if($op=='list'){
$block['recent']['info']=t('Recent blog posts');
return$block;
}
elseif($op=='view'){
if(user_access('access content')){
$result=db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"),0,10);
if($node_title_list=node_title_list($result)){
$block['content']=$node_title_list;
$block['content'].=theme('more_link',url('blog'),t('Read the latest blog entries.'));
$block['subject']=t('Recent blog posts');
return$block;
}
if(user_access('access content')){
$result=db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"),0,10);
if($node_title_list=node_title_list($result)){
$block['content']=$node_title_list;
$block['content'].=theme('more_link',url('blog'),t('Read the latest blog entries.'));