Author Topic: watermark when showing pic  (Read 54602 times)

0 Members and 1 Guest are viewing this topic.

TheOracle

  • Guest
Re: watermark when showing pic
« Reply #45 on: September 14, 2005, 02:41:47 AM »
Quote

ll we want is prevent the direct access from standard users


If it's the case, then I'd strongly advise you re-evaluate your codes again as no restrictions has been set-up in order to block anonymous visits on that MOD. ;)

Quote

so i think no secure systems are required for this last mod


It is up to you of course. Althought, I'd still recommend that you do so. ;)

Offline okram

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: watermark when showing pic
« Reply #46 on: September 14, 2005, 02:57:46 AM »
no restrictions has been set-up in order to block anonymous visits on that MOD. ;)
Yes there have... in the watermark.php file we check the existance of the $_SESSION['_access_is_correct']-variable... if it hasn't been set... then we don not show the pic, but an error message... i chose the page_header.php file to set our variable, because this page is included in all the gallery php-files, just to mention: details.php, postcard.php, etc etc... BUT it is not included at all in the watermark file, so if the user type the url http://mysite.com/gallery/watermark.php?id=353 wont see any image as long as the variable does not exists... Standard users won't know of course how to create this variable manually... and in page_footer.php, which is also include in all pages, we unset the variable just in case it is set yet... i think it's enough with that

It is up to you of course. Althought, I'd still recommend that you do so. ;)
I stand by what i said before... i do not come to a reason for highly-prottecting this file...

The only thing i care in this mod is avoid users access to unmarked images...

Regards

TheOracle

  • Guest
Re: watermark when showing pic
« Reply #47 on: September 14, 2005, 03:05:50 AM »
Quote

$_SESSION['_access_is_correct']


You should really replace that

with :

Code: [Select]

$user_info['user_level'] != GUEST


instead. ;)

Quote

i think it's enough with that


Sure. Have a good one. 8)

Offline okram

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: watermark when showing pic
« Reply #48 on: September 14, 2005, 06:13:29 AM »
Quote
Quote

$_SESSION['_access_is_correct']



You should really replace that

with :


Code:

$user_info['user_level'] != GUEST


instead.


I've done a general overview of the last 20 posts in this topic, and I've come to the conclussion that there's a misunderstanding with the direct-access-prevent stuff... when we say we want to prevent the direct access to the watermark php-file we are not talking about the user level... i mean guests, registered users or admins... I think you TheOracle understood all this like that.

When saying direct-access we are talking about accessing the WMark file by writting the url in the browser...

Quote
no restrictions has been set-up in order to block anonymous visits on that MOD.

I guess you mean unregistered users when you say {anonymous visits}... In fact, we dont care if the user is registered or not, logged in or not... I think that can be well configured from the 4images control panel... As i said, all we want to do is avoid direct accessing by typing the watermark.php URL in the browser...

That's why i check a  session var instead of checking the user level...

Quote
$user_info['user_level'] != GUEST

The reason to prevent this direct access is just to avoid massive downloads of pics out of the details.php page, which is bound to show the images...

P.D. Sorry 4 my bad english  :lol: ... in fact i'm a spanish speaker  :?

TheOracle

  • Guest
Re: watermark when showing pic
« Reply #49 on: September 14, 2005, 11:48:40 AM »
My earlier posts was simply about suggested / recommended technics since you wish to use it under 4images. ;)

Offline marius26

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://www.steves-network.net
Re: watermark when showing pic
« Reply #50 on: December 20, 2005, 05:56:09 PM »
did u try add in jpg.html template:
Code: [Select]
<img src="watermark.php?get_image={media_src}"> ? (make sure watermark.php is located in 4images root directory.)

works like a charm, no problems , check on my site, click on pic at the bottom to see this script in action.

Offline Lukazs

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: watermark when showing pic
« Reply #51 on: December 25, 2006, 11:39:11 AM »
Hi,

Is it possible to use only one of this script ability to not show full patch to image? I'm talking about watermark.php?image_id=xxx, this works great for images but how to set it to show other files? It's no needed to add watermark, just image_id=xx instead of data/media/489/game_shooting.swf in the end of site url.

Thanks.  :wink: :oops: 8O

Offline Benjamin

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: watermark when showing pic
« Reply #52 on: April 20, 2007, 06:32:38 PM »
Hi all!

First of all I want to thank the topicstarter and the people who gave help! So...Thanks! Because the main meaning of the Mod is working for me, but there is a problem:

The things I did:

- put the 'watermark.php' in the 4images root
- put a 'watermark.png' image in the 4images root
- added the line (<img src="watermark.php?get_image={media_src}">) in jpg.html

Everything is working BUT the uploaded photo is now posted 2 times, under eachother :S It looks like this -> http://www.relic-hunters.nl/gallery/details.php?image_id=3

How do I get rid of that?

Friendly regards,
Benjamin

P.S. Sorry for my bad English!

Offline Benjamin

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: watermark when showing pic
« Reply #53 on: April 20, 2007, 06:47:01 PM »
hi,
this mod is better
http://www.4homepages.de/forum/index.php?topic=13719.0

gruss ivan

Is it ? I can't even find Instalation Notes... Don't know how to install it if the docs aren't there... :oops:

Offline Benjamin

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: watermark when showing pic
« Reply #54 on: April 20, 2007, 07:46:08 PM »
Thank you very much! Got the wrong instalation files...because the info wasn't there... Downloaded it from another place.

It's working now! Thank you! :D

Offline almighty7

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: watermark when showing pic
« Reply #55 on: March 01, 2009, 10:54:40 PM »
hmmm...I just got an idea about download thingie...
what if u rename in download.php
Code: [Select]
function get_file_data($file_path) {to function get_file_data2($file_path) {
and above that line add this:
Code: [Select]
function get_file_data($image)
{
  $types = array(1 => "gif", 2 => "jpeg", 3 => "png");
  if ($image_info = @getimagesize($image))
  {
    $image_create_handle = "imagecreatefrom".$types[$image_info[2]];
    if (!$im2 = @$image_create_handle($image))
    {
      die("Error opening $image!");
    }
 
    imagecopy($im2, $im, (imagesx($im2)/100)-(imagesx($im)/100), (imagesy($im2)/100)-(imagesy($im)/100), 0, 0, imagesx($im), imagesy($im));
   
    if($_GET[repeat])
    {
      $waterless = imagesx($im2) - imagesx($im);
      $rest = ceil($waterless/imagesx($im)/1);
     
      for($n=1; $n<=$rest; $n++)
      {
        imagecopy($im2, $im, ((imagesx($im2)/100)-(imagesx($im)/100))-(imagesx($im)*$n), (imagesy($im2)/100)-(imagesy($im)/100), 0, 0, imagesx($im), imagesy($im));
        imagecopy($im2, $im, ((imagesx($im2)/100)-(imagesx($im)/100))+(imagesx($im)*$n), (imagesy($im2)/100)-(imagesy($im)/100), 0, 0, imagesx($im), imagesy($im));
      }
    }
    ob_start();
    @ob_implicit_flush(0);
    imagejpeg($im2);
    $file_data = ob_get_contents();
    ob_end_clean();
    imagedestroy($im);
    imagedestroy($im2);
    return $file_data;
  }
  else
  {
    return get_file_data2($image);
  }
}

:?:

I tried to do this, but I don't find the lines in the download.php. That's because I have 4images 1.7.6.

I have a mod that makes an annotation over a watermark.php file (a transparent PNG). Unfortenately I want the Watermark to appear on the downloaded image, too, but I don't want to brand the pictures with the annotation (because I want to use the original ones for another thing).

Can anybody help me