Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > ibProArcade Archive
Small hack to allow game installations from a remote server (with 1550 or so games) Details »»
Small hack to allow game installations from a remote server (with 1550 or so games)
Version: , by fsw fsw is offline
Developer Last Online: Apr 2008 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-07-2006 Last Update: Never Installs: 0
 
No support by the author.

I do need this tested - as the way I set it up its just a bit of a pain to test myself

With my limited testing, it appears to work - and since my addition is about three lines of code, (plus a copy/paste/modification of another 10 or 15 lines) - not much to mess up here - but if there is a way - I will always find it.

Attached - and link below
  • Just fixed one small file location error I noticed when pasting in the code below

Code:
http://sportsforum.ws/_arcade.phps

Download Now

File Type: (21.3 KB, 14 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-07-2006, 08:50 PM
fsw fsw is offline
 
Join Date: Sep 2005
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh - and since I didnt mention it - copy your arcade.php file in the admincp folder to a backup name, and then save the above file as arcade.php

This is the changes I made to the original

Find

PHP Code:

        $header 
= array();
        
$header[] = "<div align='center'>".$ibforums->lang['acp_game_targame']."</div>";
        
$header[] = $ibforums->lang['acp_game_tarfile'] ;
        
$header[] = $ibforums->lang['acp_gamesort_game'];
        
$header[] = "<div align='center'>".$ibforums->lang['acp_game_tararchive']."</div>";
        
$colspan sizeof($header); 


Above it Add

PHP Code:
        $header = array();
        
$header[] = "<div align='center'>Download Games</div>";
        
$header[] = $ibforums->lang['acp_game_tarfile'] ;
        
$header[] = "<div align='center'>Grab & Install</div>";
        
$colspan sizeof($header);

        
print_table_header("Download Games"$colspan);
        
print_description_row("Download and Install games from <b><a href='http://sportsforum.ws/' target='_blank'>FSW</a></b>"0$colspan);
        
print_cells_row($header1);

        
$files unserialize(file_get_contents("http://sportsforum.ws/arcade/tar/tars"));



                
$install_link "";
                if( 
count($files) > )
                {
                        foreach( 
$files as $this_file )
                        {
                                
$name preg_replace"/^(game)_(.+?)\.(\S+)$/""\\2"$this_file );

                                
$DB->query("SELECT gid, gname FROM ibf_games_list WHERE gname='".$name."'");
                                if(!
$DB->get_num_rows() )
                                {
                                        
$install_link "<a href='arcade.php?$session[sessionurl]&amp;code=external_tar_install&amp;file=$this_file'>".$ibforums->lang['acp_game_tar_install']."</a>";
                                
$cell = array();
                                
$cell[] = "<div align='center'><b>".$name."</b></div>";
                                
$cell[] = "<div align='center'>".$this_file."</div>";
                                
$cell[] = "<div align='center'>".$install_link."</div>";
                                   
print_cells_row($cell);
                }
                        }
                }
                else
                {
                
print_description_row("<div align='center'>- <i>".$ibforums->lang['acp_game_tar_empty']."</i> -</div>"0$colspan);
                }

        
print_table_break(''"90%"); 







Find


PHP Code:
// ##############################
// TAR install
// ############################## 

Above it Add

PHP Code:
if ($action == "external_tar_install")
{

file_put_contentsgetcwd()."/arcade/tar/".basename($IN['file']),file_get_contents("http://sportsforum.ws/arcade/tar/".$IN['file']));
$action="tar_install";







Thats it. As I said not much to mess up
Reply With Quote
  #3  
Old 10-17-2006, 02:58 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just gave this a whirl and it did not work. The error listed is:

Quote:
Fatal error: Call to undefined function: file_put_contents() in /home/site/public_html/admincp/arcade.php on line 2525
That line of code is your code.
Reply With Quote
  #4  
Old 10-18-2006, 03:47 AM
fsw fsw is offline
 
Join Date: Sep 2005
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Rich
I just gave this a whirl and it did not work. The error listed is:



That line of code is your code.

You cant use file_put_contents()?



Wait - thats a php5 one isnt it?

Just ran over to php.net - figured there would be a cheap substitute siting there for php4 - and there was (cheap - there was a better one - but this one was shorter and I assume it works - dont need anything other than writing the file

PHP Code:
if (!function_exists('file_put_contents')) {
function 
file_put_contents($n,$d) {
  
$f=@fopen($n,"w");
  if (!
$f) {
   return 
false;
  } else {
   
fwrite($f,$d);
   
fclose($f);
   return 
true;
  }
}


Throw that in above the last section - man - life without file_put_contents - I wouldnt even remember to how to write a file anymore
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07096 seconds
  • Memory Usage 2,283KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (1)postbit_attachment
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete