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

Fever13

  • Захожу иногда
  • 79
  • 0 / 0
Доброго времени суток!Подскажите пожалуйста, установлен AdsManager 2.6.5, хочу за место текста водяного знака вставить картинку *.png, каким образом это можно сделать? Спасибо.
*

max_1985

  • Давно я тут
  • 611
  • 56 / 0
*

Fever13

  • Захожу иногда
  • 79
  • 0 / 0
Сделали всё как описано, не работает на версии адс менеджера 2.6.5 (( белый экран и всё, хоть ты тресни! заменили фрагмент кода в AdsManager.php, и там только изменили путь к изображению. Что ещё не так? Спасибо.
*

Fever13

  • Захожу иногда
  • 79
  • 0 / 0
Ап! Помогите пожалуйста! Вот код файла /administrator/components/com_adsmanager/models/adsmanager.php 


Код
<?php
/**
 * @package AdsManager
 * @copyright Copyright (C) 2010-2011 JoomPROD.com. All rights reserved.
 * @license GNU/GPL
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

jimport('joomla.application.component.model');
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_adsmanager'.DS.'tables');

/**
 * @package Joomla
 * @subpackage Contact
 */
class AdsmanagerModelAdsmanager extends JModel

function changeState($table,$id,$field,$state,$cid)
{
$cids = implode( ',', $cid );
$this->_db->setQuery("UPDATE $table SET $field = $state WHERE $id IN ($cids)");
//echo "UPDATE $table SET $field = $state WHERE $id IN ($cids)";
//exit();
$this->_db->query();
}

function createImageAndThumb($src_file,$image_name,$thumb_name,

$max_width,
    $max_height,
$max_width_t,
$max_height_t,
$tag,
$path,
$orig_name)
{
if (intval(ini_get('memory_limit')) < 64)
ini_set('memory_limit', '64M');

$src_file = urldecode($src_file);

$orig_name = strtolower($orig_name);
$findme  = '.jpg';
$pos = strpos($orig_name, $findme);
if ($pos === false)
{
$findme  = '.jpeg';
$pos = strpos($orig_name, $findme);
if ($pos === false)
{
$findme  = '.gif';
$pos = strpos($orig_name, $findme);
if ($pos === false)
{
$findme  = '.png';
$pos = strpos($orig_name, $findme);
if ($pos === false)
{
return;
}
else
{
$type = "png";
}
}
else
{
$type = "gif";
}
}
else
{
$type = "jpeg";
}
}
else
{
$type = "jpeg";
}

$max_h = $max_height;
$max_w = $max_width;
$max_thumb_h = $max_height_t;
$max_thumb_w = $max_width_t;

if ( file_exists( "$path/$image_name")) {
unlink( "$path/$image_name");
}

if ( file_exists( "$path/$thumb_name")) {
unlink( "$path/$thumb_name");
}

$read = 'imagecreatefrom' . $type;
$write = 'image' . $type;

$src_img = $read($src_file);

// height/width
$imginfo = getimagesize($src_file);
$src_w = $imginfo[0];
$src_h = $imginfo[1];

$zoom_h = $max_h / $src_h;
    $zoom_w = $max_w / $src_w;
    $zoom   = min($zoom_h, $zoom_w);
    $dst_h  = $zoom<1 ? round($src_h*$zoom) : $src_h;
    $dst_w  = $zoom<1 ? round($src_w*$zoom) : $src_w;

$zoom_h = $max_thumb_h / $src_h;
    $zoom_w = $max_thumb_w / $src_w;
    $zoom   = min($zoom_h, $zoom_w);
    $dst_thumb_h  = $zoom<1 ? round($src_h*$zoom) : $src_h;
    $dst_thumb_w  = $zoom<1 ? round($src_w*$zoom) : $src_w;

$dst_img = imagecreatetruecolor($dst_w,$dst_h);
$white = imagecolorallocate($dst_img,255,255,255);
imagefill($dst_img,0,0,$white);
imagecopyresampled($dst_img,$src_img, 0,0,0,0, $dst_w,$dst_h,$src_w,$src_h);
$textcolor = imagecolorallocate($dst_img, 255, 255, 255);
if (isset($tag)) {
$fontfile = JPATH_SITE."/components/com_adsmanager/font/verdana.ttf";
            imagettftext ($dst_img, 10, 0, 5, 20,$textcolor,$fontfile,$tag );
        } 
if($type == 'jpeg'){
        $desc_img = $write($dst_img,"$path/$image_name", 75);
}else{
        $desc_img = $write($dst_img,"$path/$image_name", 2);
}

imagedestroy($dst_img);

$dst_t_img = imagecreatetruecolor($dst_thumb_w,$dst_thumb_h);
$white = imagecolorallocate($dst_t_img,255,255,255);
imagefill($dst_t_img,0,0,$white);
imagecopyresampled($dst_t_img,$src_img, 0,0,0,0, $dst_thumb_w,$dst_thumb_h,$src_w,$src_h);
$textcolor = imagecolorallocate($dst_t_img, 255, 255, 255);
if (isset($tag)) {
//imagestring($dst_t_img, 2, 2, 2, $tag, $textcolor);
$fontfile = JPATH_SITE."/components/com_adsmanager/font/verdana.ttf";
            imagettftext ($dst_t_img, 7, 0, 5, 12,$textcolor,$fontfile,$tag );
}
if($type == 'jpeg'){
        $desc_img = $write($dst_t_img,"$path/$thumb_name", 75);
}else{
        $desc_img = $write($dst_t_img,"$path/$thumb_name", 2);
}

imagedestroy($dst_t_img);
}
}
*

Fever13

  • Захожу иногда
  • 79
  • 0 / 0
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

AdsManager вывод нужных полей по отдельности

Автор klekovkinandrey

Ответов: 2
Просмотров: 12608
Последний ответ 06.04.2024, 09:54:15
от Rinat abzyi
AdsManager загрузка файлов

Автор FlexNL

Ответов: 1
Просмотров: 1447
Последний ответ 21.10.2021, 17:20:09
от khan-alex
AdsManager 2.9.13 Есть ли возможность добавить функцию снять с публикации по мимо редактировать и уд

Автор murovoz

Ответов: 11
Просмотров: 11621
Последний ответ 27.03.2020, 22:39:23
от Pavel
Два компонента AdsManager в одном движке

Автор kaman62

Ответов: 12
Просмотров: 26781
Последний ответ 27.03.2020, 22:32:04
от Pavel
Onlinestatus CB в AdsManager

Автор Den JW

Ответов: 1
Просмотров: 9220
Последний ответ 17.02.2020, 23:37:52
от Den JW