PDA

View Full Version : Listing status plugin



Andreas_M
September 30, 2012, 12:22 PM
Hello,


have a question and also some ideas for next versions of the listing status plugin.

- How can I change the position of the watermark? Would like to set it top/left corner.

Maybe some of the following would be great at next version:
- Selectable the positions of the watermark
- Integrate listing status with listing plans. For new listings it would be possible to choose something like "lastminute" for home vacations.


Best regards
Andreas

Mike
October 1, 2012, 07:01 AM
Hello Andreas,

Thank you for participation, it's unfortunately not easy and require additional coding to the software to make the change. I think it's good idea to have ability to change it in the plugin.

But it will not be in the plugin in next versions before the software update because it's not enough to make changes to the plugin but we have to change software itself to make this possible.
In case you want to hardcode some conditions to make it for your specific statuses i can help with instructions.

Andreas_M
October 1, 2012, 05:54 PM
Hi Mike,


didn

Andreas_M
October 1, 2012, 05:54 PM
Hi Mike,


didnt know, that the changes would make so much work. But the plugin would be more comfortable with the functionality.
In my case, I just need the watermark in the upper left corner. Similar to the featured watermark.


Best regards
Andreas

Mike
October 2, 2012, 12:08 PM
You have to look into classes/rlResize.class.php

find function



function saveImage()
{


inside the function find code




if ( $watermark )
{
list($watermark_width,$watermark_height) = getimagesize($w_source);
$image = $this->resResizedImage;

$dest_x = $this->arrResizedDetails[0] - $watermark_width - 5;
$dest_y = $this->arrResizedDetails[1] - $watermark_height - 5;

//imagealphablending($image, false);
imagesavealpha($this->resResizedImage, true);
imagecopyresampled($this->resResizedImage, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $watermark_width, $watermark_height);

/* clear memory */
imagedestroy($watermark);
}


try to change to




if ( $watermark )
{
list($watermark_width,$watermark_height) = getimagesize($w_source);
$image = $this->resResizedImage;

$dest_x = $watermark_width - 5;
$dest_y = $watermark_height - 5;

//imagealphablending($image, false);
imagesavealpha($this->resResizedImage, true);
imagecopyresampled($this->resResizedImage, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $watermark_width, $watermark_height);

/* clear memory */
imagedestroy($watermark);
}



But it will affect all watermarks, if you want it to specific statuses you have to put condition to $w_source variable and change positions


something like



if( $w_source == '/path/to/default/watermark/watermark.png' )
{
$dest_x = $this->arrResizedDetails[0] - $watermark_width - 5;
$dest_y = $this->arrResizedDetails[1] - $watermark_height - 5;
}elseif( $w_source == '/path/to/Sold/watermark/sold.png' )
{
$dest_x = $watermark_width - 20;
$dest_y = $watermark_height - 20;
}

Andreas_M
October 2, 2012, 06:41 PM
Hello Mike,


I tried it, but it has no effect to the listing status watermark.

Andreas_M
October 2, 2012, 06:55 PM
Hi,


now it works. changed the following:



$dest_x = $watermark_width - 70;
$dest_y = $watermark_height - 41;

Mike
October 3, 2012, 06:15 AM
I'm glad that you sorted it on your own :) sorry for mistake.

Andreas_M
October 3, 2012, 12:14 PM
No problem, so I will learn a little more.
I am not so good at coding, but my quota in try and error / fixing is acceptable ;-)