PageRenderTime 219ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/Quản lý website đọc truyện online PHP/users/includes/album/image_upload.php

https://gitlab.com/phamngsinh/baitaplon_sinhvien
PHP | 108 lines | 4 code | 4 blank | 100 comment | 0 complexity | e5778f834986eafd71052e432afeece2 MD5 | raw file
  1. <?php
  2. defined('_IN_JOHNCMS') or die('Error: restricted access');
  3. require('../incfiles/head.php');
  4. // if(!$website)
  5. // /**
  6. // * @package JohnCMS
  7. // * @link http://johncms.com
  8. // * @copyright Copyright (C) 2008-2011 JohnCMS Community
  9. // * @license LICENSE.txt (see attached file)
  10. // * @version VERSION.txt (see attached file)
  11. // * @author http://johncms.com/about
  12. // */
  13. // defined('_IN_JOHNCMS') or die('Error: restricted access');
  14. // require('../incfiles/head.php');
  15. // /*
  16. // -----------------------------------------------------------------
  17. // Выгрузка фотографии
  18. // -----------------------------------------------------------------
  19. // */
  20. // if ($al && $user['id'] == $user_id || $rights >= 7) {
  21. // $req_a = mysql_query("SELECT * FROM `cms_album_cat` where `website` = '$website' AND `id` = '$al' AND `user_id` = '" . $user['id'] . "'");
  22. // if (!mysql_num_rows($req_a)) {
  23. // echo functions::display_error($lng['error_wrong_data']);
  24. // require('../incfiles/end.php');
  25. // exit;
  26. // }
  27. // $res_a = mysql_fetch_assoc($req_a);
  28. // require('../incfiles/lib/class.upload.php');
  29. // echo '<div class="phdr"><a href="album.php?act=show&amp;al=' . $al . '&amp;user=' . $user['id'] . '"><b>' . $lng['photo_album'] . '</b></a> | ' . $lng_profile['upload_photo'] . '</div>';
  30. // if (isset($_POST['submit'])) {
  31. // $handle = new upload($_FILES['imagefile']);
  32. // if ($handle->uploaded) {
  33. // $handle->file_new_name_body = 'img_' . time();
  34. // $handle->allowed = array(
  35. // 'image/jpeg',
  36. // 'image/gif',
  37. // 'image/png'
  38. // );
  39. // $handle->file_max_size = 1024*1024;
  40. // $handle->image_resize = true;
  41. // $handle->image_x = 640;
  42. // $handle->image_y = 480;
  43. // $handle->image_ratio_no_zoom_in = true;
  44. // $handle->image_convert = 'jpg';
  45. // Поставить в зависимость от настроек в Админке
  46. // $handle->image_text = $set['homeurl'];
  47. // $handle->image_text_x = 0;
  48. // $handle->image_text_y = 0;
  49. // $handle->image_text_font = 3;
  50. // $handle->image_text_background = '#AAAAAA';
  51. // $handle->image_text_background_percent = 50;
  52. // $handle->image_text_padding = 1;
  53. // $handle->process('../files/users/album/' . $user['id'] . '/');
  54. // $img_name = $handle->file_dst_name;
  55. // if ($handle->processed) {
  56. // Обрабатываем превьюшку
  57. // $handle->file_new_name_body = 'tmb_' . time();
  58. // $handle->image_resize = true;
  59. // $handle->image_x = 80;
  60. // $handle->image_y = 80;
  61. // $handle->image_ratio_no_zoom_in = true;
  62. // $handle->image_convert = 'jpg';
  63. // $handle->process('../files/users/album/' . $user['id'] . '/');
  64. // $tmb_name = $handle->file_dst_name;
  65. // if ($handle->processed) {
  66. // $description = isset($_POST['description']) ? trim($_POST['description']) : '';
  67. // $description = mb_substr($description, 0, 500);
  68. // mysql_query("INSERT INTO `cms_album_files` SET
  69. // `album_id` = '$al',
  70. // `user_id` = '" . $user['id'] . "',
  71. // `img_name` = '" . mysql_real_escape_string($img_name) . "',
  72. // `tmb_name` = '" . mysql_real_escape_string($tmb_name) . "',
  73. // `description` = '" . mysql_real_escape_string($description) . "',
  74. // `time` = '" . time() . "',
  75. // `access` = '" . $res_a['access'] . "',
  76. // `website` = '$website'
  77. // ");
  78. // echo '<div class="gmenu"><p>' . $lng_profile['photo_uploaded'] . '<br />' .
  79. // '<a href="album.php?act=show&amp;al=' . $al . '&amp;user=' . $user['id'] . '">' . $lng['continue'] . '</a></p></div>' .
  80. // '<div class="phdr"><a href="profile.php?user=' . $user['id'] . '">' . $lng['profile'] . '</a></div>';
  81. // } else {
  82. // echo functions::display_error($handle->error);
  83. // }
  84. // } else {
  85. // echo functions::display_error($handle->error);
  86. // }
  87. // $handle->clean();
  88. // }
  89. // } else {
  90. // echo '<form enctype="multipart/form-data" method="post" action="album.php?act=image_upload&amp;al=' . $al . '&amp;user=' . $user['id'] . '">' .
  91. // '<div class="menu"><p><h3>' . $lng_profile['select_image'] . '</h3>' .
  92. // '<input type="file" name="imagefile" value="" /></p>' .
  93. // '<p><h3>' . $lng['description'] . '</h3>' .
  94. // '<textarea name="description" rows="' . $set_user['field_h'] . '"></textarea><br />' .
  95. // '<small>' . $lng['not_mandatory_field'] . ', max. 500</small></p>' .
  96. // '<input type="hidden" name="MAX_FILE_SIZE" value="' . (1024*1024 ) . '" />' .
  97. // '<p><input type="submit" name="submit" value="' . $lng_profile['upload'] . '" /></p>' .
  98. // '</div></form>' .
  99. // '<div class="phdr"><small>' . $lng_profile['select_image_help'] . ' ' . $set['flsz'] . 'kb.<br />' . $lng_profile['select_image_help_5'] . '</small></div>' .
  100. // '<p><a href="album.php?act=show&amp;al=' . $al . '&amp;user=' . $user['id'] . '">' . $lng['back'] . '</a></p>';
  101. // }
  102. // }
  103. // ?>
  104. Chúng tôi tạm bảo trì chức năng này