Exemplo n.º 1
0
 /**
  * Create a bit renderer for the specified item.
  *
  * @access public
  *
  * @param	array							item information
  * @return	vB_Group_Bit
  */
 function create($item, $group)
 {
     $this->group = $group;
     return parent::create_instance($item);
 }
Exemplo n.º 2
0
 $perpage = (!$vbulletin->GPC['perpage'] or $vbulletin->GPC['perpage'] > $vbulletin->options['sg_maxperpage']) ? $vbulletin->options['sg_perpage'] : $vbulletin->GPC['perpage'];
 // Create category collection
 $collection_factory = new vB_Collection_Factory($vbulletin);
 $collection = $collection_factory->create('groupcategory', false, $vbulletin->GPC['pagenumber'], $perpage, $desc);
 $collection->filter_sort_field($sortfield);
 // Set counts for view
 list($start, $end, $shown, $total) = array_values($collection->fetch_counts());
 // Get actual resolved page number in case input was normalised
 $pagenumber = $show['pagenumber'] = $collection->fetch_pagenumber();
 $quantity = $collection->fetch_quantity();
 // Create bit factory
 $bitfactory = new vB_Bit_Factory($vbulletin, 'groupcategory');
 // Build bits for all categories
 $categorybits = '';
 while ($category = $collection->fetch_item()) {
     $bit =& $bitfactory->create_instance($category);
     $categorybits .= $bit->construct();
 }
 unset($bitfactory, $bit, $collection_factory, $collection);
 $sortorder = $desc ? 'desc' : 'asc';
 $oppositesort = $vbulletin->GPC['order'] == 'asc' ? 'desc' : 'asc';
 $sorturl = 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'do=categorylist' . ($perpage != $vbulletin->options['sg_perpage'] ? "&pp={$perpage}" : '');
 $titlesort = $sorturl . '&sort=title&order=' . ('title' == $sortfield ? $oppositesort : 'asc');
 $groupsort = $sorturl . '&sort=groups&order=' . ('groups' == $sortfield ? $oppositesort : 'desc');
 $templater = vB_Template::create('forumdisplay_sortarrow');
 $templater->register('oppositesort', $oppositesort);
 $sortarrow["{$sortfield}"] = $templater->render();
 // Construct page navigation
 $pagenavurl = $sorturl . ($vbulletin->GPC['order'] ? "&order={$sortorder}" : '') . ($vbulletin->GPC['sort'] ? "&sort={$sortfield}" : '');
 $pagenav = construct_page_nav($pagenumber, $perpage, $total, $pagenavurl);
 // Set page template
Exemplo n.º 3
0
 if ((!$userinfo or !$vbulletin->GPC['pagenumber']) and $vbulletin->options['album_recentalbumdays']) {
     // Create collection
     require_once DIR . '/includes/class_groupmessage.php';
     $collection_factory = new vB_Collection_Factory($vbulletin);
     $collection = $collection_factory->create('album', false, $vbulletin->GPC['pagenumber'], $perpage);
     // Set counts for view
     list($pagestart, $pageend, $pageshown, $pagetotal) = array_values($collection->fetch_counts());
     // Get actual resolved page number in case input was normalised
     if ($collection->fetch_count()) {
         $pagenumber = $collection->fetch_pagenumber();
         // Create bit factory
         $bitfactory = new vB_Bit_Factory($vbulletin, 'album');
         // Build message bits for all items
         $latestbits = '';
         while ($item = $collection->fetch_item()) {
             $bit =& $bitfactory->create_instance($item);
             $bit->set_template('album_latestbit');
             $latestbits .= $bit->construct();
         }
         // Construct page navigation
         $latest_pagenav = construct_page_nav($pagenumber, $perpage, $pagetotal, 'album.php?' . $vbulletin->session->vars['sessionurl'] . "do=latest");
         $show['latestalbums'] = true;
     }
     unset($collection_factory, $collection);
     if (!$userinfo) {
         // navbar and final output
         $navbits = construct_navbits(array('album.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['albums'], '' => $vbphrase['recently_updated_albums']));
         $navbar = render_navbar_template($navbits);
         $custompagetitle = $vbphrase['recently_updated_albums'];
     } else {
         // navbar and final output