<?php
if (self::$db_alter->fetch_table_info('dbtech_vbshop_itemtype'))
{
	$lite = array(
		'smiliecategory' 	=> array(
			'title' 		=> 'Add Smilie Category',
			'description' 	=> 'Purchase the ability to add/edit a smilie category.',
		),
		'smilie' 	=> array(
			'title' 		=> 'Upload Smilie',
			'description' 	=> 'Purchase the ability to add/edit a smilie.',
		),
		'poststyle' 	=> array(
			'title' 		=> 'Post Style',
			'description' 	=> 'Purchase the ability to change the style of your posts.',
		),
		'threadtitlestyle' 	=> array(
			'title' 		=> 'Thread Title Style',
			'description' 	=> 'Purchase the ability to change thread title style.',
		),
	);
	foreach ($lite as $filename => $info)
	{
		self::$db->query_write("
			REPLACE INTO `" . TABLE_PREFIX . "dbtech_vbshop_itemtype`
				(`itemtypeid`, `title`, `description`, `filename`)
			VALUES (
				" . self::$db->sql_prepare($filename) . ",
				" . self::$db->sql_prepare($info['title']) . ",
				" . self::$db->sql_prepare($info['description']) . ",
				'/dbtech/vbshop/items/" . $filename . ".php'
			)
		");
	}

	$pro = array(
		'poststyle2' 	=> array(
			'title' 		=> 'Post Style (Pre-Defined)',
			'description' 	=> 'Purchase the ability to change the style of your posts to a pre-defined style.',
		),		
		'createforum' 	=> array(
			'title' 		=> 'Create Forum',
			'description' 	=> 'Purchase the ability to create a forum.',
		),
		'moderateforum' 	=> array(
			'title' 		=> 'Moderate Forum',
			'description' 	=> 'Purchase the ability to moderate a forum.',
		),
		'threadtitlestyle2' 	=> array(
			'title' 		=> 'Thread Title Style (Pre-Defined)',
			'description' 	=> 'Purchase the ability to change thread title style to a pre-defined style.',
		),
	);
	foreach ($pro as $filename => $info)
	{
		self::$db->query_write("
			REPLACE INTO `" . TABLE_PREFIX . "dbtech_vbshop_itemtype`
				(`itemtypeid`, `title`, `description`, `filename`)
			VALUES (
				" . self::$db->sql_prepare($filename) . ",
				" . self::$db->sql_prepare($info['title']) . ",
				" . self::$db->sql_prepare($info['description']) . ",
				'/dbtech/vbshop_pro/items/" . $filename . ".php'
			)
		");
	}
	self::report('Populated Table', 'dbtech_vbshop_itemtype');
}

if (class_exists('VBSHOP_CACHE'))
{
	VBSHOP_CACHE::build('itemtype');
}