Guest User

Untitled

a guest
Jun 13th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.65 KB | None | 0 0
  1. $view = new view;
  2. $view->name = 'Schedule';
  3. $view->description = 'Schedule';
  4. $view->tag = '';
  5. $view->view_php = '';
  6. $view->base_table = 'node';
  7. $view->is_cacheable = FALSE;
  8. $view->api_version = 2;
  9. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  10. $handler = $view->new_display('default', 'Defaults', 'default');
  11. $handler->override_option('fields', array(
  12. 'cablecast_show_nid' => array(
  13. 'label' => 'Cablecast Show NID ',
  14. 'alter' => array(
  15. 'alter_text' => 0,
  16. 'text' => '',
  17. 'make_link' => 0,
  18. 'path' => '',
  19. 'link_class' => '',
  20. 'alt' => '',
  21. 'prefix' => '',
  22. 'suffix' => '',
  23. 'target' => '',
  24. 'help' => '',
  25. 'trim' => 0,
  26. 'max_length' => '',
  27. 'word_boundary' => 1,
  28. 'ellipsis' => 1,
  29. 'html' => 0,
  30. 'strip_tags' => 0,
  31. ),
  32. 'empty' => '',
  33. 'hide_empty' => 0,
  34. 'empty_zero' => 0,
  35. 'set_precision' => FALSE,
  36. 'precision' => 0,
  37. 'decimal' => '.',
  38. 'separator' => '',
  39. 'prefix' => '',
  40. 'suffix' => '',
  41. 'exclude' => 1,
  42. 'id' => 'cablecast_show_nid',
  43. 'table' => 'cablecast_schedule_event',
  44. 'field' => 'cablecast_show_nid',
  45. 'override' => array(
  46. 'button' => 'Override',
  47. ),
  48. 'relationship' => 'none',
  49. ),
  50. 'start_time' => array(
  51. 'label' => 'Time',
  52. 'alter' => array(
  53. 'alter_text' => 0,
  54. 'text' => '',
  55. 'make_link' => 0,
  56. 'path' => '',
  57. 'link_class' => '',
  58. 'alt' => '',
  59. 'prefix' => '',
  60. 'suffix' => '',
  61. 'target' => '',
  62. 'help' => '',
  63. 'trim' => 0,
  64. 'max_length' => '',
  65. 'word_boundary' => 1,
  66. 'ellipsis' => 1,
  67. 'html' => 0,
  68. 'strip_tags' => 0,
  69. ),
  70. 'empty' => '',
  71. 'hide_empty' => 0,
  72. 'empty_zero' => 0,
  73. 'date_format' => 'custom',
  74. 'custom_date_format' => 'g:i a',
  75. 'exclude' => 0,
  76. 'id' => 'start_time',
  77. 'table' => 'cablecast_schedule_event',
  78. 'field' => 'start_time',
  79. 'relationship' => 'none',
  80. ),
  81. 'showID' => array(
  82. 'label' => '',
  83. 'alter' => array(
  84. 'alter_text' => 0,
  85. 'text' => '',
  86. 'make_link' => 0,
  87. 'path' => 'show\\[showID]',
  88. 'link_class' => '',
  89. 'alt' => '',
  90. 'prefix' => '',
  91. 'suffix' => '',
  92. 'target' => '',
  93. 'help' => '',
  94. 'trim' => 0,
  95. 'max_length' => '',
  96. 'word_boundary' => 1,
  97. 'ellipsis' => 1,
  98. 'html' => 0,
  99. 'strip_tags' => 0,
  100. ),
  101. 'empty' => '',
  102. 'hide_empty' => 0,
  103. 'empty_zero' => 0,
  104. 'set_precision' => FALSE,
  105. 'precision' => 0,
  106. 'decimal' => '.',
  107. 'separator' => '',
  108. 'prefix' => '',
  109. 'suffix' => '',
  110. 'exclude' => 1,
  111. 'id' => 'showID',
  112. 'table' => 'cablecast_schedule_event',
  113. 'field' => 'showID',
  114. 'relationship' => 'none',
  115. ),
  116. 'title' => array(
  117. 'label' => 'Title',
  118. 'alter' => array(
  119. 'alter_text' => 0,
  120. 'text' => '',
  121. 'make_link' => 1,
  122. 'path' => 'node/[cablecast_show_nid]',
  123. 'link_class' => '',
  124. 'alt' => '',
  125. 'prefix' => '',
  126. 'suffix' => '',
  127. 'target' => '',
  128. 'help' => '',
  129. 'trim' => 0,
  130. 'max_length' => '',
  131. 'word_boundary' => 1,
  132. 'ellipsis' => 1,
  133. 'html' => 0,
  134. 'strip_tags' => 0,
  135. ),
  136. 'empty' => '',
  137. 'hide_empty' => 0,
  138. 'empty_zero' => 0,
  139. 'link_to_node' => 0,
  140. 'exclude' => 0,
  141. 'id' => 'title',
  142. 'table' => 'node',
  143. 'field' => 'title',
  144. 'relationship' => 'none',
  145. 'override' => array(
  146. 'button' => 'Override',
  147. ),
  148. ),
  149. ));
  150. $handler->override_option('sorts', array(
  151. 'start_time' => array(
  152. 'order' => 'ASC',
  153. 'id' => 'start_time',
  154. 'table' => 'cablecast_schedule_event',
  155. 'field' => 'start_time',
  156. 'relationship' => 'none',
  157. ),
  158. ));
  159. $handler->override_option('arguments', array(
  160. 'name' => array(
  161. 'default_action' => 'ignore',
  162. 'style_plugin' => 'default_summary',
  163. 'style_options' => array(),
  164. 'wildcard' => 'all',
  165. 'wildcard_substitution' => 'All',
  166. 'title' => '',
  167. 'breadcrumb' => '',
  168. 'default_argument_type' => 'fixed',
  169. 'default_argument' => '',
  170. 'validate_type' => 'none',
  171. 'validate_fail' => 'not found',
  172. 'glossary' => 0,
  173. 'limit' => '0',
  174. 'case' => 'none',
  175. 'path_case' => 'lower',
  176. 'transform_dash' => 1,
  177. 'add_table' => 0,
  178. 'require_value' => 0,
  179. 'id' => 'name',
  180. 'table' => 'term_data',
  181. 'field' => 'name',
  182. 'validate_user_argument_type' => 'uid',
  183. 'validate_user_roles' => array(
  184. '2' => 0,
  185. '4' => 0,
  186. '3' => 0,
  187. '5' => 0,
  188. ),
  189. 'relationship' => 'none',
  190. 'default_options_div_prefix' => '',
  191. 'default_argument_fixed' => '',
  192. 'default_argument_user' => 0,
  193. 'default_argument_php' => '',
  194. 'validate_argument_node_type' => array(
  195. 'webform' => 0,
  196. 'blog' => 0,
  197. 'cablecast_show' => 0,
  198. 'cablecast_schedule_event' => 0,
  199. 'product' => 0,
  200. 'class' => 0,
  201. 'community_calendar_event' => 0,
  202. 'image' => 0,
  203. 'page' => 0,
  204. 'profile' => 0,
  205. 'story' => 0,
  206. ),
  207. 'validate_argument_node_access' => 0,
  208. 'validate_argument_nid_type' => 'nid',
  209. 'validate_argument_vocabulary' => array(
  210. '13' => 0,
  211. '1' => 0,
  212. ),
  213. 'validate_argument_type' => 'tid',
  214. 'validate_argument_transform' => 0,
  215. 'validate_user_restrict_roles' => 0,
  216. 'validate_argument_php' => '',
  217. ),
  218. ));
  219. $handler->override_option('filters', array(
  220. 'status' => array(
  221. 'operator' => '=',
  222. 'value' => '1',
  223. 'group' => '0',
  224. 'exposed' => FALSE,
  225. 'expose' => array(
  226. 'operator' => FALSE,
  227. 'label' => '',
  228. ),
  229. 'id' => 'status',
  230. 'table' => 'node',
  231. 'field' => 'status',
  232. 'relationship' => 'none',
  233. ),
  234. 'type' => array(
  235. 'operator' => 'in',
  236. 'value' => array(
  237. 'cablecast_schedule_event' => 'cablecast_schedule_event',
  238. ),
  239. 'group' => '0',
  240. 'exposed' => FALSE,
  241. 'expose' => array(
  242. 'operator' => FALSE,
  243. 'label' => '',
  244. ),
  245. 'id' => 'type',
  246. 'table' => 'node',
  247. 'field' => 'type',
  248. 'relationship' => 'none',
  249. ),
  250. 'nid_php' => array(
  251. 'operator' => 'OR',
  252. 'value' => '$nids = array();
  253. if($_GET["schedule_date"]) {
  254. $date = strtotime($_GET["schedule_date"]);
  255. }
  256. else {
  257. $date = time();
  258. }
  259. $schedule_start = strtotime(date("Y-m-d\\T00:00:00", $date));
  260. $schedule_end = strtotime(date("Y-m-d\\T23:59:59", $date));
  261. $schedule_result = db_query("SELECT nid FROM cablecast_schedule_event WHERE (start_time >= %d) AND (start_time < %d)", $schedule_start, $schedule_end);
  262. while($schedule_row = db_fetch_array($schedule_result)) {
  263. $nids[] = $schedule_row[\'nid\'];
  264. }
  265. return $nids;',
  266. 'group' => '0',
  267. 'exposed' => FALSE,
  268. 'expose' => array(
  269. 'operator' => FALSE,
  270. 'label' => '',
  271. ),
  272. 'handler' => 'php',
  273. 'id' => 'nid_php',
  274. 'table' => 'node',
  275. 'field' => 'nid_php',
  276. 'relationship' => 'none',
  277. ),
  278. ));
  279. $handler->override_option('access', array(
  280. 'type' => 'none',
  281. ));
  282. $handler->override_option('cache', array(
  283. 'type' => 'none',
  284. ));
  285. $handler->override_option('header', '<?php
  286. $date = $_GET["schedule_date"] ? strtotime($_GET["schedule_date"]) : time();
  287. echo "<h1>".date(\'l jS \\of F Y \', $date)."</h1>";
  288. ?>');
  289. $handler->override_option('header_format', '5');
  290. $handler->override_option('header_empty', 0);
  291. $handler->override_option('items_per_page', 0);
  292. $handler->override_option('style_plugin', 'table');
  293. $handler = $view->new_display('page', 'Page', 'page_1');
  294. $handler->override_option('path', 'schedule/%');
  295. $handler->override_option('menu', array(
  296. 'type' => 'none',
  297. 'title' => '',
  298. 'description' => '',
  299. 'weight' => 0,
  300. 'name' => 'navigation',
  301. ));
  302. $handler->override_option('tab_options', array(
  303. 'type' => 'none',
  304. 'title' => '',
  305. 'description' => '',
  306. 'weight' => 0,
  307. 'name' => 'navigation',
  308. ));
Add Comment
Please, Sign In to add comment