diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2005-09-03 10:20:02 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2005-09-03 10:20:02 +0000 |
| commit | 41b8dd09e250dd3ea483e1fe94faf94be09af99d (patch) | |
| tree | 638233456220909511641cd190090559edc30283 /plugins/storage.bitfile.php | |
| parent | f54d3fa65f9aed33d22ff188b4fc3ec81542566b (diff) | |
| download | liberty-41b8dd09e250dd3ea483e1fe94faf94be09af99d.tar.gz liberty-41b8dd09e250dd3ea483e1fe94faf94be09af99d.tar.bz2 liberty-41b8dd09e250dd3ea483e1fe94faf94be09af99d.zip | |
synch recent changes from R1 to HEAD
Diffstat (limited to 'plugins/storage.bitfile.php')
| -rw-r--r-- | plugins/storage.bitfile.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/storage.bitfile.php b/plugins/storage.bitfile.php index ad9a1cd..be15c1f 100644 --- a/plugins/storage.bitfile.php +++ b/plugins/storage.bitfile.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * @package liberty * @subpackage plugins_storage */ @@ -11,7 +11,7 @@ global $gLibertySystem; */ define( 'PLUGIN_GUID_BIT_FILES', 'bitfile' ); -$pluginParams = array ( +$pluginParams = array ( 'store_function' => 'bit_files_store', 'verify_function' => 'bit_files_verify', 'load_function' => 'bit_files_load', @@ -64,12 +64,12 @@ function bit_files_load( $pRow ) { global $gBitSystem, $gLibertySystem; $ret = NULL; if( !empty( $pRow['foreign_id'] ) && is_numeric( $pRow['foreign_id'] )) { - $query = "SELECT * + $query = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` ta INNER JOIN `".BIT_DB_PREFIX."tiki_files` tf ON (tf.`file_id` = ta.`foreign_id`) WHERE ta.`foreign_id` = ? AND ta.`content_id` = ?"; if( $rs = $gBitSystem->mDb->query($query, array( $pRow['foreign_id'], $pRow['content_id'] )) ) { $ret = $rs->fields; - if (preg_match ( '/image\//', $ret['mime_type'] )) { + if (preg_match ( '/image\//', $ret['mime_type'] )) { $ret['thumbnail_url']['avatar'] = BIT_ROOT_URL.dirname( $ret['storage_path'] ).'/avatar.jpg'; $ret['thumbnail_url']['small'] = BIT_ROOT_URL.dirname( $ret['storage_path'] ).'/small.jpg'; $ret['thumbnail_url']['medium'] = BIT_ROOT_URL.dirname( $ret['storage_path'] ).'/medium.jpg'; @@ -92,7 +92,7 @@ function bit_files_load( $pRow ) { function bit_files_expunge( $pStorageId ) { global $gBitUser, $gBitSystem; $ret = FALSE; - + if (is_numeric($pStorageId)) { $sql = "SELECT * FROM `".BIT_DB_PREFIX."tiki_attachments` WHERE `attachment_id` = ?"; $rs = $gBitSystem->mDb->query($sql, array($pStorageId)); @@ -103,8 +103,8 @@ function bit_files_expunge( $pStorageId ) { $fileRow = &$fileRs->fields; if ($fileRow) { $absolutePath = BIT_ROOT_PATH.'/'.$fileRow['storage_path']; - - if ($gBitUser->isAdmin() || $gBitUser->mUserId == $row['user_id']) { + + if ($gBitUser->isAdmin() || $gBitUser->mUserId == $row['user_id']) { if (file_exists($absolutePath)) { unlink($absolutePath); } |
