Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ENABLE_kiikun = 1;
- function get_gd_id($string) {
- if(ereg('folders', $string)){
- return str_replace('?usp=sharing', '', basename('https://drive.google.com/drive/folders/'.$string.'?usp=sharing'));
- }else{
- if (strpos($string, "/edit")) {
- $string = str_replace("/edit", "/view", $string);
- } else if (strpos($string, "?id=")) {
- $parts = parse_url($string);
- parse_str($parts['query'], $query);
- return $query['id'];
- } else if (!strpos($string, "/view")) {
- $string = $string . "/view";
- }
- $start = "file/d/";
- $end = "/view";
- $string = " " . $string;
- $ini = strpos($string, $start);
- if ($ini == 0) {
- return "";
- }
- $ini += strlen($start);
- $len = strpos($string, $end, $ini) - $ini;
- return substr($string, $ini, $len);
- }
- }
- function fnEncrypt( $string) {
- $secret_key = 'drivekey';
- $secret_iv = 'google';
- $output = false;
- $encrypt_method = "AES-256-CBC";
- $key = hash( 'sha256', $secret_key );
- $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );
- $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );
- return $output;
- }
- function kiikun($content){
- global $ENABLE_kiikun;
- if($ENABLE_kiikun){
- $domen = 'http://space.kiikun.com/';
- preg_match_all('/href="(.*?)"/s', $content, $matches);
- foreach($matches[1] as $link){
- if(ereg('drive.google.com', $link)){
- $asli[] = $link;
- $ganti[] = $domen.'?id='.fnEncrypt(get_gd_id($link));
- }
- }
- $crot = str_replace($asli, $ganti, $content);
- return apply_filters('the_content', $crot);
- }else{
- return $content;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement