"subscribe_node", "join" => array( "left" => array( "table" => "node", "field" => "nid", ), "right" => array( "field" => "nid", ), ), "fields" => array( 'sid' => array( 'name' => t('Subscribe: Channel Id'), 'sortable' => TRUE, 'handler' => 'views_handler_field_int', 'help' => t("Channel id for an imported node"), ), 'remote_nid' => array( 'name' => t('Subcribe: Remote nid'), 'sortable' => TRUE, 'handler' => 'views_handler_field_int', 'help' => t("Remote nid for an imported node"), ), 'remote_uid' => array( 'name' => t('Subcribe: Remote uid'), 'sortable' => TRUE, 'handler' => 'views_handler_field_int', 'help' => t("Remote uid for an imported node"), ), 'remote_author' => array( 'name' => t('Subcribe: Remote author'), 'sortable' => TRUE, 'help' => t("Remote author for an imported node"), ), ), "filters" => array( 'remote_author' => array( 'name' => t('Subscribe: Remote Author'), 'operator' => 'views_handler_operator_or', 'value-type' => 'array', 'value' => array( '#type' => 'select', '#multiple' => 'true', '#size' => '3', '#options' => 'subscribe_views_author_options', ), 'help' => t('Filter imported nodes based on the remote author.'), ), 'remote_uid' => array( 'name' => t('Subscribe: Remote UID'), 'operator' => 'views_handler_operator_gtlt', 'help' => t('Filter imported nodes based on the remote author uid.'), ), 'sid' => array( 'name' => t('Subscribe: Channel id'), 'operator' => 'views_handler_operator_gtlt', 'help' => t('Filter imported nodes based on their channel.'), ), ), "sorts" => array( "sid" => array( 'name' => "Subscribe: remote channel id", 'help' => "Sort by the remote channel id", ) ), ); $tables['subscribe_node'] = $table; $table = array( "name" => "subscribe_subscriptions", "join" => array( "type" => 'left', "left" => array( "table" => "subscribe_node", "field" => "sid", ), "right" => array( "field" => "sid", ), ), "fields" => array( 'name' => array( 'name' => t('Subscribe: Channel name'), 'sortable' => TRUE, 'help' => t("Channel name for an imported node"), ), 'base_url' => array( 'name' => t('Subscribe: Channel base_url'), 'sortable' => TRUE, 'handler' => 'views_handler_field_url', 'help' => t("Base URL for an imported node"), ), 'channel_id' => array( 'name' => t('Subscribe: Remote channel id'), 'sortable' => TRUE, 'handler' => 'views_handler_field_int', 'help' => t("Channel id for an imported node"), ), 'last_update' => array( 'name' => t('Subscribe: Last update'), 'sortable' => TRUE, 'handler' => views_handler_field_dates(), 'help' => t("Last update for imported node's channel"), ), ), "filters" => array( 'name' => array( 'name' => t('Subscribe: Channel name'), 'operator' => 'views_handler_operator_or', 'value-type' => 'array', 'value' => array( '#type' => 'select', '#multiple' => 'true', '#size' => '3', '#options' => 'subscribe_views_channel_name_options', ), 'help' => t('Filter imported nodes based on the channel name.'), ), 'base_url' => array( 'name' => t('Subscribe: Channel base url'), 'operator' => 'views_handler_operator_or', 'value-type' => 'array', 'value' => array( '#type' => 'select', '#multiple' => 'true', '#size' => '3', '#options' => 'subscribe_views_channel_baseurl_options', ), 'help' => t('Filter imported nodes based on the remote system url.'), ), 'channel_id' => array( 'name' => t('Subscribe: Remote channel id'), 'operator' => 'views_handler_operator_gtlt', 'help' => t('Filter imported nodes based on the remote channel id.'), ), 'last_update' => array( 'name' => t('Subscribe: Last updated'), 'operator' => 'views_handler_operator_gtlt', 'value' => views_handler_filter_date_value_form(), 'handler' => 'views_handler_filter_timestamp', 'option' => 'string', 'help' => t('Filter imported nodes based on when the content was last updated.'), ), ), "sorts" => array( 'name' => array( 'name' => t('Subscribe: channel name'), 'help' => t("Sort by channel name"), ), 'base_url' => array( 'name' => t('Subscribe: channel base url'), 'help' => t("Sort by channel base url"), ), 'channel_id' => array( 'name' => t('Subscribe: channel id'), 'help' => t("Sort by channel id"), ), 'last_update' => array( 'name' => t('Subscribe: last update time'), 'help' => t("Sort by channel's last update time"), 'options' => 'views_handler_sort_date_options', 'handler' => 'views_handler_sort_date', ), ), ); $tables['subscribe_subscriptions'] = $table; return $tables; } /** * Implementation of hook_views_arguments * @todo Implement this */ function subscribe_views_arguments() { } /** * Implementation of hook_views_default_views * @todo Implement this */ function subscribe_views_default_views() { } /** * Handler for default views * @todo Implement this */ function subscribe_handler_default_views() { } /* * Format as a field as a email address. */ function views_handler_field_url($fieldinfo, $fielddata, $value, $data) { return l($value, $value); } /** * Provides array of options for channel name filter. */ function subscribe_views_channel_name_options() { $result = db_query('SELECT name from {subscribe_subscriptions}'); $options = array(); while ($row = db_fetch_object($result)) { $name = $row->name; $options[$name] = $name; } return $options; } /** * Provides array of options for remote node author filter. */ function subscribe_views_author_options() { $result = db_query('SELECT remote_author from {subscribe_node}'); $options = array(); while ($row = db_fetch_object($result)) { $author_name = $row->remote_author; $options[$author_name] = $author_name; } return $options; } /** * Provides array of options for channel base_url filter. */ function subscribe_views_channel_baseurl_options() { $result = db_query('SELECT base_url from {subscribe_subscriptions}'); $options = array(); while ($row = db_fetch_object($result)) { $base_url = $row->base_url; $options[$base_url] = $base_url; } return $options; }