Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2.  
  3. //  PROOF OF CONCEPT ONLY NOT INTENDED TO BE USED.
  4. //
  5. //  TINY_CHAT_ROOM_VIEWER: Version Public sauce
  6. //  DATE: 2-4-2011
  7. //  DEVELOPER: PHP - Heisenberg a.k.a Cancerous a.k.a Gellin && <gay>HTML</gay> - TheOneSage
  8. //  KNOWN AFFILIATES: www.GAMEHACKING.NET || www.dxtgaming.com || www.rule-de-game.com || www.uc-forum.com || www.delta-h.net
  9. //  GIVE CREDIT WERE ITS DO - DONT BE A n3WF4G
  10. //
  11. //  PROOF OF CONCEPT ONLY NOT INTENDED TO BE USED.
  12.  
  13. require_once( "functions.php" );
  14.  
  15. //Start a interwebs session
  16. session_start();
  17.  
  18. //The name of the document used for the form action methods
  19. $v_DOCUMENT_NAME = "remote_viewer.php";
  20.  
  21. //Password
  22. $v_PASSWORD = "hellodevs";
  23.  
  24. //SuM CSSCAUSE
  25. //http://tinychat.com/public/css/global.css?v=2.0.0c
  26. //http://gamehacking.net/other/TinyThing/Viewer/css/style.css
  27.  
  28. echo'<html>
  29.    <body>
  30.         <link rel="stylesheet" href="http://gamehacking.net/TinyThing/css/style.css" type="text/css" media="screen" />
  31.             <table align="center" cellspacing="5">
  32.                 <tr>
  33.                     <td colspan=2 align="center"> <font size="6">.:: TinyChat Creeper ::.</font></td>
  34.                 </tr>
  35.             </table>';
  36.  
  37. // if the password button was clicked and the password is correct OR the user has a previous login session.
  38. if(( $_POST['pass_submit'] == "login" && $_POST['pass'] == $v_PASSWORD ) || $_SESSION['loggedin'] == 1 )
  39. {
  40.     $_SESSION['loggedin'] = 1;
  41.    
  42.     if( isset( $_POST['room'] ) && $_POST['room'] != "" )
  43.         $v_ROOM = $_POST['room'];
  44.     else
  45.         $v_ROOM = '';
  46.        
  47.     $v_IMAGE_SET = (int)$_POST['imageset'];
  48.        
  49.     if( !is_int( $v_IMAGE_SET ) )
  50.         (int)$v_IMAGE_SET = 0;
  51.            
  52.     if( (int)$v_IMAGE_SET < 0 || (int)$v_IMAGE_SET > 4 )
  53.         (int)$v_IMAGE_SET = 0;
  54.        
  55.     //onfocus="javascript:{if(!this._haschanged){this.value=null};this._haschanged=true;}"
  56.        
  57.     echo'<table align="center" cellspacing="5">
  58.          <form action=',$v_DOCUMENT_NAME,' method="post" name="view">
  59.             <tr><td></td></tr>
  60.             <tr><td></td></tr>
  61.             <tr><td></td></tr>
  62.            
  63.             <tr>
  64.                 <td align="center">Room</td>
  65.             </tr>
  66.        
  67.             <tr>
  68.               <td><input type="text" class="input" name="room" value="',$v_ROOM,'" /></td>
  69.             </tr>
  70.            
  71.             <tr><td></td></tr>
  72.             <tr><td></td></tr>
  73.             <tr><td></td></tr>
  74.            
  75.             <tr>
  76.                 <td align="center">Image ( 0 - 4 )</td>
  77.             </tr>
  78.            
  79.             <tr>
  80.               <td><input type="text" class="input" name="imageset" value="',$v_IMAGE_SET,'" /></td>
  81.             </tr>
  82.            
  83.             <tr><td></td></tr>
  84.             <tr><td></td></tr>
  85.            
  86.             <tr>
  87.                 <td><input type="checkbox" name="showusername" value="showusername" />Show Usernames</td>
  88.             </tr>
  89.            
  90.             <tr><td></td></tr>
  91.             <tr><td></td></tr>
  92.            
  93.             <tr>
  94.               <td colspan=2 align="center"><input type="submit" class="button" name="view" value="go" /></td>
  95.             </tr>
  96.         </form>
  97.         </table>';
  98.    
  99.     //If GO was pressed and their is data in both input box's
  100.     if( $_POST['view'] == "go" && isset( $_POST['room'] ) && isset( $_POST['imageset'] ) )
  101.     {
  102.         $v_PAGE          = fopen( 'http://tinychat.com/api/hovercard.php?username='.$v_ROOM, 'r' );
  103.         $v_XML_PAGE      = "http://tinychat.apigee.com/".$v_ROOM.".xml";
  104.         $v_IMAGE_DEFUALT = "http://upload.tinychat.com/i/";
  105.         $v_IMAGE_URL     = $v_IMAGE_DEFUALT.$v_IMAGE_SET."/";
  106.        
  107.         if( $v_PAGE )
  108.         {
  109.             $v_CONTENT = '';
  110.             $v_REPLACE    = array( "width='20'", "height='20'", "width='50'", "height='50'" );
  111.             $v_REPLACE_TO = array( "width='160'", "height='120'", "width='200'", "height='200'" );
  112.  
  113.             //Parse the html page and edit the image tags
  114.             while( $v_tLine = fread( $v_PAGE, 1024 ) )
  115.             {
  116.                 //Parse the html that $v_PAGE outputs and change the size of the image to something visible.
  117.                 $v_TEMP     =  str_replace( $v_REPLACE, $v_REPLACE_TO, $v_tLine );
  118.                 $v_TEMP2    =  str_replace( $v_IMAGE_DEFUALT, $v_IMAGE_URL, $v_TEMP );
  119.                 $v_CONTENT .= $v_TEMP2;
  120.             }
  121.            
  122.             //Image tag double check
  123.             //Ghetto rigged for safety
  124.             $v_FINAL     =  str_replace( $v_REPLACE, $v_REPLACE_TO, $v_CONTENT );
  125.                
  126.             echo'<br /><br />';
  127.             echo $v_FINAL;     //The only proper way to get this stupid preformed html to center was to close the table tag and open it after. i dont html
  128.            
  129.             //Show Usernames
  130.             if( isset( $_POST['showusername'] ) )
  131.             {
  132.                 echo'<br /><br />';
  133.                
  134.                 //Load the XML to a string
  135.                 $XML_FILE_CONTENTS = file_get_contents( $v_XML_PAGE );
  136.                
  137.                 //Put the XML into an array
  138.                 $XML_ARRAY         = makexmlarray( $XML_FILE_CONTENTS, 0 );
  139.        
  140.                 (int)$v_iTotalNames = (int)count( $XML_ARRAY['tinychat']['names'] );
  141.                
  142.                 echo'<table align="center" cellspacing="5" >';
  143.                
  144.                 (int)$v_CLOSETR = 0;
  145.                
  146.                 //The Ghettoest shit on the block But it works like a nigga on a stick
  147.                 //Makes 3 col's of usernames :) it would also be easy to check if the username had a image and if it does turn it into a hyperlink
  148.                 //seems rather pointless with all the images already on the screen
  149.                
  150.                 for( (int)$i = 0; (int)$i <= (int)$v_iTotalNames; (int)$i++ )
  151.                 {
  152.                     if( $XML_ARRAY['tinychat']['names'] != "" )
  153.                     {
  154.                         if( (int)$i % 3 == 0 )
  155.                             (int)$v_ISREMAINDER = 0;
  156.                         else
  157.                             (int)$v_ISREMAINDER = 1;
  158.                    
  159.                         if( (int)$v_ISREMAINDER == 0 )
  160.                         {
  161.                             (int)$v_CLOSETR = 0;
  162.                              echo'<tr>';
  163.                         }
  164.                        
  165.                         if( (int)$v_CLOSETR > 3 )
  166.                             (int)$v_CLOSETR = 0;
  167.                    
  168.                         echo '<td>'.$XML_ARRAY['tinychat']['names'][(int)$i].'</td>';
  169.                    
  170.                         if( (int)$v_ISREMAINDER == 0 && (int)$v_CLOSETR == 3 )
  171.                         {
  172.                             echo'</tr>';
  173.                         }
  174.                         (int)$v_CLOSETR += 1;
  175.                     }
  176.                 }
  177.                 echo'</table>';
  178.             }
  179.         }
  180.         else
  181.         {
  182.             echo'<table align="center" cellspacing="5"><tr><td colspan=2 align="center"> <font size="6" color="#FF0000" ><strong>ERROR - MOTHERFUCKER!!!</strong></font></td></tr></table>';
  183.         }
  184.     }
  185. }
  186. else
  187. {
  188.     echo'<table align="center" cellspacing="5">';
  189.    
  190.     if( $_POST['pass_submit'] )
  191.     {
  192.         if( $_POST['pass'] != "" )
  193.         {
  194.             echo'<tr><td colspan=2 align="center"> <font size="6" color="#FF0000" ><strong>INVALID PASS!</strong></font></td></tr>';
  195.         }
  196.         else if( $_POST['pass'] == "" )
  197.         {
  198.             echo'<tr><td colspan=2 align="center"> <font size="6" color="#FF0000" ><strong>ENTER A PASS!</strong></font></td></tr>';
  199.         }
  200.     }
  201.    
  202.     echo'<form action=',$v_DOCUMENT_NAME,' method="post" name="pass_submit">
  203.             <tr><td></td></tr>
  204.            
  205.             <tr>
  206.                 <td align="center">Password</td>
  207.             </tr>
  208.  
  209.             <tr>
  210.                 <td align="center"><input type="password" class="input" name="pass" /></td>
  211.             </tr>
  212.  
  213.             <tr>
  214.                 <td colspan=2 align="center"><input type="submit" class="button" name="pass_submit" value="login" /></td>
  215.             </tr>
  216.         </form>';
  217.        
  218.     echo'</table>';
  219. }
  220.  
  221. echo'</body>
  222.         <table align="center" cellspacing="5">
  223.             <tr><td colspan=2 align="center"><img src="http://tinychat.com/public/images/island_fun.png" alt="FUNISLANDTHING" /></td></tr>
  224.             <tr><td colspan=2 align="center">Created By - <font color="#0000FF">Gellin</font> and <font color="#006633">TheOneSage</font></td></tr>
  225.         </table>
  226.      </html>';
  227. ?>