setQuery( $q ); $jdatabase->query(); if( $jdatabase->getNumRows() ) { $component_installed = true; } $q = "SELECT id FROM #__modules as m WHERE m.module='mod_virtuemart'"; $jdatabase->setQuery( $q ); $jdatabase->query(); if( $jdatabase->getNumRows() ) { $module_installed = true; } echo "

\"Cart\"\n"; echo "VirtueMart Getter / Downloader Script

"; echo '

'; echo 'This script will help you to transfer the Installation Files for VirtueMart to this Server. It downloads the latest Component or Module Install Package directly '; echo 'from the VirtueMart Developer Portal to your server. This is especially helpful when your Joomla! site is located on a remote Server with a fast Internet Connection,'; echo ' but it will also work for a local Server. Note that a direct Internet Connection is needed anyway! Just click on "Begin Download" and the Script will do the Rest.

'; echo ""; echo ""; if( $component_installed ) { echo ''; } else { echo ""; } if( $module_installed ) { echo ''; } else { echo ""; } echo "

1. Component Download

2. Module Download

OK    The VirtueMart Component is already installed on this Server.
\n"; echo "\n"; echo "\n"; echo "\n

"; echo "\"Remote\n"; echo "Download from....(Remote URL)
\n"; echo "\n


"; echo "\"Local\n"; echo "Download to this directory...
\n"; echo "\n


"; echo "


\n"; echo "
OK    The VirtueMart Main Module is already installed on this Server.
\n"; echo "\n"; echo "\n"; echo "\n

"; echo "\"Remote\n"; echo "Download from....(Remote URL)
\n"; echo "\n


"; echo "\"Local\n"; echo "Download to this directory...
\n"; echo "\n


"; echo "


\n"; echo "
"; if( $module_installed && $component_installed ) { $q = "SELECT `id` FROM `#__components` as c WHERE c.option='com_virtuemartremoteinstaller'"; $jdatabase->setQuery( $q ); $Item = Array(); $eid = $jdatabase->loadResult(); echo "

"; echo "

Uninstall the VirtueMart Remote Installer Component

"; echo "

"; echo ""; echo ""; echo ""; echo ""; echo JHTML::_( 'form.token' ); echo "


"; echo "
"; } break; } function installVirtueMart( $remote_file ) { global $mainframe, $extract_dir; //////////////////////////////////////////////////////////////////////////// // Step 1: Download the file com_virtuemart_x.x.tar.gz // from dev.virtuemart.net // if( empty($_POST['downloaddir'])) $downloaddir = JPATH_SITE.DS."media"; else $downloaddir = $_POST['downloaddir']; if( !is_writable( $downloaddir ) ) { return false; } $element = jrequest::getVar('element') == 'component' ? 'component' : 'module'; $local_file = $downloaddir.DS.'virtuemart_'.$element .'.zip'; require_once( dirname( __FILE__ ) . DS."downloader.php"); $downloadMethods = array( new CurlDownloader(), new WgetDownloader(), new FopenDownloader(), new FsockopenDownloader() ); foreach( $downloadMethods as $method ) { if( $method->isSupported() ) { $downloader = $method; } } if( !$downloader->download( $remote_file, $local_file ) ) { $mainframe->redirect( 'index.php?option=com_virtuemartremoteinstaller', 'Failed to download the Package File!' ); } //////////////////////////////////////////////////////////////////////////// // Step 2: Extract the file com_virtuemart_x.x.tar.gz // to downloaddir/XXXXXXXX/ // jimport('joomla.filesystem.archive'); $uniqueid = uniqid( "vm_" ); if( @mkdir( $downloaddir.DS.$uniqueid ) ) $extract_dir = $downloaddir.DS.$uniqueid; else $extract_dir = $downloaddir; if( JArchive::extract($local_file, $extract_dir ) !== false ) { echo "

Extraction successful!
"; unlink( $local_file ); return true; } else { $mainframe->redirect( 'index.php?option=com_virtuemartremoteinstaller'); } } function installFromDir( $element ) { global $extract_dir; ?> Success


The script has successfully downloaded and extracted the VirtueMart on your Server.

Just click on 'Install' to Install the VirtueMart now.