/*
They are very simple. Not as tutorials. Just stored here...
*/

== Node (with field for import in bt_torrent.install) ==
<?php
$content[type]  = array (
  'name' => 'Torrent',
  'type' => 'torrent',
  'description' => '',
  'title_label' => '',
  'body_label' => '',
  'min_word_count' => '0',
  'help' => '',
  'node_options' => 
  array (
    'status' => true,
    'promote' => true,
    'sticky' => false,
    'revision' => false,
  ),
  'language_content_type' => '0',
  'old_type' => 'torrent',
  'orig_type' => '',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'comment' => '2',
  'comment_default_mode' => '4',
  'comment_default_order' => '1',
  'comment_default_per_page' => '50',
  'comment_controls' => '3',
  'comment_anonymous' => 0,
  'comment_subject_field' => '1',
  'comment_preview' => '1',
  'comment_form_location' => '0',
);
$content[fields]  = array (
  0 => 
  array (
    'label' => 'TorrentFile',
    'field_name' => 'field_torrent_file',
    'type' => 'torrent',
    'widget_type' => 'torrentfield_widget',
    'change' => 'Change basic information',
    'weight' => '1',
    'file_extensions' => 'torrent',
    'file_path' => '',
    'max_filesize_per_file' => '',
    'max_filesize_per_node' => '',
    'description' => '',
    'required' => 1,
    'multiple' => '0',
    'list_default' => '0',
    'force_list_default' => '1',
    'show_description' => '0',
    'op' => 'Save field settings',
    'module' => 'torrentfield',
    'widget_module' => 'torrentfield',
    'columns' => 
    array (
      'fid' => 
      array (
        'type' => 'int',
        'not null' => false,
      ),
      'list' => 
      array (
        'type' => 'int',
        'size' => 'tiny',
        'not null' => false,
      ),
      'data' => 
      array (
        'type' => 'text',
        'serialize' => true,
      ),
    ),
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
);
$content[extra]  = array (
  'title' => '-5',
  'body_field' => '0',
  'menu' => '-2',
);
?>

== Nodes ==
<?php
$content[type]  = array (
  'name' => 'MyTorrent',
  'type' => 'mytorrent',
  'description' => '',
  'title_label' => '',
  'body_label' => '',
  'min_word_count' => '0',
  'help' => '',
  'node_options' => 
  array (
    'status' => true,
    'promote' => true,
    'sticky' => false,
    'revision' => false,
  ),
  'language_content_type' => '0',
  'upload' => '0',
  'old_type' => 'mytorrent',
  'orig_type' => '',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'comment' => '2',
  'comment_default_mode' => '4',
  'comment_default_order' => '1',
  'comment_default_per_page' => '50',
  'comment_controls' => '3',
  'comment_anonymous' => 0,
  'comment_subject_field' => '1',
  'comment_preview' => '1',
  'comment_form_location' => '0',
);
$content[fields]  = array (
  0 => 
  array (
    'label' => 'Torrent File',
    'field_name' => 'field_torrent_file',
    'type' => 'torrent',
    'widget_type' => 'torrentfield_widget',
    'change' => 'Change basic information',
    'weight' => 0,
    'file_extensions' => 'torrent',
    'file_path' => '',
    'max_filesize_per_file' => '',
    'max_filesize_per_node' => '',
    'description' => '',
    'required' => 1,
    'multiple' => '0',
    'list_default' => '1',
    'force_list_default' => '1',
    'show_description' => '0',
    'op' => '  ',
    'module' => 'torrentfield',
    'widget_module' => 'torrentfield',
    'columns' => 
    array (
      'fid' => 
      array (
        'type' => 'int',
        'not null' => false,
      ),
      'list' => 
      array (
        'type' => 'int',
        'size' => 'tiny',
        'not null' => false,
      ),
      'data' => 
      array (
        'type' => 'text',
        'serialize' => true,
      ),
    ),
    'display_settings' => 
    array (
      'weight' => 0,
      'parent' => '',
      'label' => 
      array (
        'format' => 'above',
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
);
$content[extra]  = array (
  'title' => '-5',
  'menu' => '-2',
);

== Views ==

// Put this in foo.module in your modules/foo directory:
/**
 * Implementation of hook_views_api().
 */
function foo_views_api() {
  return array(
    'api' => 2,
    'path' => drupal_get_path('module', 'foo'),
    //'path' => drupal_get_path('module', 'foo') . '/includes',
  );
}

// Put this in foo.views_default.inc in your modules/foo directory or modules/foo/includes directory:
/**
 * Implementation of hook_views_default_views().
 */
function foo_views_default_views() {
  $view = new view;
  $view->name = 'torrents';
  $view->description = '';
  $view->tag = '';
  $view->view_php = '';
  $view->base_table = 'bt_torrents';
  $view->is_cacheable = FALSE;
  $view->api_version = 2;
  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  $handler = $view->new_display('default', 'Defaults', 'default');
  $handler->override_option('fields', array(
    'fid' => array(
      'label' => 'Fid',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'fid',
      'table' => 'bt_torrents',
      'field' => 'fid',
      'relationship' => 'none',
    ),
    'leechers' => array(
      'label' => 'Leechers',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'leechers',
      'table' => 'bt_torrents',
      'field' => 'leechers',
      'relationship' => 'none',
    ),
    'seeders' => array(
      'label' => 'Seeders',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'seeders',
      'table' => 'bt_torrents',
      'field' => 'seeders',
      'relationship' => 'none',
    ),
    'snatches' => array(
      'label' => 'Snatches',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'snatches',
      'table' => 'bt_torrents',
      'field' => 'snatches',
      'relationship' => 'none',
    ),
    'downloaded' => array(
      'label' => 'Downloaded',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'downloaded',
      'table' => 'bt_torrents',
      'field' => 'downloaded',
      'relationship' => 'none',
    ),
    'info_hash' => array(
      'label' => 'Information Hash',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'info_hash',
      'table' => 'bt_torrents',
      'field' => 'info_hash',
      'relationship' => 'none',
    ),
    'announce_url' => array(
      'label' => 'Announce URL',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'announce_url',
      'table' => 'bt_torrents',
      'field' => 'announce_url',
      'relationship' => 'none',
    ),
  ));
  $handler->override_option('access', array(
    'type' => 'none',
  ));
  $handler->override_option('style_plugin', 'table');
  $handler->override_option('style_options', array(
    'grouping' => '',
    'override' => 1,
    'sticky' => 0,
    'order' => 'asc',
    'columns' => array(
      'fid' => 'fid',
      'leechers' => 'leechers',
      'seeders' => 'seeders',
      'snatches' => 'snatches',
      'downloaded' => 'downloaded',
      'info_hash' => 'info_hash',
      'announce_url' => 'announce_url',
    ),
    'info' => array(
      'fid' => array(
        'sortable' => 0,
        'separator' => '',
      ),
      'leechers' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'seeders' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'snatches' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'downloaded' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'info_hash' => array(
        'separator' => '',
      ),
      'announce_url' => array(
        'separator' => '',
      ),
    ),
    'default' => '-1',
  ));
  $handler = $view->new_display('page', '', 'page_1');
  $handler->override_option('path', 'torrents');
  $handler->override_option('menu', array(
    'type' => 'normal',
    'title' => 'Torrents',
    'description' => '',
    'weight' => '-999',
    'name' => 'navigation',
  ));
  $handler->override_option('tab_options', array(
    'type' => 'none',
    'title' => '',
    'description' => '',
    'weight' => 0,
  ));
  $views[$view->name] = $view;

  $view = new view;
  $view->name = 'files_as_torrents';
  $view->description = 'Files as Torrents';
  $view->tag = '';
  $view->view_php = '';
  $view->base_table = 'files';
  $view->is_cacheable = FALSE;
  $view->api_version = 2;
  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  $handler = $view->new_display('default', 'Defaults', 'default');
  $handler->override_option('fields', array(
    'fid' => array(
      'label' => 'File ID',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'link_to_file' => 0,
      'exclude' => 0,
      'id' => 'fid',
      'table' => 'files',
      'field' => 'fid',
      'relationship' => 'none',
    ),
    'filename' => array(
      'label' => '',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'link_to_file' => 0,
      'exclude' => 0,
      'id' => 'filename',
      'table' => 'files',
      'field' => 'filename',
      'relationship' => 'none',
    ),
    'filepath' => array(
      'label' => '',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'link_to_file' => 0,
      'exclude' => 0,
      'id' => 'filepath',
      'table' => 'files',
      'field' => 'filepath',
      'relationship' => 'none',
    ),
    'filesize' => array(
      'label' => '',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'filesize',
      'table' => 'files',
      'field' => 'filesize',
      'relationship' => 'none',
    ),
    'timestamp' => array(
      'label' => 'Upload date',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'date_format' => 'small',
      'custom_date_format' => '',
      'exclude' => 0,
      'id' => 'timestamp',
      'table' => 'files',
      'field' => 'timestamp',
      'relationship' => 'none',
    ),
    'filemime' => array(
      'label' => 'Mime type',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'link_to_file' => 0,
      'exclude' => 0,
      'id' => 'filemime',
      'table' => 'files',
      'field' => 'filemime',
      'relationship' => 'none',
    ),
    'status' => array(
      'label' => '',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'status',
      'table' => 'files',
      'field' => 'status',
      'relationship' => 'none',
    ),
    'fid_1' => array(
      'label' => 'Fid',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'fid_1',
      'table' => 'bt_torrents',
      'field' => 'fid',
      'relationship' => 'none',
    ),
    'downloaded' => array(
      'label' => 'Downloaded',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'downloaded',
      'table' => 'bt_torrents',
      'field' => 'downloaded',
      'relationship' => 'none',
    ),
    'leechers' => array(
      'label' => 'Leechers',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'leechers',
      'table' => 'bt_torrents',
      'field' => 'leechers',
      'relationship' => 'none',
    ),
    'seeders' => array(
      'label' => 'Seeders',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'seeders',
      'table' => 'bt_torrents',
      'field' => 'seeders',
      'relationship' => 'none',
    ),
    'snatches' => array(
      'label' => 'Snatches',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'snatches',
      'table' => 'bt_torrents',
      'field' => 'snatches',
      'relationship' => 'none',
    ),
    'fid_2' => array(
      'label' => 'Fid',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'fid_2',
      'table' => 'bt_torrents_files',
      'field' => 'fid',
      'relationship' => 'none',
    ),
    'name' => array(
      'label' => 'Filename',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'name',
      'table' => 'bt_torrents_files',
      'field' => 'name',
      'relationship' => 'none',
    ),
    'length' => array(
      'label' => 'Length',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'length',
      'table' => 'bt_torrents_files',
      'field' => 'length',
      'relationship' => 'none',
    ),
    'path' => array(
      'label' => '',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'path',
      'table' => 'bt_torrents_files',
      'field' => 'path',
      'relationship' => 'none',
    ),
  ));
  $handler->override_option('access', array(
    'type' => 'none',
  ));
  $handler->override_option('items_per_page', 100);
  $handler->override_option('use_pager', '1');
  $handler->override_option('style_plugin', 'table');
  $handler->override_option('style_options', array(
    'grouping' => '',
    'override' => 1,
    'sticky' => 0,
    'order' => 'asc',
    'columns' => array(
      'fid' => 'fid',
      'filename' => 'filename',
      'filepath' => 'filepath',
      'filesize' => 'filesize',
      'timestamp' => 'timestamp',
      'filemime' => 'filemime',
      'status' => 'status',
      'fid_1' => 'fid_1',
      'downloaded' => 'downloaded',
      'leechers' => 'leechers',
      'seeders' => 'seeders',
      'snatches' => 'snatches',
      'fid_2' => 'fid_2',
      'name' => 'name',
      'length' => 'length',
      'path' => 'path',
    ),
    'info' => array(
      'fid' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'filename' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'filepath' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'filesize' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'timestamp' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'filemime' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'status' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'fid_1' => array(
        'sortable' => 0,
        'separator' => '',
      ),
      'downloaded' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'leechers' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'seeders' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'snatches' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'fid_2' => array(
        'sortable' => 0,
        'separator' => '',
      ),
      'name' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'length' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'path' => array(
        'sortable' => 1,
        'separator' => '',
      ),
    ),
    'default' => '-1',
  ));
  $handler = $view->new_display('page', '', 'page_1');
  $handler->override_option('path', 'files_as_torrents');
  $handler->override_option('menu', array(
    'type' => 'normal',
    'title' => 'Files as Torrents',
    'description' => '',
    'weight' => '-998',
    'name' => 'navigation',
  ));
  $handler->override_option('tab_options', array(
    'type' => 'none',
    'title' => '',
    'description' => '',
    'weight' => 0,
  ));
  $views[$view->name] = $view;

  $view = new view;
  $view->name = 'torrent_files';
  $view->description = 'Torrent Files';
  $view->tag = '';
  $view->view_php = '';
  $view->base_table = 'bt_torrents_files';
  $view->is_cacheable = FALSE;
  $view->api_version = 2;
  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  $handler = $view->new_display('default', 'Defaults', 'default');
  $handler->override_option('fields', array(
    'fid' => array(
      'label' => 'Fid',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'fid',
      'table' => 'bt_torrents_files',
      'field' => 'fid',
      'relationship' => 'none',
    ),
    'name' => array(
      'label' => 'Filename',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'name',
      'table' => 'bt_torrents_files',
      'field' => 'name',
      'relationship' => 'none',
    ),
    'length' => array(
      'label' => 'Length',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'length',
      'table' => 'bt_torrents_files',
      'field' => 'length',
      'relationship' => 'none',
    ),
    'path' => array(
      'label' => '',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'path',
      'table' => 'bt_torrents_files',
      'field' => 'path',
      'relationship' => 'none',
    ),
  ));
  $handler->override_option('access', array(
    'type' => 'none',
  ));
  $handler->override_option('items_per_page', 100);
  $handler->override_option('style_plugin', 'table');
  $handler->override_option('style_options', array(
    'grouping' => '',
    'override' => 1,
    'sticky' => 0,
    'order' => 'asc',
    'columns' => array(
      'fid' => 'fid',
      'name' => 'name',
      'length' => 'length',
      'path' => 'path',
    ),
    'info' => array(
      'fid' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'name' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'length' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'path' => array(
        'sortable' => 1,
        'separator' => '',
      ),
    ),
    'default' => '-1',
  ));
  $handler = $view->new_display('page', '', 'page_1');
  $handler->override_option('path', 'torrent_files');
  $handler->override_option('menu', array(
    'type' => 'normal',
    'title' => 'Torrent Files',
    'description' => '',
    'weight' => '0',
    'name' => 'navigation',
  ));
  $handler->override_option('tab_options', array(
    'type' => 'none',
    'title' => '',
    'description' => '',
    'weight' => 0,
  ));
  $views[$view->name] = $view;

  $view = new view;
  $view->name = 'tracker_users';
  $view->description = '';
  $view->tag = '';
  $view->view_php = '';
  $view->base_table = 'bt_tracker_users';
  $view->is_cacheable = FALSE;
  $view->api_version = 2;
  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  $handler = $view->new_display('default', 'Defaults', 'default');
  $handler->override_option('fields', array(
    'uid' => array(
      'label' => 'Uid',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'uid',
      'table' => 'bt_tracker_users',
      'field' => 'uid',
      'relationship' => 'none',
    ),
    'bytes_downloaded' => array(
      'label' => 'Downloaded',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'bytes_downloaded',
      'table' => 'bt_tracker_users',
      'field' => 'bytes_downloaded',
      'relationship' => 'none',
    ),
    'bytes_uploaded' => array(
      'label' => 'Uploaded',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'bytes_uploaded',
      'table' => 'bt_tracker_users',
      'field' => 'bytes_uploaded',
      'relationship' => 'none',
    ),
    'passkey' => array(
      'label' => 'Passkey',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'passkey',
      'table' => 'bt_tracker_users',
      'field' => 'passkey',
      'relationship' => 'none',
    ),
    'passkey_status' => array(
      'label' => 'Passkey Status',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'exclude' => 0,
      'id' => 'passkey_status',
      'table' => 'bt_tracker_users',
      'field' => 'passkey_status',
      'relationship' => 'none',
    ),
  ));
  $handler->override_option('access', array(
    'type' => 'none',
  ));
  $handler->override_option('items_per_page', 100);
  $handler->override_option('style_plugin', 'table');
  $handler->override_option('style_options', array(
    'grouping' => '',
    'override' => 1,
    'sticky' => 0,
    'order' => 'asc',
    'columns' => array(
      'bytes_downloaded' => 'bytes_downloaded',
      'passkey' => 'passkey',
      'passkey_status' => 'passkey_status',
      'uid' => 'uid',
      'bytes_uploaded' => 'bytes_uploaded',
    ),
    'info' => array(
      'bytes_downloaded' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'passkey' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'passkey_status' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'uid' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'bytes_uploaded' => array(
        'sortable' => 1,
        'separator' => '',
      ),
    ),
    'default' => '-1',
  ));
  $handler = $view->new_display('page', '', 'page_1');
  $handler->override_option('path', 'tracker_users');
  $handler->override_option('menu', array(
    'type' => 'normal',
    'title' => 'Tracker Users',
    'description' => '',
    'weight' => '0',
    'name' => 'navigation',
  ));
  $handler->override_option('tab_options', array(
    'type' => 'none',
    'title' => '',
    'description' => '',
    'weight' => 0,
  ));
  $views[$view->name] = $view;

  $view = new view;
  $view->name = 'users_as_tracker_users';
  $view->description = 'Users as Tracker Users';
  $view->tag = '';
  $view->view_php = '';
  $view->base_table = 'users';
  $view->is_cacheable = FALSE;
  $view->api_version = 2;
  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  $handler = $view->new_display('default', 'Defaults', 'default');
  $handler->override_option('fields', array(
    'uid' => array(
      'label' => 'Uid',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'link_to_user' => 0,
      'exclude' => 0,
      'id' => 'uid',
      'table' => 'users',
      'field' => 'uid',
      'relationship' => 'none',
    ),
    'name' => array(
      'label' => '',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
      ),
      'link_to_user' => 1,
      'overwrite_anonymous' => 0,
      'anonymous_text' => '',
      'exclude' => 0,
      'id' => 'name',
      'table' => 'users',
      'field' => 'name',
      'relationship' => 'none',
    ),
  ));
  $handler->override_option('access', array(
    'type' => 'none',
  ));
  $views[$view->name] = $view;

  return $views;
}
