show.pl 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/usr/bin/env perl
  2. #
  3. # This file is part of the LibreOffice project.
  4. #
  5. # This Source Code Form is subject to the terms of the Mozilla Public
  6. # License, v. 2.0. If a copy of the MPL was not distributed with this
  7. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  8. #
  9. # This file incorporates work covered by the following license notice:
  10. #
  11. # Licensed to the Apache Software Foundation (ASF) under one or more
  12. # contributor license agreements. See the NOTICE file distributed
  13. # with this work for additional information regarding copyright
  14. # ownership. The ASF licenses this file to you under the Apache
  15. # License, Version 2.0 (the "License"); you may not use this file
  16. # except in compliance with the License. You may obtain a copy of
  17. # the License at http://www.apache.org/licenses/LICENSE-2.0 .
  18. #
  19. require "common.pl";
  20. print "Content-type: text/html\n\n";
  21. # get current and next picture
  22. $sCurrPic = join( "", common::File_read( "currpic.txt" ) );
  23. @aPictureArray = common::File_read( "picture.txt" );
  24. # not last picture or wrong input ?
  25. if( abs( $sCurrPic ) > 0 )
  26. {
  27. $nCurrPic = abs( $sCurrPic );
  28. $nPictureArrayLen = @aPictureArray;
  29. if( $nCurrPic < $nPictureArrayLen )
  30. {
  31. $sPictureName1 = ( split( ";", @aPictureArray[ $nCurrPic ] ) )[ 1 ];
  32. $sPictureName2 = ( split( ";", @aPictureArray[ $nCurrPic + 1 ] ) )[ 1 ];
  33. }
  34. else
  35. {
  36. $sPictureName1 = ( split( ";", @aPictureArray[ $nCurrPic ] ) )[ 1 ];
  37. $sPictureName2 = $sPictureName1;
  38. }
  39. }
  40. print "<HTML>";
  41. print "<HEAD>";
  42. print "<TITLE>$$1</TITLE>";
  43. print "</HEAD>";
  44. print "<BODY bgcolor=\"white\">";
  45. print "<P ALIGN=CENTER><IMG src=\"" . $sPictureName1 . "\" width=$$4 height=$$5 border=0>";
  46. print "<P><IMG src=\"" . $sPictureName2 . "\" width=1 height=1 border=0>";
  47. print "</BODY>";
  48. print "</HTML>";