diff --git a/wp-content/plugins/bp-dedication/includes/bp-dedication-functions.php b/wp-content/plugins/bp-dedication/includes/bp-dedication-functions.php index c845117..1bca57c 100644 --- a/wp-content/plugins/bp-dedication/includes/bp-dedication-functions.php +++ b/wp-content/plugins/bp-dedication/includes/bp-dedication-functions.php @@ -89,31 +89,33 @@ if ( !defined( 'DECODE_ENCODE_KEY' ) ) define( 'DECODE_ENCODE_KEY', 'asong2u' ); function bp_dedication_encode($string) { - $key = sha1($key); - $strLen = strlen($string); - $keyLen = strlen($key); - for ($i = 0; $i < $strLen; $i++) { - $ordStr = ord(substr($string,$i,1)); - if ($j == $keyLen) { $j = 0; } - $ordKey = ord(substr($key,$j,1)); - $j++; - $hash .= strrev(base_convert(dechex($ordStr + $ordKey),16,36)); - } - return $hash; + return base64_encode($string); +// $key = sha1($key); +// $strLen = strlen($string); +// $keyLen = strlen($key); +// for ($i = 0; $i < $strLen; $i++) { +// $ordStr = ord(substr($string,$i,1)); +// if ($j == $keyLen) { $j = 0; } +// $ordKey = ord(substr($key,$j,1)); +// $j++; +// $hash .= strrev(base_convert(dechex($ordStr + $ordKey),16,36)); +// } +// return $hash; } function bp_dedication_decode($string) { - $key = sha1($key); - $strLen = strlen($string); - $keyLen = strlen($key); - for ($i = 0; $i < $strLen; $i+=2) { - $ordStr = hexdec(base_convert(strrev(substr($string,$i,2)),36,16)); - if ($j == $keyLen) { $j = 0; } - $ordKey = ord(substr($key,$j,1)); - $j++; - $hash .= chr($ordStr - $ordKey); - } - return $hash; + return base64_decode($string); +// $key = sha1($key); +// $strLen = strlen($string); +// $keyLen = strlen($key); +// for ($i = 0; $i < $strLen; $i+=2) { +// $ordStr = hexdec(base_convert(strrev(substr($string,$i,2)),36,16)); +// if ($j == $keyLen) { $j = 0; } +// $ordKey = ord(substr($key,$j,1)); +// $j++; +// $hash .= chr($ordStr - $ordKey); +// } +// return $hash; } diff --git a/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php b/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php index e8534bb..25c12b3 100644 --- a/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php +++ b/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php @@ -28,7 +28,7 @@ function bp_dedication_send_dedication_notification( $post_id, $to_user_email, $ $post_link = get_option('siteurl') . '/index.php'; $post_link = add_query_arg('refid', $enc_link, $post_link); - $post_link = bp_dedication_getTinyUrl($post_link); + //$post_link = bp_dedication_getTinyUrl($post_link); /* Set up and send the message */ $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s dedicated a song 2 u!', 'bp-dedication' ), stripslashes($sender_name) ); diff --git a/wp-content/themes/score/functions.php b/wp-content/themes/score/functions.php index 6ad9a03..316ef63 100644 --- a/wp-content/themes/score/functions.php +++ b/wp-content/themes/score/functions.php @@ -777,10 +777,4 @@ function gp_get_total_unread_dedications() { else return 0; } -// Ondemand function to generate tinyurl -function getTinyUrl($url) { - $tinyurl = file_get_contents("http://tinyurl.com/api-create.php?url=".$url); - return $tinyurl; -} - ?> \ No newline at end of file diff --git a/wp-content/themes/score/loop-dedication-data.php b/wp-content/themes/score/loop-dedication-data.php index b0b35b6..a6ea3cd 100644 --- a/wp-content/themes/score/loop-dedication-data.php +++ b/wp-content/themes/score/loop-dedication-data.php @@ -17,7 +17,7 @@ if(get_post_meta($post->ID, 'ghostpool_thumbnail_height', true) && get_post_meta $gp_settings['image_height'] = $gp_settings['thumbnail_height']; } -//$gp_settings['enc_link'] = getTinyUrl(add_query_arg('refid', bp_dedication_encode(get_permalink()), get_option('siteurl') . '/index.php')); +$gp_settings['enc_link'] = add_query_arg('refid', bp_dedication_encode(get_permalink()), get_option('siteurl') . '/index.php'); // Song data $gp_settings['video'] = get_post_meta($post->ID, 'ghostpool_dedication_url', true);