<?php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin Hack Management System                                 # ||
|| # ---------------------------------------------------------------- # ||
|| # All PHP code in this file is ©2004 GameCrash.org.                # ||
|| # http://www.gamecrash.org (soon) | http://www.letzplay.de         # ||
|| # ---------------------------------------------------------------- # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'info.php');

// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array();

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');

// #############################################################################
// ########################### START MAIN SCRIPT ###############################
// #############################################################################

$hackinfo = vbhms_import_infofile($hack);

vbhms_print_header('', $hackinfo['hacktitle']['data'], 'Hack Details');

print_table_start(false, '100%');
print_table_header($hackinfo['hacktitle']['data']);

$installedhack = $DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "vbhms_hack WHERE hackname='" . addslashes($hack) . "'");

print_description_row('<strong>General information</strong>');
print_label_row('Hack title', $hackinfo['hacktitle']['data']);
if (!empty($hackinfo['hackurl']['data']))
{
	print_label_row('Hack description', $hackinfo['hackdescription']['data']);
}
if (!empty($hackinfo['hackurl']['data']))
{
	print_label_row('Hack url', '<a href="' . $hackinfo['hackurl']['data'] . '" target="_blank">' . $hackinfo['hackurl']['data'] . '</a>');
}

print_description_row('<strong>Hack Autor</strong>');
print_label_row('Name', $hackinfo['autorname']['data']);
if (!empty($hackinfo['autorurl']['data']))
{
	print_label_row('Contact', '<a href="' . $hackinfo['autorurl']['data'] . '" target="_blank">' . $hackinfo['autorurl']['data'] . '</a>');
}

print_description_row('<strong>Versions</strong>');
print_label_row('Version uploaded', $hackinfo['hackversion']['data']);
print_label_row('Version installed', iif($installedhack === false, 'Not yet installed', $installedhack['hackversion']));

print_description_row('<strong>Links</strong>');
if (count($hackinfo['infolink']) > 0)
{
	for ($i = 0; $i < count($hackinfo['infolink']); $i++)
	{
		print_label_row($hackinfo['infolink'][$i]['attrs']['title'], '<a href="' . $hackinfo['infolink'][$i]['data'] . '" target="_blank">' . $hackinfo['infolink'][$i]['data'] . '</a>');
		$links[] = '<a href="' . $hackinfo['infolink'][$i]['data'] . '" target="_blank">[' . $hackinfo['infolink'][$i]['attrs']['title'] . ']</a>';
	}
}
else
{
	print_description_row('The autor has not attached any links to this hack.');
}

print_table_footer(4);

vbhms_print_footer(false);

?>