Author Topic: {image_id}  (Read 17356 times)

0 Members and 1 Guest are viewing this topic.

Offline Lukazs

  • Newbie
  • *
  • Posts: 46
    • View Profile
{image_id}
« on: June 01, 2006, 03:38:03 PM »
Hi, i have done that jpg images would be shown as {image_id} (not {media_src} )  i meen <img src="watermark.php?image_id={image_id}"{limit_var}="{new_limit}" border="0">, but how to do that .swf files would be shown like {image_id}

If u dont understand me, please ask, i will try to explain.

Thank u .

Lukazs

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: {image_id}
« Reply #1 on: June 02, 2006, 12:06:06 AM »
I guess, this question is belong to the topic where you got your "watermark.php", because that is the only code you'll need to change to add support for .swf or other formats.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Lukazs

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: {image_id}
« Reply #2 on: June 06, 2006, 10:15:04 AM »
I guess, this question is belong to the topic where you got your "watermark.php", because that is the only code you'll need to change to add support for .swf or other formats.

Yes, You understand me like i wanted. But when I put {image_id} in template to play swf files:

    <td bgcolor="#000000">
     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="560" height="550" />
      <param name="movie" value="{image_id}" >
      <param name="quality" value="high" >
      <param name="play" value="true" >
      <param name="scale" value="false" >
      <embed src="{image_id}" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="560" height="550"  type="application/x-shockwave-flash" ></embed></object></td>
  </tr>

it shows only image id and thats all. And people can't watch swf files. I don't know what to do. I need your help.

Thank you.
Lukas

Offline Lukazs

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: {image_id}
« Reply #3 on: June 16, 2006, 01:42:53 PM »
Hi, How to make this script show all images like (swf, avi, flv etc.). I would like that all images would be shown like this http://www.zaisk.com/watermark.php?image_id=XXX

There is the script, it works only with jpg,gf and png images. I need to delete the watermark and leave only "watermark.php?image_id=XXX".

Sorry for my bad english, i tryed my best.
Thank you for help.
Lukazs
Code: [Select]
<?php
$nozip 
1;
define('ROOT_PATH''./');
define('GET_CACHES'1);
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();

$watermark "water.png";

if (!
$image_id)
{
  die(
"Security violation");
}

$sql "SELECT cat_id, image_media_file, image_thumb_file
        FROM "
.IMAGES_TABLE."
        WHERE image_id = 
$image_id";
$image_row $site_db->query_firstrow($sql);
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;

if (!
check_permission("auth_viewcat"$cat_id) || !check_permission("auth_viewimage"$cat_id) || !$image_row)
{
  die(
"No permission");
}

$im imagecreatefrompng($watermark);

$image MEDIA_PATH."/".$cat_id."/".$image_row['image_media_file'];
$types = array(=> "gif"=> "jpeg"=> "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), 00imagesx($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), 00imagesx($im), imagesy($im));
      
imagecopy($im2$im, ((imagesx($im2)/100)-(imagesx($im)/100))+(imagesx($im)*$n), (imagesy($im2)/100)-(imagesy($im)/100), 00imagesx($im), imagesy($im));
    }
  }
  
  
header("Content-Type: image/jpeg");
  
imagejpeg($im2);
  
imagedestroy($im);
  
imagedestroy($im2);
}
else
{
  die(
"Error opening $image!");
}  
?>