Просмотр файла catalogdeep/test/functions.php

Размер файла: 1.17Kb
  1. <?php<< Error_Reporting(0);
  2.  
  3.  
  4.  
  5. /**
  6.  
  7. * JAVA download-центр
  8.  
  9. * (c) USED for МАКСИМКО)))
  10.  
  11. */
  12.  
  13.  
  14.  
  15. if ( !in_array ( 'config.php', get_included_files () ) )
  16.  
  17. include ( 'config.php' );
  18.  
  19.  
  20.  
  21. function myHeader ( $title )
  22.  
  23. {
  24.  
  25. global $style;
  26. include '../bloks/top_site.php';
  27.  
  28. }
  29.  
  30.  
  31.  
  32. function myFooter ()
  33.  
  34. {
  35.  
  36. include '../bloks/c_banners.php';
  37.  
  38. }
  39.  
  40.  
  41.  
  42. function markImage ( $image, $saveto )
  43.  
  44.  
  45.  
  46. {
  47.  
  48.  
  49.  
  50. global $copyright;
  51.  
  52.  
  53.  
  54. $pinfo = pathinfo ( $image );
  55.  
  56. $ext = strtolower ( $pinfo['extension'] );
  57.  
  58. switch ( $ext )
  59.  
  60. {
  61.  
  62. case 'gif':
  63.  
  64. $i = imagecreatefromgif ( $image );
  65.  
  66. break;
  67.  
  68. case 'jpg': case 'jpeg':
  69.  
  70. $i = imagecreatefromjpeg ( $image );
  71.  
  72. break; break;
  73.  
  74. case 'png':
  75.  
  76. $i = imagecreatefrompng ( $image );
  77.  
  78. break;
  79.  
  80. default:
  81.  
  82. RETURN FALSE;
  83.  
  84. break;
  85.  
  86. }
  87.  
  88.  
  89.  
  90. //$white = imagecolorallocate ( $i, 255, 10, 15 );
  91.  
  92. //imagestring ( $i, 3, 2, 1, $copyright, $white);
  93.  
  94.  
  95.  
  96. $i2 = imagecreatefrompng ( 'mark.png' );
  97.  
  98. imagejpeg ( $i, 'tmp/tmp.jpeg' );
  99.  
  100. $i = imagecreatefromjpeg ( 'tmp/tmp.jpeg');
  101.  
  102. imagecopyresampled ( $i, $i2, 0, 0, 0, 0, imagesx ( $i ), imagesy ( $i ), imagesx ( $i2 ), imagesy ( $i2 ) );
  103.  
  104. @unlink ( 'tmp/tmp.jpeg' );
  105.  
  106. //header ( "Content-type: image/png" );
  107.  
  108. imagepng ( $i, $saveto );
  109.  
  110.  
  111.  
  112. RETURN;
  113.  
  114.  
  115.  
  116. }
  117.  
  118.  
  119.  
  120.  
  121.  
  122. ?>
  123.