Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class BP_CubePoint_Template {
- var $current_point = -1;
- var $point_count;
- var $points;
- var $point;
- var $in_the_loop;
- var $pag_page;
- var $pag_per_page;
- var $pag_links;
- var $pag_table_links;
- function BP_CubePoint_Template( $args = '' ) {
- $this->__construct( $args);
- }
- function __construct( $args = '' ) {
- global $bp;
- $defaults = bp_cubepoint_default_query_args();
- $r = apply_filters('bp_cubepoint_template_args',wp_parse_args( $args, $defaults ));
- extract( $r , EXTR_SKIP);
- $this->pag_page = $page;
- $this->pag_per_page = $per_page;
- $this->uid = $uid;
- /***
- * You can use the "type" variable to fetch different things to output.
- * For example on the groups template loop, you can fetch groups by "newest", "active", "alphabetical"
- * and more. This would be the "type". You can then call different functions to fetch those
- * different results.
- */
- $total = bp_cubepoint_get_point_count($r);
- $this->points = bp_cubepoint_get_points($r);
- // Item Requests
- if ( !$max || $max >= $total )
- $this->total_point_count = $total;
- else
- $this->total_point_count = $max;
- if ( !$max || $max >= count($this->points))
- $this->point_count = count($this->points);
- else
- $this->point_count = $max;
- $this->pag_links = paginate_links( array(
- 'base' => $bp->displayed_user->domain . $bp->cubepoint->slug .'/'. $bp->cubepoint->points_slug .'/%_%',
- 'format' => '%#%',
- 'total' => ceil( (int) $this->total_point_count / (int) $this->pag_per_page ),
- 'current' => (int) $this->pag_page,
- 'prev_text' => '←',
- 'next_text' => '→',
- 'mid_size' => 1
- ));
- $this->pag_table_links = paginate_links( array(
- 'base' => $bp->displayed_user->domain . $bp->cubepoint->slug .'/'. $bp->cubepoint->table_slug .'/%_%',
- 'format' => '%#%',
- 'total' => ceil( (int) $this->total_point_count / (int) $this->pag_per_page ),
- 'current' => (int) $this->pag_page,
- 'prev_text' => '←',
- 'next_text' => '→',
- 'mid_size' => 1
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement