Advertisement
Guest User

Untitled

a guest
Aug 11th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.87 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for Zend Encoder/SafeGuard & PhpExpress)
  6. *
  7. * @ Version : 1.1.3.0
  8. * @ Author : DeZender
  9. * @ Release on : 17.05.2011
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function download_photo($url, $saveto) {
  15. global $config;
  16.  
  17. if (!( curlSaveToFile( $url, $saveto ))) {
  18. return false;
  19. }
  20.  
  21. return true;
  22. }
  23.  
  24. function curlSaveToFile($url, $local) {
  25. $ch = curl_init( );
  26. $fh = fopen( $local, 'w' );
  27. curl_setopt( $ch, CURLOPT_URL, $url );
  28. curl_setopt( $ch, CURLOPT_FILE, $fh );
  29. curl_setopt( $ch, CURLOPT_HEADER, false );
  30. curl_setopt( $ch, CURLOPT_VERBOSE, false );
  31. curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
  32. curl_setopt( $ch, CURLOPT_NOPROGRESS, true );
  33. curl_setopt( $ch, CURLOPT_USERAGENT, '"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11' );
  34. curl_exec( $ch );
  35.  
  36. if (curl_errno( $ch )) {
  37. return false;
  38. }
  39.  
  40. curl_close( $ch );
  41. fclose( $fh );
  42.  
  43. if (10 < filesize( $local )) {
  44. return true;
  45. }
  46.  
  47. return false;
  48. }
  49.  
  50. function delete_user($USERID) {
  51. global $config;
  52. global $conn;
  53.  
  54. if (0 < $USERID) {
  55. $query = 'select profilepicture from members where USERID=\'' . mysql_real_escape_string( $USERID ) . '\' limit 1';
  56. $executequery = $conn->execute( $query );
  57. $delpp = $executequery->fields['profilepicture'];
  58.  
  59. if ($delpp != '') {
  60. $del1 = $config['membersprofilepicdir'] . '/' . $delpp;
  61.  
  62. if (file_exists( $del1 )) {
  63. unlink( $del1 );
  64. }
  65.  
  66. $del2 = $config['membersprofilepicdir'] . '/thumbs/' . $delpp;
  67.  
  68. if (file_exists( $del2 )) {
  69. unlink( $del2 );
  70. }
  71.  
  72. $del3 = $config['membersprofilepicdir'] . '/o/' . $delpp;
  73.  
  74. if (file_exists( $del3 )) {
  75. unlink( $del3 );
  76. }
  77. }
  78.  
  79. $query = 'SELECT PID FROM posts WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
  80. $results = $conn->execute( $query );
  81. $returnthis = $results->getrows( );
  82. $vtotal = count( $returnthis );
  83.  
  84. for ($i = 0; $i < $vtotal; ++$i) {
  85. $DPID = intval( $returnthis[$i]['PID'] );
  86.  
  87. if (0 < $DPID) {
  88. delete_post( $DPID );
  89. continue;
  90. }
  91. }
  92.  
  93. $query = 'DELETE FROM members WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
  94. $conn->execute( $query );
  95. $query = 'DELETE FROM members_passcode WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
  96. $conn->execute( $query );
  97. $query = 'DELETE FROM members_verifycode WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
  98. $conn->execute( $query );
  99. $query = 'DELETE FROM posts_favorited WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
  100. $conn->execute( $query );
  101. $query = 'DELETE FROM posts_unfavorited WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
  102. $conn->execute( $query );
  103. }
  104.  
  105. }
  106.  
  107. function delete_post($PID) {
  108. global $config;
  109. global $conn;
  110.  
  111. if (0 < $PID) {
  112. $query = 'select pic from posts where PID=\'' . mysql_real_escape_string( $PID ) . '\' limit 1';
  113. $executequery = $conn->execute( $query );
  114. $thepp = $executequery->fields['pic'];
  115.  
  116. if ($thepp != '') {
  117. $p1 = $config['pdir'] . '/t/l-' . $thepp;
  118.  
  119. if (file_exists( $p1 )) {
  120. @unlink( $p1 );
  121. }
  122.  
  123. $p1 = $config['pdir'] . '/t/' . $thepp;
  124.  
  125. if (file_exists( $p1 )) {
  126. @unlink( $p1 );
  127. }
  128.  
  129. $p1 = $config['pdir'] . '/t/s-' . $thepp;
  130.  
  131. if (file_exists( $p1 )) {
  132. @unlink( $p1 );
  133. }
  134.  
  135. $p1 = $config['pdir'] . '/' . $thepp;
  136.  
  137. if (file_exists( $p1 )) {
  138. @unlink( $p1 );
  139. }
  140. }
  141.  
  142. $query = 'DELETE FROM posts WHERE PID=\'' . mysql_real_escape_string( $PID ) . '\'';
  143. $conn->execute( $query );
  144. $query = 'DELETE FROM posts_favorited WHERE PID=\'' . mysql_real_escape_string( $PID ) . '\'';
  145. $conn->execute( $query );
  146. $query = 'DELETE FROM posts_reports WHERE PID=\'' . mysql_real_escape_string( $PID ) . '\'';
  147. $conn->execute( $query );
  148. $query = 'DELETE FROM posts_unfavorited WHERE PID=\'' . mysql_real_escape_string( $PID ) . '\'';
  149. $conn->execute( $query );
  150. }
  151.  
  152. }
  153.  
  154. function do_resize_image($file, $width = 0, $height = 0, $proportional = false, $output = 'file') {
  155. if ($height <= 0) {
  156. if ($width <= 0) {
  157. return false;
  158. }
  159. }
  160.  
  161. $info = getimagesize( $file );
  162. $image = '';
  163. $final_width = 0;
  164. $final_height = 0;
  165. $height_old = $info[1];
  166. $width_old = $info[0];
  167.  
  168. if ($proportional) {
  169. if ($width == 0) {
  170. $factor = $height / $height_old;
  171. } else {
  172. if ($height == 0) {
  173. $factor = $width / $width_old;
  174. } else {
  175. $factor = min( $width / $width_old, $height / $height_old );
  176. }
  177. }
  178.  
  179. $final_width = round( $width_old * $factor );
  180. $final_height = round( $height_old * $factor );
  181.  
  182. if ($width_old < $final_width) {
  183. if ($height_old < $final_height) {
  184. $final_width = $width_old;
  185. $final_height = $height_old;
  186. }
  187. }
  188. } else {
  189. $final_width = ($width <= 0 ? $width_old : $width);
  190. $final_height = ($height <= 0 ? $height_old : $height);
  191. }
  192.  
  193. switch ($info[2]) {
  194. case IMAGETYPE_GIF: {
  195. $image = imagecreatefromgif( $file );
  196. break;
  197. }
  198.  
  199. case IMAGETYPE_JPEG: {
  200. $image = imagecreatefromjpeg( $file );
  201. break;
  202. }
  203.  
  204. case IMAGETYPE_PNG: {
  205. $image = imagecreatefrompng( $file );
  206. break;
  207. }
  208. }
  209.  
  210. return false;
  211. }
  212.  
  213. function cleanit($text) {
  214. return htmlentities( strip_tags( stripslashes( $text ) ), ENT_COMPAT, 'UTF-8' );
  215. }
  216.  
  217. function insert_get_seo_profile($a) {
  218. $uname = $a['username'];
  219. echo 'user/' . $uname;
  220. }
  221.  
  222. function get_seo_profile($uname) {
  223. return 'user/' . $uname;
  224. }
  225.  
  226. function escape($data) {
  227. if (ini_get( 'magic_quotes_gpc' )) {
  228. $data = stripslashes( $data );
  229. }
  230.  
  231. return mysql_real_escape_string( $data );
  232. }
  233.  
  234. function insert_get_advertisement($var) {
  235. global $conn;
  236.  
  237. $query = 'SELECT code FROM advertisements WHERE AID=\'' . mysql_real_escape_string( $var[AID] ) . '\' AND active=\'1\' limit 1';
  238. $executequery = $conn->execute( $query );
  239. $getad = $executequery->fields[code];
  240. echo strip_mq_gpc( $getad );
  241. }
  242.  
  243. function verify_email_username($usernametocheck) {
  244. global $config;
  245. global $conn;
  246.  
  247. $query = 'select count(*) as total from members where username=\'' . mysql_real_escape_string( $usernametocheck ) . '\' limit 1';
  248. $executequery = $conn->execute( $query );
  249. $totalu = $executequery->fields[total];
  250.  
  251. if (1 <= $totalu) {
  252. return false;
  253. }
  254.  
  255. return true;
  256. }
  257.  
  258. function verify_valid_email($emailtocheck) {
  259. $eregicheck = '^([-!#$%&\'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#$%&\'*+/0-9=?A-Z^_`a-z{|}~]+\.)+[a-zA-Z]{2,4}$';
  260. return eregi( $eregicheck, $emailtocheck );
  261. }
  262.  
  263. function verify_email_unique($emailtocheck) {
  264. global $config;
  265. global $conn;
  266.  
  267. $query = 'select count(*) as total from members where email=\'' . mysql_real_escape_string( $emailtocheck ) . '\' limit 1';
  268. $executequery = $conn->execute( $query );
  269. $totalemails = $executequery->fields[total];
  270.  
  271. if (1 <= $totalemails) {
  272. return false;
  273. }
  274.  
  275. return true;
  276. }
  277.  
  278. function mailme($sendto, $sendername, $from, $subject, $sendmailbody, $bcc = '') {
  279. global $SERVER_NAME;
  280.  
  281. $subject = nl2br( $subject );
  282. $sendmailbody = nl2br( $sendmailbody );
  283. $sendto = $sendto;
  284.  
  285. if ($bcc != '') {
  286. $headers = 'Bcc: ' . $bcc . '
  287. ';
  288. }
  289.  
  290. $headers = 'MIME-Version: 1.0
  291. ';
  292. $headers .= 'Content-type: text/html; charset=utf-8
  293. ';
  294. $headers .= 'X-Priority: 3
  295. ';
  296. $headers .= 'X-MSMail-Priority: Normal
  297. ';
  298. $headers .= 'X-Mailer: PHP/MIME-Version: 1.0
  299. ';
  300. $headers .= 'From: ' . $from . '
  301. ';
  302. $headers .= 'Content-Type: text/html
  303. ';
  304. mail( '' . $sendto, '' . $subject, '' . $sendmailbody, '' . $headers );
  305. }
  306. ...............................................................
  307. ......................................
  308. ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement