diff options
| author | modela bitweaver <spiderr@bitweaver.org> | 2021-02-13 19:03:53 -0500 |
|---|---|---|
| committer | modela bitweaver <spiderr@bitweaver.org> | 2021-02-13 19:03:53 -0500 |
| commit | 3d3800b82a5590812c3a5fea1d81e8adf4a413c3 (patch) | |
| tree | 418e3b129f86b6c23ce1acfea736402105931ee2 /includes | |
| parent | 8233282a8001567dcfe80446ed8c454a7d6f171e (diff) | |
| download | fisheye-3d3800b82a5590812c3a5fea1d81e8adf4a413c3.tar.gz fisheye-3d3800b82a5590812c3a5fea1d81e8adf4a413c3.tar.bz2 fisheye-3d3800b82a5590812c3a5fea1d81e8adf4a413c3.zip | |
move bit_setup_inc.php to includes/
Diffstat (limited to 'includes')
| -rw-r--r-- | includes/bit_setup_inc.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php new file mode 100644 index 0000000..bf0e69e --- /dev/null +++ b/includes/bit_setup_inc.php @@ -0,0 +1,48 @@ +<?php +global $gBitSystem, $gBitUser, $gBitSmarty, $gBitThemes; + +$registerHash = array( + 'package_name' => 'fisheye', + 'package_path' => dirname( __FILE__ ).'/', + 'homeable' => TRUE, +); +$gBitSystem->registerPackage( $registerHash ); + +if( $gBitSystem->isPackageActive( 'fisheye' ) ) { + + // Default Preferences Defines + define ( 'FISHEYE_DEFAULT_ROWS_PER_PAGE', 5 ); + define ( 'FISHEYE_DEFAULT_COLS_PER_PAGE', 2 ); + define ( 'FISHEYE_DEFAULT_THUMBNAIL_SIZE', 'large' ); + + $menuHash = array( + 'package_name' => FISHEYE_PKG_NAME, + 'index_url' => FISHEYE_PKG_URL.'index.php', + 'menu_template' => 'bitpackage:fisheye/menu_fisheye.tpl', + ); + $gBitSystem->registerAppMenu( $menuHash ); + + define( 'LIBERTY_SERVICE_PHOTOSHARING', 'photosharing'); + + $gLibertySystem->registerService( LIBERTY_SERVICE_PHOTOSHARING, FISHEYE_PKG_NAME, array( + 'users_expunge_function' => 'fisheye_expunge_user', + ) ); + + function fisheye_expunge_user( $pObject ) { + global $gBitDb; + if( !empty( $pObject->mUserId ) ) { + $query = "SELECT fg.`content_id` FROM `".BIT_DB_PREFIX."fisheye_gallery` fg INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON(fg.`content_id`=lc.`content_id`) WHERE lc.`user_id`=?"; + if( $galleries = $gBitDb->getCol( $query, array( $pObject->mUserId ) ) ) { + foreach( $galleries as $contentId ) { + $delGallery = new FisheyeGallery( NULL, $contentId ); + if( $delGallery->load() ) { + $delGallery->expunge( TRUE ); + } + } + } + } + } + + include_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php' ); +} +?> |
