[klutz] Major update to Klutz RELENG_1 (incl: fixed image cli pping)

Bearne, Paul PBEARNE at tycoelectronics.com
Wed Mar 17 08:45:31 PST 2004


hi 

I got bored 

here is the code needed to load an error image

I stuck this in common-header.inc
Please use the image preload from horde framework if there is one
-------------------------------------------------------------------
<script language="javascript" type="text/javascript">
<!--
function imageNotFound(img){
	document.getElementById(img.id).src="<?php echo
$registry->getParam('webroot', 'horde') ?>/klutz/graphics/FileNotFound.gif";

}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
MM_preloadImages("<?php echo $registry->getParam('webroot', 'horde')
?>/klutz/graphics/FileNotFound.gif")
//-->
</script>
---------------------------------------------------------------------
and in comic.inc
---------------------------------------------------------------------
<table border="0" cellpadding="1" cellspacing="0">
 <tr>
  <td align="left" class="header">
<?php if (!empty($homepage)): ?>
   <a href="<?php echo $homepage; ?>" target="_blank" class="header">
    <?php printf(_("%s by %s"), $name, $author) ?>
   </a>
<?php else: ?>
    <?php printf(_("%s by %s"), $name, $author) ?>
<?php endif; ?>
  </td>
  <td align="right" class="header"><span class="smallheader"><?php echo
strftime("%B %d, %Y", $date) ?></span></td>
 </tr>
 <tr>
  <td colspan="2">
 
-  <img alt="<?php echo $name ?>" src="<?php echo $url ?>" <?php echo $size
?> />
+  <img alt="<?php echo $name ?>" src="<?php echo $url ?>" <?php echo $size
?> id="<?php echo $url ?>" onerror="imageNotFound(this);"/>
  </td>
 </tr>
</table>
-----------------------------------------------------------------------
I just used the url as the id I knew it would work But please replace with
better code



and attach is simple graphic Please change at will


Paul




-----Original Message-----
From: Marcus I. Ryan [mailto:marcus at horde.org]
Sent: 17 March 2004 14:33
To: Bearne, Paul
Cc: klutz at lists.horde.org
Subject: RE: [klutz] Major update to Klutz RELENG_1 (incl: fixed image
cli pping)


I can't recreate the problem.  Make sure that ie6 isn't caching the old goto
page (it's told to cache it, so this is likely and caused me problems during
coding the update).  The name of the object on that line changed between
releases, so your error would seem to confirm this.

As for the image, it's been discussed, and I originally had such a thing
when
this was a stand-alone PERL script.  I've been a little reluctant just for
the fact it's an image where none is necessary making the page bigger,
rendering more complicated, etc.  Beyond that, if a site admin uses the
(prefered) file backend and wanted such a thing, they'd just have to modify
tempaltes/comics/missing.inc to add the image.

I'll always look at patches, but they should be made against HEAD.  This is
a
feature request that will likely not make it into the release because I'm
trying to actually get a release out the door.  Because of new features I
let
my last attempt falter; I don't want to delay this one for new features too.

--
Marcus I. Ryan, marcus at horde.org
-----------------------------------------------------------------------
  "Love is a snowmobile racing across the tundra and then suddenly it
  flips over, pinning you underneath.  At night, the ice weasels come."
                  -- Matt Groening
-----------------------------------------------------------------------


Quoting "Bearne, Paul" <PBEARNE at tycoelectronics.com>:

> hi
>
> That's better
> Only bug I have found is that the goto in ie 6 (I haven't tried the early
> versions ) doesn't work
>
> line 62 object required
>
> But other wise this is usable in both file and direct fetch
>
> one idea for the direct fetch mode is to use the onerror event on the
image
> to load an image not found image. ( I would be happy to code this if you
> would like. )
>
> Paul
> -----Original Message-----
> From: Marcus I. Ryan [mailto:marcus at horde.org]
> Sent: 16 March 2004 14:49
> To: Bearne, Paul
> Cc: klutz at lists.horde.org; dev at lists.horde.org
> Subject: RE: [klutz] Major update to Klutz RELENG_1 (incl: fixed image
> cli pping)
>
>
> The snapshot these changes would appear in are the 3-16 snapshot, so
that's
> definately not related.
>
> --
> Marcus I. Ryan, marcus at horde.org
> -----------------------------------------------------------------------
>   "Love is a snowmobile racing across the tundra and then suddenly it
>   flips over, pinning you underneath.  At night, the ice weasels come."
>                   -- Matt Groening
> -----------------------------------------------------------------------
>
>
> Quoting "Bearne, Paul" <PBEARNE at tycoelectronics.com>:
>
>> Hi
>>
>> I am trying this out
>>
>> Fatal error: Call to undefined function: removedate() in
>> /usr/local/home/httpd/vhtdocs/bearne/horde/klutz/backend.php on line 233
>> and
>>
>> Fetching Adam at Home for date March 16, 2004...
>> Fatal error: Call to undefined function: storeimage() in
>> /usr/local/home/httpd/vhtdocs/bearne/horde/klutz/backend.php on line 193
>>
>> I am probly missing  a file
>>
>> overwrote an old Klutxz with  klutz-RELENG-2004-03-15.tar.gz
>> 15-Mar-2004 03:16   114k
>>
>> Paul
>>
>> -----Original Message-----
>> From: Marcus I. Ryan [mailto:marcus at horde.org]
>> Sent: 16 March 2004 04:28
>> To: klutz at lists.horde.org
>> Cc: dev at lists.horde.org
>> Subject: [klutz] Major update to Klutz RELENG_1 (incl: fixed image
>> clipping)
>>
>>
>> Recently there have been questions about images being clipped with Klutz
>> RELENG_1.  I verified that it's caused (at least in the most easily
>> replicated circumstance) by the Snoopy.php library used in older code.
>>
>> Thanks to FINALLY getting some extra free time, I've backported as much
of
>> HEAD as I could, including updating to PEAR's HTTP_Request.  You will
need
>> to
>> make sure you install HTTP_Request before this code will work.  From a
>> command-line type:
>>
>> pear install HTTP_Request
>>
>> Please give the code a good workout.  Unless I hear something shortly, I
>> will
>> try to move ahead with a release cycle (release candidates, etc.).  As a
>> side
>> note, I primarily run the HEAD branch of code, so one major part I
haven't
>> tried is the updates to the batch-portion of the comic fetch.  It works
> from
>> the GUI, though.
>>
>> Also, translations may/will need to be updated, and it still needs
install
>> docs (if someone wanted to write some and submit them that would be
> great!).
>>
>> Please report any issues to the klutz or dev mailing lists ASAP.  Thanks!
>>
>> --
>> Marcus I. Ryan, marcus at horde.org
>> -----------------------------------------------------------------------
>>  "Love is a snowmobile racing across the tundra and then suddenly it
>>  flips over, pinning you underneath.  At night, the ice weasels come."
>>                  -- Matt Groening
>> -----------------------------------------------------------------------
>>
>> --
>> klutz mailing list - Join the hunt: http://horde.org/bounties/#klutz
>> Frequently Asked Questions: http://horde.org/faq/
>> To unsubscribe, mail: klutz-unsubscribe at lists.horde.org
>
>
>
> --
> klutz mailing list - Join the hunt: http://horde.org/bounties/#klutz
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: klutz-unsubscribe at lists.horde.org



-- 
klutz mailing list - Join the hunt: http://horde.org/bounties/#klutz
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: klutz-unsubscribe at lists.horde.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: FileNotFound.gif
Type: image/gif
Size: 968 bytes
Desc: not available
Url : http://lists.horde.org/archives/klutz/attachments/20040317/fddfa2a9/FileNotFound-0001.gif


More information about the klutz mailing list