Hacking RELEASE PHP script to host your own GDrive links + Welcome msg on TINFOIL / HBG

atomik22

Member
OP
Newcomer
Joined
Dec 18, 2014
Messages
16
Trophies
0
XP
80
Country
Canada
HBG SHOP / TINFOIL users

For those who might care, I made a very simple(shitty) php webpage to host your own GDrive links(Folders OR/AND single NSP) + Personnal welcome text.

Just add the COMPLETE link shown in the webpage to the file browser of HBG/Tinfoil and you are done.

See it here --> http://www.atomikpc.com/static/

**Don't forget that this is only a demo used be everyone.
**If you like it, host it yourself or PM me, I will host your personal one for free.
**The links are resetted each 5 minutes on the demo but not if you host it.
**You can manually reset the form if you erase everything then save.
 
Last edited by atomik22,

atomik22

Member
OP
Newcomer
Joined
Dec 18, 2014
Messages
16
Trophies
0
XP
80
Country
Canada
Here's the source code

Code:
<?
    if(isset($_POST['message'])){
        $message=$_POST['message'];
    }
       
    if(isset($_POST['linksNSP']))
    {
        $splitlinksNSP=explode("\n", $_POST['linksNSP']);
        for($y=0;$y<=sizeof($splitlinksNSP)-1;$y++)
        {
            if($y!=sizeof($splitlinksNSP)-1)
            {
                $linksTotNSP=$linksTotNSP . $splitlinksNSP[$y] . "\",\"";
            }else{
               $linksTotNSP=$linksTotNSP . $splitlinksNSP[$y] ;
            }
        }
    }
   
    if(isset($_POST['links']))
    {
        $splitlinks=explode("\n", $_POST['links']);
        for($i=0;$i<=sizeof($splitlinks)-1;$i++)
        {
            if($i!=sizeof($splitlinks)-1)
            {
                $linksTot=$linksTot . $splitlinks[$i] . "\",\"";
            }else{
                $linksTot=$linksTot . $splitlinks[$i] . "\"],\"success\":\"" . $message . "\"}";
            }
        }
        $final= "{\"files\":[\"" . $linksTotNSP . "\"],\"directories\":[\"" . $linksTot;
        $final=str_replace("\n", "", $final);
        $final=str_replace("\r", "", $final);
        $final=str_replace("[\"\"]", "[]", $final);
        $final=str_replace(",\"\"", "", $final);
        $fp = fopen("index.json", "w");
        fwrite($fp, $final);
        fclose($fp);
        header("Location: " . $_SERVER['PHP_SELF']);
    }
    $fn = fopen("index.json","r");
    $result = fgets($fn);
    fclose($fn);
    $splittedR=explode(":[", $result);
    $splittedNSP=explode('"', $splittedR[1]);
    for($i=1;$i<sizeof($splittedNSP)-2;$i+=2)
    {
        $linksNSP=$linksNSP . $splittedNSP[$i] . "\n";
    }
   
    $splittedFolders=explode('"', $splittedR[2]);
   
    for($i=1;$i<sizeof($splittedFolders);$i+=2)
    {
        if ($splittedFolders[$i]=="success")
        {
            $succes=1;
            $succesText=$splittedFolders[$i+2];
        }else{
            if($succes!=1){
               $links=$links . $splittedFolders[$i] . "\n";
            } 
        }
    }
   
    if(trim($succesText)==""){
        $succesText="Put your welcome message here";
    }
     if(trim($links)=="" && trim($linksNSP)==""){
        $links="https://drive.google.com/open?id=xxxxxxxxxxxxxxxx\rhttps://drive.google.com/open?id=yyyyyyyyyyyyyyyy\rhttps://drive.google.com/open?id=zzzzzzzzzzzzzzzz";
        $linksNSP="https://drive.google.com/open?id=xxxxxxxxxxxxxxxx\rhttps://drive.google.com/open?id=yyyyyyyyyyyyyyyy\rhttps://drive.google.com/open?id=zzzzzzzzzzzzzzzz";
    }
?>
<html>
    <head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
        <title>Tinfoil</title>
    </head>
    <body>
        <form name="allo" method="post">
             <table>
                <tr><td>
            Welcome message</td><td><textarea id="message" name="message" rows="5" cols="70"><?echo $succesText?></textarea></td></tr><tr>
            <td>One GDrive <b>NSP</b> link per row, no folder<br>No maximum</td><td><textarea id="linksNSP" name="linksNSP" rows="10" cols="125"><?echo $linksNSP?></textarea></td></tr><tr>
            <td>One GDrive <b>FOLDER</b> link per row, no single nsp<br>No maximum</td><td><textarea id="links" name="links" rows="10" cols="125"><?echo $links?></textarea></td></tr><tr>
            <td><input type=Submit id="Envoyer" value="Save"></td></tr><tr></table>
        </form>
    </body>
</html>
<?
   
    echo "Copy this link in the file browser of HBG Shop/Tinfoil";
    function url(){
  return sprintf(
    "%s://%s%s",
    isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
    $_SERVER['SERVER_NAME'],
    $_SERVER['REQUEST_URI']
  );
}
echo "<br><br>" . str_replace("index.php","", url()) . "index.json";
   
   
?>
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: good night