users
[ class tree: users ] [ index: users ] [ all elements ]

Source for file my.php

Documentation is available at my.php

  1. <?php
  2. /**
  3.  * my home page
  4.  *
  5.  * @copyright (c) 2004-15 bitweaver.org
  6.  *
  7.  * @package users
  8.  * @subpackage functions
  9.  */
  10.  
  11. /**
  12.  * required setup
  13.  */
  14. require_once( '../kernel/setup_inc.php' );
  15.  
  16. if( !$gBitUser->isRegistered() ) {
  17.     Header( 'Location: '.USERS_PKG_URL.'login.php' );
  18.     die;
  19. }
  20.  
  21. // custom userfields
  22. if( $gBitSystem->isFeatureActive( 'custom_user_fields' ) ) {
  23.     $customFields= explode( ',', $gBitSystem->getConfig( 'custom_user_fields' )  );
  24.     $gBitSmarty->assign('customFields', $customFields);
  25. }
  26.  
  27. if( $gBitSystem->isFeatureActive( 'display_users_content_list' ) ) {
  28.     // some content specific offsets and pagination settings
  29.     if( !empty( $_REQUEST['sort_mode'] ) ) {
  30.         $content_sort_mode = $_REQUEST['sort_mode'];
  31.         $gBitSmarty->assign( 'sort_mode', $content_sort_mode );
  32.     }
  33.  
  34.     $max_content = $gBitSystem->getConfig( 'max_records' );
  35.     $offset_content = !empty( $_REQUEST['offset'] ) ? $_REQUEST['offset'] : 0;
  36.     $gBitSmarty->assign( 'curPage', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 );
  37.     $offset_content = ( $page - 1 ) * $gBitSystem->getConfig( 'max_records' );
  38.  
  39.     // set the user_id to only display content viewing user
  40.     $_REQUEST['user_id'] = $gBitUser->mUserId;
  41.  
  42.     // now that we have all the offsets, we can get the content list
  43.     include_once( LIBERTY_PKG_PATH.'get_content_list_inc.php' );
  44.  
  45.     // calculate page number
  46.     $numPages = ceil( $contentListHash['cant'] / $gBitSystem->getConfig( 'max_records' ) );
  47.     $gBitSmarty->assign( 'numPages', $numPages );
  48.  
  49.     //$gBitSmarty->assign_by_ref('offset', $offset);
  50.     $gBitSmarty->assign( 'contentSelect', $contentSelect );
  51.     $gBitSmarty->assign( 'contentTypes', $contentTypes );
  52.     $gBitSmarty->assign( 'contentList', $contentList );
  53.     $gBitSmarty->assign( 'contentCount', $contentListHash['cant'] );
  54.     $gBitSmarty->assign( 'listInfo', $contentListHash );
  55.     // end of content listing
  56. }
  57.  
  58. $gBitSystem->display( 'bitpackage:users/my_bitweaver.tpl', 'My '.$gBitSystem->getConfig( 'site_title' ) , array( 'display_mode' => 'display' ));
  59.  
  60. ?>

Documentation generated on Wed, 29 Jul 2015 13:57:13 +0000 by phpDocumentor 1.5.0-lsces