Fix for View of user posts

  1. $view = new view;
  2. $view->name = 'user_tracker';
  3. $view->description = 'Shows posts started by or participated in by a given user';
  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.   'title' => array(
  13.     'id' => 'title',
  14.     'table' => 'node',
  15.     'field' => 'title',
  16.     'label' => 'Title',
  17.     'link_to_node' => TRUE,
  18.   ),
  19.   'created' => array(
  20.     'label' => 'Created',
  21.     'alter' => array(
  22.       'alter_text' => 0,
  23.       'text' => '',
  24.       'make_link' => 0,
  25.       'path' => '',
  26.       'link_class' => '',
  27.       'alt' => '',
  28.       'prefix' => '',
  29.       'suffix' => '',
  30.       'target' => '',
  31.       'help' => '',
  32.       'trim' => 0,
  33.       'max_length' => '',
  34.       'word_boundary' => 1,
  35.       'ellipsis' => 1,
  36.       'html' => 0,
  37.       'strip_tags' => 0,
  38.     ),
  39.     'empty' => '',
  40.     'hide_empty' => 0,
  41.     'empty_zero' => 0,
  42.     'date_format' => 'small',
  43.     'custom_date_format' => '',
  44.     'exclude' => 0,
  45.     'id' => 'created',
  46.     'table' => 'node',
  47.     'field' => 'created',
  48.     'relationship' => 'none',
  49.   ),
  50. ));
  51. $handler->override_option('sorts', array(
  52.   'last_comment_timestamp' => array(
  53.     'id' => 'last_comment_timestamp',
  54.     'table' => 'node_comment_statistics',
  55.     'field' => 'last_comment_timestamp',
  56.     'order' => 'DESC',
  57.   ),
  58. ));
  59. $handler->override_option('arguments', array(
  60.   'uid' => array(
  61.     'default_action' => 'default',
  62.     'style_plugin' => 'default_summary',
  63.     'style_options' => array(),
  64.     'wildcard' => 'all',
  65.     'wildcard_substitution' => 'All',
  66.     'title' => '',
  67.     'breadcrumb' => '',
  68.     'default_argument_type' => 'current_user',
  69.     'default_argument' => '',
  70.     'validate_type' => 'user',
  71.     'validate_fail' => 'empty',
  72.     'break_phrase' => 0,
  73.     'not' => 0,
  74.     'me_alias' => 1,
  75.     'id' => 'uid',
  76.     'table' => 'users',
  77.     'field' => 'uid',
  78.     'validate_user_argument_type' => 'uid',
  79.     'validate_user_roles' => array(
  80.       '2' => 2,
  81.       '5' => 5,
  82.       '16' => 16,
  83.       '15' => 15,
  84.       '7' => 7,
  85.       '10' => 10,
  86.       '14' => 14,
  87.       '9' => 9,
  88.       '3' => 3,
  89.       '4' => 4,
  90.       '6' => 6,
  91.       '17' => 17,
  92.       '18' => 18,
  93.       '22' => 0,
  94.       '21' => 0,
  95.     ),
  96.     'relationship' => 'none',
  97.     'default_options_div_prefix' => '',
  98.     'default_argument_user' => 0,
  99.     'default_argument_fixed' => '',
  100.     'default_argument_php' => '',
  101.     'validate_argument_node_type' => array(
  102.       'webform' => 0,
  103.       'blog' => 0,
  104.       'ad' => 0,
  105.       'audio' => 0,
  106.       'daily_container' => 0,
  107.       'image' => 0,
  108.       'product' => 0,
  109.       'forum' => 0,
  110.       'amazon_book' => 0,
  111.       'bible_verse' => 0,
  112.       'blogs_import' => 0,
  113.       'book' => 0,
  114.       'church' => 0,
  115.       'cityvision' => 0,
  116.       'consultant_listing' => 0,
  117.       'donations_discounts' => 0,
  118.       'event_cck' => 0,
  119.       'grants' => 0,
  120.       'image_import' => 0,
  121.       'internal_page' => 0,
  122.       'job' => 0,
  123.       'job_import' => 0,
  124.       'organization' => 0,
  125.       'page' => 0,
  126.       'podcast' => 0,
  127.       'quote' => 0,
  128.       'resume' => 0,
  129.       'techmission_page' => 0,
  130.       'twitter' => 0,
  131.       'twitter_import' => 0,
  132.       'uprofile' => 0,
  133.       'video_import' => 0,
  134.       'video_import_feed' => 0,
  135.       'volunteer_match' => 0,
  136.       'volunteer_opportunity' => 0,
  137.       'weblink_cck' => 0,
  138.     ),
  139.     'validate_argument_node_access' => 0,
  140.     'validate_argument_nid_type' => 'nid',
  141.     'validate_argument_vocabulary' => array(
  142.       '280' => 0,
  143.       '54' => 0,
  144.       '265' => 0,
  145.       '36' => 0,
  146.       '286' => 0,
  147.       '331' => 0,
  148.       '10' => 0,
  149.       '8' => 0,
  150.       '288' => 0,
  151.       '15' => 0,
  152.       '258' => 0,
  153.       '259' => 0,
  154.       '330' => 0,
  155.       '11' => 0,
  156.       '261' => 0,
  157.       '272' => 0,
  158.       '271' => 0,
  159.       '19' => 0,
  160.       '281' => 0,
  161.       '4' => 0,
  162.       '337' => 0,
  163.       '35' => 0,
  164.       '26' => 0,
  165.       '266' => 0,
  166.       '269' => 0,
  167.       '30' => 0,
  168.       '48' => 0,
  169.       '263' => 0,
  170.       '13' => 0,
  171.       '5' => 0,
  172.       '42' => 0,
  173.       '285' => 0,
  174.       '267' => 0,
  175.       '340' => 0,
  176.       '338' => 0,
  177.       '339' => 0,
  178.       '3' => 0,
  179.       '336' => 0,
  180.       '268' => 0,
  181.       '34' => 0,
  182.       '287' => 0,
  183.       '40' => 0,
  184.       '41' => 0,
  185.       '279' => 0,
  186.       '273' => 0,
  187.       '38' => 0,
  188.       '32' => 0,
  189.       '6' => 0,
  190.       '31' => 0,
  191.       '12' => 0,
  192.       '52' => 0,
  193.       '24' => 0,
  194.       '23' => 0,
  195.       '37' => 0,
  196.       '25' => 0,
  197.       '22' => 0,
  198.       '17' => 0,
  199.       '20' => 0,
  200.       '21' => 0,
  201.       '335' => 0,
  202.       '51' => 0,
  203.       '47' => 0,
  204.       '262' => 0,
  205.       '33' => 0,
  206.       '46' => 0,
  207.       '332' => 0,
  208.       '18' => 0,
  209.       '264' => 0,
  210.       '28' => 0,
  211.       '9' => 0,
  212.       '284' => 0,
  213.       '53' => 0,
  214.       '289' => 0,
  215.       '328' => 0,
  216.       '290' => 0,
  217.       '291' => 0,
  218.       '292' => 0,
  219.       '293' => 0,
  220.       '294' => 0,
  221.       '295' => 0,
  222.       '296' => 0,
  223.       '329' => 0,
  224.       '297' => 0,
  225.       '298' => 0,
  226.       '299' => 0,
  227.       '300' => 0,
  228.       '301' => 0,
  229.       '302' => 0,
  230.       '303' => 0,
  231.       '304' => 0,
  232.       '305' => 0,
  233.       '306' => 0,
  234.       '307' => 0,
  235.       '308' => 0,
  236.       '309' => 0,
  237.       '310' => 0,
  238.       '311' => 0,
  239.       '312' => 0,
  240.       '313' => 0,
  241.       '314' => 0,
  242.       '315' => 0,
  243.       '316' => 0,
  244.       '317' => 0,
  245.       '318' => 0,
  246.       '319' => 0,
  247.       '320' => 0,
  248.       '321' => 0,
  249.       '322' => 0,
  250.       '323' => 0,
  251.       '324' => 0,
  252.       '325' => 0,
  253.       '326' => 0,
  254.       '327' => 0,
  255.     ),
  256.     'validate_argument_type' => 'tid',
  257.     'validate_argument_transform' => 0,
  258.     'validate_user_restrict_roles' => 1,
  259.     'validate_argument_php' => '',
  260.     'me_redirect' => 1,
  261.     'me_validate_user_argument_type' => 'uid',
  262.     'me_validate_user_roles' => array(
  263.       '2' => 0,
  264.       '5' => 0,
  265.       '16' => 0,
  266.       '15' => 0,
  267.       '7' => 0,
  268.       '10' => 0,
  269.       '22' => 0,
  270.       '14' => 0,
  271.       '9' => 0,
  272.       '3' => 0,
  273.       '4' => 0,
  274.       '6' => 0,
  275.       '17' => 0,
  276.       '18' => 0,
  277.       '21' => 0,
  278.     ),
  279.     'validate_argument_node_flag_name' => '*relationship*',
  280.     'validate_argument_node_flag_test' => 'flaggable',
  281.     'validate_argument_node_flag_id_type' => 'id',
  282.     'validate_argument_user_flag_name' => '*relationship*',
  283.     'validate_argument_user_flag_test' => 'flaggable',
  284.     'validate_argument_user_flag_id_type' => 'id',
  285.     'me_validate_user_restrict_roles' => 0,
  286.     'image_size' => array(
  287.       '_original' => '_original',
  288.       'thumbnail' => 'thumbnail',
  289.       'preview' => 'preview',
  290.     ),
  291.     'override' => array(
  292.       'button' => 'Override',
  293.     ),
  294.     'default_argument_image_size' => '_original',
  295.   ),
  296. ));
  297. $handler->override_option('filters', array(
  298.   'type' => array(
  299.     'operator' => 'in',
  300.     'value' => array(
  301.       'blog' => 'blog',
  302.       'audio' => 'audio',
  303.       'image' => 'image',
  304.       'weblink' => 'weblink',
  305.       'product' => 'product',
  306.       'forum' => 'forum',
  307.       'amazon_book' => 'amazon_book',
  308.       'book' => 'book',
  309.       'cityvision' => 'cityvision',
  310.       'consultant_listing' => 'consultant_listing',
  311.       'donations_discounts' => 'donations_discounts',
  312.       'event_cck' => 'event_cck',
  313.       'grants' => 'grants',
  314.       'job' => 'job',
  315.       'organization' => 'organization',
  316.       'page' => 'page',
  317.       'resume' => 'resume',
  318.       'video_import' => 'video_import',
  319.       'volunteer_opportunity' => 'volunteer_opportunity',
  320.     ),
  321.     'group' => '0',
  322.     'exposed' => FALSE,
  323.     'expose' => array(
  324.       'operator' => FALSE,
  325.       'label' => '',
  326.     ),
  327.     'id' => 'type',
  328.     'table' => 'node',
  329.     'field' => 'type',
  330.     'relationship' => 'none',
  331.   ),
  332.   'moderate' => array(
  333.     'operator' => '=',
  334.     'value' => '0',
  335.     'group' => '0',
  336.     'exposed' => FALSE,
  337.     'expose' => array(
  338.       'operator' => FALSE,
  339.       'label' => '',
  340.     ),
  341.     'id' => 'moderate',
  342.     'table' => 'node',
  343.     'field' => 'moderate',
  344.     'relationship' => 'none',
  345.   ),
  346.   'status' => array(
  347.     'operator' => '=',
  348.     'value' => '1',
  349.     'group' => '0',
  350.     'exposed' => FALSE,
  351.     'expose' => array(
  352.       'operator' => FALSE,
  353.       'label' => '',
  354.     ),
  355.     'id' => 'status',
  356.     'table' => 'node',
  357.     'field' => 'status',
  358.     'relationship' => 'none',
  359.   ),
  360. ));
  361. $handler->override_option('access', array(
  362.   'type' => 'role',
  363.   'role' => array(
  364.     '2' => '2',
  365.     '5' => '5',
  366.     '7' => '7',
  367.     '3' => '3',
  368.     '4' => '4',
  369.     '6' => '6',
  370.     '8' => '8',
  371.   ),
  372.   'perm' => '',
  373. ));
  374. $handler->override_option('cache', array(
  375.   'type' => 'time',
  376.   'results_lifespan' => '21600',
  377.   'output_lifespan' => '21600',
  378. ));
  379. $handler->override_option('title', 'User Contributions');
  380. $handler->override_option('header_format', '1');
  381. $handler->override_option('footer_format', '1');
  382. $handler->override_option('empty', 'No posts found.');
  383. $handler->override_option('empty_format', '1');
  384. $handler->override_option('items_per_page', '15');
  385. $handler->override_option('use_pager', '0');
  386. $handler->override_option('use_more', 1);
  387. $handler->override_option('use_more_always', 0);
  388. $handler->override_option('style_plugin', 'table');
  389. $handler->override_option('style_options', array(
  390.   'columns' => array(),
  391.   'default' => '',
  392.   'info' => array(),
  393.   'override' => FALSE,
  394.   'order' => 'asc',
  395. ));
  396. $handler = $view->new_display('page', 'Page', 'page_1');
  397. $handler->override_option('fields', array(
  398.   'title' => array(
  399.     'id' => 'title',
  400.     'table' => 'node',
  401.     'field' => 'title',
  402.     'label' => 'Title',
  403.     'link_to_node' => TRUE,
  404.   ),
  405.   'created' => array(
  406.     'label' => 'Created',
  407.     'alter' => array(
  408.       'alter_text' => 0,
  409.       'text' => '',
  410.       'make_link' => 0,
  411.       'path' => '',
  412.       'link_class' => '',
  413.       'alt' => '',
  414.       'prefix' => '',
  415.       'suffix' => '',
  416.       'target' => '',
  417.       'help' => '',
  418.       'trim' => 0,
  419.       'max_length' => '',
  420.       'word_boundary' => 1,
  421.       'ellipsis' => 1,
  422.       'html' => 0,
  423.       'strip_tags' => 0,
  424.     ),
  425.     'empty' => '',
  426.     'hide_empty' => 0,
  427.     'empty_zero' => 0,
  428.     'date_format' => 'small',
  429.     'custom_date_format' => '',
  430.     'exclude' => 0,
  431.     'id' => 'created',
  432.     'table' => 'node',
  433.     'field' => 'created',
  434.     'override' => array(
  435.       'button' => 'Use default',
  436.     ),
  437.     'relationship' => 'none',
  438.   ),
  439.   'last_updated' => array(
  440.     'label' => 'Updated',
  441.     'alter' => array(
  442.       'alter_text' => 0,
  443.       'text' => '',
  444.       'make_link' => 0,
  445.       'path' => '',
  446.       'link_class' => '',
  447.       'alt' => '',
  448.       'prefix' => '',
  449.       'suffix' => '',
  450.       'target' => '',
  451.       'help' => '',
  452.       'trim' => 0,
  453.       'max_length' => '',
  454.       'word_boundary' => 1,
  455.       'ellipsis' => 1,
  456.       'html' => 0,
  457.       'strip_tags' => 0,
  458.     ),
  459.     'empty' => '',
  460.     'hide_empty' => 0,
  461.     'empty_zero' => 0,
  462.     'date_format' => 'small',
  463.     'custom_date_format' => '',
  464.     'exclude' => 0,
  465.     'id' => 'last_updated',
  466.     'table' => 'node_comment_statistics',
  467.     'field' => 'last_updated',
  468.     'override' => array(
  469.       'button' => 'Use default',
  470.     ),
  471.     'relationship' => 'none',
  472.   ),
  473. ));
  474. $handler->override_option('items_per_page', 50);
  475. $handler->override_option('use_pager', 'mini');
  476. $handler->override_option('path', 'user/%/tracker');
  477. $handler->override_option('menu', array(
  478.   'type' => 'none',
  479.   'title' => '',
  480.   'description' => '',
  481.   'weight' => 0,
  482.   'name' => 'navigation',
  483. ));
  484. $handler->override_option('tab_options', array(
  485.   'type' => 'none',
  486.   'title' => '',
  487.   'description' => '',
  488.   'weight' => 0,
  489.   'name' => 'navigation',
  490. ));

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.