0 ) { $tld = array_pop( $host_parts ); } } return $tld; } } if ( ! function_exists('glob_recursive')){ function glob_recursive($pattern, $flags = 0) { $files = glob($pattern, $flags); foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) { $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags)); } return $files; } } function gs_anonymousdata() { #grab data from this installation if(isset($_POST['preview'])) { global $LANG, $TIMEZONE, $SITEURL, $live_plugins, $thisfile_anony; $missing_modules = array(); $php_modules = get_loaded_extensions(); if (! in_arrayi('curl', $php_modules) ) { $missing_modules[] = 'curl'; $email_not_curl = true; } else { $email_not_curl = false; } if (! in_arrayi('gd', $php_modules) ) { $missing_modules[] = 'GD'; } if (! in_arrayi('zip', $php_modules) ) { $missing_modules[] = 'ZipArchive'; } if (! in_arrayi('SimpleXML', $php_modules) ) { $missing_modules[] = 'SimpleXML'; } if ( function_exists('apache_get_modules') ) { if(! in_arrayi('mod_rewrite',apache_get_modules())) { $missing_modules[] = 'mod_rewrite'; } } $lastModified = @filemtime(GSDATAOTHERPATH .'.htaccess'); if($lastModified == NULL) $lastModified = filemtime(utf8_decode(GSDATAOTHERPATH .'.htaccess')); $preview_data = @new SimpleXMLExtended(''); $preview_data->addChild('submission_date', date('c')); $preview_data->addChild('getsimple_version', get_site_version(false)); $preview_data->addChild('language', $LANG); $preview_data->addChild('timezone', $TIMEZONE); $preview_data->addChild('php_version', PHP_VERSION); $preview_data->addChild('server_type', PHP_OS); $preview_data->addChild('modules_missing', json_encode($missing_modules)); $preview_data->addChild('number_pages', folder_items(GSDATAPAGESPATH)-1); $preview_data->addChild('number_plugins', count($live_plugins)); $preview_data->addChild('number_files', count(glob_recursive(GSDATAUPLOADPATH.'*'))); $preview_data->addChild('number_themes', folder_items(GSTHEMESPATH)); $preview_data->addChild('number_backups', count(getFiles(GSBACKUPSPATH.'zip'))); $preview_data->addChild('number_users', folder_items(GSUSERSPATH)-1); $preview_data->addChild('domain_tld', get_tld_from_url($SITEURL)); $preview_data->addChild('install_date', date('m-d-Y', $lastModified)); $preview_data->addChild('category', $_POST['category']); $preview_data->addChild('link_back', $_POST['link_back']); XMLsave($preview_data, GSDATAOTHERPATH . 'anonymous_data.xml'); } # post data to server if(isset($_POST['send'])) { global $thisfile_anony; $xml = file_get_contents(GSDATAOTHERPATH . 'anonymous_data.xml'); $success = i18n_r($thisfile_anony.'/ANONY_SUCCESS'); $php_modules = get_loaded_extensions(); if (in_arrayi('curl', $php_modules)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, 'http://get-simple.info/api/anonymous/?data='.urlencode($xml)); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: text/xml')); $result = curl_exec($ch); curl_close($ch); } else { sendmail('chris@get-simple.info','Anonymous Data Submission',$xml); } } global $thisfile_anony; ?>

'. $success .'

'; } ?>


    

*