Location: PHPKode > projects > Phpress > phpress/artzoom.php
<?
/*
    Copyright (C)2004-2007  Matthieu Perez - hide@address.com

    This file is part of PhPress.

    PhPress is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    PhPress is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with PhPress.  If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////
// artzoom.php
//print 'artzoom.php';
session_start();

require 'program/common/constantes.php' ;
require LANG_PATH . $lang ."/msg.php";
require PROG_COM_PATH .'functions_mysql.php';
require PROG_COM_PATH . 'functions_common.php';
//require 'program/html/default.css';
require 'program/html/lightblue.css';

// zoom ctrl
print '    
<table><tr> 
<FORM name="art_zoom" action="artzoom.php?article_id='.$article_id.'" method="POST" target="artzoom'.$article_id.'">
<td align="left">
Zoom
</td>
<INPUT type="hidden" name="zoom_change" value="zoom_change">
<input type="hidden" name="origin" value="artzoom">
<td bgcolor="">
<SELECT name="zoom" '.$black_box.' onchange="document.art_zoom.submit();">';
    
    print '<option  value=""</option>';
    
	function artzooming($zoom_value, $zoom_ratio, $block_zoom_ratio)
        {
           if(!$block_zoom_ratio)
           {
           print '<option value="'.$zoom_value.'"';
           select_previous($zoom_ratio, "$zoom_value");
           print '>'.$zoom_value.'%</option>'; 
           }
           else
           {
           print '<option value="'.$zoom_value.'"';
           select_previous($block_zoom_ratio, "$zoom_value");
           print '>'.$zoom_value.'%</option>'; 
           }
        }
            
        artzooming(200, $zoom_ratio, $block_zoom_ratio);
        artzooming(150, $zoom_ratio, $block_zoom_ratio);
        artzooming(100, $zoom_ratio, $block_zoom_ratio);
        artzooming(97, $zoom_ratio, $block_zoom_ratio);        
        artzooming(95, $zoom_ratio, $block_zoom_ratio);
        artzooming(93, $zoom_ratio, $block_zoom_ratio);
        artzooming(90, $zoom_ratio, $block_zoom_ratio);                        
        artzooming(87, $zoom_ratio, $block_zoom_ratio);
        artzooming(85, $zoom_ratio, $block_zoom_ratio);
        artzooming(83, $zoom_ratio, $block_zoom_ratio);                        
        artzooming(80, $zoom_ratio, $block_zoom_ratio);
        artzooming(77, $zoom_ratio, $block_zoom_ratio);        
        artzooming(75, $zoom_ratio, $block_zoom_ratio);                
        artzooming(73, $zoom_ratio, $block_zoom_ratio);        
        artzooming(70, $zoom_ratio, $block_zoom_ratio);
        artzooming(67, $zoom_ratio, $block_zoom_ratio);                
        artzooming(65, $zoom_ratio, $block_zoom_ratio);
        artzooming(63, $zoom_ratio, $block_zoom_ratio);                
        artzooming(60, $zoom_ratio, $block_zoom_ratio);      
        artzooming(57, $zoom_ratio, $block_zoom_ratio);        
        artzooming(55, $zoom_ratio, $block_zoom_ratio);        
        artzooming(53, $zoom_ratio, $block_zoom_ratio);               
        artzooming(50, $zoom_ratio, $block_zoom_ratio);
        artzooming(47, $zoom_ratio, $block_zoom_ratio);                 
        artzooming(45, $zoom_ratio, $block_zoom_ratio);                
        artzooming(43, $zoom_ratio, $block_zoom_ratio);                       
        artzooming(40, $zoom_ratio, $block_zoom_ratio); 
        artzooming(37, $zoom_ratio, $block_zoom_ratio);                 
        artzooming(35, $zoom_ratio, $block_zoom_ratio);
        artzooming(33, $zoom_ratio, $block_zoom_ratio);                         
        artzooming(30, $zoom_ratio, $block_zoom_ratio);
        artzooming(27, $zoom_ratio, $block_zoom_ratio);                
        artzooming(25, $zoom_ratio, $block_zoom_ratio);
        artzooming(23, $zoom_ratio, $block_zoom_ratio);                        
        artzooming(20, $zoom_ratio, $block_zoom_ratio);
        artzooming(17, $zoom_ratio, $block_zoom_ratio);
        artzooming(15, $zoom_ratio, $block_zoom_ratio); 
        artzooming(13, $zoom_ratio, $block_zoom_ratio);                       
        artzooming(10, $zoom_ratio, $block_zoom_ratio);
        artzooming(7, $zoom_ratio, $block_zoom_ratio);        
        artzooming(5, $zoom_ratio, $block_zoom_ratio);
          
print '           
    </SELECT>
    </td>
    </FORM>

    <td > </td>
    </tr></table>
    ';    
    
// reload the frame    
if($origin=='artzoom')
{
setcookie('block_zoom_ratio', $zoom);

   if($article_id)
   {
    print '
   <script language=\'javascript\'>
   parent.frames[\'artzoom'.$article_id.'\'].location=\'artzoom.php?article_id='.$article_id.'\';   
   parent.frames[\'article_images_'.$article_id.'\'].location=\'article_images.php?article_id='.$article_id.'\';   
   </script>';
   }
   
   else
   {
   print '
   <script language=\'javascript\'>
   parent.frames[\'artzoom\'].location=\'artzoom.php\';   
   parent.frames[\'blockdisplay\'].location=\'blockdisplay.php\';   
   </script>';
   }
}
?>
Return current item: Phpress