• Index
  • » Apps
  • » How to make APPS in THC_HS 0.2+

#1 How to make APPS in THC_HS 0.2+

zomgwtfbbq
127.0.0.1
From: from the internet!
Registered: 2010-08-14
Posts: 90
Website

How to make APPS in THC_HS 0.2+

How to make APPS in THC_HS 0.2+

SUMMARY:
Apps are the only tools you need to install first, this is very easy:

main configuration > add page path

Once you do this a record in extra.php(/Data) will be made and you will be able to use the application after you click the succeeded link.

THC_HS 0.2 APPS
Since THC_HS 0.2 a few things have changed in apps handling.
First of all you need to specify a variable called $_IDENTIFY, much of it's function will be probably be implemented later on(maybe update check on apps.php..?), but for now it allows you to install apps with less effort, also without this variable the app won't show up in apps.php as it includes all items in extra.php so without $_IDENTIFY the app won't be indentified as such.
This is pretty much the only difference, so let's get started and use thc_ad aka AdflyFuck for a demo and I will bring it down to a template you can use to convert your own apps to thc compatible apps that you can link into the suite.

<?php
/* Tools & Design 2008-2011
Author: Remco Kouw
Site: http://www.hacksuite.com
*/

// if the file is included(apps.php) just set the $_IDENTIFY array
$_IDENTIFY = array();
$_IDENTIFY['name'] = "thc_ad";
$_IDENTIFY['label'] = "AdflyFuck";
$_IDENTIFY['file'] = "adflyfuck.php";
$_IDENTIFY['version'] = "0.0.3";
$_IDENTIFY['author'] = "zomgwtfbbq";
if(!defined('IN_SCRIPT')){
    include_once("header.php");
    if(isset($_POST['sUrl'])){
        // form submitted, let's fetch the page data
        $sUrl = $_POST['sUrl'];
        if(substr($sUrl,0,14)!="http://adf.ly/"){
            die("Not a valid adfly link.");
        }
        // connect and get data
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $sUrl);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
        $sResponse = curl_exec($ch);
        curl_close($ch);
        $sSearch = "_.G(\"skip_button\").href = '";
        $iStart = strpos($sResponse,$sSearch) + strlen($sSearch);
        $sTarget = substr($sResponse,$iStart,(strpos($sResponse,"'",$iStart)-$iStart));
        $aUrl = @parse_url($sTarget);
        if(!isset($aUrl['host']) || !@strlen($aUrl['host'])){
            die("Invalid host, target not found.");
        }
        header("Location: ".$sTarget);
        exit;
    }
    else{
        /* send adfly url */
        $sCode = "<div class=\"applayout\">\n";
        $sCode .= "    <form method=\"post\" target=\"_blank\">\n";
        $sCode .= "    <h2 class=\"apps\">".$_IDENTIFY['label']."</h2>\n";
        $sCode .= "    <table border=\"0\">\n";
        $sCode .= "    <tr><td>ad page:</td><td><input type=\"text\" name=\"sUrl\" value=\"\"></td></tr>\n";
        $sCode .= "    <tr><td colspan=2><input type=\"submit\" name=\"submit\" value=\"Open\"></td></tr>\n";
        $sCode .= "    </table>\n";
        $sCode .= "    </form>\n";
        $sCode .= "</div>\n";
    }
    include_once($_PATHS['style_root']."/index.php");
}
?>

Ok now let's bring this down to our cute little hello world program.. smile

<?php
$_IDENTIFY = array();
$_IDENTIFY['name'] = "thc_ad";
$_IDENTIFY['label'] = "AdflyFuck";
$_IDENTIFY['file'] = "adflyfuck.php";
$_IDENTIFY['version'] = "0.0.3";
$_IDENTIFY['author'] = "zomgwtfbbq";
if(!defined('IN_SCRIPT')){
    include_once("header.php");
    // here goes your app and stores output in $sCode
    $sCode = "hello world!";
    include_once($_PATHS['style_root']."/index.php");
}
?>

As you can see with a small amount of code you can create your own app and integrate it into the hacksuite, you just need to edit the $_IDENTIFY variable which is too straightforward to actually discuss it.
All your output should just always be available in variable $sCode and you're good to go, oh and don't forget to add the page path. tongue


I'm a motherfucker..but still cute! smile

#2 How to make APPS in THC_HS 0.2+

muizz93
New member
Registered: 2012-04-07
Posts: 1

Re: How to make APPS in THC_HS 0.2+

hai there,
can u show me a video tutorial for this? because i really don't understand what are u trying to do

  • Index
  • » Apps
  • » How to make APPS in THC_HS 0.2+
18-08-2011 02:41:28
New project uploaded! Check it out
16-04-2011 13:04:57
THC_HS 0.2 branch is now available, you can check out the update list here or download it from here.
24-03-2011 07:48:43
New video uploaded! Check it out
24-03-2011 07:43:09
New project uploaded! Check it out
19-03-2011 13:15:29
New video uploaded! Check it out
19-03-2011 13:10:08
New project uploaded! Check it out
05-03-2011 15:06:10
New video uploaded! Check it out
05-03-2011 13:26:50
New project uploaded! Check it out
23-02-2011 05:24:57
New video uploaded! Check it out
17-02-2011 09:46:24
New project uploaded! Check it out
09-01-2011 18:27:51
New project uploaded! Check it out
01-01-2011 14:22:22
first of all I wish everyone a happy new year, let's make the best of it. I've started the new year with an update on the suite, it's current version is 0.1.0 and all known issues have been solved. :) also rewrote the rss feed generator for the forum from scratch, added the education section and some other minor stuff not worth mentioning...ok you got me I forgot what they were, blame yesterday's Black label.. :p Cheers and happy hacking. :)
18-12-2010 17:55:07
finally the site is up, although there are some minor issues(that you probably won't even notice), the site is fully functional.. feel free to give us some feedback in the forum. :)
18-08-2010 22:02:13
template almost completed, now for the coding :D
17-08-2010 18:15:33
first mockup of the site
26-07-2010 21:15:33
registered hacksuite.com