par
lnalaplusbelle » 29 mars 2015, 14:37
Bonjour à tous,
J'ai un composant Joomla qui est une galerie images mais les images sont compressé et c'est pas très jolie, j'ai cherché comment faire pour garder une bonne qualité mais je trouve PAS, dès fois je suis un peu une bêbete
le script est :
Code : Tout sélectionner
<?php
/**
**/
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
class Config {
var $_configFile = null;
var $tabs = null;
var $selectgallery = null;
var $usertype = null;
var $published = null;
var $max_image_size = null;
var $tmb_image_wd = null;
var $tmb_image_hg = null;
var $slaids_text = null;
var $slaids_wait = null;
var $slaids_duration = null;
var $slaids_effect = null;
var $slaids_transitions = null;
var $slaids_direction = null;
var $slaids_tmbcolumn = null;
var $slaids_tmbrows = null;
var $img_image_wd0 = null;
var $img_image_hg0 = null;
var $tmb_image_wd0 = null;
var $tmb_image_hg0 = null;
var $slaids_textPosTop = null;
var $slaids_textPosLeft = null;
var $slaids_textWrapPosTop = null;
var $slaids_textWrapPosLeft = null;
var $slaids_textWrapWidth = null;
var $slaids_textWrapHeight = null;
var $slaids_textWrapBorder = null;
var $slaids_textWrapBackground = null;
var $fe_columnAmount = null;
var $smoothg_delay = null;
var $smoothg_duration = null;
var $smoothg_slideshow = null;
var $smoothg_carousel = null;
var $smoothg_infopane = null;
var $smoothg_links = null;
var $smoothg_slideinfo = null;
var $smoothg_caropacity = null;
var $smoothg_caropacitybig = null;
var $smoothg_carheight = null;
var $img_image_wd1 = null;
var $img_image_hg1 = null;
var $smoothg_tmbimgwd = null;
var $smoothg_tmbimghg = null;
var $smoothg_tmbimgspacing = null;
function Config(){
global $mosConfig_absolute_path;
$this->_configFile = $mosConfig_absolute_path."/administrator/components/com_expgallery/config.expgallery.php";
}
function load()
{
require_once($this->_configFile);
$this->selectgallery = $selectgallery;
$this->usertype = $usertype;
$this->published = $published;
$this->max_image_size = $max_image_size;
$this->tmb_image_wd = $tmb_image_wd;
$this->tmb_image_hg = $tmb_image_hg;
$this->slaids_text = $slaids_text;
$this->slaids_wait = $slaids_wait;
$this->slaids_duration = $slaids_duration;
$this->slaids_effect = $slaids_effect;
$this->slaids_transitions = $slaids_transitions;
$this->slaids_direction = $slaids_direction;
$this->slaids_tmbcolumn = $slaids_tmbcolumn;
$this->slaids_tmbrows = $slaids_tmbrows;
$this->img_image_wd0 = $img_image_wd0;
$this->img_image_hg0 = $img_image_hg0;
$this->tmb_image_wd0 = $tmb_image_wd0;
$this->tmb_image_hg0 = $tmb_image_hg0;
$this->slaids_textPosTop = $slaids_textPosTop;
$this->slaids_textPosLeft = $slaids_textPosLeft;
$this->slaids_textWrapPosTop = $slaids_textWrapPosTop;
$this->slaids_textWrapPosLeft = $slaids_textWrapPosLeft;
$this->slaids_textWrapWidth = $slaids_textWrapWidth;
$this->slaids_textWrapHeight = $slaids_textWrapHeight;
$this->slaids_textWrapBorder = $slaids_textWrapBorder;
$this->slaids_textWrapBackground = $slaids_textWrapBackground;
$this->fe_columnAmount = $fe_columnAmount;
$this->smoothg_delay = $smoothg_delay;
$this->smoothg_duration = $smoothg_duration;
$this->smoothg_slideshow = $smoothg_slideshow;
$this->smoothg_carousel = $smoothg_carousel;
$this->smoothg_infopane = $smoothg_infopane;
$this->smoothg_links = $smoothg_links;
$this->smoothg_slideinfo = $smoothg_slideinfo;
$this->smoothg_caropacity = $smoothg_caropacity;
$this->smoothg_caropacitybig = $smoothg_caropacitybig;
$this->smoothg_carheight = $smoothg_carheight;
$this->img_image_wd1 = $img_image_wd1;
$this->img_image_hg1 = $img_image_hg1;
$this->smoothg_tmbimgwd = $smoothg_tmbimgwd;
$this->smoothg_tmbimghg = $smoothg_tmbimghg;
$this->smoothg_tmbimgspacing = $smoothg_tmbimgspacing;
}
function save($option)
{
@chmod ($this->_configFile, 0766);
$permission = is_writable($this->_configFile);
if (!$permission) {
mosRedirect("index2.php?option=$option&act=settings", 'Config file not writeable!');
break;
}
$config = "<?php\n";
$config .= "\$selectgallery = '" . $_POST['selectgallery'] . "';\n";
$config .= "\$usertype = '" . $_POST['usertype'] . "';\n";
$config .= "\$published = '" . $_POST['published'] . "';\n";
$config .= "\$max_image_size = '" . $_POST['max_image_size'] . "';\n";
$config .= "\$tmb_image_wd = '" . $_POST['tmb_image_wd'] . "';\n";
$config .= "\$tmb_image_hg = '" . $_POST['tmb_image_hg'] . "';\n";
$config .= "\$slaids_text = '" . $_POST['slaids_text'] . "';\n";
$config .= "\$slaids_wait = '" . $_POST['slaids_wait'] . "';\n";
$config .= "\$slaids_duration = '" . $_POST['slaids_duration'] . "';\n";
$config .= "\$slaids_effect = '" . $_POST['slaids_effect'] . "';\n";
$config .= "\$slaids_transitions = '" . $_POST['slaids_transitions'] . "';\n";
$config .= "\$slaids_direction = '" . $_POST['slaids_direction'] . "';\n";
$config .= "\$slaids_tmbcolumn = '" . $_POST['slaids_tmbcolumn'] . "';\n";
$config .= "\$slaids_tmbrows = '" . $_POST['slaids_tmbrows'] . "';\n";
$config .= "\$img_image_wd0 = '" . $_POST['img_image_wd0'] . "';\n";
$config .= "\$img_image_hg0 = '" . $_POST['img_image_hg0'] . "';\n";
$config .= "\$tmb_image_wd0 = '" . $_POST['tmb_image_wd0'] . "';\n";
$config .= "\$tmb_image_hg0 = '" . $_POST['tmb_image_hg0'] . "';\n";
$config .= "\$slaids_textPosTop = '" . $_POST['slaids_textPosTop'] . "';\n";
$config .= "\$slaids_textPosLeft = '" . $_POST['slaids_textPosLeft'] . "';\n";
$config .= "\$slaids_textWrapPosTop = '" . $_POST['slaids_textWrapPosTop'] . "';\n";
$config .= "\$slaids_textWrapPosLeft = '" . $_POST['slaids_textWrapPosLeft'] . "';\n";
$config .= "\$slaids_textWrapWidth = '" . $_POST['slaids_textWrapWidth'] . "';\n";
$config .= "\$slaids_textWrapHeight = '" . $_POST['slaids_textWrapHeight'] . "';\n";
$config .= "\$slaids_textWrapBorder = '" . $_POST['slaids_textWrapBorder'] . "';\n";
$config .= "\$slaids_textWrapBackground = '" . $_POST['slaids_textWrapBackground'] . "';\n";
$config .= "\$fe_columnAmount = '" . $_POST['fe_columnAmount'] . "';\n";
$config .= "\$smoothg_delay = '" . $_POST['smoothg_delay'] . "';\n";
$config .= "\$smoothg_duration = '" . $_POST['smoothg_duration'] . "';\n";
$config .= "\$smoothg_slideshow = '" . $_POST['smoothg_slideshow'] . "';\n";
$config .= "\$smoothg_carousel = '" . $_POST['smoothg_carousel'] . "';\n";
$config .= "\$smoothg_infopane = '" . $_POST['smoothg_infopane'] . "';\n";
$config .= "\$smoothg_links = '" . $_POST['smoothg_links'] . "';\n";
$config .= "\$smoothg_slideinfo = '" . $_POST['smoothg_slideinfo'] . "';\n";
$config .= "\$smoothg_caropacity = '" . $_POST['smoothg_caropacity'] . "';\n";
$config .= "\$smoothg_caropacitybig = '" . $_POST['smoothg_caropacitybig'] . "';\n";
$config .= "\$smoothg_carheight = '" . $_POST['smoothg_carheight'] . "';\n";
$config .= "\$img_image_wd1 = '" . $_POST['img_image_wd1'] . "';\n";
$config .= "\$img_image_hg1 = '" . $_POST['img_image_hg1'] . "';\n";
$config .= "\$smoothg_tmbimgwd = '" . $_POST['smoothg_tmbimgwd'] . "';\n";
$config .= "\$smoothg_tmbimghg = '" . $_POST['smoothg_tmbimghg'] . "';\n";
$config .= "\$smoothg_tmbimgspacing = '" . $_POST['smoothg_tmbimgspacing'] . "';\n";
$config .= "?>\n";
if ($fp = fopen($this->_configFile, "w")) {
fputs($fp, $config, strlen($config));
fclose ($fp);
}
mosRedirect("index2.php?option=$option&act=settings", 'Settings saved.');
}
} // class end
class expgalleryCategories extends mosDBTable {
var $id = null;
var $name = null;
var $url_img = null;
var $published = null;
function expgalleryCategories(&$db){
$this->mosDBTable('#__expgallery_categories', 'id', $db);
}
} // class end
class expgalleryAds extends mosDBTable {
var $id = null;
var $user_id = null;
var $cat_id = null;
var $name = null;
var $description = null;
var $date_crt = null;
var $published = null;
function expgalleryAds(&$db){
$this->mosDBTable('#__expgallery_ads', 'id', $db);
}
} // class end
class expgalleryImg extends mosDBTable {
var $id = null;
var $ad_id = null;
var $url_big = null;
var $url_img = null;
var $url_tmb = null;
var $img_width = null;
var $img_height = null;
var $tmb_width = null;
var $tmb_height = null;
function expgalleryImg(&$db){
$this->mosDBTable('#__expgallery_img', 'id', $db);
}
} // class end
class ImageOptions {
function isAllowable(&$file, $keyname) {
$allowable = array ('jpg', 'gif', 'png');
$extension = substr(trim($file[$keyname]["name"]), -3);
foreach($allowable as $val) {
if(strcasecmp($val, $extension) == 0)
return(1);
}
return(0);
}
function resize($filename, $original, $newx, $newy, $resized, $mod=0) {
$result = array();
if(strlen($filename)) {
if($mod == 0) {
$filename = substr($filename, 0, strlen($filename) - 4);
$filename .= "_".mktime();
}
if($mod == 1) {
$filename = substr($filename, 0, strlen($filename) - 4);
$filename .= "_".mktime()."_t";
}
}
$imagetype = array( 1 => '1', 2 => '2', 3 => '3');
list($orgWidth, $orgHeight, $type, $attr) = getimagesize($original);
if($type == $imagetype[2]) {
$backup = $resized."/".$filename.".jpg"; // NAME OF BACKUP
copy ($original, $backup); // COPY SOURCE TO BACKUP
$source = imagecreatefromjpeg($backup); // CREATE IMAGE IDENTIFIER
$sourcex = imagesx($source); // GET WIDTH
$sourcey = imagesy($source); // GET HEIGHT
if($newy == 0) {
if($sourcex > $newx) {
$newy = round(($newx * $sourcey) / $sourcex);
}
else {
$newx = $sourcex;
$newy = $sourcey;
}
}
$destination = imagecreatetruecolor($newx, $newy); // CREATE A NEW TRUE COLOR IMAGE
unlink($backup); // DELETE BACKUP FILE
if(!imagecopyresampled($destination, $source, 0, 0, 0, 0, $newx, $newy, $sourcex, $sourcey)) {
imagedestroy($source); // FREE MEMORY FROM $source
imagedestroy($destination); // FREE MEMORY FROM $destination
return(0); // RETURN ERROR
}
else {
imagedestroy($source);
if(imagejpeg($destination, $resized."/".$filename.".jpg")) { // CREATE RESIZED IMAGE
imagedestroy($destination);
$result[0]["width"] = $newx;
$result[0]["height"] = $newy;
$result[0]["name"] = $filename.".jpg";
return($result); // RETURN SUCCESS
}
imagedestroy($destination);
}
return (0);
}
if($type == $imagetype[1]) {
$backup = $resized."/".$filename.".gif"; // NAME OF BACKUP
copy ($original, $backup); // COPY SOURCE TO BACKUP
$source = imagecreatefromgif($backup); // CREATE IMAGE IDENTIFIER
$sourcex = imagesx($source); // GET WIDTH
$sourcey = imagesy($source); // GET HEIGHT
if($newy == 0) {
if($sourcex > $newx) {
$newy = round(($newx * $sourcey) / $sourcex);
}
else {
$newx = $sourcex;
$newy = $sourcey;
}
}
$destination = imagecreatetruecolor($newx, $newy); // CREATE A NEW TRUE COLOR IMAGE
unlink($backup); // DELETE BACKUP FILE
if(!imagecopyresampled($destination, $source, 0, 0, 0, 0, $newx, $newy, $sourcex, $sourcey)) {
imagedestroy($source); // FREE MEMORY FROM $source
imagedestroy($destination); // FREE MEMORY FROM $destination
return(0); // RETURN ERROR
}
else {
imagedestroy($source);
if(imagegif($destination, $resized."/".$filename.".gif")) { // CREATE RESIZED IMAGE
imagedestroy($destination);
$result[0]["width"] = $newx;
$result[0]["height"] = $newy;
$result[0]["name"] = $filename.".gif";
return($result); // RETURN SUCCESS
}
imagedestroy($destination);
}
return (0);
}
if($type == $imagetype[3]) {
$backup = $resized."/".$filename.".png"; // NAME OF BACKUP
copy ($original, $backup); // COPY SOURCE TO BACKUP
$source = imagecreatefrompng($backup); // CREATE IMAGE IDENTIFIER
$sourcex = imagesx($source); // GET WIDTH
$sourcey = imagesy($source); // GET HEIGHT
if($newy == 0) {
if($sourcex > $newx) {
$newy = round(($newx * $sourcey) / $sourcex);
}
else {
$newx = $sourcex;
$newy = $sourcey;
}
}
$destination = imagecreatetruecolor($newx, $newy); // CREATE A NEW TRUE COLOR IMAGE
unlink($backup); // DELETE BACKUP FILE
if(!imagecopyresampled($destination, $source, 0, 0, 0, 0, $newx, $newy, $sourcex, $sourcey)) {
imagedestroy($source); // FREE MEMORY FROM $source
imagedestroy($destination); // FREE MEMORY FROM $destination
return(0); // RETURN ERROR
}
else {
imagedestroy($source);
if(imagepng($destination, $resized."/".$filename.".png")) { // CREATE RESIZED IMAGE
imagedestroy($destination);
$result[0]["width"] = $newx;
$result[0]["height"] = $newy;
$result[0]["name"] = $filename.".png";
return($result); // RETURN SUCCESS
}
imagedestroy($destination);
}
return (0);
}
return(0);
}
/**
* GD2 lib
*/
function checkgd() {
$tmp_dat = gd_info();
if(is_array($tmp_dat) && count($tmp_dat) > 3) {
unset($tmp_dat);
return (1);
}
return(0);
}
}// class end
class pageSort {
var $prev_row = null;
var $prev_filter = null;
var $filter_val = null;
var $letterlinks = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var $numberslink = "0-9";
function pageSort($prev_row, $prev_filter = null) {
$this->prev_row = $prev_row;
$this->prev_filter = $prev_filter;
}
function getListLetters() {
$html = "";
$html .= "\t<table class=\"adminlist\">\r\n";
$html .= "\t<tr><td>\r\n";
$html .= $this->getLettersLinks();
$html .= "\t<input type=\"hidden\" name=\"sort_by\" value=\"".$this->prev_row."\" />\r\n";
$html .= "\t</td></tr>\r\n";
$html .= "\t</table>\r\n";
return ($html);
}
function getFilter() {
$html = "";
$html .= "\t<table class=\"adminlist\">\r\n";
$html .= "\t<tr><td>\r\n";
$html .= $this->getFilterInput();
$html .= "\t</td></tr>\r\n";
$html .= "\t</table>\r\n";
return ($html);
}
function getLettersLinks() {
$html = "";
$start_ch = "[";
$end_ch = "]";
$separator_ch = "|";
$html .= "\t<span class=\"pagenav\">".$start_ch."</span>\r\n";
if($this->prev_row != $this->numberslink && is_numeric($this->prev_row)) {
$this->prev_row = $this->numberslink;
}
if($this->prev_row == $this->numberslink) {
$html .= "\t<span class=\"pagenav\">".$this->numberslink."</span>\r\n";
}
else {
$html .= "\t<a href=\"#number\" class=\"pagenav\" onClick=\"javascript: document.adminForm.sort_by.value='".$this->numberslink."'; document.adminForm.filter_by.value=''; document.adminForm.submit(); return false;\">".$this->numberslink."</a>\r\n";
}
$tmp_str = $this->letterlinks;
for($i = 0; $i < strlen($tmp_str); $i++) {
if($tmp_str[$i] == $this->prev_row) {
$html .= "\t<span class=\"pagenav\">".$separator_ch."</span>\r\n";
$html .= "\t<span class=\"pagenav\">".$tmp_str[$i]."</span>\r\n";
}
else {
$html .= "\t<span class=\"pagenav\">".$separator_ch."</span>\r\n";
$html .= "\t<a href=\"#".$tmp_str[$i]."\" class=\"pagenav\" onClick=\"javascript: document.adminForm.sort_by.value='".$tmp_str[$i]."'; document.adminForm.filter_by.value=''; document.adminForm.submit(); return false;\">".$tmp_str[$i]."</a>\r\n";
}
}
$html .= "\t<span class=\"pagenav\">".$separator_ch."</span>\r\n";
$html .= "\t<a href=\"#all\" class=\"pagenav\" onClick=\"javascript: document.adminForm.sort_by.value=''; document.adminForm.filter_by.value=''; document.adminForm.submit(); return false;\">...</a> ".$end_ch."\r\n";
return ($html);
}
function getFilterInput() {
$html = "\t<span class=\"pagenav\"><b>Filter:</b> <input class=\"text_area\" type=\"text\" name=\"filter_by\" maxlength=\"20\" size=\"25\" value=\"".$this->prev_filter."\" /></span>\r\n";
return ($html);
}
}// end of class
?>
Je comprends vraiment pas merci pour votre aide
Bonjour à tous,
J'ai un composant Joomla qui est une galerie images mais les images sont compressé et c'est pas très jolie, j'ai cherché comment faire pour garder une bonne qualité mais je trouve PAS, dès fois je suis un peu une bêbete :oops:
le script est :
[code]<?php
/**
**/
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
class Config {
var $_configFile = null;
var $tabs = null;
var $selectgallery = null;
var $usertype = null;
var $published = null;
var $max_image_size = null;
var $tmb_image_wd = null;
var $tmb_image_hg = null;
var $slaids_text = null;
var $slaids_wait = null;
var $slaids_duration = null;
var $slaids_effect = null;
var $slaids_transitions = null;
var $slaids_direction = null;
var $slaids_tmbcolumn = null;
var $slaids_tmbrows = null;
var $img_image_wd0 = null;
var $img_image_hg0 = null;
var $tmb_image_wd0 = null;
var $tmb_image_hg0 = null;
var $slaids_textPosTop = null;
var $slaids_textPosLeft = null;
var $slaids_textWrapPosTop = null;
var $slaids_textWrapPosLeft = null;
var $slaids_textWrapWidth = null;
var $slaids_textWrapHeight = null;
var $slaids_textWrapBorder = null;
var $slaids_textWrapBackground = null;
var $fe_columnAmount = null;
var $smoothg_delay = null;
var $smoothg_duration = null;
var $smoothg_slideshow = null;
var $smoothg_carousel = null;
var $smoothg_infopane = null;
var $smoothg_links = null;
var $smoothg_slideinfo = null;
var $smoothg_caropacity = null;
var $smoothg_caropacitybig = null;
var $smoothg_carheight = null;
var $img_image_wd1 = null;
var $img_image_hg1 = null;
var $smoothg_tmbimgwd = null;
var $smoothg_tmbimghg = null;
var $smoothg_tmbimgspacing = null;
function Config(){
global $mosConfig_absolute_path;
$this->_configFile = $mosConfig_absolute_path."/administrator/components/com_expgallery/config.expgallery.php";
}
function load()
{
require_once($this->_configFile);
$this->selectgallery = $selectgallery;
$this->usertype = $usertype;
$this->published = $published;
$this->max_image_size = $max_image_size;
$this->tmb_image_wd = $tmb_image_wd;
$this->tmb_image_hg = $tmb_image_hg;
$this->slaids_text = $slaids_text;
$this->slaids_wait = $slaids_wait;
$this->slaids_duration = $slaids_duration;
$this->slaids_effect = $slaids_effect;
$this->slaids_transitions = $slaids_transitions;
$this->slaids_direction = $slaids_direction;
$this->slaids_tmbcolumn = $slaids_tmbcolumn;
$this->slaids_tmbrows = $slaids_tmbrows;
$this->img_image_wd0 = $img_image_wd0;
$this->img_image_hg0 = $img_image_hg0;
$this->tmb_image_wd0 = $tmb_image_wd0;
$this->tmb_image_hg0 = $tmb_image_hg0;
$this->slaids_textPosTop = $slaids_textPosTop;
$this->slaids_textPosLeft = $slaids_textPosLeft;
$this->slaids_textWrapPosTop = $slaids_textWrapPosTop;
$this->slaids_textWrapPosLeft = $slaids_textWrapPosLeft;
$this->slaids_textWrapWidth = $slaids_textWrapWidth;
$this->slaids_textWrapHeight = $slaids_textWrapHeight;
$this->slaids_textWrapBorder = $slaids_textWrapBorder;
$this->slaids_textWrapBackground = $slaids_textWrapBackground;
$this->fe_columnAmount = $fe_columnAmount;
$this->smoothg_delay = $smoothg_delay;
$this->smoothg_duration = $smoothg_duration;
$this->smoothg_slideshow = $smoothg_slideshow;
$this->smoothg_carousel = $smoothg_carousel;
$this->smoothg_infopane = $smoothg_infopane;
$this->smoothg_links = $smoothg_links;
$this->smoothg_slideinfo = $smoothg_slideinfo;
$this->smoothg_caropacity = $smoothg_caropacity;
$this->smoothg_caropacitybig = $smoothg_caropacitybig;
$this->smoothg_carheight = $smoothg_carheight;
$this->img_image_wd1 = $img_image_wd1;
$this->img_image_hg1 = $img_image_hg1;
$this->smoothg_tmbimgwd = $smoothg_tmbimgwd;
$this->smoothg_tmbimghg = $smoothg_tmbimghg;
$this->smoothg_tmbimgspacing = $smoothg_tmbimgspacing;
}
function save($option)
{
@chmod ($this->_configFile, 0766);
$permission = is_writable($this->_configFile);
if (!$permission) {
mosRedirect("index2.php?option=$option&act=settings", 'Config file not writeable!');
break;
}
$config = "<?php\n";
$config .= "\$selectgallery = '" . $_POST['selectgallery'] . "';\n";
$config .= "\$usertype = '" . $_POST['usertype'] . "';\n";
$config .= "\$published = '" . $_POST['published'] . "';\n";
$config .= "\$max_image_size = '" . $_POST['max_image_size'] . "';\n";
$config .= "\$tmb_image_wd = '" . $_POST['tmb_image_wd'] . "';\n";
$config .= "\$tmb_image_hg = '" . $_POST['tmb_image_hg'] . "';\n";
$config .= "\$slaids_text = '" . $_POST['slaids_text'] . "';\n";
$config .= "\$slaids_wait = '" . $_POST['slaids_wait'] . "';\n";
$config .= "\$slaids_duration = '" . $_POST['slaids_duration'] . "';\n";
$config .= "\$slaids_effect = '" . $_POST['slaids_effect'] . "';\n";
$config .= "\$slaids_transitions = '" . $_POST['slaids_transitions'] . "';\n";
$config .= "\$slaids_direction = '" . $_POST['slaids_direction'] . "';\n";
$config .= "\$slaids_tmbcolumn = '" . $_POST['slaids_tmbcolumn'] . "';\n";
$config .= "\$slaids_tmbrows = '" . $_POST['slaids_tmbrows'] . "';\n";
$config .= "\$img_image_wd0 = '" . $_POST['img_image_wd0'] . "';\n";
$config .= "\$img_image_hg0 = '" . $_POST['img_image_hg0'] . "';\n";
$config .= "\$tmb_image_wd0 = '" . $_POST['tmb_image_wd0'] . "';\n";
$config .= "\$tmb_image_hg0 = '" . $_POST['tmb_image_hg0'] . "';\n";
$config .= "\$slaids_textPosTop = '" . $_POST['slaids_textPosTop'] . "';\n";
$config .= "\$slaids_textPosLeft = '" . $_POST['slaids_textPosLeft'] . "';\n";
$config .= "\$slaids_textWrapPosTop = '" . $_POST['slaids_textWrapPosTop'] . "';\n";
$config .= "\$slaids_textWrapPosLeft = '" . $_POST['slaids_textWrapPosLeft'] . "';\n";
$config .= "\$slaids_textWrapWidth = '" . $_POST['slaids_textWrapWidth'] . "';\n";
$config .= "\$slaids_textWrapHeight = '" . $_POST['slaids_textWrapHeight'] . "';\n";
$config .= "\$slaids_textWrapBorder = '" . $_POST['slaids_textWrapBorder'] . "';\n";
$config .= "\$slaids_textWrapBackground = '" . $_POST['slaids_textWrapBackground'] . "';\n";
$config .= "\$fe_columnAmount = '" . $_POST['fe_columnAmount'] . "';\n";
$config .= "\$smoothg_delay = '" . $_POST['smoothg_delay'] . "';\n";
$config .= "\$smoothg_duration = '" . $_POST['smoothg_duration'] . "';\n";
$config .= "\$smoothg_slideshow = '" . $_POST['smoothg_slideshow'] . "';\n";
$config .= "\$smoothg_carousel = '" . $_POST['smoothg_carousel'] . "';\n";
$config .= "\$smoothg_infopane = '" . $_POST['smoothg_infopane'] . "';\n";
$config .= "\$smoothg_links = '" . $_POST['smoothg_links'] . "';\n";
$config .= "\$smoothg_slideinfo = '" . $_POST['smoothg_slideinfo'] . "';\n";
$config .= "\$smoothg_caropacity = '" . $_POST['smoothg_caropacity'] . "';\n";
$config .= "\$smoothg_caropacitybig = '" . $_POST['smoothg_caropacitybig'] . "';\n";
$config .= "\$smoothg_carheight = '" . $_POST['smoothg_carheight'] . "';\n";
$config .= "\$img_image_wd1 = '" . $_POST['img_image_wd1'] . "';\n";
$config .= "\$img_image_hg1 = '" . $_POST['img_image_hg1'] . "';\n";
$config .= "\$smoothg_tmbimgwd = '" . $_POST['smoothg_tmbimgwd'] . "';\n";
$config .= "\$smoothg_tmbimghg = '" . $_POST['smoothg_tmbimghg'] . "';\n";
$config .= "\$smoothg_tmbimgspacing = '" . $_POST['smoothg_tmbimgspacing'] . "';\n";
$config .= "?>\n";
if ($fp = fopen($this->_configFile, "w")) {
fputs($fp, $config, strlen($config));
fclose ($fp);
}
mosRedirect("index2.php?option=$option&act=settings", 'Settings saved.');
}
} // class end
class expgalleryCategories extends mosDBTable {
var $id = null;
var $name = null;
var $url_img = null;
var $published = null;
function expgalleryCategories(&$db){
$this->mosDBTable('#__expgallery_categories', 'id', $db);
}
} // class end
class expgalleryAds extends mosDBTable {
var $id = null;
var $user_id = null;
var $cat_id = null;
var $name = null;
var $description = null;
var $date_crt = null;
var $published = null;
function expgalleryAds(&$db){
$this->mosDBTable('#__expgallery_ads', 'id', $db);
}
} // class end
class expgalleryImg extends mosDBTable {
var $id = null;
var $ad_id = null;
var $url_big = null;
var $url_img = null;
var $url_tmb = null;
var $img_width = null;
var $img_height = null;
var $tmb_width = null;
var $tmb_height = null;
function expgalleryImg(&$db){
$this->mosDBTable('#__expgallery_img', 'id', $db);
}
} // class end
class ImageOptions {
function isAllowable(&$file, $keyname) {
$allowable = array ('jpg', 'gif', 'png');
$extension = substr(trim($file[$keyname]["name"]), -3);
foreach($allowable as $val) {
if(strcasecmp($val, $extension) == 0)
return(1);
}
return(0);
}
function resize($filename, $original, $newx, $newy, $resized, $mod=0) {
$result = array();
if(strlen($filename)) {
if($mod == 0) {
$filename = substr($filename, 0, strlen($filename) - 4);
$filename .= "_".mktime();
}
if($mod == 1) {
$filename = substr($filename, 0, strlen($filename) - 4);
$filename .= "_".mktime()."_t";
}
}
$imagetype = array( 1 => '1', 2 => '2', 3 => '3');
list($orgWidth, $orgHeight, $type, $attr) = getimagesize($original);
if($type == $imagetype[2]) {
$backup = $resized."/".$filename.".jpg"; // NAME OF BACKUP
copy ($original, $backup); // COPY SOURCE TO BACKUP
$source = imagecreatefromjpeg($backup); // CREATE IMAGE IDENTIFIER
$sourcex = imagesx($source); // GET WIDTH
$sourcey = imagesy($source); // GET HEIGHT
if($newy == 0) {
if($sourcex > $newx) {
$newy = round(($newx * $sourcey) / $sourcex);
}
else {
$newx = $sourcex;
$newy = $sourcey;
}
}
$destination = imagecreatetruecolor($newx, $newy); // CREATE A NEW TRUE COLOR IMAGE
unlink($backup); // DELETE BACKUP FILE
if(!imagecopyresampled($destination, $source, 0, 0, 0, 0, $newx, $newy, $sourcex, $sourcey)) {
imagedestroy($source); // FREE MEMORY FROM $source
imagedestroy($destination); // FREE MEMORY FROM $destination
return(0); // RETURN ERROR
}
else {
imagedestroy($source);
if(imagejpeg($destination, $resized."/".$filename.".jpg")) { // CREATE RESIZED IMAGE
imagedestroy($destination);
$result[0]["width"] = $newx;
$result[0]["height"] = $newy;
$result[0]["name"] = $filename.".jpg";
return($result); // RETURN SUCCESS
}
imagedestroy($destination);
}
return (0);
}
if($type == $imagetype[1]) {
$backup = $resized."/".$filename.".gif"; // NAME OF BACKUP
copy ($original, $backup); // COPY SOURCE TO BACKUP
$source = imagecreatefromgif($backup); // CREATE IMAGE IDENTIFIER
$sourcex = imagesx($source); // GET WIDTH
$sourcey = imagesy($source); // GET HEIGHT
if($newy == 0) {
if($sourcex > $newx) {
$newy = round(($newx * $sourcey) / $sourcex);
}
else {
$newx = $sourcex;
$newy = $sourcey;
}
}
$destination = imagecreatetruecolor($newx, $newy); // CREATE A NEW TRUE COLOR IMAGE
unlink($backup); // DELETE BACKUP FILE
if(!imagecopyresampled($destination, $source, 0, 0, 0, 0, $newx, $newy, $sourcex, $sourcey)) {
imagedestroy($source); // FREE MEMORY FROM $source
imagedestroy($destination); // FREE MEMORY FROM $destination
return(0); // RETURN ERROR
}
else {
imagedestroy($source);
if(imagegif($destination, $resized."/".$filename.".gif")) { // CREATE RESIZED IMAGE
imagedestroy($destination);
$result[0]["width"] = $newx;
$result[0]["height"] = $newy;
$result[0]["name"] = $filename.".gif";
return($result); // RETURN SUCCESS
}
imagedestroy($destination);
}
return (0);
}
if($type == $imagetype[3]) {
$backup = $resized."/".$filename.".png"; // NAME OF BACKUP
copy ($original, $backup); // COPY SOURCE TO BACKUP
$source = imagecreatefrompng($backup); // CREATE IMAGE IDENTIFIER
$sourcex = imagesx($source); // GET WIDTH
$sourcey = imagesy($source); // GET HEIGHT
if($newy == 0) {
if($sourcex > $newx) {
$newy = round(($newx * $sourcey) / $sourcex);
}
else {
$newx = $sourcex;
$newy = $sourcey;
}
}
$destination = imagecreatetruecolor($newx, $newy); // CREATE A NEW TRUE COLOR IMAGE
unlink($backup); // DELETE BACKUP FILE
if(!imagecopyresampled($destination, $source, 0, 0, 0, 0, $newx, $newy, $sourcex, $sourcey)) {
imagedestroy($source); // FREE MEMORY FROM $source
imagedestroy($destination); // FREE MEMORY FROM $destination
return(0); // RETURN ERROR
}
else {
imagedestroy($source);
if(imagepng($destination, $resized."/".$filename.".png")) { // CREATE RESIZED IMAGE
imagedestroy($destination);
$result[0]["width"] = $newx;
$result[0]["height"] = $newy;
$result[0]["name"] = $filename.".png";
return($result); // RETURN SUCCESS
}
imagedestroy($destination);
}
return (0);
}
return(0);
}
/**
* GD2 lib
*/
function checkgd() {
$tmp_dat = gd_info();
if(is_array($tmp_dat) && count($tmp_dat) > 3) {
unset($tmp_dat);
return (1);
}
return(0);
}
}// class end
class pageSort {
var $prev_row = null;
var $prev_filter = null;
var $filter_val = null;
var $letterlinks = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var $numberslink = "0-9";
function pageSort($prev_row, $prev_filter = null) {
$this->prev_row = $prev_row;
$this->prev_filter = $prev_filter;
}
function getListLetters() {
$html = "";
$html .= "\t<table class=\"adminlist\">\r\n";
$html .= "\t<tr><td>\r\n";
$html .= $this->getLettersLinks();
$html .= "\t<input type=\"hidden\" name=\"sort_by\" value=\"".$this->prev_row."\" />\r\n";
$html .= "\t</td></tr>\r\n";
$html .= "\t</table>\r\n";
return ($html);
}
function getFilter() {
$html = "";
$html .= "\t<table class=\"adminlist\">\r\n";
$html .= "\t<tr><td>\r\n";
$html .= $this->getFilterInput();
$html .= "\t</td></tr>\r\n";
$html .= "\t</table>\r\n";
return ($html);
}
function getLettersLinks() {
$html = "";
$start_ch = "[";
$end_ch = "]";
$separator_ch = "|";
$html .= "\t<span class=\"pagenav\">".$start_ch."</span>\r\n";
if($this->prev_row != $this->numberslink && is_numeric($this->prev_row)) {
$this->prev_row = $this->numberslink;
}
if($this->prev_row == $this->numberslink) {
$html .= "\t<span class=\"pagenav\">".$this->numberslink."</span>\r\n";
}
else {
$html .= "\t<a href=\"#number\" class=\"pagenav\" onClick=\"javascript: document.adminForm.sort_by.value='".$this->numberslink."'; document.adminForm.filter_by.value=''; document.adminForm.submit(); return false;\">".$this->numberslink."</a>\r\n";
}
$tmp_str = $this->letterlinks;
for($i = 0; $i < strlen($tmp_str); $i++) {
if($tmp_str[$i] == $this->prev_row) {
$html .= "\t<span class=\"pagenav\">".$separator_ch."</span>\r\n";
$html .= "\t<span class=\"pagenav\">".$tmp_str[$i]."</span>\r\n";
}
else {
$html .= "\t<span class=\"pagenav\">".$separator_ch."</span>\r\n";
$html .= "\t<a href=\"#".$tmp_str[$i]."\" class=\"pagenav\" onClick=\"javascript: document.adminForm.sort_by.value='".$tmp_str[$i]."'; document.adminForm.filter_by.value=''; document.adminForm.submit(); return false;\">".$tmp_str[$i]."</a>\r\n";
}
}
$html .= "\t<span class=\"pagenav\">".$separator_ch."</span>\r\n";
$html .= "\t<a href=\"#all\" class=\"pagenav\" onClick=\"javascript: document.adminForm.sort_by.value=''; document.adminForm.filter_by.value=''; document.adminForm.submit(); return false;\">...</a> ".$end_ch."\r\n";
return ($html);
}
function getFilterInput() {
$html = "\t<span class=\"pagenav\"><b>Filter:</b> <input class=\"text_area\" type=\"text\" name=\"filter_by\" maxlength=\"20\" size=\"25\" value=\"".$this->prev_filter."\" /></span>\r\n";
return ($html);
}
}// end of class
?>
[/code]
Je comprends vraiment pas merci pour votre aide