Ejemplo n.º 1
0
 $collection = $collection_factory->create('album', false, $vbulletin->GPC['pagenumber'], $perpage);
 // Set counts for view
 list($pagestart, $pageend, $pageshown, $pagetotal) = array_values($collection->fetch_counts());
 // Nasty kludge
 $album_width = $album_height = $vbulletin->options['album_thumbsize'];
 $album_height += $stylevar['cellpadding'] * 2 + 52;
 $album_width += $stylevar['cellpadding'] * 2 + 16;
 // 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($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']));
     eval('$navbar = "' . fetch_template('navbar') . '";');
     $custompagetitle = $vbphrase['recently_updated_albums'];
 } else {
     // navbar and final output
Ejemplo 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($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');
    eval('$sortarrow["$sortfield"] = "' . fetch_template('forumdisplay_sortarrow') . '";');
    // 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
    $templatename = 'socialgroups_categorylist';
}
 /**
  * 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($item);
 }