/**
  * Constructor
  *
  * @param Blog This may be NULL only when must select comments from all Blog. Use NULL carefully, because it may generate very long queries!
  * @param integer|NULL Limit
  * @param string name of cache to be used
  * @param string prefix to differentiate page/order params when multiple Results appear one same page
  * @param string Name to be used when saving the filterset (leave empty to use default for collection)
  */
 function CommentList2($Blog, $limit = 1000, $cache_name = 'CommentCache', $param_prefix = '', $filterset_name = '')
 {
     global $Settings;
     // Call parent constructor:
     parent::DataObjectList2(get_Cache($cache_name), $limit, $param_prefix, NULL);
     // Set Blog. Note: It can be NULL on ?disp=usercomments
     $this->Blog = $Blog;
     // The SQL Query object:
     $this->CommentQuery = new CommentQuery();
     $this->CommentQuery->Blog = $this->Blog;
     // The Item filter SQL Query object:
     $this->ItemQuery = new ItemQuery('T_items__item', 'post_', 'post_ID');
     // Blog can be NULL on ?disp=usercomments, in this case ItemQuery blog must be set to 0, which means all blog
     $this->ItemQuery->blog = empty($this->Blog) ? 0 : $this->Blog->ID;
     if (!empty($filterset_name)) {
         // Set the filterset_name with the filterset_name param
         $this->filterset_name = 'CommentList_filters_' . $filterset_name;
     } else {
         // Set a generic filterset_name
         $this->filterset_name = 'CommentList_filters_coll' . (!is_null($this->Blog) ? $this->Blog->ID : '0');
     }
     $this->page_param = $param_prefix . 'paged';
     // Initialize the default filter set:
     $this->set_default_filters(array('filter_preset' => NULL, 'author_IDs' => NULL, 'author' => NULL, 'author_email' => NULL, 'author_url' => NULL, 'url_match' => '=', 'include_emptyurl' => NULL, 'author_IP' => NULL, 'post_ID' => NULL, 'comment_ID' => NULL, 'comment_ID_list' => NULL, 'rating_toshow' => NULL, 'rating_turn' => 'above', 'rating_limit' => 1, 'keywords' => NULL, 'phrase' => 'AND', 'exact' => 0, 'statuses' => NULL, 'expiry_statuses' => array('active'), 'types' => array('comment', 'trackback', 'pingback'), 'orderby' => 'date', 'order' => !is_null($this->Blog) ? $this->Blog->get_setting('comments_orderdir') : 'DESC', 'comments' => $this->limit, 'page' => 1, 'featured' => NULL, 'timestamp_min' => NULL, 'timestamp_max' => NULL, 'threaded_comments' => false, 'user_perm' => NULL));
 }
 /**
  * Constructor
  *
  * @param integer|NULL Limit
  * @param string prefix to differentiate page/order params when multiple Results appear one same page
  * @param string Name to be used when saving the filterset (leave empty to use default)
  * @param array Query params:
  *                    'join_group'   => true,
  *                    'join_session' => false,
  *                    'join_country' => true,
  *                    'join_city'    => true,
  *                    'keywords_fields'     - Fields of users table to search by keywords
  *                    'where_status_closed' - FALSE - to don't display closed users
  *                    'where_org_ID' - ID of organization
  */
 function UserList($filterset_name = '', $limit = 20, $param_prefix = 'users_', $query_params = array())
 {
     // Call parent constructor:
     parent::DataObjectList2(get_Cache('UserCache'), $limit, $param_prefix, NULL);
     // Init query params, @see $this->query_init()
     $this->query_params = $query_params;
     if (!empty($filterset_name)) {
         // Set the filterset_name with the filterset_name param
         $this->filterset_name = 'UserList_filters_' . $filterset_name;
     } else {
         // Set a generic filterset_name
         $this->filterset_name = 'UserList_filters';
     }
     $this->order_param = 'results_' . $param_prefix . 'order';
     $this->page_param = $param_prefix . 'paged';
     // Initialize the default filter set:
     $this->set_default_filters(array('filter_preset' => NULL, 'country' => NULL, 'region' => NULL, 'subregion' => NULL, 'city' => NULL, 'membersonly' => false, 'keywords' => NULL, 'gender' => NULL, 'status_activated' => NULL, 'account_status' => NULL, 'reported' => NULL, 'custom_sender_email' => NULL, 'custom_sender_name' => NULL, 'group' => -1, 'age_min' => NULL, 'age_max' => NULL, 'userfields' => array(), 'order' => '-D', 'users' => array(), 'level_min' => NULL, 'level_max' => NULL, 'org' => NULL));
 }
 /**
  * Constructor
  *
  * @todo  add param for saved session filter set
  *
  * @param Blog
  * @param mixed Default filter set: Do not show posts before this timestamp, can be 'now'
  * @param mixed Default filter set: Do not show posts after this timestamp, can be 'now'
  * @param integer|NULL Limit
  * @param string name of cache to be used (for table prefix info)
  * @param string prefix to differentiate page/order params when multiple Results appear one same page
  * @param array restrictions for itemlist (position, contact, firm, ...) key: restriction name, value: ID of the restriction
  */
 function ItemListLight(&$Blog, $timestamp_min = NULL, $timestamp_max = NULL, $limit = 20, $cache_name = 'ItemCacheLight', $param_prefix = '', $filterset_name = '')
 {
     global $Settings, $posttypes_specialtypes;
     // Call parent constructor:
     parent::DataObjectList2(get_Cache($cache_name), $limit, $param_prefix, NULL);
     // asimo> The ItemQuery init was moved into the query_init() method
     // The SQL Query object:
     // $this->ItemQuery = new ItemQuery( $this->Cache->dbtablename, $this->Cache->dbprefix, $this->Cache->dbIDname );
     $this->Blog =& $Blog;
     if (!empty($filterset_name)) {
         // Set the filterset_name with the filterset_name param
         $this->filterset_name = 'ItemList_filters_' . $filterset_name;
     } else {
         // Set a generic filterset_name
         $this->filterset_name = 'ItemList_filters_coll' . (!is_null($this->Blog) ? $this->Blog->ID : '0');
     }
     $this->page_param = $param_prefix . 'paged';
     // Initialize the default filter set:
     $this->set_default_filters(array('filter_preset' => NULL, 'ts_min' => $timestamp_min, 'ts_max' => $timestamp_max, 'ts_created_max' => NULL, 'coll_IDs' => NULL, 'cat_array' => array(), 'cat_modifier' => NULL, 'cat_focus' => 'wide', 'tags' => NULL, 'authors' => NULL, 'authors_login' => NULL, 'assignees' => NULL, 'assignees_login' => NULL, 'author_assignee' => NULL, 'lc' => 'all', 'keywords' => NULL, 'keyword_scope' => 'title,content', 'phrase' => 'AND', 'exact' => 0, 'post_ID' => NULL, 'post_ID_list' => NULL, 'post_title' => NULL, 'ymdhms' => NULL, 'week' => NULL, 'ymdhms_min' => NULL, 'ymdhms_max' => NULL, 'statuses' => NULL, 'types' => '-' . implode(',', $posttypes_specialtypes), 'visibility_array' => get_inskin_statuses(is_null($this->Blog) ? NULL : $this->Blog->ID, 'post'), 'orderby' => !is_null($this->Blog) ? $this->Blog->get_setting('orderby') : 'datestart', 'order' => !is_null($this->Blog) ? $this->Blog->get_setting('orderdir') : 'DESC', 'unit' => !is_null($this->Blog) ? $this->Blog->get_setting('what_to_show') : 'posts', 'posts' => $this->limit, 'page' => 1, 'featured' => NULL));
 }
Beispiel #4
0
 /**
  * Constructor
  *
  * @todo  add param for saved session filter set
  *
  * @param Blog
  * @param mixed Default filter set: Do not show posts before this timestamp, can be 'now'
  * @param mixed Default filter set: Do not show posts after this timestamp, can be 'now'
  * @param integer|NULL Limit
  * @param string name of cache to be used (for table prefix info)
  * @param string prefix to differentiate page/order params when multiple Results appear one same page
  * @param array restrictions for itemlist (position, contact, firm, ...) key: restriction name, value: ID of the restriction
  */
 function ItemListLight(&$Blog, $timestamp_min = NULL, $timestamp_max = NULL, $limit = 20, $cache_name = 'ItemCacheLight', $param_prefix = '', $filterset_name = '', $restrict_to = array())
 {
     global $Settings;
     // Call parent constructor:
     parent::DataObjectList2(get_Cache($cache_name), $limit, $param_prefix, NULL);
     // The SQL Query object:
     $this->ItemQuery =& new ItemQuery($this->Cache->dbtablename, $this->Cache->dbprefix, $this->Cache->dbIDname);
     $this->Blog =& $Blog;
     if (!empty($filterset_name)) {
         // Set the filterset_name with the filterset_name param
         $this->filterset_name = 'ItemList_filters_' . $filterset_name;
     } else {
         // Set a generic filterset_name
         $this->filterset_name = 'ItemList_filters_coll' . $this->Blog->ID;
     }
     $this->page_param = $param_prefix . 'paged';
     $this->restrict_to = $restrict_to;
     // Initialize the default filter set:
     $this->set_default_filters(array('filter_preset' => NULL, 'ts_min' => $timestamp_min, 'ts_max' => $timestamp_max, 'ts_created_max' => NULL, 'cat_array' => array(), 'cat_modifier' => NULL, 'cat_focus' => 'wide', 'tags' => NULL, 'authors' => NULL, 'assignees' => NULL, 'author_assignee' => NULL, 'lc' => 'all', 'keywords' => NULL, 'phrase' => 'AND', 'exact' => 0, 'post_ID' => NULL, 'post_ID_list' => NULL, 'post_title' => NULL, 'ymdhms' => NULL, 'week' => NULL, 'ymdhms_min' => NULL, 'ymdhms_max' => NULL, 'statuses' => NULL, 'types' => '-1000', 'visibility_array' => array('published', 'protected', 'private'), 'orderby' => $this->Blog->get_setting('orderby'), 'order' => $this->Blog->get_setting('orderdir'), 'unit' => $this->Blog->get_setting('what_to_show'), 'posts' => $this->limit, 'page' => 1));
 }