1. atomik22

    OP atomik22 Member
    Newcomer

    Joined:
    Dec 18, 2014
    Messages:
    16
    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, Sep 20, 2019
    Mexilon, loler55 and TheZander like this.
  2. atomik22

    OP atomik22 Member
    Newcomer

    Joined:
    Dec 18, 2014
    Messages:
    16
    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";
       
       
    ?>
    
    
     
  3. Josephvb10

    Josephvb10 GBAtemp Advanced Fan
    Member

    Joined:
    Aug 26, 2009
    Messages:
    652
    Country:
    Costa Rica
    And what is this useful for?
     
    Skirlez likes this.
  4. atomik22

    OP atomik22 Member
    Newcomer

    Joined:
    Dec 18, 2014
    Messages:
    16
    Country:
    Canada
    Well, this is probably not meant for you if you don't know.
     
    loler55 likes this.
  5. rodrigues14

    rodrigues14 Advanced Member
    Newcomer

    Joined:
    Nov 30, 2009
    Messages:
    52
    Country:
    Brazil
    This will be load The gdrive folder like hbg or others shops?
     
  6. wurstpistole

    wurstpistole GBAtemp MVP
    Member

    Joined:
    Nov 19, 2015
    Messages:
    4,476
    Country:
    United Kingdom
    Yes. This is absolutely what it does. It will grant you access to every gdrive with Switch games in existence, just like the title and the description unmistakeably state.
     
  7. rodrigues14

    rodrigues14 Advanced Member
    Newcomer

    Joined:
    Nov 30, 2009
    Messages:
    52
    Country:
    Brazil
    Sorry i mean load gdrive links fast as shops
     
  8. iRuthl3ss

    iRuthl3ss Newbie
    Newcomer

    Joined:
    Dec 22, 2019
    Messages:
    2
    Country:
    United States
    Can someone give me a quick tutorial on how to host this?

    Or can you create a URL for me to host :)
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Welcome, TINFOIL, script