PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/Quản lý website blog radio PHP/includes/constants.php

https://gitlab.com/phamngsinh/baitaplon_sinhvien
PHP | 239 lines | 83 code | 61 blank | 95 comment | 5 complexity | 2cd613244c5ee25ced34def2b2244a5c MD5 | raw file
  1. <?php
  2. /**
  3. * @Project NUKEVIET 3.x
  4. * @Author VINADES.,JSC (contact@vinades.vn)
  5. * @Copyright (C) 2012 VINADES.,JSC. All rights reserved
  6. * @Createdate 1-27-2010 5:25
  7. */
  8. if ( ! defined( 'NV_MAINFILE' ) ) die( 'Stop!!!' );
  9. //Neu thay doi bat ky gia tri trong file nay ban can vao admin phan cau hinh he thong va luu lai
  10. //Ten file config
  11. define( "NV_CONFIG_FILENAME", "config.php" );
  12. //Ten thu muc admin
  13. define( "NV_ADMINDIR", "admin" );
  14. //Ten thu muc editors
  15. define( "NV_EDITORSDIR", "editors" );
  16. //Thu muc chua dien dan
  17. define( "DIR_FORUM", "forum" );
  18. //Thu muc uploads
  19. define( "NV_UPLOADS_DIR", "uploads" );
  20. //Thu muc files
  21. define( "NV_FILES_DIR", "files" );
  22. //Thu muc uploads banner
  23. define( "NV_BANNER_DIR", "banners" );
  24. //Thu muc chua cac file logs
  25. define( "NV_LOGS_DIR", "logs" );
  26. //Thu muc chua sessions
  27. define( "NV_SESSION_SAVE_PATH", "sess" );
  28. //Thu muc chua cac file tam thoi
  29. define( "NV_TEMP_DIR", "tmp" );
  30. //Ten thu muc cache
  31. define( "NV_CACHEDIR", "cache" );
  32. //Ten thu muc luu data
  33. define( "NV_DATADIR", "data" );
  34. //TDT file tam thoi, toi da 3 ky tu
  35. define( "NV_TEMPNAM_PREFIX", "nv_" );
  36. //Ten file error_log
  37. define( 'NV_ERRORLOGS_FILENAME', 'error_log' );
  38. //duoi cua file log
  39. define( "NV_LOGS_EXT", "log" );
  40. //Ten thay the cho bien $name
  41. define( "NV_NAME_VARIABLE", "nv" );
  42. //Ten thay the cho bien $op
  43. define( "NV_OP_VARIABLE", "op" );
  44. //Ten thay the cho bien ngon ngu
  45. define( "NV_LANG_VARIABLE", "language" );
  46. //Ten bien kiem tra lai mat khau admin
  47. define( "NV_ADMINRELOGIN_VARIABLE", "adminrelogin" );
  48. //So lan admin duoc phep kiem tra lai password.
  49. //Neu sau so lan do ma van khai bao sai, he thong se tuoc quyen admin va day ra trang chu
  50. define( "NV_ADMINRELOGIN_MAX", 3 );
  51. //Quang thoi gian de kiem tra lai pass cua admin (Neu admin khong hoat dong)
  52. define( "NV_ADMIN_CHECK_PASS_TIME", 3600 );
  53. //Thoi gian ton tai cua cookie, 31536000 giay = 1 nam
  54. define( 'NV_LIVE_COOKIE_TIME', 31536000 );
  55. //Thoi gian ton tai cua session, 0 = ton tai cho den khi dong trinh duyet
  56. define( 'NV_LIVE_SESSION_TIME', 0 );
  57. //Do nen trang khi bat che do nen
  58. define( 'ZLIB_OUTPUT_COMPRESSION_LEVEL', 6 );
  59. //Phuong phap ma hoa mat khau: 0 = md5, 1 = sha1
  60. define( 'NV_CRYPT_SHA1', 1 );
  61. //so ky tu toi da cua password doi voi user
  62. define( 'NV_UPASSMAX', 20 );
  63. //so ky tu toi thieu cua password doi voi user
  64. define( 'NV_UPASSMIN', 5 );
  65. //so ky tu toi da cua ten tai khoan doi voi user
  66. define( 'NV_UNICKMAX', 20 );
  67. //so ky tu toi thieu cua ten tai khoan doi voi user
  68. define( 'NV_UNICKMIN', 4 );
  69. //so ky tu cua Ma kiem tra
  70. define( 'NV_GFX_NUM', 6 );
  71. //Kich thuoc cua hinh hien thi Ma kiem tra
  72. define( 'NV_GFX_WIDTH', 120 );
  73. define( 'NV_GFX_HEIGHT', 25 );
  74. //Thoi gian de tinh online, tinh bang giay, 300 = 5 phut
  75. define( 'NV_ONLINE_UPD_TIME', 300 );
  76. //Thoi gian luu tru referer, 2592000 = 30 ngay
  77. define( 'NV_REF_LIVE_TIME', 2592000 );
  78. //Chieu rong toi da cua hinh tai len
  79. define( 'NV_MAX_WIDTH', 1500 );
  80. //Chieu dai toi da cua hinh tai len
  81. define( 'NV_MAX_HEIGHT', 1500 );
  82. //So ky tu toi thieu cua input tim kiem
  83. define( 'NV_MIN_SEARCH_LENGTH', 3 );
  84. //So ky tu toi da cua input tim kiem
  85. define( 'NV_MAX_SEARCH_LENGTH', 60 );
  86. //Co bat tinh nang chong flood hay khong
  87. define( 'NV_IS_FLOOD_BLOCKER', 1 );
  88. //So requests toi da trong 1 phut
  89. define( 'NV_MAX_REQUESTS_60', 40 );
  90. //So requests toi da trong 5 phut
  91. define( 'NV_MAX_REQUESTS_300', 150 );
  92. //ky tu phan cach trong title
  93. define( "NV_TITLEBAR_DEFIS", "-" );
  94. //Cac thiet lap trong siteword
  95. define( 'NV_SITEWORDS_MIN_WORD_LENGTH', 4 );
  96. define( 'NV_SITEWORDS_MIN_WORD_OCCUR', 5 );
  97. define( 'NV_SITEWORDS_MIN_2WORDS_LENGTH', 2 );
  98. define( 'NV_SITEWORDS_MIN_2WORDS_PHRASE_OCCUR', 2 );
  99. define( 'NV_SITEWORDS_MIN_3WORDS_LENGTH', 0 );
  100. define( 'NV_SITEWORDS_MIN_3WORDS_PHRASE_OCCUR', 0 );
  101. define( 'NV_SITEWORDS_MAX_STRLEN', 300 );
  102. //Mac dinh, neu cac thong so khong thay doi, MySQL khong ket noi moi
  103. //ma quay lai voi ket noi cu. Neu NEW_LINK = true se khien MySql luon ket noi moi
  104. define( 'NV_MYSQL_NEW_LINK', false );
  105. //Neu true: Ket noi thuong xuyen
  106. //false: Ket noi khi can
  107. define( 'NV_MYSQL_PERSISTENCY', false );
  108. // mysql 5.6 support utf8_general_ci, utf8_vietnamese_ci
  109. define( 'NV_MYSQL_COLLATION', 'utf8_general_ci' );
  110. // Thiet lap cho get,post,cookie,session,request,env,server
  111. define( "NV_COOKIE_SECURE", 0 );
  112. define( "NV_COOKIE_HTTPONLY", 1 );
  113. define( "NV_ALLOW_REQUEST_MODS", "get,post,cookie,session,request,env,server" );
  114. define( "NV_REQUEST_DEFAULT_MODE", "request" );
  115. define( "NV_XSS_REPLACESTRING", "<x>" );
  116. //HIen thi, ghi loi
  117. //Khong chinh sua gi o 4 dong duoi nay
  118. if ( ! defined( 'E_STRICT' ) ) define( 'E_STRICT', 2048 ); //khong sua
  119. if ( ! defined( 'E_RECOVERABLE_ERROR' ) ) define( 'E_RECOVERABLE_ERROR', 4096 ); //khong sua
  120. if ( ! defined( 'E_DEPRECATED' ) ) define( 'E_DEPRECATED', 8192 ); //khong sua
  121. if ( ! defined( 'E_USER_DEPRECATED' ) ) define( 'E_USER_DEPRECATED', 16384 ); //khong sua
  122. /*
  123. E_ALL - All errors and warnings (doesn't include E_STRICT)
  124. E_ERROR - fatal run-time errors
  125. E_WARNING - run-time warnings (non-fatal errors)
  126. E_PARSE - compile-time parse errors
  127. E_NOTICE - run-time notices (these are warnings which often result
  128. from a bug in your code, but it's possible that it was
  129. intentional (e.g., using an uninitialized variable and
  130. relying on the fact it's automatically initialized to an
  131. empty string)
  132. E_STRICT - run-time notices, enable to have PHP suggest changes
  133. to your code which will ensure the best interoperability
  134. and forward compatibility of your code
  135. E_CORE_ERROR - fatal errors that occur during PHP's initial startup
  136. E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
  137. initial startup
  138. E_COMPILE_ERROR - fatal compile-time errors
  139. E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
  140. E_USER_ERROR - user-generated error message
  141. E_USER_WARNING - user-generated warning message
  142. E_USER_NOTICE - user-generated notice message
  143. Examples:
  144. - Show all errors, except for notices and coding standards warnings
  145. error_reporting = E_ALL & ~E_NOTICE
  146. - Show all errors, except for notices
  147. error_reporting = E_ALL & ~E_NOTICE | E_STRICT
  148. - Show only errors
  149. error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
  150. */
  151. define( "NV_DISPLAY_ERRORS_LIST", E_ALL ); //Danh sach cac loi se hien thi
  152. //define( "NV_DISPLAY_ERRORS_LIST", 0); //tat thong bao loi
  153. define( "NV_LOG_ERRORS_LIST", E_ALL | E_STRICT ); //Danh sach cac loi se ghi log
  154. define( "NV_SEND_ERRORS_LIST", E_USER_ERROR ); //Danh sach cac loi se gui den email
  155. // Ma HTML duoc chap nhan
  156. define( 'NV_ALLOWED_HTML_TAGS', 'embed, object, param, a, b, blockquote, br, caption, col, colgroup, div, em, h1, h2, h3, h4, h5, h6, hr, i, img, li, p, span, strong, sub, sup, table, tbody, td, th, tr, u, ul' );
  157. //Phan dau cua trang
  158. define( 'NV_FILEHEAD', "/**\n * @Project NUKEVIET 3.x\n * @Author VINADES.,JSC (contact@vinades.vn)\n * @Copyright (C) " . gmdate( "Y" ) . " VINADES.,JSC. All rights reserved\n * @Createdate " . gmdate( "D, d M Y H:i:s" ) . " GMT\n */" );
  159. // Phien ban giao dien tu cao den thap - it nhat phai co hai kieu mac dinh khong duoc it hon
  160. define( "NV_THEME_TYPE", 'd,t' );
  161. //Chong IFRAME
  162. define( "NV_ANTI_IFRAME", 0 );
  163. $global_config['site_charset'] = "utf-8";
  164. $global_config['check_module'] = "/^[a-z0-9\-]+$/";
  165. $global_config['check_op'] = "/^[a-zA-Z0-9\-]+$/";
  166. $global_config['check_op_file'] = "/^([a-zA-Z0-9\-\_]+)\.php$/";
  167. $global_config['check_block_global'] = "/^global\.([a-zA-Z0-9\-\_]+)\.php$/";
  168. $global_config['check_block_module'] = "/^(global|module)\.([a-zA-Z0-9\-\_]+)\.php$/";
  169. $global_config['check_theme'] = "/^(?!admin\_|mobile\_)([a-zA-Z0-9\-\_]+)$/";
  170. $global_config['check_theme_mobile'] = "/^(mobile)\_[a-zA-Z0-9\-\_]+$/";
  171. $global_config['check_theme_admin'] = "/^(admin)\_[a-zA-Z0-9\-\_]+$/";
  172. $global_config['check_email'] = '/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/';
  173. $global_config['check_cron'] = "/^(cron)\_[a-zA-Z0-9\_]+$/";
  174. $global_config['check_op_layout'] = "/^layout\.([a-zA-Z0-9\-\_]+)\.tpl$/";
  175. ?>