Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RezaSalmanzadeh

Pages: [1]
2
[Mod] Resize wallpaper for restrain resize template.

By this mod you can restrain resize your template and create scroll at down your web pages for big pictures or wallpepars, install this mod is easy.

Just 5 files to edit:

/includes/functions.php
/lang/english/main.php
/templates/default(or template name)/media/gif.html
/templates/default(or template name)/media/jpg.html
/templates/default(or template name)/media/png.html

& create:

image.php



-------[installing]-------



Step 1.

Open /includes/functions.php
Find:

Code: [Select]
function get_media_code($media_file_name, $image_id = 0, $cat_id = 0, $image_name = "", $mode = "", $show_link = 0, $detailed_view = 0) {
  global $site_template, $site_sess, $lang, $mode;

  if (!get_file_path($media_file_name, "media", $cat_id, 0, 0)) {
    $media = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
    $site_template->register_vars("iptc_info", "");
  }
  else {
    $media_src = get_file_path($media_file_name, "media", $cat_id, 0, 1);
    $file_extension = get_file_extension($media_file_name);
    $media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"".$image_name."\" />";
    if ($show_link) {
      $media_icon = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$media_icon."</a>";
    }
    $width_height = "";
    $width = "";
    $height = "";
    $iptc_info = "";
    $src = (!file_exists($media_src) && file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src))) ? preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src) : $media_src;
    if ($image_info = @getimagesize($src, $info)) {
      $width_height = " ".$image_info[3];
      $width = $image_info[0];
      $height = $image_info[1];
      if ($detailed_view && isset($info['APP13'])) {
        $iptc_array = get_iptc_info($info['APP13']);
        $bgcounter = 0;
        foreach ($iptc_array as $key => $val) {
          $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
          $site_template->register_vars(array(
            "iptc_value" => $val,
            "iptc_name" => $lang['iptc_'.$key],
            "row_bg_number" => $row_bg_number
          ));
          $iptc_info .= $site_template->parse_template("iptc_bit");
        }
      }
    }
    $site_template->register_vars(array(
      "media_src" => $media_src,
      "media_icon" => $media_icon,
      "image_name" => $image_name,
      "width_height" => $width_height,
      "width" => $width,
      "height" => $height,
      "iptc_info" => $iptc_info
    ));
    $media = $site_template->parse_template("media/".$file_extension);
  }
  return $media;
}


Replace with:

Code: [Select]
function get_media_code($media_file_name, $image_id = 0, $cat_id = 0, $image_name = "", $mode = "", $show_link = 0, $detailed_view = 0) {
  global $site_template, $site_sess, $lang, $mode, $lang;

  if (!get_file_path($media_file_name, "media", $cat_id, 0, 0)) {
    $media = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
    $site_template->register_vars("iptc_info", "");
  }
  else {
    $media_src = get_file_path($media_file_name, "media", $cat_id, 0, 1);
    $file_extension = get_file_extension($media_file_name);
    $media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"".$image_name."\" />";
    if ($show_link) {
      $media_icon = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$media_icon."</a>";
    }
    $width_height = "";
    $width = "";
    $height = "";
    $iptc_info = "";
    $src = (!file_exists($media_src) && file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src))) ? preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src) : $media_src;
    if ($image_info = @getimagesize($src, $info)) {
      $width_height = " ".$image_info[3];
      $width = $image_info[0];
      $height = $image_info[1];
      if ($width > $lang['wm_width'] || $height > $lang['wm_height']){
      $set = 'true';
      }else{
      $notset = 'true';
      }
      if ($detailed_view && isset($info['APP13'])) {
        $iptc_array = get_iptc_info($info['APP13']);
        $bgcounter = 0;
        foreach ($iptc_array as $key => $val) {
          $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
          $site_template->register_vars(array(
            "iptc_value" => $val,
            "iptc_name" => $lang['iptc_'.$key],
            "row_bg_number" => $row_bg_number
          ));
          $iptc_info .= $site_template->parse_template("iptc_bit");
        }
      }
    }
    $site_template->register_vars(array(
      "set" => $set,
      "notset" => $notset,
      "lang_wm_gloss" => $lang['wm_gloss'],
      "media_src" => $media_src,
      "media_icon" => $media_icon,
      "image_name" => $image_name,
      "width_height" => $width_height,
      "width" => $width,
      "height" => $height,
      "iptc_info" => $iptc_info
    ));
    $media = $site_template->parse_template("media/".$file_extension);
  }
  return $media;
}

function php_image_creator($width_1, $height_1, $n_width, $n_height, $image, $quality){
  header('Content-type: image/jpeg');
  $image_p = imagecreatetruecolor($n_width, $n_height);
  $image_q = imagecreatefromjpeg($image);
  imagecopyresampled($image_p, $image_q, 0, 0, 0, 0, $n_width, $n_height, $width_1, $height_1);
  $picture = imagejpeg($image_p, null, $quality);
  return $picture;
}



Step 2.

Open /lang/english/main.php
Find:

Code: [Select]

?>



Add before:

Code: [Select]

//-----------------------------------------------------
//--- Wallpaper MOD -----------------------------------
//-----------------------------------------------------
$lang['wm_gloss'] = "This picture is a wallpaper for view real size please click on picture.";
$lang['wm_width'] = "800";  // This number is width standard for your picture in pixel.
$lang['wm_height'] = "600"; // This number is height standard for your picture in pixel.
$lang['wm_quality'] = "80"; // This number is quality your picture in pixel, best quality is (60 - 100).



You can change width, height or quality wallpapers by 3 array $lang['wm_width'], $lang['wm_height'] and $lang['wm_quality'] (default is 800 X 600).


Step 3.

Open /templates/default(or template name)/media/gif.html
Find:

Code: [Select]

<!-- Template file for GIF Files -->
<img src="{media_src}" border="1" alt="{image_name}"{width_height} /><br />


Replace with:

Code: [Select]

<!-- Template file for GIF Files -->
{if set}<b>{lang_wm_gloss}</b><br /><br /><a target="_blank" alt="{image_name}" href="{media_src}"><img src="image.php?v={media_src}" border="1" alt="{image_name} :: Wallpaper"/></a><br />{endif set}
{if notset}<img src="{media_src}" border="1" alt="{image_name}"{width_height}/><br />{endif notset}



Also for jpg.html & png.html


Step4 .

Create an empty php file by name "image.php" and copy below code to it, then copy "image.php" to root directory (4image folder).


Code: [Select]

<?php

/********************************************************************
 *                  ~~~{ In the name of god }~~~                    *
 *                                                                  *
 *       4images - A Web Based Image Gallery Management System      *
 *    ------------------------------------------------------------  *
 *                                                                  *
 *              File: image.php                                     *
 *    Final Revision: 2005/08/31 09:12:21 PM                        *
 *         Copyright: (C) 2005 Reza Salmanzadeh                     *
 *             Email: Reza_664@yahoo.com                            *
 *          Web Site: www.Taklyrics.com                             *
 *     Scriptversion: 0.1                                           *
 *                                                                  *
 ********************************************************************
 *                                                                  *
 *                                                                  *
 *           ()()()()   ()()()()  ()()()()     ()()                 *
 *           ()     ()  ()    ()  ()   ()     ()  ()                *
 *           ()     ()  ()  ()        ()     ()    ()               *
 *           ()()()()   ()()()       ()     ()()()()()              *
 *           ()     ()  ()  ()      ()      ()      ()              *
 *           ()     ()  ()    ()   ()   ()  ()      ()              *
 *           ()     ()  ()()()()  ()()()()  ()      ()              *
 *     -----------------------------------------------------        *
 *                                                                  *
 *******************************************************************/ 
 
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
$image $HTTP_GET_VARS['v'];
$maxwidth $lang['wm_width'];
$maxheight $lang['wm_height'];
$quality $lang['wm_quality'];
if (
$image != ""){                
$size getimagesize("$image");
$height_1 $size[1];
$width_1 $size[0];
if ($height_1 $maxheight){
$n_height $maxheight;
$percent = ($size[1] / $n_height);
$n_width = ($size[0] / $percent);
}else if ($width_1 $maxwidth){
$n_width $maxwidth;
$percent = ($size[0] / $n_width);
$n_height = ($size[1] / $percent);
}
if ($n_height $maxheight){
$n_height $maxheight;
$percent = ($size[1] / $n_height);
$n_width = ($size[0] / $percent);
}else if ($n_width $maxwidth){
$n_width $maxwidth;
$percent = ($size[0] / $n_width);
$n_height = ($size[1] / $percent);
}
php_image_creator($width_1$height_1$n_width$n_height$image$quality);
}
  
?>




// For use this mod php version of server just support "gd" !


Good luck!
Reza Salmanzadeh  :wink:


4
please answer the question ?

I need insert in user online list image flag with country name !

5
Thanks Dear "V@no"
That is  an  useful mod.

I need insert in user online list image flag with country name please help me !

Reza  :wink:

6
Tanx for link  :wink:

Reza

7
Templates & Styles (Releases & Support) / Re: [TEMPLATE] blue
« on: March 14, 2005, 10:52:52 PM »
This is a beautiful template and light , very nice.

Reza  :wink:

8
hello dear "b.o.fan"
I am sorry , i can not show a demo of this mod because i dont inistall 4image on the my host (my host is down) but i tested this mod on the personal computer please if you or other friends testing this mod insert below link your website tanx.

Reza!  :wink:

9
[MOD] Fading Effect For Thumbnails In 4Image

By this mod you can quickly create fading effect for all thumbnails in your webSite gallery



Just 2 files to edit:
/templates/default(or template name)/header.html
/includes/functions.php



-------[installing]-------

Step 1.

Open /templates/default/header.html
Insert this javascript code between <head></head> tags
Code: [Select]
<script>
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
       
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
   
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}
</script>

Also you can insert this javascript code without <script></script> tags in an external file (for example "Filename.js") and insert below code between <head></head> tags
Code: [Select]
<SCRIPT LANGUAGE="javascript" TYPE="text/javascript" SRC="Filename.js"></SCRIPT>

Step 2.

Open /includes/functions.php
Find:
Code: [Select]
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
  global $site_sess, $config;

  if (!check_media_type($media_file_name)) {
    $thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
      $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
      $image_info = @getimagesize($dummy);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
    }
    else {
      $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
    }
  }

  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;
}

Replace with:
Code: [Select]
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
  global $site_sess, $config;

  if (!check_media_type($media_file_name)) {
    $thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
      $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
      $image_info = @getimagesize($dummy);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" style=\"filter:alpha(opacity=70)\" onMouseOver=\"nereidFade(this,100,50,20)\" onMouseOut=\"nereidFade(this,70,50,5)\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
    }
    else {
      $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" style=\"filter:alpha(opacity=70)\" onMouseOver=\"nereidFade(this,100,50,20)\" onMouseOut=\"nereidFade(this,70,50,5)\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
    }
  }

  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;
}


/*

  This mod is active only in IE5+

*/

Good luck!
Reza Salmanzadeh  :wink:

Pages: [1]