Skip to content

Commit

Permalink
Fixed a few bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
GodMod committed Oct 7, 2017
1 parent 2c7fbb9 commit 5fe1518
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion mediacenter_plugin_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function __shortcuts()
}

//This Version is for EQdkp PLus 2.2.x
public $version = '2.1.7';
public $version = '2.1.8';
public $build = '';
public $copyright = 'GodMod';
public $vstatus = 'Alpha';
Expand Down
2 changes: 1 addition & 1 deletion pageobjects/editmedia_pageobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public function save(){
$arrValues['album_id'] = $this->in->get('album_id');

//Check if Personal Album
if (is_numeric($arrValues['album_id']) && $this->pdh->get('mediacenter_albums', 'personal_album', array())){
if (is_numeric($arrValues['album_id']) && $this->pdh->get('mediacenter_albums', 'personal_album', array((int)$arrValues['album_id']))){
if (!$this->user->check_auth('a_mediacenter_manage', false) && $this->user->id != $this->pdh->get('mediacenter_albums', 'user_id', array((int)$arrValues['album_id']))) {
$this->user->check_auth('u_mediacenter_something');
};
Expand Down
3 changes: 2 additions & 1 deletion pageobjects/views_pageobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public function download(){
$this->pdh->process_hook_queue();

if (file_exists($file)){
ob_clean();
header('Content-Type: application/octet-stream');
header('Content-Length: '.$this->pfh->FileSize($file));
header('Content-Disposition: attachment; filename="'.sanitize($arrMediaData['filename']).'"');
Expand Down Expand Up @@ -230,7 +231,7 @@ public function image(){
}

if (file_exists($strImage)){

ob_clean();
switch(strtolower($strExtension)){
case 'jpg':
case 'jpeg':
Expand Down
17 changes: 9 additions & 8 deletions pdh/write/mediacenter_media/pdh_w_mediacenter_media.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,16 @@ public function update_media($intMediaID, $intAlbumID, $strName, $strDescription
}

//If it's a image, we have a preview image
if ($strFile != "" && $strPreviewimage == ""){
if ($strFile != "" && $strFilename != "" && $strPreviewimage == ""){
$strExtension = strtolower(pathinfo($strFilename, PATHINFO_EXTENSION));
if (!in_array($strExtension, array('jpg', 'jpeg', 'png', 'gif'))) return false;
$filename = md5(rand().unique_id());
$this->pfh->copy($strFileFolder.$strLocalfile, $strThumbfolder.$filename.'.'.$strExtension);
$this->pfh->thumbnail($strThumbfolder.$filename.'.'.$strExtension, $strThumbfolder, $filename.'.64.'.$strExtension, 64);
$this->pfh->thumbnail($strThumbfolder.$filename.'.'.$strExtension, $strThumbfolder, $filename.'.240.'.$strExtension, 240);

$strLocalPreviewImage = $filename.'.'.$strExtension;
if (in_array($strExtension, array('jpg', 'jpeg', 'png', 'gif'))) {
$filename = md5(rand().unique_id());
$this->pfh->copy($strFileFolder.$strLocalfile, $strThumbfolder.$filename.'.'.$strExtension);
$this->pfh->thumbnail($strThumbfolder.$filename.'.'.$strExtension, $strThumbfolder, $filename.'.64.'.$strExtension, 64);
$this->pfh->thumbnail($strThumbfolder.$filename.'.'.$strExtension, $strThumbfolder, $filename.'.240.'.$strExtension, 240);

$strLocalPreviewImage = $filename.'.'.$strExtension;
}
}

}elseif($intType == 1){
Expand Down
1 change: 1 addition & 0 deletions templates/base_template/mediacenter.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

.mcDownloadButton .button {
font-size: 1.3em;
display: inline-block;
}

.mcDownloadButton .button .small {
Expand Down

0 comments on commit 5fe1518

Please sign in to comment.