Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for Zend Encoder/SafeGuard & PhpExpress)
- *
- * @ Version : 1.1.3.0
- * @ Author : DeZender
- * @ Release on : 17.05.2011
- * @ Official site : http://DeZender.Net
- *
- */
- function download_photo($url, $saveto) {
- global $config;
- if (!( curlSaveToFile( $url, $saveto ))) {
- return false;
- }
- return true;
- }
- function curlSaveToFile($url, $local) {
- $ch = curl_init( );
- $fh = fopen( $local, 'w' );
- curl_setopt( $ch, CURLOPT_URL, $url );
- curl_setopt( $ch, CURLOPT_FILE, $fh );
- curl_setopt( $ch, CURLOPT_HEADER, false );
- curl_setopt( $ch, CURLOPT_VERBOSE, false );
- curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
- curl_setopt( $ch, CURLOPT_NOPROGRESS, true );
- 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' );
- curl_exec( $ch );
- if (curl_errno( $ch )) {
- return false;
- }
- curl_close( $ch );
- fclose( $fh );
- if (10 < filesize( $local )) {
- return true;
- }
- return false;
- }
- function delete_user($USERID) {
- global $config;
- global $conn;
- if (0 < $USERID) {
- $query = 'select profilepicture from members where USERID=\'' . mysql_real_escape_string( $USERID ) . '\' limit 1';
- $executequery = $conn->execute( $query );
- $delpp = $executequery->fields['profilepicture'];
- if ($delpp != '') {
- $del1 = $config['membersprofilepicdir'] . '/' . $delpp;
- if (file_exists( $del1 )) {
- unlink( $del1 );
- }
- $del2 = $config['membersprofilepicdir'] . '/thumbs/' . $delpp;
- if (file_exists( $del2 )) {
- unlink( $del2 );
- }
- $del3 = $config['membersprofilepicdir'] . '/o/' . $delpp;
- if (file_exists( $del3 )) {
- unlink( $del3 );
- }
- }
- $query = 'SELECT PID FROM posts WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
- $results = $conn->execute( $query );
- $returnthis = $results->getrows( );
- $vtotal = count( $returnthis );
- for ($i = 0; $i < $vtotal; ++$i) {
- $DPID = intval( $returnthis[$i]['PID'] );
- if (0 < $DPID) {
- delete_post( $DPID );
- continue;
- }
- }
- $query = 'DELETE FROM members WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
- $conn->execute( $query );
- $query = 'DELETE FROM members_passcode WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
- $conn->execute( $query );
- $query = 'DELETE FROM members_verifycode WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
- $conn->execute( $query );
- $query = 'DELETE FROM posts_favorited WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
- $conn->execute( $query );
- $query = 'DELETE FROM posts_unfavorited WHERE USERID=\'' . mysql_real_escape_string( $USERID ) . '\'';
- $conn->execute( $query );
- }
- }
- function delete_post($PID) {
- global $config;
- global $conn;
- if (0 < $PID) {
- $query = 'select pic from posts where PID=\'' . mysql_real_escape_string( $PID ) . '\' limit 1';
- $executequery = $conn->execute( $query );
- $thepp = $executequery->fields['pic'];
- if ($thepp != '') {
- $p1 = $config['pdir'] . '/t/l-' . $thepp;
- if (file_exists( $p1 )) {
- @unlink( $p1 );
- }
- $p1 = $config['pdir'] . '/t/' . $thepp;
- if (file_exists( $p1 )) {
- @unlink( $p1 );
- }
- $p1 = $config['pdir'] . '/t/s-' . $thepp;
- if (file_exists( $p1 )) {
- @unlink( $p1 );
- }
- $p1 = $config['pdir'] . '/' . $thepp;
- if (file_exists( $p1 )) {
- @unlink( $p1 );
- }
- }
- $query = 'DELETE FROM posts WHERE PID=\'' . mysql_real_escape_string( $PID ) . '\'';
- $conn->execute( $query );
- $query = 'DELETE FROM posts_favorited WHERE PID=\'' . mysql_real_escape_string( $PID ) . '\'';
- $conn->execute( $query );
- $query = 'DELETE FROM posts_reports WHERE PID=\'' . mysql_real_escape_string( $PID ) . '\'';
- $conn->execute( $query );
- $query = 'DELETE FROM posts_unfavorited WHERE PID=\'' . mysql_real_escape_string( $PID ) . '\'';
- $conn->execute( $query );
- }
- }
- function do_resize_image($file, $width = 0, $height = 0, $proportional = false, $output = 'file') {
- if ($height <= 0) {
- if ($width <= 0) {
- return false;
- }
- }
- $info = getimagesize( $file );
- $image = '';
- $final_width = 0;
- $final_height = 0;
- $height_old = $info[1];
- $width_old = $info[0];
- if ($proportional) {
- if ($width == 0) {
- $factor = $height / $height_old;
- } else {
- if ($height == 0) {
- $factor = $width / $width_old;
- } else {
- $factor = min( $width / $width_old, $height / $height_old );
- }
- }
- $final_width = round( $width_old * $factor );
- $final_height = round( $height_old * $factor );
- if ($width_old < $final_width) {
- if ($height_old < $final_height) {
- $final_width = $width_old;
- $final_height = $height_old;
- }
- }
- } else {
- $final_width = ($width <= 0 ? $width_old : $width);
- $final_height = ($height <= 0 ? $height_old : $height);
- }
- switch ($info[2]) {
- case IMAGETYPE_GIF: {
- $image = imagecreatefromgif( $file );
- break;
- }
- case IMAGETYPE_JPEG: {
- $image = imagecreatefromjpeg( $file );
- break;
- }
- case IMAGETYPE_PNG: {
- $image = imagecreatefrompng( $file );
- break;
- }
- }
- return false;
- }
- function cleanit($text) {
- return htmlentities( strip_tags( stripslashes( $text ) ), ENT_COMPAT, 'UTF-8' );
- }
- function insert_get_seo_profile($a) {
- $uname = $a['username'];
- echo 'user/' . $uname;
- }
- function get_seo_profile($uname) {
- return 'user/' . $uname;
- }
- function escape($data) {
- if (ini_get( 'magic_quotes_gpc' )) {
- $data = stripslashes( $data );
- }
- return mysql_real_escape_string( $data );
- }
- function insert_get_advertisement($var) {
- global $conn;
- $query = 'SELECT code FROM advertisements WHERE AID=\'' . mysql_real_escape_string( $var[AID] ) . '\' AND active=\'1\' limit 1';
- $executequery = $conn->execute( $query );
- $getad = $executequery->fields[code];
- echo strip_mq_gpc( $getad );
- }
- function verify_email_username($usernametocheck) {
- global $config;
- global $conn;
- $query = 'select count(*) as total from members where username=\'' . mysql_real_escape_string( $usernametocheck ) . '\' limit 1';
- $executequery = $conn->execute( $query );
- $totalu = $executequery->fields[total];
- if (1 <= $totalu) {
- return false;
- }
- return true;
- }
- function verify_valid_email($emailtocheck) {
- $eregicheck = '^([-!#$%&\'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#$%&\'*+/0-9=?A-Z^_`a-z{|}~]+\.)+[a-zA-Z]{2,4}$';
- return eregi( $eregicheck, $emailtocheck );
- }
- function verify_email_unique($emailtocheck) {
- global $config;
- global $conn;
- $query = 'select count(*) as total from members where email=\'' . mysql_real_escape_string( $emailtocheck ) . '\' limit 1';
- $executequery = $conn->execute( $query );
- $totalemails = $executequery->fields[total];
- if (1 <= $totalemails) {
- return false;
- }
- return true;
- }
- function mailme($sendto, $sendername, $from, $subject, $sendmailbody, $bcc = '') {
- global $SERVER_NAME;
- $subject = nl2br( $subject );
- $sendmailbody = nl2br( $sendmailbody );
- $sendto = $sendto;
- if ($bcc != '') {
- $headers = 'Bcc: ' . $bcc . '
- ';
- }
- $headers = 'MIME-Version: 1.0
- ';
- $headers .= 'Content-type: text/html; charset=utf-8
- ';
- $headers .= 'X-Priority: 3
- ';
- $headers .= 'X-MSMail-Priority: Normal
- ';
- $headers .= 'X-Mailer: PHP/MIME-Version: 1.0
- ';
- $headers .= 'From: ' . $from . '
- ';
- $headers .= 'Content-Type: text/html
- ';
- mail( '' . $sendto, '' . $subject, '' . $sendmailbody, '' . $headers );
- }
- ...............................................................
- ......................................
- ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement