2 yabba Feb 03, 2005 15:49

thanks a lot ?????!
it works great. although for some reason i had to "fix" some code above your javascript to
if ( ereg('image/',$img1_type)) {
$piece_of_code = '<img src="'.$fileupload_url.'/'.$img1_name.'" border="0" alt="'.$imgdesc.'" />';
} else {
$piece_of_code = '<a href="'.$fileupload_url.'/'.$img1_name.'" title="'.$imgdesc.'" />'.$imgdesc.'</a>';
}
so all the < " and > will be in place :)
In admin/b2upload.php
Delete everything from :-
<p><?php echo T_('Here\'s the code to display it:') ?></p>
to
</form>
</p>
And replace it with :-
<script type="text/javascript">
window.setTimeout("autoClose()",5000);
function autoClose(){
targetopener('<?php echo $piece_of_code; ?>');
window.close();
}
</script>
Change the 5000 to the length of delay you want before the window close.
?
*edit* DON'T forget to make a copy of upload.php first ;)