/_jppf/classes/vxr/vxr.php
PHP | 780 lines | 464 code | 138 blank | 178 comment | 89 complexity | ceadefcac2e701556d16d67e6f662473 MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause, LGPL-2.1
- <?php
- /**
- * vxr.php
- *
- * PhotoViewer System.
- * Displays images in a directory, properly.
- *
- * Creado el 22-jul-2006
- *
- * @author Juan Prada
- *
- *
-
-
- Ideas:
-
- Que se puedan elegir varios tama?os desde el menu.
- Que reciba un parámetro para iniciar en esa foto.
- Un botón en el menu para entregar dicho link [LINK]
- Tambien para el link en PHPBB
- (Panel flotante, que se puedan ir a?adiendo y luego copiarlo para pegar)
-
-
-
-
-
- * @version (In spanish, sorry)
- *
-
- 1.8 20/01/2011 18:32:42
- Mejoras en el DEBUG
-
-
- 1.7 08/06/2008
- Se permite la paremtración con archivos .ini
- vxr.ini
- vxr_showpage.ini
-
-
-
- * 1.6 27/11/2007
- * Se pule el indicador de foto cargando, envitando entre otras
- * cosas la aparición de la barra de scroll lateral innecesariamente.
- *
- * Se mejora la representación EXIF, no mostrando los datos que no están
- * y mostrando inteligentemente el nombre y modelo de la cámara.
- *
- * En la parte JS, detecta el navegador para realizar la transparencia de una
- * manera o de otra.
- *
- * Tambien cambia los estilos en el CSS y en el PHP según el navegador.
- *
- * Se hace compatible con IE 6.0
- *
- * Se hace que se ilumine la foto ante un MouseOver
- *
- * Se mejora el sistema de debug automatico que se actuva al poner el parámetro
- * ?debug=1
- *
- * Se corrige el bug que ocurría cuando en el directorio de iconos había otros
- * iconos de otras dimensiones (otros archivos)
- *
- *
- *
- * 1.5 1/11/2007
- * Llamada a la función de componer una página usando arrays.
- * Usa transparencias para indicar el icono que se está cargando.
- * Al cargar, selecciona la primera foto.
- * Paneles ocultables
- * Panel de EXIF
- * Menu
- *
- * 1.4 20/05/2007
- * Incorpora el sistema de seguridad
- *
- * 1.3 31/03/2007
- * Usa divs para la representación
- *
- * 1.2 10/10/2006
- * Permite disponer los iconos verticalmente
- */
-
- include_once('aa/inc_funks_images.php');
- include_once 'funkpack_vxr.php';
-
- class vxr {
- var $dat = array();
- var $html = '';
- var $is_version = '';
- var $is_idioma = '';
- var $is_version_f = '';
- var $is_debug_txt = '';
- var $ib_debug = false;
- var $i_browser = array();
- var $msg = array();
-
- function vxr($param='') {
- global $fnvxr;
-
- $this->is_version = '1.8';
- $this->is_version_f = '20/01/2011 18:32:58';
-
- // Debug flag pick
- $this->ib_debug = isset($_REQUEST['debug']);
-
- // Picks the browser info
- $this->i_browser = $fnvxr->f_get_browser();
-
- // Language pick
- $this->is_idioma = substr(strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']),0,2);
-
- // Initialize messages
- $this->of_vxr_inic_msg();
-
- // Initialize parameters
- $this->of_vxr_param_inic();
-
- // If some params arrived, set them
- if ((!isset($param)) && file_exists('vxr.ini')) {
- $param = parse_ini_file('vxr.ini');
- $this->of_set_param($param);
- //die( nl2br(print_r($param, true)) );
- } else {
- if ( (is_array($param)) && (!empty($param)) ) $this->of_set_param($param);
- }
- //echo( nl2br(print_r($this->dat, true)) );
-
-
- // Start the security system
- $this->vxkey(); // (This function can end in a die() statment!)
-
- }
-
-
- function vxkey() {
- // First of all, check la key
- if (!isset($this->dat['key'])) $this->dat['key']='';
- if (strlen($this->dat['key'])) {
- if ( ($_REQUEST['key'] != $this->dat['key']) && ($_COOKIE['vxKey'] != $this->dat['key']) ) {
- // Acceso no permitido
- switch($this->is_idioma) {
- case 'es':
- $msg = array(
- 'Error 19823.2 en su navegador. Configure los DNS y el Wins por lo menos.',
- 'Internet colapsado, pruebe de nuevo en un futuro.',
- 'El servidor ha sido afectado por un escape radiactivo, deshágase de su computadora.',
- 'Aquí no es',
- 'Formateando su disco duro... espere unos minutos.',
- 'Ella dijo no.',
- 'Espere unos instantes...',
- 'Problema con el cable, revise sus conexiones.',
- 'La están peinando...',
- 'Error supremo. Recompile el kernel.',);
- break;
- default:
- $msg = array(
- 'Browser 19823.2 error. Please configure the DNS and Wins.',
- 'Internet turned off, please check again in the future.',
- 'The server has a radiactive leak. Please remove your computer.',
- 'OH NOES! I HAS NOZING',
- 'Formatting your harddrive... wait some minutes.',
- 'Hi chap!',
- 'Please wait...',
- 'Cable issue, check your connections.',
- 'OH NOES! I IZ TUNED OF...',
- 'Supreme Error. Rebuild the Kernel.',);
- }
-
- $h.='<form name="vxkey" id="" class="f" method="post" action="">';
- $h.='<input style="position:fixed; left:0px; bottom:0px; border:0px none;color:white;background-color:orange;" type="password" name="key" value="">';
- $h.='</form>';
- die($msg[rand(0, count($msg) - 1)].'<br><br>'.$h);
- } else {
- // La clave es válida, graba una cookie válida durante 48 horas
- setcookie("vxKey", $this->dat['key'], time()+ (3600 * 48) );
- }
- }
- }
-
-
- function of_debug($as_txt) {
- $this->is_debug_txt.=$as_txt;
- }
-
- function of_vxr_param_inic() {
- $this->dat=array(
- 'php_time_limit' => '240',
- 'dir' => 'res/', // Resource files dir (The images of the toolbar, etc)
- 'dir_vxr_naveg' => "/_comun/classes/vxr/", // Place where this class is stored, mapped for the client
- 'icon_dim' => '150x32', // Icon dimensions
- 'princ_dim' => '-650', // Width 650px for the main imagen. If not set, the main image is not modified
- 'princ_pref' => '650_', // Main image filename sub-prefix if modified
- 'princ_BorrarOrig' => true, // In case of modifying the main image, if the original one must be deleted
- 'princ_load_opa' => '.4', // Main image transparency when loading
- 'icon_pref' => '150_', // Icon's filename sub-prefix
- 'icon_path' => 'vxrtn/', // Path where icons must be stored
- 'imgtratada_pref' => 'p', // Filename prefix for everyone, to allow knowing witch to convert
- 'progDiv_load_opa'=> '.5', // La transparencia del DIV del gráfico de progreso
- 'progDiv_icon_opa'=> '.4', // La transparencia del DIV del gráfico de progreso en el icono
- 'icon_style' => 'border:1px solid black;', // El estilo CSS para el icono
- 'icon_style_sel' => '', // El estilo CSS para el icono seleccionado
- 'princ_style' => '', // El estilo CSS de la imagen principal
- 'icon_sep' => '', // Algo para poner en las celdas de la tabla además del icono
- 'icon_TextoInicial'=>'',
- 'icon_TextoFinal' => '<div align="center">'.$this->msg['infoinic'].'</div>',
- 'progImgRes' => 'vxr_progress_01.gif',
- 'progIcoRes' => 'p2.gif',
- 'icon_spread' => 'vertical', // Modo en el cual se van disponiendo los iconos
- 'icon_Filas' => 16, // Filas cuando la disposición es vertical
- 'icon_Columnas' => 6, // (Para cuando 'icon_spread' es horizontal
- 'icon_spacing' => '0', // El cellspacing de la tabla de iconos
- '' => '',
- );
- }
-
- function of_set_param($param) {
- $this->dat = array_merge($this->dat, $param);
- }
-
- function of_vxr_do() {
- global $fnvxr;
-
- // Elabora la lista de las imagenes
-
- $d = $this->ib_debug;
-
- set_time_limit ( $this->dat['php_time_limit'] );
-
- if (!strlen($this->dat['princ_dim'])) {
- $this->dat['princ_pref']='';
- }
-
- $imagenes=array(); reset($imagenes);
- $img_validas=array(); reset($img_validas);
- $html=array(); reset($html);
-
- // Lista los archivos del directorio
- $li_num = $fnvxr->f_dir_img($this->dat['dir'],$imagenes,'');
-
- // Elimina los iconos de la versión anterior
- $i=0;
- for ($n=0; $n<$li_num; $n++) {
- if (substr($imagenes[$n],0,3) != 'TN_') {
- $img_validas[$i] = $imagenes[$n];
- $i++;
- }
- }
- $imagenes = $img_validas;
- $li_num = $i;
- $il_tratadas_a = 0;
- $il_tratadas_b = 0;
-
- // Recorre los archivos para ver si tiene que convertir alguno
- if ($d) $this->of_debug('Recorre los '.$li_num.' archivos para ver si tiene que convertir alguno...'.'<br/>');
- if ($d) $this->of_debug('print_r($imagenes):<pre> '.print_r($imagenes,true).'</pre><br/>');
- for ($n=0; $n < $li_num; $n++) {
- $partes_ruta = pathinfo($imagenes[$n]);
- $ext_orig[$n] = $partes_ruta['extension'];
-
- if ($d) $this->of_debug( $n.': '.$imagenes[$n].'<br/>');
-
- // Tratamiento del icono
- $ls_temp = $this->dat['dir'].$this->dat['icon_path'].$this->dat['imgtratada_pref'].$this->dat['icon_pref'].$partes_ruta['basename'];
- if ($d) $this->of_debug( 'Comprobado el tratamiento del icono: $ls_temp='.$ls_temp.'<br/>');
- if (!file_exists($ls_temp)) {
- if ($d) $this->of_debug('No existe el icono, se crea. '.$this->msg['debug_noimageicon'].' $ls_temp='.$ls_temp.'<br/>');
- $ls_nueva = f_img_asegura_icono('',$imagenes[$n],$this->dat['dir'],$this->dat['icon_dim'],$this->dat['imgtratada_pref'].$this->dat['icon_pref'],'',$this->dat['icon_path'],true);
- $il_tratadas_a++;
- } else {
- if ($d) $this->of_debug('El icono existe'.'<br/>');
- }
-
-
- // Código para redimensinar la imagen si está especificado ello
- $ls_temp = substr($imagenes[$n],0,strlen($this->dat['imgtratada_pref']));
- if ($d) $this->of_debug( 'Prueba redimensionado: $ls_temp='.$ls_temp.'; $this->dat[\'imgtratada_pref\']='. $this->dat['imgtratada_pref'].'<br/>');
- if ($ls_temp != $this->dat['imgtratada_pref']) {
-
- if ($d) $this->of_debug('$this->dat[\'princ_dim\']="'.$this->dat['princ_dim'].'"<br/>');
-
- if (strlen($this->dat['princ_dim'])) {
- // Comprueba si existe la imagen ya tratada para principal (650 px de ancho)
- $ls_temp=$this->dat['dir'].$this->dat['imgtratada_pref'].$this->dat['princ_pref'].$imagenes[$n];
- if ($d) $this->of_debug('Comprobando si existe $ls_temp="'.$ls_temp.'"<br/>');
- if (!file_exists($ls_temp)) {
- if ($d) $this->of_debug( 'No existe!. Asegura icono para '.$imagenes[$n].'<br/>');
- $ls_nueva = f_img_asegura_icono('',$imagenes[$n],$this->dat['dir'],$this->dat['princ_dim'],$this->dat['imgtratada_pref'].$this->dat['princ_pref'],'','',true);
- $il_tratadas_b++;
- // Ahora borra la original
- if ($this->dat['princ_BorrarOrig']) unlink($this->dat['dir'].$imagenes[$n]);
- }
- }
- } else {
- if ($d) $this->of_debug('No es necesario redimensionar'.'<br/>');
- }
-
-
- }
-
- if ($d) $this->of_debug('Fin de la conversión, comienza a recorrer las imágenes para pintarlas'.'<br/>');
-
- if ($d) $this->of_debug( 'print_r($imagenes): <pre>'.print_r($imagenes,true).'</pre><br/>');
-
- // Vuelve a recorrer el las imagenes para ir pintándolas
- $li_len_pref = strlen($this->dat['imgtratada_pref'].$this->dat['princ_pref']);
- $li_len_pref_icon = strlen($this->dat['imgtratada_pref'].$this->dat['icon_pref']);
-
- if ($d) $this->of_debug( '$this->dat[\'dir\'].$this->dat[\'icon_path\']='.$this->dat['dir'].$this->dat['icon_path'].'<br/>');
- $li_num = $fnvxr->f_dir_img($this->dat['dir'].$this->dat['icon_path'],$imagenes,'');
-
- if ($d) $this->of_debug( 'print_r($imagenes): <pre>'.print_r($imagenes,true).'</pre><br/>');
- $li_index_js = 0;
- $li_index_js_sel = 0;
- $ls_img_inic = '';
- $ls_exif_inic = '';
- $html['jsInLine'] = "\nfunction jf_vxr_start() {\n";
- $html['imggran'] = '';
-
- // Averigua donde colocar el PROGRESSBAR de cada icono, (el offset x e y)
- list($ancho, $alto, $tipo, $atr) = getimagesize(dirname(__FILE__).'/res/'.$this->dat['progIcoRes']);
- $icoDim = explode('x',$this->dat['icon_dim']);
- $ll_icoXoffset = round(($icoDim[0] - $ancho) / 2);
- $ll_icoYoffset = round(($icoDim[1] - $alto) / 2);
-
-
- // Predefine las características de transparencia de los iconos
- switch($this->i_browser['agent']) {
- case 'IE':
- $ls_style_tr_icon = ';filter=alpha(opacity=40);';
- $ls_style_tr_icon_sel = ';filter=alpha(opacity=100);';
- break;
- default:
- $ls_style_tr_icon = ';opacity:.5;';
- $ls_style_tr_icon_sel = ';opacity:1;';
- }
-
-
- $nn=0; // Almacena un index de las fotos válidas, para cuando hay varios archivos de iconos en el directorio
- // Es el index y orden real de aparición de fotos
- for ($n=0; $n < $li_num; $n++) {
- if ($d) $this->of_debug( '<hr/>');
- if ($d) $this->of_debug( '$n='.$n.'; <b>$nn='.$nn.'</b><br/>');
- if ($d) $this->of_debug( '$imagenes['.$n.']='.$imagenes[$n]."<br/>");
- if ($d) $this->of_debug( 'substr($imagenes[$n],0,$li_len_pref_icon)='.substr($imagenes[$n],0,$li_len_pref_icon)."<br/>");
- if ($d) $this->of_debug( '$this->dat[\'imgtratada_pref\'].$this->dat[\'icon_pref\']='.$this->dat['imgtratada_pref'].$this->dat['icon_pref']."<br/>");
-
- if (substr($imagenes[$n],0,$li_len_pref_icon) == $this->dat['imgtratada_pref'].$this->dat['icon_pref']) {
- // La imagen listada corresponde con la del icono, o sea que hay que buscar la principal
- if ($d) $this->of_debug( '$this->dat["princ_pref"]='.$this->dat['princ_pref']."<br/>");
- if (strlen($this->dat['princ_pref'])) {
- // Hay definido un prefijo para la imagen principal, se compone la imagen final usándolo, tras quitar el anterior prefilo (el del icono)
- if ($d) $this->of_debug( '$li_len_pref='.$li_len_pref."<br/>");
- $ls_img_gran=$this->dat['imgtratada_pref'].$this->dat['princ_pref'].substr($imagenes[$n], $li_len_pref);
- } else {
- if ($d) $this->of_debug( '$li_len_pref_icon='.$li_len_pref_icon."<br/>");
- $ls_img_gran = substr($imagenes[$n], $li_len_pref_icon, strlen($imagenes[$n]) - 3 - $li_len_pref_icon ).$ext_orig[$nn];
- }
-
- if ($d) $this->of_debug( '$ls_img_gran='.$ls_img_gran."<br/>");
-
- // Construye el index de almacenamiento en arrays
- if (file_exists($this->dat['dir'].$ls_img_gran)) {
- $li_index_js++;
- list($ls_width, $ls_height, $type, $attr) = getimagesize($this->dat['dir'].$ls_img_gran);
- $html['jsInLine'].="\t".'arrayImg['.$li_index_js.']="'.$this->dat['dir'].$ls_img_gran.'";'."\n";
- $html['jsInLine'].="\t".'arrayWidth['.$li_index_js.']="'.$ls_width.'";'."\n";
- $html['jsInLine'].="\t".'arrayHeight['.$li_index_js.']="'.$ls_height.'";'."\n";
- $ls_exif = $this->of_vxr_getexif($this->dat['dir'].$ls_img_gran);
- $html['jsInLine'].="\t".'arrayExif['.$li_index_js.']="'.addslashes($ls_exif).'";'."\n";
-
- // Determina la imagen inicial y el estilo del primer icono seleccionado
- if (!strlen($ls_img_inic)) {
- $ls_img_inic = $ls_img_gran;
- $ls_exif_inic = $ls_exif;
- $li_index_js_sel = $li_index_js;
- $ls_style_img=$ls_style_tr_icon_sel.$this->dat['icon_style'].$this->dat['icon_style_sel'];
- } else {
- $ls_style_img=$ls_style_tr_icon.$this->dat['icon_style'];
- }
-
- // Construye el HTML que lo llamará
- $ls_adic =' ID="ico'.$li_index_js.'"';
- $ls_adic.=' OnClick="jfvxroc(\''.$li_index_js.'\');"';
- $ls_adic.=' OnMouseOver="jfvxromo(\''.$li_index_js.'\');"';
- $ls_adic.=' OnMouseOut="jfvxromu(\''.$li_index_js.'\');"';
- $ls_adic.=' style="'.$ls_style_img.'"';
- $html['icons'][$nn] =
- '<div id="divIco'.$li_index_js.'" style="text-align:center;vertical-align:middle;position:relative;">'.
- $fnvxr->f_draw_img($this->dat['dir'].$this->dat['icon_path'].$imagenes[$n],'','','','0','','','',$ls_adic).$this->dat['icon_sep'];
-
-
- // Pone la imagen con la progress bar
- switch($this->i_browser['agent']) {
- case 'IE':
- $ls_style_img = 'filter=alpha(opacity='.($this->dat['progDiv_icon_opa'] * 100).');';
- break;
- default:
- $ls_style_img = 'opacity:'.$this->dat['progDiv_icon_opa'].';';
- }
-
- $ls_style_img.='position:absolute; left:'.$ll_icoXoffset.'px; top:'.$ll_icoXoffset.'px; z-index:4; display:none;';
-
- $html['icons'][$nn].= '<img src="'.$this->dat['dir_vxr_naveg'].'res/'.$this->dat['progIcoRes'].'" style="'.$ls_style_img.'" id="imgProgIco'.$li_index_js.'">';
-
-
- // Finaliza el DIV que alberga el icono y la barra de progreso
- $html['icons'][$nn].='</div>';
-
- // Suma el contador de iconos
- $nn++;
- } else {
- // Error! La imagen grande no ha sido bien calculada!
- if ($d) $this->of_debug( 'ERROR! $this->dat[\'dir\'].$ls_img_gran=\''.$this->dat['dir'].$ls_img_gran.'\' NO EXISTE!<br/>');
- }
-
- }
- }
- $li_num_iconos_validos=$nn;
-
- if ($this->ib_debug) $this->of_debug('<hr/>');
- if ($this->ib_debug) $this->of_debug('$li_num_iconos_validos='.$li_num_iconos_validos.'<br>');
- if ($this->ib_debug) $this->of_debug('$li_index_js='.$li_index_js.'<br>');
-
- // Pone variables para que estén accesibles en el Javascript
- $html['jsInLine'].= "\t".'id_opacityImg='.$this->dat['princ_load_opa'].';'."\n";
- $html['jsInLine'].= "\t".'ii_vxr_curr_sel='.$li_index_js_sel.';'."\n";
- $html['jsInLine'].= "\t".'ii_vxr_last_sel='.$li_index_js_sel.';'."\n";
- $html['jsInLine'].= "\t".'ii_vxr_max='.$li_index_js.';'."\n";
- list($ancho, $altura, $tipo, $atr) = getimagesize(dirname(__FILE__).'/res/'.$this->dat['progImgRes']);
- $html['jsInLine'].= "\t".'ii_ancho_imgProcess='.$ancho.';'."\n";
- $html['jsInLine'].= "\t".'ii_alto_imgProcess='.$altura.';'."\n";
- if ($this->ib_debug) $html['jsInLine'].= "\t".'ib_vxrDebug=true;'."\n";
- $html['jsInLine'].= "}\n";
-
- // Prepara los datos que han de aparecer en el panel para el EXIF, inicialmente
- $html['exifinicial'] = $ls_exif_inic;
-
- // Inicia el DIV que contiene la imagen principal
- $html['imggran'].='<div id="vxrContenedorPrinc" style="text-align:center;position:relative;width:100%;height:auto;">';
-
-
- // Pone el div con la progress bar
- switch($this->i_browser['agent']) {
- case 'IE':
- $ls_temp = 'filter=alpha(opacity='.($this->dat['progDiv_load_opa'] * 100).');';
- break;
- default:
- $ls_temp = 'opacity:'.$this->dat['progDiv_load_opa'].';';
- }
- $ls_style_para_img_progress=' style="border:1px solid gray;'.$ls_temp.'"';
- $ls_img_progress = '<img src="'.$this->dat['dir_vxr_naveg'].'res/'.$this->dat['progImgRes'].'" '.$ls_style_para_img_progress.' id="imgProgress">';
-
- $html['imggran'].='<div id="divProgress"
- style="position:absolute; z-index:3;display:none;
- text-align:center;vertical-align:middle;overflow:hidden;
- left:0px;
- width:99%;
- border:0px solid red;">';
- $html['imggran'].= $ls_img_progress;
- $html['imggran'].= '</div>';
-
-
- // Define la imagen principal
- $html['imggran'].= '<img src="'.$this->dat['dir'].$ls_img_inic.'" id="img_princ" style="'.$this->dat['princ_style'].'" OnLoad="jf_vxr_princ_ol(this);">';
-
- // Termina el DIV que contiene la imagen principal
- $html['imggran'].= '</div>';
-
- // Construye la tabla con los iconos
- $html['listaimg'] = "\n";
- if ($this->dat['icon_spread'] == 'horizontal') {
- // Ha de disponerse horizontalmente
- $html['listaimg'] = "\n<tr>";
- foreach($html['icons'] as $k=>$icon) {
- $html['listaimg'].= "\n".'<td>'.$icon.'</td>';
- if ((($k + 1) % $this->dat['icon_Columnas']) == 0) {
- $html['listaimg'].= "\n</tr>";
- if (($k + 1) < $li_num_iconos_validos) $html['listaimg'].= "\n<tr>";
- }
- }
- if ((($k + 1) % $this->dat['icon_Columnas']) != 0) $html['listaimg'].= "\n</tr>";
- } else {
- // Ha de disponerse verticalmente
- $k = 0;
- $k_inic = 0;
- $html['listaimg'] = "\n<tr>";
- for ($i=0; $i < $li_num_iconos_validos; $i++) {
- if ($d) $this->of_debug( '$i='.$i.' $k='.$k.' $k_inic='.$k_inic.'<br/>');
- $html['listaimg'].= "\n".'<td>'.$html['icons'][$k].'</td>';
- $k += $this->dat['icon_Filas'];
- if ($k >= $li_num_iconos_validos) {
- $html['listaimg'].= "\n</tr>";
- $k = $k_inic + 1;
- $k_inic = $k;
- }
- }
- }
- $html['listaimg'].= "\n";
-
- // Engloba las lista de imagenes en una tabla
- $html['listaimg'] = '<table border=0 cellpadding=0 cellspacing='.$this->dat['icon_spacing'].'>'.$html['listaimg'].'</table>';
-
- // A?ade un texto final a los iconos
- if (strlen($this->dat['icon_TextoFinal'])) {
- $html['listaimg'].= '<div class="vxrIconTextoFinal">'.$this->dat['icon_TextoFinal'].'</div>';
- }
-
- // A?ade un texto inicial a los iconos
- if (strlen($this->dat['icon_TextoInicial'])) {
- $html['listaimg'] = '<div class="vxrIconTextoInicial">'.$this->dat['icon_TextoInicial'].'</div>'.$html['listaimg'];
- }
-
-
- // Monitoriza las que ha tratado
- if ($il_tratadas_a) $html['techinfo'].= 'Tratadas A: '.$il_tratadas_a.' ';
- if ($il_tratadas_b) $html['techinfo'].= 'Tratadas B: '.$il_tratadas_b.' ';
-
- // El archivo javascript a incluir
- $html['js']=$this->dat['dir_vxr_naveg'].'vxr.js';
-
- // Sitúa el retorno
- $this->html = $html;
-
- return $html;
- }
-
- function of_vxr_gethtml() {
- return $this->html;
- }
-
-
-
-
-
- // Toma y prepara los datos del EXIF del archivo
- function of_vxr_getexif($as_file) {
- global $fnvxr;
-
- $s='';
-
- if (function_exists('exif_read_data')) {
- $d = exif_read_data($as_file);
-
- $fnvxr->f_array_value_always_set($d, 'DateTimeOriginal');
- $fnvxr->f_array_value_always_set($d, 'Make');
- $fnvxr->f_array_value_always_set($d, 'Model');
- $fnvxr->f_array_value_always_set($d, 'COMPUTED');
- $fnvxr->f_array_value_always_set($d, 'ExposureTime');
- $fnvxr->f_array_value_always_set($d, 'ISOSpeedRatings');
- $fnvxr->f_array_value_always_set($d, 'FocalLengthIn35mmFilm');
- $fnvxr->f_array_value_always_set($d, 'Flash');
- $fnvxr->f_array_value_always_set($d['COMPUTED'], 'ApertureFNumber');
-
- $s.= $this->of_vxr_gepar('Fecha:',$d['DateTimeOriginal']);
- $s.= $this->of_vxr_gepar('Archivo',$d['FileName']);
- $s.= $this->of_vxr_gepar('Tama?o:',$d['FileSize']);
- $s.= $this->of_vxr_gepar('Dimensiones:',$d['COMPUTED']['Width'].'x'.$d['COMPUTED']['Height']);
-
- if ( $fnvxr->f_string_primer_elemento($d['Make'], ' ') ==
- $fnvxr->f_string_primer_elemento($d['Model'], ' ') ) {
- $s.= $this->of_vxr_gepar('Cámara:',$d['Model']);
- } else {
- $s.= $this->of_vxr_gepar('Cámara:',$d['Make'].' '.$d['Model']);
- }
-
- $s.= $this->of_vxr_gepar('Apertura:',$d['COMPUTED']['ApertureFNumber']);
- $s.= $this->of_vxr_gepar('Exposición:',$d['ExposureTime']);
- $s.= $this->of_vxr_gepar('ISO:',$d['ISOSpeedRatings']);
- $s.= $this->of_vxr_gepar('Focal:',$d['FocalLengthIn35mmFilm']);
- $s.= $this->of_vxr_gepar('Flash',$d['Flash']);
- }
- $all='';
- //$all='<hr/>'.nl2br(print_r($d,true));
- return '<table class="va">'.$s.'</table>'.$all;
- }
-
- function of_vxr_gepar($a, $b) {
- $s='';
- if (strlen($b))
- $s='<tr><td class="vb">'.$a.'</td><td class="vc">'.$b.'</td></tr>';
- return $s;
- }
-
-
-
- //----------------------------------------------------------------------------------------------
-
-
- //
- // Función que lo hace todo, para fotos en un mismo directorio
- //
- // Parametros: Por mantener la compatibilidad, se deja el sistema de parámetros
- // anterior, pero tambien se permite usar un array, que usará los valores
- // propios del VXR más los especiales para este visor rápido.
-
-
-
- function of_vxr_show_modo_a($as_titulo='VXr Quick Photo Gallery', $as_size_icono='48', $ai_columnas=3, $ai_borde=0, $as_colortexto='#ff6600', $as_colorfondo='#000000', $as_icon_style='border-top:1px solid black;', $as_icon_TF='') {
- // Usa los valores entregados como parámetro (Versión primitiva)
- // Los 'showpage_*' son los parametros relativos a esta funcion
- $pagedat=array(
- 'dir' => './',
- 'princ_dim' => '',
- 'icon_path' => 'vxrtn/',
- 'icon_sep' => '',
- 'icon_spread' => 'horizontal', // Can be 'vertical', too
- 'icon_Columnas' => $ai_columnas,
- 'icon_Filas' => $ai_columnas,
- 'icon_TextoFinal' => '',
- 'icon_spacing' => $ai_borde,
- 'icon_style' => $as_icon_style,
- 'icon_TextoFinal' => $as_icon_TF,
- 'showpage_size_icono' => $as_size_icono,
- 'showpage_colorfondo' => $as_colorfondo,
- 'showpage_colortexto' => $as_colortexto,
- 'showpage_titulo' => $as_titulo,
- );
- return $this->of_vxr_showpage($pagedat);
- }
-
-
-
-
- //
- // Función que lo hace todo, para fotos en un mismo directorio
- //
- // Esta función también es un ejemplo de cómo se implementaría cualquier otro
- // sitio de visor.
- //
- //
- //
- /*
-
- // Campos del array VXR, pero que al menos es necesario indicar en esta función
- (Ver el código)
-
- // Existen más campos del array VXR que se pueden utilizar
-
- // Campos del array propios de esta función:
-
- ********* Los que comienzan por 'showpage_*' ***********
- */
-
- function of_vxr_showpage($mydat='') {
- global $fnvxr;
-
- $html = array();
- $pagedat = array();
-
-
- // If some params arrived, set them
- if ((!is_array($mydat)) && file_exists('vxr_showpage.ini')) {
- $mydat = parse_ini_file('vxr_showpage.ini');
- } else {
- if (!is_array($mydat)) $mydat = array();
- }
-
-
- // Corrige los valores que faltan
- $fnvxr->f_asv($mydat['showpage_colorfondo'],'#000000');
- $fnvxr->f_asv($mydat['showpage_colortexto'],'#ff6600');
- $fnvxr->f_asv($mydat['showpage_titulo'],'VXr Quick Photo Gallery');
-
- if (strlen($mydat['showpage_size_icono'])) {
- $mydat['icon_dim'] = $mydat['showpage_size_icono'].'x'.$mydat['showpage_size_icono'];
- $mydat['icon_pref'] = $mydat['showpage_size_icono'].'_';
- } else {
- $fnvxr->f_asv($mydat['icon_dim'], '48x48');
- $fnvxr->f_asv($mydat['icon_pref'], '48_');
- }
-
- $fnvxr->f_asv($mydat['dir'],'./');
- $fnvxr->f_asv($mydat['princ_dim'],'');
- $fnvxr->f_asv($mydat['icon_path'],'vxrtn/');
- $fnvxr->f_asv($mydat['icon_sep'],'');
- $fnvxr->f_asv($mydat['icon_spread'],'horizontal');
- $fnvxr->f_asv($mydat['icon_Columnas'],'3');
- $fnvxr->f_asv($mydat['icon_Filas'],'');
- $fnvxr->f_asv($mydat['icon_spacing'],'0');
- $fnvxr->f_asv($mydat['icon_style'],'border:1px solid black;');
- $fnvxr->f_asv($mydat['icon_TextoFinal'],'');
-
- $fnvxr->f_asv($mydat['showpage_colorfondo'],'#000000');
- $fnvxr->f_asv($mydat['showpage_colortexto'],'#ff6600');
- $fnvxr->f_asv($mydat['showpage_titulo'],'VXr Quick Photo Gallery');
- $fnvxr->f_asv($mydat[''],'');
-
- //echo nl2br(print_r($mydat, true));
- // echo '<hr>';
-
- $this->dat = array_merge($this->dat, $mydat);
-
- //echo nl2br(print_r($this->dat, true));
- //die();
-
-
- switch($this->i_browser['agent']) {
- case 'IE':
- $ls_file_css='vxr_ie.css';
- $ls_tmp_css='absolute';
- $ls_tmp_tr_capa_exif='filter=alpha(opacity=40);';
- $ls_tmp_tr_capa_debug='filter=alpha(opacity=70);';
- break;
- default:
- $ls_file_css='vxr.css';
- $ls_tmp_css='fixed';
- $ls_tmp_tr_capa_exif='opacity:.4;';
- $ls_tmp_tr_capa_debug='opacity:.7;';
- }
-
-
-
- $html = $this->of_vxr_do();
-
-
- // Comienza con el HTML
- $pagedat=array(
- 'javascript' => $html['js'],
- 'jsInLine' => $html['jsInLine'],
- 'OnLoad' => 'jf_vxr_start();',
- 'stylesheet' => '/_comun/classes/vxr/'.$ls_file_css,
- 'borde' => '0',
- 'bgcolor' => $mydat['showpage_colorfondo'],
- 'text' => $mydat['showpage_colorfondo'],
- 'title' => $mydat['showpage_titulo'],
- 'comentario' => "VXr Quick Photo Gallery {$this->is_version}\n(C)2006-2007 Juan Prada / silueth.com",
- );
-
- echo $fnvxr->f_draw_html_start($pagedat);
-
- // El menu
- include(dirname(__FILE__).'/vxr_menu.php');
-
-
- // Código CSS para ver el borde de los divs
- $dc='';
- //$dc='border: 2px dotted yellow;';
-
-
- // La imagen grande
- echo "\n".'<div id="divPageImgGran" style="position:relative; width:100%; left:0px; top:18px; text-align:center;'.$dc.'">'.$html['imggran'].'</div>';
-
- // La lista de imagenes
- echo "\n".'<div id="divPageIconos" style="position:'.$ls_tmp_css.'; left:0px; top:20px;'.$dc.'">'.$html['listaimg'].'</div>';
-
- // El texto técnico
- echo "\n".'<div id="divPageTextoTec" style="position:'.$ls_tmp_css.'; left:5px; bottom:5px;'.$dc.'"><pre>'.$html['techinfo'].'</pre></div>';
-
- // La información del EXIF
- echo '<div id="divPageEXIF" style="position:absolute; right:0px; top:18px; z-index:300; display:none; background:#222222; color:#ffffff; padding:4px; '.$ls_tmp_tr_capa_exif.$dc.'">'.$html['exifinicial'].'</div>';
-
- // El DIV con el debug
- if ($this->ib_debug)
- echo '<div id="divPageDebug" style="position:absolute; right:8px; top:18px; z-index:300; background:#111111; color:#ffffff; padding:6px; '.$ls_tmp_tr_capa_debug.$dc.'"><pre>'.$this->is_debug_txt.'</pre></div>';
-
- echo $fnvxr->f_draw_html_end();
-
- }
-
-
- /**
- * of_vxr_inic_msg()
- *
- * Define appropiate text in the proper language
- */
- function of_vxr_inic_msg() {
- switch($this->is_idioma) {
- case 'es':
- $this->msg['infoinic']='Haga click en los iconos de esta columna para ampliar las fotos';
- $this->msg['debug_noimageicon']='No existe imagen para icono:';
- break;
- default:
- $this->msg['infoinic']='Click in the icons to select each picture';
- $this->msg['debug_noimageicon']='There is no image for the icon:';
- break;
- }
- }
- }
-
- ?>