| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
*
|
| 7 |
* Provides default views and RSS feeds for photoblogs.
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Implementation of hook_views_default_views().
|
| 12 |
*/
|
| 13 |
function photoblog_views_views_default_views() {
|
| 14 |
$view = new stdClass();
|
| 15 |
$view->name = 'photoblog_posts';
|
| 16 |
$view->description = 'Photoblog posts by user, category, year, month, with corresponding RSS feeds.';
|
| 17 |
$view->access = array();
|
| 18 |
$view->view_args_php = '';
|
| 19 |
$view->page = TRUE;
|
| 20 |
$view->page_title = 'Photoblog posts';
|
| 21 |
$view->page_header = '';
|
| 22 |
$view->page_header_format = '1';
|
| 23 |
$view->page_footer = '';
|
| 24 |
$view->page_footer_format = '1';
|
| 25 |
$view->page_empty = '';
|
| 26 |
$view->page_empty_format = '1';
|
| 27 |
$view->page_type = 'list';
|
| 28 |
$view->url = 'photoblog/posts';
|
| 29 |
$view->use_pager = FALSE;
|
| 30 |
$view->nodes_per_page = '0';
|
| 31 |
$view->sort = array(
|
| 32 |
array(
|
| 33 |
'tablename' => 'node',
|
| 34 |
'field' => 'created',
|
| 35 |
'sortorder' => 'DESC',
|
| 36 |
'options' => 'normal',
|
| 37 |
),
|
| 38 |
);
|
| 39 |
$view->argument = array(
|
| 40 |
array(
|
| 41 |
'type' => 'uid',
|
| 42 |
'argdefault' => 2,
|
| 43 |
'title' => '%1',
|
| 44 |
'options' => '',
|
| 45 |
'wildcard' => '*',
|
| 46 |
'wildcard_substitution' => 'All authors',
|
| 47 |
),
|
| 48 |
array(
|
| 49 |
'type' => 'taxid',
|
| 50 |
'argdefault' => 2,
|
| 51 |
'title' => '%2',
|
| 52 |
'options' => '',
|
| 53 |
'wildcard' => '*',
|
| 54 |
'wildcard_substitution' => 'All photoblogs',
|
| 55 |
),
|
| 56 |
array(
|
| 57 |
'type' => 'year',
|
| 58 |
'argdefault' => 2,
|
| 59 |
'title' => '%3',
|
| 60 |
'options' => '',
|
| 61 |
'wildcard' => '*',
|
| 62 |
'wildcard_substitution' => 'All years',
|
| 63 |
),
|
| 64 |
array(
|
| 65 |
'type' => 'month',
|
| 66 |
'argdefault' => 2,
|
| 67 |
'title' => '%4',
|
| 68 |
'options' => '',
|
| 69 |
'wildcard' => '*',
|
| 70 |
'wildcard_substitution' => 'All months',
|
| 71 |
),
|
| 72 |
array(
|
| 73 |
'type' => 'node_feed',
|
| 74 |
'argdefault' => 2,
|
| 75 |
'title' => '',
|
| 76 |
'options' => '',
|
| 77 |
'wildcard' => '',
|
| 78 |
'wildcard_substitution' => '',
|
| 79 |
),
|
| 80 |
);
|
| 81 |
$view->field = array(
|
| 82 |
array(
|
| 83 |
'tablename' => 'image',
|
| 84 |
'field' => 'nid',
|
| 85 |
'label' => '',
|
| 86 |
'handler' => 'image_views_handler_image_img_link',
|
| 87 |
'options' => 'thumbnail',
|
| 88 |
),
|
| 89 |
);
|
| 90 |
$view->filter = array(
|
| 91 |
array (
|
| 92 |
'tablename' => 'node',
|
| 93 |
'field' => 'status',
|
| 94 |
'operator' => '=',
|
| 95 |
'options' => '',
|
| 96 |
'value' => 1,
|
| 97 |
),
|
| 98 |
array(
|
| 99 |
'tablename' => 'node',
|
| 100 |
'field' => 'type',
|
| 101 |
'operator' => 'OR',
|
| 102 |
'options' => '',
|
| 103 |
'value' => array(
|
| 104 |
0 => 'image',
|
| 105 |
),
|
| 106 |
),
|
| 107 |
array (
|
| 108 |
'tablename' => 'term_data',
|
| 109 |
'field' => 'vid',
|
| 110 |
'operator' => 'OR',
|
| 111 |
'options' => '',
|
| 112 |
'value' => array(
|
| 113 |
0 => _photoblog_get_vid(),
|
| 114 |
),
|
| 115 |
),
|
| 116 |
);
|
| 117 |
$view->exposed_filter = array();
|
| 118 |
$view->requires = array('node', 'image');
|
| 119 |
$views[$view->name] = $view;
|
| 120 |
return $views;
|
| 121 |
}
|
| 122 |
|