Placement of the watermark image in the site.
5 posters
Page 1 of 1
Placement of the watermark image in the site.
Where to put this code to work in my forum?
- Code:
<?php
$main_img = "YourMainPicture.jpg"; // главното изображение
$watermark_img = "watermark.gif"; // Изображението , което се използва за воден знак . Използвайте GIF или PNG, JPEG няма подръжка на прозрачност
$padding = 3; // разстоянието до border в пиксели за изображението на водния знак
$opacity = 100; // прозрачността на водния знак
$watermark = imagecreatefromgif($watermark_img); // прави водния знак
$image = imagecreatefromjpeg($main_img); // прави главното изображение
if(!$image || !$watermark) die("Error: main image or watermark could not be loaded!");
$watermark_size = getimagesize($watermark_img);
$watermark_width = $watermark_size[0];
$watermark_height = $watermark_size[1];
$image_size = getimagesize($main_img);
$dest_x = $image_size[0] - $watermark_width - $padding;
$dest_y = $image_size[1] - $watermark_height - $padding;
// копира водния знак и го поставя в главното изображение
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $opacity);
// изкарва изображението
header("content-type: image/jpeg");
imagejpeg($image);
imagedestroy($image);
imagedestroy($watermark);
?>
Re: Placement of the watermark image in the site.
Hi @smurfavr,
That's a PHP file, so unfortunately you wont be able to install it anywhere in the administration panel.
That's a PHP file, so unfortunately you wont be able to install it anywhere in the administration panel.
Re: Placement of the watermark image in the site.
How can i add watermark on my forum, i tried everything and it didnt work
Worst Nightmare- Forumember
- Posts : 107
Reputation : 2
Language : English
Re: Placement of the watermark image in the site.
Ange Tuteur wrote:Hi @smurfavr,
That's a PHP file, so unfortunately you wont be able to install it anywhere in the administration panel.
If you read the above posts you would see the code wont work because its a php. That would explain why didnt work. |_Twisted_Mods_ wrote:what is this code suppose to do?
Re: Placement of the watermark image in the site.
Can anybody give a similar code that will work on my site.
psp
This code that will happen?
http://www.patrick-wied.at/static/watermarkjs/
Or this.
Javascript
HTML:
psp
This code that will happen?
http://www.patrick-wied.at/static/watermarkjs/
Or this.
Javascript
- Code:
function watermark(inputId,text){
var inputBox = document.getElementById(inputId);
if (inputBox.value.length > 0){
if (inputBox.value == text)
inputBox.value = '';
}
else
inputBox.value = text;
}
HTML:
- Code:
<input id="inputTextboxId" type="text" value="type here" onfocus="watermark('inputTextboxId','type here');" onblur="watermark('inputTextboxId','type here');" />
Last edited by smurfavr on Mon 23 Feb - 16:39; edited 1 time in total
Re: Placement of the watermark image in the site.
I did not understand what you're saying. I use gogle translator._Twisted_Mods_ wrote:is this just for in topics?
Re: Placement of the watermark image in the site.
Do you only want it to show when someone is reading a topic?
Remember to mark your topic when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?
Team Leader
Review Section Rules | Request A Review | Sticker Points
Re: Placement of the watermark image in the site.
k this work on phpbb2 in topics only
goto acp>modules>javascript management
create a new script
title:Your Choice
Placement: in topics
copy and paste the code below then save
you can change the url in imgurl to what ever image you would like for the copyright
goto acp>modules>javascript management
create a new script
title:Your Choice
Placement: in topics
copy and paste the code below then save
- Code:
$(function(){
$('.post .postbody img').each(function(index){
var imgurl = 'https://www.filepicker.io/api/file/wTmT0TT6ELnUrZ1SwyYC+copyrights.png';
var height = $(this).height();
var position = $(this).position();
var width = $(this).width();
$(this).wrap('<div id="imgwrap" style="display: inline-block;position: relative;height:'+height+';width:'+width+'"></div>').parent().append('<span id="imgoverlay" style="background-image:url('+imgurl+'); position:absolute;height:100%;width:100%;left:0px;top:0px">');
});
});
you can change the url in imgurl to what ever image you would like for the copyright
Re: Placement of the watermark image in the site.
Image has a lot of watermarks. How to do it to show only one watermark? How can I change the place where to be, watermark?
Re: Placement of the watermark image in the site.
use css
- Code:
#imgoverlay{
background-repeat:no-repeat;
background-position: 50% 50%
}
Re: Placement of the watermark image in the site.
How can I change the place where to be, watermark? Can you image the code should be replaced with text that can be changed?
Re: Placement of the watermark image in the site.
yea u can use this one for text
var text = '� CopyRight'; << this is the text that will overlay the images
var color = 'rgba(255,255,255,0.2)'; << font color with 0.2 transparency
var fontsize = '14px'; << font size
var position = 'center'; << text align (left,right,center)
- Code:
$(function () {
$('.post .postbody img').each(function (index) {
var text = '� CopyRight';
var color = 'rgba(255,255,255,0.2)';
var fontsize = '14px';
var position = 'center';
var height = $(this).height();
var top = height / 2;
var width = $(this).width();
$(this).wrap('<div id="imgwrap" style=";display: inline-block;position: relative;height:' + height + 'px;width:' + width + 'px"></div>').parent().append('<span id="imgoverlay" style="font-size:' + fontsize + ';color:' + color + ';text-align:' + position + ';margin-left:5px;position:absolute;height:' + height + 'px;width:' + (width - 10) + 'px;left:0px;top:' + top + 'px">'+text+'</span>');
});
});
var text = '� CopyRight'; << this is the text that will overlay the images
var color = 'rgba(255,255,255,0.2)'; << font color with 0.2 transparency
var fontsize = '14px'; << font size
var position = 'center'; << text align (left,right,center)
Re: Placement of the watermark image in the site.
Can be done watermark remains in the picture when some copy it from my website. Can the inscription of the image is always placed in the lower right corner of the photo.
Similar topics
» Watermark on the photos.
» Change the placement of the image in the character sheet
» Site friend image
» Site supervisor rank image
» [phpbb3] How to change the name of my site on a window? (see image inside, can't explain it thoroughly)
» Change the placement of the image in the character sheet
» Site friend image
» Site supervisor rank image
» [phpbb3] How to change the name of my site on a window? (see image inside, can't explain it thoroughly)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum