@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | -require_once dirname(dirname(__DIR__)) . '/include/common.php'; |
|
| 23 | +require_once dirname(dirname(__DIR__)).'/include/common.php'; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Class Configurator |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $moduleDirName = basename(dirname(__DIR__)); |
| 46 | 46 | $capsDirName = strtoupper($moduleDirName); |
| 47 | 47 | |
| 48 | - require_once dirname(dirname(__DIR__)) . '/include/config.php'; |
|
| 48 | + require_once dirname(dirname(__DIR__)).'/include/config.php'; |
|
| 49 | 49 | $config = getConfig(); |
| 50 | 50 | |
| 51 | 51 | $this->name = $config->name; |
@@ -35,19 +35,19 @@ discard block |
||
| 35 | 35 | // $query = $GLOBALS['xoopsDB']->query($sql); |
| 36 | 36 | // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
| 37 | 37 | $html .= '<fieldset>'; |
| 38 | - $html .= "<legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . '</legend>'; |
|
| 38 | + $html .= "<legend style='font-weight: bold; color: #900;'>".constant('CO_'.$moduleDirNameUpper.'_IMAGEINFO').'</legend>'; |
|
| 39 | 39 | $html .= "<div style='padding: 8px;'>"; |
| 40 | 40 | // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>"; |
| 41 | 41 | // $html .= "<br>"; |
| 42 | 42 | // $html .= "<br>"; |
| 43 | - $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . '</div>'; |
|
| 43 | + $html .= '<div>'.constant('CO_'.$moduleDirNameUpper.'_SPHPINI').'</div>'; |
|
| 44 | 44 | $html .= '<ul>'; |
| 45 | 45 | |
| 46 | - $gdlib = function_exists('gd_info') ? '<span style="color: #008000;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: #ff0000;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
| 47 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
| 46 | + $gdlib = function_exists('gd_info') ? '<span style="color: #008000;">'.constant('CO_'.$moduleDirNameUpper.'_GDON').'</span>' : '<span style="color: #ff0000;">'.constant('CO_'.$moduleDirNameUpper.'_GDOFF').'</span>'; |
|
| 47 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS').$gdlib; |
|
| 48 | 48 | if (function_exists('gd_info')) { |
| 49 | 49 | if (true === ($gdlib = gd_info())) { |
| 50 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
| 50 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBVERSION').'<b>'.$gdlib['GD Version'].'</b>'; |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -57,18 +57,18 @@ discard block |
||
| 57 | 57 | // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: #008000;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: #ff0000;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
| 58 | 58 | // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
| 59 | 59 | |
| 60 | - $downloads = ini_get('file_uploads') ? '<span style="color: #008000;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: #ff0000;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
| 61 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
| 60 | + $downloads = ini_get('file_uploads') ? '<span style="color: #008000;">'.constant('CO_'.$moduleDirNameUpper.'_ON').'</span>' : '<span style="color: #ff0000;">'.constant('CO_'.$moduleDirNameUpper.'_OFF').'</span>'; |
|
| 61 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS').$downloads; |
|
| 62 | 62 | |
| 63 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: #0000ff;">' . ini_get('upload_max_filesize') . '</span></b>'; |
|
| 64 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: #0000ff;">' . ini_get('post_max_size') . '</span></b>'; |
|
| 65 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: #0000ff;">' . ini_get('memory_limit') . '</span></b>'; |
|
| 63 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE').' <b><span style="color: #0000ff;">'.ini_get('upload_max_filesize').'</span></b>'; |
|
| 64 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE').' <b><span style="color: #0000ff;">'.ini_get('post_max_size').'</span></b>'; |
|
| 65 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT').' <b><span style="color: #0000ff;">'.ini_get('memory_limit').'</span></b>'; |
|
| 66 | 66 | $html .= '</ul>'; |
| 67 | 67 | $html .= '<ul>'; |
| 68 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . '</b>'; |
|
| 68 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERPATH').' <b>'.XOOPS_ROOT_PATH.'</b>'; |
|
| 69 | 69 | $html .= '</ul>'; |
| 70 | 70 | $html .= '<br>'; |
| 71 | - $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . ''; |
|
| 71 | + $html .= constant('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC').''; |
|
| 72 | 72 | $html .= '</div>'; |
| 73 | 73 | $html .= '</fieldset><br>'; |
| 74 | 74 | |
@@ -38,13 +38,13 @@ discard block |
||
| 38 | 38 | //check for minimum XOOPS version |
| 39 | 39 | $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string |
| 40 | 40 | if (null === $requiredVer) { |
| 41 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
| 41 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
| 42 | 42 | } |
| 43 | 43 | $success = true; |
| 44 | 44 | |
| 45 | 45 | if (version_compare($currentVer, $requiredVer, '<')) { |
| 46 | 46 | $success = false; |
| 47 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 47 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return $success; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $reqVer = $module->getInfo('min_php'); |
| 70 | 70 | if (false !== $reqVer && '' !== $reqVer) { |
| 71 | 71 | if (version_compare($verNum, $reqVer, '<')) { |
| 72 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 72 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 73 | 73 | $success = false; |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function __construct(\XoopsDatabase $db, $type) |
| 38 | 38 | { |
| 39 | - parent::__construct($db, 'extgallery_' . $type . 'photo', ucfirst($type) . 'Photo', 'photo_id'); |
|
| 39 | + parent::__construct($db, 'extgallery_'.$type.'photo', ucfirst($type).'Photo', 'photo_id'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $criteria->add(new \Criteria('cat_id', $catId)); |
| 195 | 195 | $criteria->add(new \Criteria('photo_approved', 1)); |
| 196 | 196 | |
| 197 | - $sql = 'SELECT photo_id FROM ' . $this->db->prefix('extgallery_publicphoto') . ' ' . $criteria->renderWhere() . ' ORDER BY photo_weight, photo_id ASC;'; |
|
| 197 | + $sql = 'SELECT photo_id FROM '.$this->db->prefix('extgallery_publicphoto').' '.$criteria->renderWhere().' ORDER BY photo_weight, photo_id ASC;'; |
|
| 198 | 198 | |
| 199 | 199 | $result = $this->db->query($sql); |
| 200 | 200 | $ret = []; |
@@ -301,13 +301,13 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $count = count($cats); |
| 303 | 303 | if ($count > 0) { |
| 304 | - $in = '(' . $cats[0]->getVar('cat_id'); |
|
| 304 | + $in = '('.$cats[0]->getVar('cat_id'); |
|
| 305 | 305 | array_shift($cats); |
| 306 | 306 | /** @var Extgallery\Category $cat */ |
| 307 | 307 | foreach ($cats as $cat) { |
| 308 | - $in .= ',' . $cat->getVar('cat_id'); |
|
| 308 | + $in .= ','.$cat->getVar('cat_id'); |
|
| 309 | 309 | } |
| 310 | - $in .= ')'; |
|
| 310 | + $in .= ')'; |
|
| 311 | 311 | $criteria = new \Criteria('cat_id', $in, 'IN'); |
| 312 | 312 | } else { |
| 313 | 313 | $criteria = new \Criteria('cat_id', '(0)', 'IN'); |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | 'x' => $x, |
| 436 | 436 | 'y' => $y, |
| 437 | 437 | 'color' => $helper->getConfig('watermark_color'), |
| 438 | - 'font' => XOOPS_ROOT_PATH . '/modules/extgallery/fonts/' . $helper->getConfig('watermark_font'), |
|
| 438 | + 'font' => XOOPS_ROOT_PATH.'/modules/extgallery/fonts/'.$helper->getConfig('watermark_font'), |
|
| 439 | 439 | 'size' => $helper->getConfig('watermark_fontsize'), |
| 440 | 440 | 'resize_first' => false, |
| 441 | 441 | 'padding' => $helper->getConfig('watermark_padding') |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | $imageTransform = $imageFactory->factory($helper->getConfig('graphic_lib')); |
| 489 | 489 | |
| 490 | 490 | $filePath = $this->getUploadPhotoPath(); |
| 491 | - $imageTransform->load($filePath . $photoName); |
|
| 491 | + $imageTransform->load($filePath.$photoName); |
|
| 492 | 492 | |
| 493 | 493 | // Save large photo only if it's bigger than medium size |
| 494 | 494 | if ($imageTransform->getImageWidth() > $helper->getConfig('medium_width') |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | $this->_makeBorder($imageTransform); |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | - $largeFilePath = $filePath . 'large/large_' . $photoName; |
|
| 507 | + $largeFilePath = $filePath.'large/large_'.$photoName; |
|
| 508 | 508 | $imageTransform->save($largeFilePath, '', 100); |
| 509 | 509 | $imageTransform->free(); |
| 510 | 510 | } |
@@ -531,9 +531,9 @@ discard block |
||
| 531 | 531 | $filePath = $this->getUploadPhotoPath(); |
| 532 | 532 | } |
| 533 | 533 | if (null === $mediumFilePath) { |
| 534 | - $mediumFilePath = $filePath . 'medium/' . $photoName; |
|
| 534 | + $mediumFilePath = $filePath.'medium/'.$photoName; |
|
| 535 | 535 | } |
| 536 | - $imageTransform->load($filePath . $photoName); |
|
| 536 | + $imageTransform->load($filePath.$photoName); |
|
| 537 | 537 | |
| 538 | 538 | // Fitting image to desired size |
| 539 | 539 | if ($helper->getConfig('enable_medium_border')) { |
@@ -577,8 +577,8 @@ discard block |
||
| 577 | 577 | $imageFactory = new \Image_Transform; |
| 578 | 578 | $imageTransform = $imageFactory->factory($helper->getConfig('graphic_lib')); |
| 579 | 579 | |
| 580 | - $filePath = $this->getUploadPhotoPath() . 'medium/' . $photoName; |
|
| 581 | - $thumbPath = $this->getUploadPhotoPath() . 'thumb/thumb_' . $photoName; |
|
| 580 | + $filePath = $this->getUploadPhotoPath().'medium/'.$photoName; |
|
| 581 | + $thumbPath = $this->getUploadPhotoPath().'thumb/thumb_'.$photoName; |
|
| 582 | 582 | |
| 583 | 583 | $imageTransform->load($filePath); |
| 584 | 584 | $imageTransform->fit($helper->getConfig('thumb_width'), $helper->getConfig('thumb_heigth')); |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | */ |
| 594 | 594 | public function _haveLargePhoto($photoName) |
| 595 | 595 | { |
| 596 | - return file_exists($this->getUploadPhotoPath() . 'large/large_' . $photoName); |
|
| 596 | + return file_exists($this->getUploadPhotoPath().'large/large_'.$photoName); |
|
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | /** |
@@ -614,11 +614,11 @@ discard block |
||
| 614 | 614 | |
| 615 | 615 | $ret = []; |
| 616 | 616 | if ($this->_haveLargePhoto($photoName)) { |
| 617 | - $imageTransform->load($this->getUploadPhotoPath() . 'large/large_' . $photoName); |
|
| 617 | + $imageTransform->load($this->getUploadPhotoPath().'large/large_'.$photoName); |
|
| 618 | 618 | $ret['width'] = $imageTransform->getImageWidth(); |
| 619 | 619 | $ret['height'] = $imageTransform->getImageHeight(); |
| 620 | 620 | } else { |
| 621 | - $imageTransform->load($this->getUploadPhotoPath() . 'medium/' . $photoName); |
|
| 621 | + $imageTransform->load($this->getUploadPhotoPath().'medium/'.$photoName); |
|
| 622 | 622 | $ret['width'] = $imageTransform->getImageWidth(); |
| 623 | 623 | $ret['height'] = $imageTransform->getImageHeight(); |
| 624 | 624 | } |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | $fileName = explode('.', $fileName); |
| 674 | 674 | $userId = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
| 675 | 675 | |
| 676 | - return $fileName[0] . '_' . $userId . '_' . substr(md5(uniqid(mt_rand(), true)), 27) . '.' . $fileName[1]; |
|
| 676 | + return $fileName[0].'_'.$userId.'_'.substr(md5(uniqid(mt_rand(), true)), 27).'.'.$fileName[1]; |
|
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | /** |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | public function getPhotoSize($photoName) |
| 685 | 685 | { |
| 686 | 686 | if ($this->_haveLargePhoto($photoName)) { |
| 687 | - return $this->getFileSize('large/large_' . $photoName); |
|
| 687 | + return $this->getFileSize('large/large_'.$photoName); |
|
| 688 | 688 | } else { |
| 689 | 689 | return $this->getFileSize($photoName); |
| 690 | 690 | } |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | */ |
| 698 | 698 | public function getFileSize($fileName) |
| 699 | 699 | { |
| 700 | - return round(filesize($this->getUploadPhotoPath() . $fileName) / 1024, 2); |
|
| 700 | + return round(filesize($this->getUploadPhotoPath().$fileName) / 1024, 2); |
|
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | /** |
@@ -742,14 +742,14 @@ discard block |
||
| 742 | 742 | $allowedMimeTypes = ['image/jpeg', 'image/jpg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png']; |
| 743 | 743 | // $allowedMimeTypes = array('jpg/jpeg', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/x-png', 'image/png'); |
| 744 | 744 | |
| 745 | - $uploadDir = XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/'; |
|
| 745 | + $uploadDir = XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/'; |
|
| 746 | 746 | |
| 747 | 747 | // $this->photoUploader = new Extgallery\PhotoUploader($uploadDir, 50000000, 5000, 5000); |
| 748 | 748 | // $this->photoUploader->checkMd5 = $checkMd5; |
| 749 | 749 | // $this->photoUploader->fetchPhoto($_FILES[$file]); |
| 750 | 750 | |
| 751 | 751 | //------------------------ |
| 752 | - require_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
| 752 | + require_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
| 753 | 753 | $this->photoUploader = new \XoopsMediaUploader($uploadDir, $allowedMimeTypes, 50000000, 5000, 5000); |
| 754 | 754 | |
| 755 | 755 | $jupart = \Xmf\Request::getInt('jupart', 0, 'POST'); |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | ]; |
| 814 | 814 | |
| 815 | 815 | if (1 == $photoStatus) { |
| 816 | - $extraTags['X_ITEM_URL'] = XOOPS_URL . '/modules/extgallery/public-album.php?id=' . $cat->getVar('cat_id'); |
|
| 816 | + $extraTags['X_ITEM_URL'] = XOOPS_URL.'/modules/extgallery/public-album.php?id='.$cat->getVar('cat_id'); |
|
| 817 | 817 | $notificationHandler->triggerEvent('global', 0, 'new_photo', $extraTags); |
| 818 | 818 | $notificationHandler->triggerEvent('album', $cat->getVar('cat_id'), 'new_photo_album', $extraTags); |
| 819 | 819 | |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | |
| 834 | 834 | return 0; |
| 835 | 835 | } else { |
| 836 | - $extraTags['X_ITEM_URL'] = XOOPS_URL . '/modules/extgallery/admin/photo.php'; |
|
| 836 | + $extraTags['X_ITEM_URL'] = XOOPS_URL.'/modules/extgallery/admin/photo.php'; |
|
| 837 | 837 | $notificationHandler->triggerEvent('global', 0, 'new_photo_pending', $extraTags); |
| 838 | 838 | |
| 839 | 839 | return 1; |
@@ -858,14 +858,14 @@ discard block |
||
| 858 | 858 | $photoExtra = '', |
| 859 | 859 | $photoTag = '' |
| 860 | 860 | ) { |
| 861 | - require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/Image/Transform.php'; |
|
| 861 | + require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/Image/Transform.php'; |
|
| 862 | 862 | |
| 863 | 863 | $permHandler = Extgallery\PublicPermHandler::getInstance(); |
| 864 | 864 | $helper = Extgallery\Helper::getInstance(); |
| 865 | 865 | |
| 866 | 866 | // Replace all bad file name character |
| 867 | 867 | $photoName = $this->makeFileName($dirtyPhotoName); |
| 868 | - rename($this->getUploadPhotoPath() . $dirtyPhotoName, $this->getUploadPhotoPath() . $photoName); |
|
| 868 | + rename($this->getUploadPhotoPath().$dirtyPhotoName, $this->getUploadPhotoPath().$photoName); |
|
| 869 | 869 | |
| 870 | 870 | //DNPROSSI - changed photo_desc to photo_title |
| 871 | 871 | // Making auto description |
@@ -878,8 +878,8 @@ discard block |
||
| 878 | 878 | if ($helper->getConfig('save_large') && $helper->getConfig('save_original')) { |
| 879 | 879 | |
| 880 | 880 | $fileName = explode('.', $photoName); |
| 881 | - $originalName = md5(uniqid(mt_rand(), true)) . '.' . $fileName[1]; |
|
| 882 | - copy($this->getUploadPhotoPath() . $photoName, $this->getUploadPhotoPath() . 'original/' . $originalName); |
|
| 881 | + $originalName = md5(uniqid(mt_rand(), true)).'.'.$fileName[1]; |
|
| 882 | + copy($this->getUploadPhotoPath().$photoName, $this->getUploadPhotoPath().'original/'.$originalName); |
|
| 883 | 883 | } |
| 884 | 884 | |
| 885 | 885 | $this->_largePhotoTreatment($photoName); |
@@ -909,7 +909,7 @@ discard block |
||
| 909 | 909 | ]; |
| 910 | 910 | |
| 911 | 911 | // Deleting working photo |
| 912 | - unlink($this->getUploadPhotoPath() . $photoName); |
|
| 912 | + unlink($this->getUploadPhotoPath().$photoName); |
|
| 913 | 913 | |
| 914 | 914 | $this->createPhoto($data); |
| 915 | 915 | |
@@ -943,9 +943,9 @@ discard block |
||
| 943 | 943 | $subCriteria = new \CriteriaCompo(); |
| 944 | 944 | foreach ($queryArray as $keyWord) { |
| 945 | 945 | $keyWordCriteria = new \CriteriaCompo(); |
| 946 | - $keyWordCriteria->add(new \Criteria('photo_title', '%' . $keyWord . '%', 'LIKE')); |
|
| 947 | - $keyWordCriteria->add(new \Criteria('photo_desc', '%' . $keyWord . '%', 'LIKE'), 'OR'); |
|
| 948 | - $keyWordCriteria->add(new \Criteria('photo_name', '%' . $keyWord . '%', 'LIKE'), 'OR'); |
|
| 946 | + $keyWordCriteria->add(new \Criteria('photo_title', '%'.$keyWord.'%', 'LIKE')); |
|
| 947 | + $keyWordCriteria->add(new \Criteria('photo_desc', '%'.$keyWord.'%', 'LIKE'), 'OR'); |
|
| 948 | + $keyWordCriteria->add(new \Criteria('photo_name', '%'.$keyWord.'%', 'LIKE'), 'OR'); |
|
| 949 | 949 | $subCriteria->add($keyWordCriteria, $condition); |
| 950 | 950 | unset($keyWordCriteria); |
| 951 | 951 | } |
@@ -964,9 +964,9 @@ discard block |
||
| 964 | 964 | } else { |
| 965 | 965 | $title = $photo->getVar('photo_desc'); |
| 966 | 966 | } |
| 967 | - $data = [ |
|
| 967 | + $data = [ |
|
| 968 | 968 | 'image' => 'assets/images/extgallery-posticon.gif', |
| 969 | - 'link' => 'public-photo.php?photoId=' . $photo->getVar('photo_id'), |
|
| 969 | + 'link' => 'public-photo.php?photoId='.$photo->getVar('photo_id'), |
|
| 970 | 970 | 'title' => $title, |
| 971 | 971 | 'time' => $photo->getVar('photo_date'), |
| 972 | 972 | 'uid' => $photo->getVar('uid') |
@@ -995,10 +995,10 @@ discard block |
||
| 995 | 995 | { |
| 996 | 996 | $count = count($data); |
| 997 | 997 | if ($count > 0) { |
| 998 | - $in = '(' . $data[0]; |
|
| 998 | + $in = '('.$data[0]; |
|
| 999 | 999 | array_shift($data); |
| 1000 | 1000 | foreach ($data as $elmt) { |
| 1001 | - $in .= ',' . $elmt; |
|
| 1001 | + $in .= ','.$elmt; |
|
| 1002 | 1002 | } |
| 1003 | 1003 | $in .= ')'; |
| 1004 | 1004 | $criteria->add(new \Criteria('cat_id', $in, 'IN')); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | 'keyName' => 'photo', |
| 46 | 46 | 'core' => false |
| 47 | 47 | ]; |
| 48 | - $this->externalKey['uid'] = [ |
|
| 48 | + $this->externalKey['uid'] = [ |
|
| 49 | 49 | 'className' => 'User', |
| 50 | 50 | 'getMethodeName' => 'get', |
| 51 | 51 | 'keyName' => 'user', |
@@ -43,21 +43,21 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function deleteFile(\XoopsObject $photo = null) |
| 45 | 45 | { |
| 46 | - if (file_exists(XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/thumb/thumb_' . $photo->getVar('photo_name'))) { |
|
| 47 | - unlink(XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/thumb/thumb_' . $photo->getVar('photo_name')); |
|
| 46 | + if (file_exists(XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/thumb/thumb_'.$photo->getVar('photo_name'))) { |
|
| 47 | + unlink(XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/thumb/thumb_'.$photo->getVar('photo_name')); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if (file_exists(XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/medium/' . $photo->getVar('photo_name'))) { |
|
| 51 | - unlink(XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/medium/' . $photo->getVar('photo_name')); |
|
| 50 | + if (file_exists(XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/medium/'.$photo->getVar('photo_name'))) { |
|
| 51 | + unlink(XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/medium/'.$photo->getVar('photo_name')); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - if (file_exists(XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/large/large_' . $photo->getVar('photo_name'))) { |
|
| 55 | - unlink(XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/large/large_' . $photo->getVar('photo_name')); |
|
| 54 | + if (file_exists(XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/large/large_'.$photo->getVar('photo_name'))) { |
|
| 55 | + unlink(XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/large/large_'.$photo->getVar('photo_name')); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if ('' != $photo->getVar('photo_orig_name') |
| 59 | - && file_exists(XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/original/' . $photo->getVar('photo_orig_name'))) { |
|
| 60 | - unlink(XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/original/' . $photo->getVar('photo_orig_name')); |
|
| 59 | + && file_exists(XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/original/'.$photo->getVar('photo_orig_name'))) { |
|
| 60 | + unlink(XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/original/'.$photo->getVar('photo_orig_name')); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function getUploadPhotoPath() |
| 76 | 76 | { |
| 77 | - return XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/'; |
|
| 77 | + return XOOPS_ROOT_PATH.'/uploads/extgallery/public-photo/'; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $criteria->add(new \Criteria('uid', $userId)); |
| 195 | 195 | $criteria->add(new \Criteria('photo_approved', 1)); |
| 196 | 196 | |
| 197 | - $sql = 'SELECT photo_id FROM ' . $this->db->prefix('extgallery_publicphoto') . ' ' . $criteria->renderWhere() . ' ORDER BY photo_date, photo_id DESC;'; |
|
| 197 | + $sql = 'SELECT photo_id FROM '.$this->db->prefix('extgallery_publicphoto').' '.$criteria->renderWhere().' ORDER BY photo_date, photo_id DESC;'; |
|
| 198 | 198 | |
| 199 | 199 | $result = $this->db->query($sql); |
| 200 | 200 | $ret = []; |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @version CVS: $Id: Cairowrapper.php 288112 2009-09-06 21:02:37Z cweiske $ |
| 16 | 16 | * @link http://pear.php.net/package/Image_Transform |
| 17 | 17 | */ |
| 18 | -require_once __DIR__ . '/Image/Transform.php'; |
|
| 18 | +require_once __DIR__.'/Image/Transform.php'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Cairo implementation for Image_Transform package using pecl's cairo_wrapper |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | public function _resize($new_x, $new_y, $options = null) |
| 111 | 111 | { |
| 112 | 112 | if (true === $this->resized) { |
| 113 | - return PEAR::raiseError('You have already resized the image without saving it.' . ' Your previous resizing will be overwritten', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE); |
|
| 113 | + return PEAR::raiseError('You have already resized the image without saving it.'.' Your previous resizing will be overwritten', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | if ($this->new_x == $new_x && $this->new_y == $new_y) { |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | * @author Philippe.Jausions @at@ 11abacus.com |
| 6 | 6 | **/ |
| 7 | 7 | |
| 8 | -require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/Image/Image/Transform/IMAGETYPE.php'; |
|
| 8 | +require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/Image/Image/Transform/IMAGETYPE.php'; |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * @param $type |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | // +----------------------------------------------------------------------+ |
| 18 | 18 | |
| 19 | 19 | //require_once __DIR__ . '/Image/Transform/Driver/GD.php'; |
| 20 | -require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/Image/Transform/Driver/GD.php'; |
|
| 20 | +require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/Image/Transform/Driver/GD.php'; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * This driver is for GD1 or the non-bundled version of GD2 |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if ('#' == $color_mask{0}) { |
| 109 | 109 | $color_mask = $this->colorhex2colorarray($color_mask); |
| 110 | 110 | } else { |
| 111 | - require_once __DIR__ . '/Image/Transform/Driver/ColorsDefs.php'; |
|
| 111 | + require_once __DIR__.'/Image/Transform/Driver/ColorsDefs.php'; |
|
| 112 | 112 | $color_mask = isset($colornames[$color_mask]) ? $colornames[$color_mask] : false; |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $cosT = cos($t); |
| 118 | 118 | $sinT = sin($t); |
| 119 | 119 | |
| 120 | - $img =& $this->imageHandle; |
|
| 120 | + $img = & $this->imageHandle; |
|
| 121 | 121 | |
| 122 | 122 | $width = $max_x = $this->img_x; |
| 123 | 123 | $height = $max_y = $this->img_y; |