Skip to content

Commit

Permalink
v 4.2.1
Browse files Browse the repository at this point in the history
## 16.09.2014
- Поправил ошибку с генерацией картинок. если не указан метод ресайза.
- Изменено имя файла класса для ресаза, теперь его не нужно
дополнительно вызывать.
- Исправлено неправильное имя класса работы с БД при его инициализации.
- Поправил неправильно указаннау версия в инсталлере.
- Опечатка в админке (Логины авторов, для исключения их новостей).
  • Loading branch information
pafnuty committed Sep 16, 2014
1 parent 843bc6b commit 5666a8a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions upload/blockpro_install.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
'moduleDescr' => 'Модуль вывода новостей для DLE',

// Версия модуля, для установщика
'moduleVersion' => '4.0-beta',
'moduleVersion' => '4.2.1',

// Дата выпуска модуля, для установщика
'moduleDate' => '17.08.2014',
'moduleDate' => '16.09.2014',

// Версии DLE, поддержваемые модулем, для установщика
'dleVersion' => '9.x - 10.x',
'dleVersion' => '10.x',

// ID групп, для которых доступно управление модулем в админке.
'allowGroups' => '1',
Expand Down
5 changes: 4 additions & 1 deletion upload/engine/inc/blockpro.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

define('MODULE_DIR', ENGINE_DIR . '/modules/base/admin/blockpro/');

$moduleName = 'blockpro';
$moduleVersion = '4.2.1';

$moderate = $_REQUEST['moderate'];
$moderate_checked = ($moderate) ? 'checked' : '' ;
$template = $_REQUEST['template'];
Expand Down Expand Up @@ -278,7 +281,7 @@ class="btn btn-small btn-white"><?=$lang['skin_view'] ?></a>
<div class="container">
<div class="content">
<div class="col col-mb-12 col-12">
<h1 class="ta-center">Генератор строк подключения BlockPro <span class="btn btn-small btn-red mfp-open-ajax" data-mfp-src="/engine/ajax/base/check_updates.php?name=blockpro&currentVersion=4.1">Проверить обновления</span></h1>
<h1 class="ta-center">Генератор строк подключения BlockPro <span class="btn btn-small btn-red mfp-open-ajax" data-mfp-src="/engine/ajax/base/check_updates.php?name=<?=$moduleName?>&currentVersion=<?=$moduleVersion?>">Проверить обновления</span></h1>
<hr>
</div> <!-- .col col-mb-12 col-12 -->
</div> <!-- .content -->
Expand Down
2 changes: 1 addition & 1 deletion upload/engine/modules/base/admin/blockpro/generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function showXFields($configname) {

<div class="content">
<div class="col col-mb-12 col-5 col-dt-4 form-label">
Логины авторов, для показа их новостей
Логины авторов, для исключения их новостей
</div>
<div class="col col-mb-12 col-7 col-dt-8 form-control">
<input class="input" type="text" name="notAuthor" value="<?=$cfg['notAuthor']?>" placeholder="Михаил,username">
Expand Down
3 changes: 1 addition & 2 deletions upload/engine/modules/base/core/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function __construct() {
}

public function getDb() {
return SafeMysql::getInstanse(array(
return SafeMySQL::getInstanse(array(
'host' => DBHOST,
'user' => DBUSER,
'pass' => DBPASS,
Expand All @@ -72,7 +72,6 @@ public function setConfig($cfg = array()) {
return $cfg;
}


public static function getDleConfig() {
include(ENGINE_DIR . '/data/config.php');
return $config;
Expand Down
4 changes: 1 addition & 3 deletions upload/engine/modules/base/core/bpModifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class bpModifiers extends base {
* @return string $data - обрезанный результат
*/
public static function textLimit($data, $limit, $etc = '&hellip;', $wordcut = false, $charset = 'utf-8') {

$data = strip_tags($data, '<br>');
$data = trim(str_replace(array('<br>', '<br />'), ' ', $data));

Expand Down Expand Up @@ -57,7 +56,7 @@ public static function textLimit($data, $limit, $etc = '&hellip;', $wordcut = fa
*/

public static function getImage($data, $noimage = '', $imageType = 'small', $number, $size, $quality, $resizeType = 'auto', $grabRemote = true, $showSmall = false, $subdir = false, $config = array()) {

$resizeType = ($resizeType == '' || !$resizeType) ? 'auto' : $resizeType ;
// Присваиваем картинке значение noimage;
$image = $noimage;

Expand Down Expand Up @@ -133,7 +132,6 @@ public static function getImage($data, $noimage = '', $imageType = 'small', $num
}

// Подрубаем НОРМАЛЬНЫЙ класс для картинок
require_once BASE_DIR . '/core/resize_class.php';
$resizeImg = new resize($imgResized);
$resizeImg->resizeImage( //создание уменьшенной копии
$imgSize[0],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,46 +61,46 @@ private function openImage($file)
## --------------------------------------------------------

private function openImageWithCurl($url)
{
{
$extension = strtolower(strrchr($url, '.'));
$this->extension = $extension == '.jpg' ? '.jpeg' : $extension;

$file = $this->curlRequest($url);
if ($file == '')
if ($file == '')
return false;

return imagecreatefromstring($file);
}

## --------------------------------------------------------

private function curlRequest($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0');
$contents = curl_exec($ch);
curl_close($ch);
return $contents;
}
$contents = curl_exec($ch);
curl_close($ch);
return $contents;
}

## --------------------------------------------------------

public function resizeImage($newWidth, $newHeight, $option="auto")
{
// *** Get optimal width and height - based on $option
$optionArray = $this->getDimensions($newWidth, $newHeight, $option);

$optimalWidth = $optionArray['optimalWidth'];
$optimalHeight = $optionArray['optimalHeight'];


// *** Resample - create image canvas of x, y size
$this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);

if($this->extension == '.png' || $this->extension == '.gif')
{
imagecolortransparent($this->imageResized, imagecolorallocatealpha($this->imageResized, 0, 0, 0, 127));
Expand All @@ -115,7 +115,7 @@ public function resizeImage($newWidth, $newHeight, $option="auto")
}

## --------------------------------------------------------

private function getDimensions($newWidth, $newHeight, $option)
{

Expand Down Expand Up @@ -229,7 +229,7 @@ private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight)

// *** Now crop from center to exact requested size
$this->imageResized = imagecreatetruecolor($newWidth, $newHeight);

if($this->extension == '.png' || $this->extension == '.gif')
{
imagecolortransparent($this->imageResized, imagecolorallocatealpha($this->imageResized, 0, 0, 0, 127));
Expand Down

0 comments on commit 5666a8a

Please sign in to comment.