21
« on: September 25, 2010, 03:36:07 am »
proszę pomóż poprawić kod.
Mój oryginalny kod to:
Please help improve the code.
My original code is:
<?php if(($ftype = $file->getFileType()) instanceof FileType && $ftype->getIsImage()){?>
<div>
<a href="<?php echo get_url('files', 'download_image', array('id' => $file->getId(), 'inline' => true, 'modtime' => $modtime)); ?>" target="_blank" title="<?php echo lang('show image in new page') ?>">
<img id="<?php echo $genid ?>Image" src="<?php echo get_url('files', 'download_image', array('id' => $file->getId(), 'inline' => true, 'modtime' => $modtime)); ?>" style="max-width:450px;max-height:500px"/>
</a>
</div>
<?php }?>
A po wstawieniu zmian wygląda tak:
And when you insert the changes looks like this:
<?php if(($ftype = $file->getFileType()) instanceof FileType && $ftype->getIsImage()){?>
<div>
<a href="<?php echo get_url('files', 'download_image', array('id' => $file->getId(), 'inline' => true, 'modtime' => $modtime)); ?>" target="_blank" title="<?php echo lang('show image in new page') ?>">
<img id="<?php echo $genid ?>Image" src="<?php echo get_url('files', 'download_image', array('id' => $file->getId(), 'inline' => true, 'modtime' => $modtime)); ?>" style="max-width:450px;max-height:500px"/>
</a>
</div>
<?php // Vista previa embebida para pdf’s (by pawboss.com 8-3-2010)
// extraemos la extension y comprobamos que es un pdf
if (substr($file->getFilename(), -3) == 'pdf') {
//extraemos la url exacta del archivo y la asignamos
$urlpdf=get_url('files', 'download_image', array('id' => $file->getId(), 'inline' => true, 'modtime' => $modtime));
//Pintamos bajo la cabecera un iframe de 100% x 900px con el contenido de la url
?>
<iframe src=<? echo $urlpdf; ?> width='100%' height='900px' frameborder=0 align='center'></iframe>
<?
// si te gusta esta addon, escribeme a pawboss@pawboss.com
}
<?php }?>
i dalej nie działa ! co jest z nim złego ? którą cześć poprawić ?
and still does not work! what is wrong with him? which is part of the improvement?