Новости Joomla

👩‍💻 WT CDEK library v.1.3.0 - обновление PHP SDK для Joomla + CDEK.

👩‍💻 WT CDEK library v.1.3.0 - обновление PHP SDK для Joomla + CDEK.

Небольшая нативная PHP Joomla библиотека для работы с API v.2 службы доставки CDEK. Библиотека представляет собой клиент для авторизации в CDEK API по OAuth, работы с некоторыми методами API: получения ряда данных и расчета стоимости доставки. Поддерживается Joomla 4.2.7 и выше.

В пакет входят:
- библиотека Webtolk/Cdekapi
- системный плагин System - WT Cdek для хранения настроек и AJAX-интеграций
- task-плагин Task - Update WT Cdek data для обновления локальных копий справочников CDEK по расписанию
- web asset с официальным JavaScript-виджетом СДЭК

👉 v.1.3.0. Что нового?
- Полный рефакторинг библиотеки. Библиотека переработана в entity-based API с фасадом Cdek и отдельным слоем запросов. Обратная совместимость не нарушена, поэтому версия библиотеки - 1.3.0.
- Добавлена поддержка новых разделов API СДЭК. Добавлена поддержка новых разделов API СДЭК: webhooks, prealert, печатные формы, payment, passport, reverse, intakes и других сущностей.
- Улучшена интеграция с Joomla.
Улучшена интеграция с Joomla: installer script для layouts, новые поля Joomla Form для тарифов и обновлённые js виджета CDEK.
- документация библиотеки. Все методы библиотеки подробно описаны, а так же текст документации собран в отдельной папке в git репозитории и будет опубликован на сайте.

Библиотека эта нужна для разработчиков, создающих свои расширения для интеграции Joomla и курьерской службы CDEK.

Страница расширения
GitHub расширения

@joomlafeed

Поток товаров, связанные товары для JoomShopping 5+.

Поток товаров, связанные товары для JoomShopping 5+.

Расширение для JoomShopping 5+, которое позволяет связывать товары между собой на основе общих характеристик, создавая логические группы товаров в каталоге.

Расширение реализует механизм связывания товаров, похожий на стандартный Related Products, но с дополнительной возможностью быстрого подбора товаров по характеристикам.

Принцип работы
- Связывание товаров происходит в полуавтоматическом режиме.
- Администратор выбирает характеристику, по которой нужно сформировать группу товаров (например: модель, серия, объем, тип и т.д.).
- Система фильтрует и показывает список товаров с таким же значением характеристики.
- Администратор выбирает нужные товары из списка для создания связи.
Таким образом сохраняется полный контроль над связями, но значительно упрощается поиск нужных товаров.

Назначение потока товаров в одном товаре является сквозным. Это обеспечивает автоматическую связь и возможность корректировки потока в каждом товаре, который к нему относится.

Страница расширения

@joomlafeed

0 Пользователей и 1 Гость просматривают эту тему.
  • 6 Ответов
  • 3219 Просмотров
*

Sevenor

  • Захожу иногда
  • 108
  • 0 / 0
Обрезка изображений
« : 04.04.2008, 14:26:08 »
А есть ли какойнибудь простой мамбот, который урезал бы картинки в контенте, если те больше заданного параметра.

Например:
Изображение 600px, и растягивает центр, а мамбот урезает её до 550px, и все нормально.(просто присваивает width: 500px;)
*

beliyadm

  • Легенда
  • 9758
  • 1665 / 66
  • Севастополь, Россия
Re: Обрезка изображений
« Ответ #1 : 04.04.2008, 14:27:30 »
есть, много таких, тот же dinamicimage
Все истины, которые я хочу вам изложить, — бесстыдная ложь. Сделать всё хорошо
TLG: @Beliyadm
*

Sevenor

  • Захожу иногда
  • 108
  • 0 / 0
Re: Обрезка изображений
« Ответ #2 : 04.04.2008, 14:55:04 »
Поставил, ничего не изменилось.. возможно потому, что картинки в контенте грузятся со стороннего сервера, т.е. добавлены копипастом.
*

Dead Krolik

  • Захожу иногда
  • 131
  • 33 / 4
  • Теперь я рыбка
Re: Обрезка изображений
« Ответ #3 : 04.04.2008, 15:00:18 »
Дак конечно, еще спрашиваете. Как же он по-вашему будет на другом хосте менять что-то :)
*

beliyadm

  • Легенда
  • 9758
  • 1665 / 66
  • Севастополь, Россия
Re: Обрезка изображений
« Ответ #4 : 04.04.2008, 15:00:27 »
конечно, он обрабатывает картинки, вставленные в контент с помощью mosimage.
Для сторонних только напрямую прописывать width в коде
Все истины, которые я хочу вам изложить, — бесстыдная ложь. Сделать всё хорошо
TLG: @Beliyadm
*

Sevenor

  • Захожу иногда
  • 108
  • 0 / 0
Re: Обрезка изображений
« Ответ #5 : 04.04.2008, 15:24:58 »
Ну думаю есть способ сделать мамбот...
Например есть способ достучаться через css, и если сделать на основе jQuery небольшой анализатор, ввиде скрипта, то мона думаю как нить сделать.
*

Sevenor

  • Захожу иногда
  • 108
  • 0 / 0
Re: Обрезка изображений
« Ответ #6 : 04.04.2008, 16:24:11 »
Или вот аналог iMax Width

http://blogproblog.com/tag/optimizaciya-bloga/page/2/

Интересно, из этого мона сделать для Joomla мамбот.
Код
/** !! **************************************************
 * It is not necessary to modify anything in this file. *
 ************************************************** !! **/

define('IMAX_VERSION', '1.2');
// The name of the option key that stores the current version
define('IMAX_INSTALLED_VERSION', 'imax_version');
// The name of the option key that contains the max width.
define('IMAX_OPTION_MAX_WIDTH', 'imax_maxwidth');
// The name of the option key for the replace image choice.
define('IMAX_OPTION_PHYSICAL_RESIZE', 'imax_physical_resize');
define('IMAX_OPTION_DONT_FORCE_WIDTH', 'imax_dont_force_width');

/**
imax_size_images

Executes on post save. Makes sure IMG tags have width + height params and are below maxwidth
*/
function imax_size_images($the_content){

$offset = 0;
$the_new_content = '';
// get settings so we don't have to get them a million times in the loop
$force_width = get_option( IMAX_OPTION_DONT_FORCE_WIDTH ) ? 0 : 1;
$max_width = get_option( IMAX_OPTION_MAX_WIDTH );
$physical_resize = get_option( IMAX_OPTION_PHYSICAL_RESIZE ) ? 1 : 0;
$upload_path = attribute_escape(str_replace(ABSPATH, '', get_option('upload_path')));

# COLAS fix for php4, see http://fr2.php.net/function.stripos
$the_lc_content = strtolower($the_content);
while( ( $img_start = strpos( $the_lc_content, '<img', $offset ) ) !== false ){ // it could be the first char so ===
$resize_needed = 0;

$img_end = strpos( $the_content, '>', $img_start );
if( substr( $the_lc_content, $img_end - 1, 1) == '/' ) $img_end--; 
//see if IMG tag has existing width/height tags
$height_start = strpos( $the_lc_content, 'height=', $img_start );
if( $height_start && ( $height_start < $img_end ) ){

$height_end = strpos( $the_content, ' ', $height_start );
//could have been against > or there could be no ' '
if( $height_end > $img_end || $height_end == 0 ) $height_end = $img_end;

//skips over height= and removes possible "" ''
$height = trim( substr( $the_content, $height_start + 7, $height_end - ( $height_start + 7 ) ), "\x22\x27\x5C" );

} else {
$height = '';
$height_start = $img_end; //so we know to place new tag at the end of everything
$height_end = $img_end;
}
// do the same thing for width tag
$width_start = strpos( $the_lc_content, 'width=', $img_start );
if( $width_start && ( $width_start < $img_end ) ){
$width_end = strpos( $the_content, ' ', $width_start );
//could have been against >
if( $width_end > $img_end || $width_end == 0 ) $width_end = $img_end;

$width = trim( substr( $the_content, $width_start + 6, $width_end - ( $width_start + 6 ) ), "\x22\x27\x5C" );

} else {
$width = '';
$width_start = $img_end;
$width_end = $img_end;
}

//if existing W/H and if FORCE WIDTH then check size.
if($force_width && $width && height){
//if bigger than its supposed to be flag for resize. don't do it if we don't have a max_width
if( $max_width && ($width > $max_width)){
$resize_needed = 1;
}

} else if ($width && $height){ // W/H exists and we're not forcing width
//no resize needed
} else { //else has no existing W/H tag flag it!
$resize_needed = 1;
}

//do resize
if($resize_needed){
//check image file to get size
//get filename
$src_start = strpos( $the_lc_content, 'src=', $img_start );
if( $src_start && ( $src_start < $img_end ) ){
$src_end = strpos( $the_content, ' ', $src_start );
//could have been against >
if( $src_end > $img_end || $src_end == 0 ) $src_end = $img_end;

//skips over height= and removes possible "" ''
$src = trim( substr( $the_content, $src_start + 4, $src_end - ( $src_start + 4 ) ), "\x22\x27\x5C" );
} else {
$src = ''; //oh no oh my! impossible!
}

// error surpression is slow | i'm open to suggestions, needs to work on urls too
if( $src && (list($real_width, $real_height) = @getimagesize($src)) ){

//use a user inputted width if they have it

$width = ($width == '') ? $real_width : $width;
if($max_width && $width > $max_width ){ // the width needs to be resized down to max_width
$width = $max_width;
}
//keep things proportional
$height = round(($width * $real_height) / $real_width);

//resize on server if requested and resize to max size | this would skip a file that a user put a small width tag in
if( $physical_resize && ( $width == $max_width ) && ( $width != $real_width ) ){
if( ($path_start = strpos( $src, $upload_path ) ) !== 0){ //see if it's from the upload folder or sub folders
  $ext = strtolower(substr($src,strrpos($src,".")));
  if( $ext == ".jpg" || $ext == ".png" ){  //resizes jpgs & pngs
//$file_name = ABSPATH . UPLOADS . preg_replace('/.*?[\/]files[\/]/', '', $src); // COLAS: WPMU code
$file_name = ABSPATH.substr( $src, $path_start );
if( file_exists( $file_name ) ){ //make sure it is really on our server
$image_new = imagecreatetruecolor($width, $height);

if( $ext == ".jpg" ) {
$image = imagecreatefromjpeg($file_name);
if( @imagecopyresampled($image_new, $image, 0, 0, 0, 0, $width, $height, $real_width, $real_height) ){
imagejpeg( $image_new, $file_name, 80 ); //overwrite only if resize completed
}
} else { //png

$image = imagecreatefrompng($file_name);
if( @imagecopyresampled($image_new, $image, 0, 0, 0, 0, $width, $height, $real_width, $real_height) ){
imagepng( $image_new, $file_name); //overwrite only if resize completed
}
}
}
  }
}
}

//put in new img width height tags
//find out which tag comes first so the stuff in the middle doesn't end up in a black hole

if($width_start == $height_start){

$the_new_content .= substr( $the_content, $offset, $height_start - $offset ).' width=\"'.$width.'\" height=\"'.$height.'\"';

} else if($height_start > $width_start){ //width comes first

$the_new_content .= substr( $the_content, $offset, $width_start - $offset ).'width=\"'.$width.'\"';
if($height_start == $width_end){ //no width tag need ''
$the_new_content .= ' ';
} else { //possible inbetween at least a space ' '
$the_new_content .= substr( $the_content, $width_end, $height_start - $width_end);
}
$the_new_content .= 'height=\"'.$height.'\"';
//possible end stuff
$the_new_content .= substr( $the_content, $height_end, $img_end - $height_end);

} else { //height comes first

$the_new_content .= substr( $the_content, $offset, $height_start - $offset ).'height=\"'.$height.'\"';

if($width_start == $height_end){ //no width tag need ''
$the_new_content .= ' ';
} else { //possible inbetween at least a space ' '
$the_new_content .= substr( $the_content, $height_end, $width_start - $height_end);
}
$the_new_content .= 'width=\"'.$width.'\"';
//possible end stuff
$the_new_content .= substr( $the_content, $width_end, $img_end - $width_end);
}
} else { // no src scary! lets skip it
// we should consider removing this all together as it could break a template even if it is missing.
$the_new_content .= substr( $the_content, $offset, $img_end - $offset );
}

} else { // no resize copy over old stuff
$the_new_content .= substr( $the_content, $offset, $img_end - $offset );

}


$offset = $img_end; //on to look for the next <img
}

if( $offset == 0 ){ //never went anywhere - send out old content
return $the_content;
} else {
//tack on the end
$the_new_content .= substr( $the_content, $img_end );

return $the_new_content;
}
}






/**
imax_admin_panel

The option page.
*/
function imax_admin_panel() {
// Proceed with the options panel.

// If the user pushed the update button.
if ( isset($_POST['imax_physical_resize']) ) {
$err = array();

// Set or unset the physical resize option.
if ( !empty($_POST['imax_physical_resize'] ) ) {
update_option(IMAX_OPTION_PHYSICAL_RESIZE, 'yes');
} else {
update_option(IMAX_OPTION_PHYSICAL_RESIZE, '');
}


if ( !empty($_POST['imax_force_width'] ) ) {
update_option(IMAX_OPTION_DONT_FORCE_WIDTH, '');
} else {
update_option(IMAX_OPTION_DONT_FORCE_WIDTH, '1');
}

// Set the max width
update_option(IMAX_OPTION_MAX_WIDTH, $_POST['imax_max_width']);

echo '<div id="message" class="updated fade"><p>Changes Saved!</p></div>';
} // End if update button pushed.
?>
<style>
.imax_box{
padding: 15px;
}
.imax_note{
color:#999;
padding: 3px 0 10px 25px;
display:block;
}
</style>

<div class="wrap" id="imax_options_panel">
<form method='post'>
<h2>Images Max Width Options</h2>
<P>
There are two methods of resizing large inline images to a maximum width. Both methods will place the <em>width</em> & <em>height</em> parameters within all <em>&lt;IMG&gt;</em> tags (even images smaller than the max width) so that browsers will display the page better on load.
</P>


<div class='imax_box'>
<h3>Permanently Resize Large Images to a Max Width?</h3>

<div class='imax_box'>

<?php if ( get_option(IMAX_OPTION_PHYSICAL_RESIZE) != "" ) { $x2 = 'CHECKED'; } else { $x1 = 'CHECKED'; } ?>
<input type="radio" id="imax_physical_resize" name="imax_physical_resize" <?php echo $x1; ?> value=''/>
<strong>No</strong> // Client-side Resize: Temporarily resize the image in the browser on page download</input>
<div class='imax_note'>The images will remain the original size on the server. Large images may take a long time for the viewer to download. Choose this option if you have no idea what this means.</div>
<BR />
<input type="radio" id="imax_physical_resize2" name="imax_physical_resize" <?php echo $x2; ?> value='1'>
<strong>Yes</strong> // Server-side Resize: Physically resize large images to max width on the server at time of post</input>
<div class='imax_note'>This will produce a better looking image, save space on the server, and will download to viewers browsers faster. The catch is, this overwrites the original image so the full size image is no longer available on the server. </div>

<BR />
</div>
<h3>Image Resize Method</h3>

<div class='imax_box'>
<input type="checkbox" id="imax_force_width" name="imax_force_width" <?php  if ( get_option(IMAX_OPTION_DONT_FORCE_WIDTH) == "" ) { echo "CHECKED"; } ?> value='1'>
<strong>Force Width</strong>: Always resize images larger than the max width</input>
<div class='imax_note'>When this is NOT checked images with existing <em>width=</em> &amp; <em>height=</em> params can exceed the max width. By default WP does not insert these tags and it will be resized. Think of this as a Max Width override for special occations.</div>


</div>


<h3>Maximum Image Width</h3>
 <input type="text" id='imax_max_width' name='imax_max_width' value='<?php echo get_option(IMAX_OPTION_MAX_WIDTH);?>'/> px
<div class='imax_note'>Leave width empty if you would not like to resize large images.</div>

</div>

<p class="submit">
<input type="submit" name="imax_update" value="Save Settings &raquo;"/>
</p>

</form>
</div>
<?php

 } // imax_admin_panel




/**
imax_admin_add_panel

Adds the option page.
*/
function imax_admin_add_panel() {
add_options_page('Image Max Width Plugin Settings', 'iMax Width', 8, 'imax_options', 'imax_admin_panel');
}



//hooks and such////////////////////////////////////////////////
if( is_admin()) {
add_filter('content_save_pre', 'imax_size_images');
}


add_action('admin_menu', 'imax_admin_add_panel');


/**
imax_install

Initialize the settings we need to get the cards working
*/
function imax_install() {
  if ( get_option(IMAX_INSTALLED_VERSION) < IMAX_VERSION || $_GET['imax_force_install'] == 'true' ) {
   
    update_option(IMAX_INSTALLED_VERSION, IMAX_VERSION);
   
    if ( !get_option(IMAX_OPTION_MAX_WIDTH) ) {
      update_option(IMAX_OPTION_MAX_WIDTH, '');
    }
   
    if ( !get_option(IMAX_OPTION_PHYSICAL_RESIZE) ) {
      update_option(IMAX_OPTION_PHYSICAL_RESIZE, '');
    }
   
    if ( !get_option(IMAX_OPTION_DONT_FORCE_WIDTH) ) {
      update_option(IMAX_OPTION_DONT_FORCE_WIDTH, '');
    }
   
   
  }
} // imax_install

if( strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) {
add_action('init', 'imax_install');
}

?>
« Последнее редактирование: 04.04.2008, 16:32:05 от Sevenor »
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Плагин LVSpoiler - спойлеры с динамической загрузкой изображений

Автор Arkadiy

Ответов: 449
Просмотров: 107091
Последний ответ 20.04.2024, 21:10:33
от Beer
Плагин OptiPic - оптимизация изображений и конвертация в WebP

Автор optipic

Ответов: 0
Просмотров: 2752
Последний ответ 06.01.2022, 03:22:07
от optipic
SIGPLUS - инструкции для галереи всплывающих изображений / плагин, модуль / Joomla 1.5 - 2.5

Автор olaf

Ответов: 195
Просмотров: 91162
Последний ответ 10.01.2019, 16:23:26
от tortxp
DJ-MediaTools трабла - вывод 3 изображений

Автор markizmds

Ответов: 0
Просмотров: 943
Последний ответ 14.09.2018, 15:10:05
от markizmds
DJ-ImageSlider пролистование изображений в модальном окне

Автор IrochkaStep

Ответов: 1
Просмотров: 1182
Последний ответ 19.12.2016, 09:36:59
от Efanych