'e.id',
'FROM' => 'extensions AS e',
'WHERE' => 'e.disabled=0'
);
($hook = get_hook('aex_install_check_dependencies')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$installed_ext = array();
while ($row = $forum_db->fetch_assoc($result))
$installed_ext[] = $row['id'];
foreach ($ext_data['extension']['dependencies'] as $dependency)
{
if (!in_array($dependency, $installed_ext))
message(sprintf($lang_admin_ext['Missing dependency'], $dependency));
}
// Setup breadcrumbs
$forum_page['crumbs'] = array(
array($forum_config['o_board_title'], forum_link($forum_url['index'])),
array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])),
array($lang_admin_common['Extensions'], forum_link($forum_url['admin_extensions_manage'])),
array((strpos($id, 'hotfix_') === 0) ? $lang_admin_common['Manage hotfixes'] : $lang_admin_common['Manage extensions'], (strpos($id, 'hotfix_') === 0) ? forum_link($forum_url['admin_extensions_hotfixes']) : forum_link($forum_url['admin_extensions_manage'])),
(strpos($id, 'hotfix_') === 0) ? $lang_admin_ext['Install hotfix'] : $lang_admin_ext['Install extension']
);
if (isset($_POST['install_comply']))
{
($hook = get_hook('aex_install_comply_form_submitted')) ? eval($hook) : null;
// $ext_info contains some information about the extension being installed
$ext_info = array(
'id' => $id,
'path' => FORUM_ROOT.'extensions/'.$id,
'url' => $base_url.'/extensions/'.$id,
'dependencies' => array()
);
foreach ($ext_data['extension']['dependencies'] as $dependency)
{
$ext_info['dependencies'][$dependency] = array(
'id' => $dependency,
'path' => FORUM_ROOT.'extensions/'.$dependency,
'url' => $base_url.'/extensions/'.$dependency,
);
}
// Is there some uninstall code to store in the db?
$uninstall_code = (isset($ext_data['extension']['uninstall']) && forum_trim($ext_data['extension']['uninstall']) != '') ? '\''.$forum_db->escape(forum_trim($ext_data['extension']['uninstall'])).'\'' : 'NULL';
// Is there an uninstall note to store in the db?
$uninstall_note = 'NULL';
foreach ($ext_data['extension']['note'] as $cur_note)
{
if ($cur_note['attributes']['type'] == 'uninstall' && forum_trim($cur_note['content']) != '')
$uninstall_note = '\''.$forum_db->escape(forum_trim($cur_note['content'])).'\'';
}
$notices = array();
// Is this a fresh install or an upgrade?
$query = array(
'SELECT' => 'e.version',
'FROM' => 'extensions AS e',
'WHERE' => 'e.id=\''.$forum_db->escape($id).'\''
);
($hook = get_hook('aex_install_comply_qr_get_current_ext_version')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if ($forum_db->num_rows($result))
{
// EXT_CUR_VERSION will be available to the extension install routine (to facilitate extension upgrades)
define('EXT_CUR_VERSION', $forum_db->result($result));
// Run the author supplied install code
if (isset($ext_data['extension']['install']) && forum_trim($ext_data['extension']['install']) != '')
eval($ext_data['extension']['install']);
// Update the existing extension
$query = array(
'UPDATE' => 'extensions',
'SET' => 'title=\''.$forum_db->escape($ext_data['extension']['title']).'\', version=\''.$forum_db->escape($ext_data['extension']['version']).'\', description=\''.$forum_db->escape($ext_data['extension']['description']).'\', author=\''.$forum_db->escape($ext_data['extension']['author']).'\', uninstall='.$uninstall_code.', uninstall_note='.$uninstall_note.', dependencies=\'|'.implode('|', $ext_data['extension']['dependencies']).'|\'',
'WHERE' => 'id=\''.$forum_db->escape($id).'\''
);
($hook = get_hook('aex_install_comply_qr_update_ext')) ? eval($hook) : null;
$forum_db->query_build($query) or error(__FILE__, __LINE__);
// Delete the old hooks
$query = array(
'DELETE' => 'extension_hooks',
'WHERE' => 'extension_id=\''.$forum_db->escape($id).'\''
);
($hook = get_hook('aex_install_comply_qr_update_ext_delete_hooks')) ? eval($hook) : null;
$forum_db->query_build($query) or error(__FILE__, __LINE__);
}
else
{
// Run the author supplied install code
if (isset($ext_data['extension']['install']) && forum_trim($ext_data['extension']['install']) != '')
eval($ext_data['extension']['install']);
// Add the new extension
$query = array(
'INSERT' => 'id, title, version, description, author, uninstall, uninstall_note, dependencies',
'INTO' => 'extensions',
'VALUES' => '\''.$forum_db->escape($ext_data['extension']['id']).'\', \''.$forum_db->escape($ext_data['extension']['title']).'\', \''.$forum_db->escape($ext_data['extension']['version']).'\', \''.$forum_db->escape($ext_data['extension']['description']).'\', \''.$forum_db->escape($ext_data['extension']['author']).'\', '.$uninstall_code.', '.$uninstall_note.', \'|'.implode('|', $ext_data['extension']['dependencies']).'|\'',
);
($hook = get_hook('aex_install_comply_qr_add_ext')) ? eval($hook) : null;
$forum_db->query_build($query) or error(__FILE__, __LINE__);
}
// Now insert the hooks
if (isset($ext_data['extension']['hooks']['hook']))
{
foreach ($ext_data['extension']['hooks']['hook'] as $ext_hook)
{
$cur_hooks = explode(',', $ext_hook['attributes']['id']);
foreach ($cur_hooks as $cur_hook)
{
$query = array(
'INSERT' => 'id, extension_id, code, installed, priority',
'INTO' => 'extension_hooks',
'VALUES' => '\''.$forum_db->escape(forum_trim($cur_hook)).'\', \''.$forum_db->escape($id).'\', \''.$forum_db->escape(forum_trim($ext_hook['content'])).'\', '.time().', '.(isset($ext_hook['attributes']['priority']) ? $ext_hook['attributes']['priority'] : 5)
);
($hook = get_hook('aex_install_comply_qr_add_hook')) ? eval($hook) : null;
$forum_db->query_build($query) or error(__FILE__, __LINE__);
}
}
}
// Empty the PHP cache
forum_clear_cache();
// Regenerate the hooks cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
require FORUM_ROOT.'include/cache.php';
generate_hooks_cache();
// Display notices if there are any
if (!empty($notices))
{
($hook = get_hook('aex_install_notices_pre_header_load')) ? eval($hook) : null;
define('FORUM_PAGE_SECTION', 'extensions');
if (strpos($id, 'hotfix_') === 0)
define('FORUM_PAGE', 'admin-extensions-hotfixes');
else
define('FORUM_PAGE', 'admin-extensions-manage');
require FORUM_ROOT.'header.php';
// START SUBST -
ob_start();
($hook = get_hook('aex_install_notices_output_start')) ? eval($hook) : null;
?>
""
'.$cur_notice.''."\n";
?>
', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST -
require FORUM_ROOT.'footer.php';
}
else
{
($hook = get_hook('aex_install_comply_pre_redirect')) ? eval($hook) : null;
if (strpos($id, 'hotfix_') === 0)
redirect(forum_link($forum_url['admin_extensions_hotfixes']), $lang_admin_ext['Hotfix installed'].' '.$lang_admin_common['Redirect']);
else
redirect(forum_link($forum_url['admin_extensions_manage']), $lang_admin_ext['Extension installed'].' '.$lang_admin_common['Redirect']);
}
}
($hook = get_hook('aex_install_pre_header_load')) ? eval($hook) : null;
define('FORUM_PAGE_SECTION', 'extensions');
if (strpos($id, 'hotfix_') === 0)
define('FORUM_PAGE', 'admin-extensions-hotfixes');
else
define('FORUM_PAGE', 'admin-extensions-manage');
require FORUM_ROOT.'header.php';
// START SUBST -
ob_start();
($hook = get_hook('aex_install_output_start')) ? eval($hook) : null;
?>
""
', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST -
require FORUM_ROOT.'footer.php';
}
// Uninstall an extension
else if (isset($_GET['uninstall']))
{
// User pressed the cancel button
if (isset($_POST['uninstall_cancel']))
redirect(forum_link($forum_url['admin_extensions_manage']), $lang_admin_common['Cancel redirect']);
($hook = get_hook('aex_uninstall_selected')) ? eval($hook) : null;
$id = preg_replace('/[^0-9a-z_]/', '', $_GET['uninstall']);
// Fetch info about the extension
$query = array(
'SELECT' => 'e.title, e.version, e.description, e.author, e.uninstall, e.uninstall_note',
'FROM' => 'extensions AS e',
'WHERE' => 'e.id=\''.$forum_db->escape($id).'\''
);
($hook = get_hook('aex_uninstall_qr_get_extension')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if (!$forum_db->num_rows($result))
message($lang_common['Bad request']);
$ext_data = $forum_db->fetch_assoc($result);
// Check dependancies
$query = array(
'SELECT' => 'e.id',
'FROM' => 'extensions AS e',
'WHERE' => 'e.dependencies LIKE \'%|'.$forum_db->escape($id).'|%\''
);
($hook = get_hook('aex_uninstall_qr_check_dependencies')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if ($forum_db->num_rows($result) != 0)
{
$dependency = $forum_db->fetch_assoc($result);
message(sprintf($lang_admin_ext['Uninstall dependency'], $dependency['id']));
}
// Setup breadcrumbs
$forum_page['crumbs'] = array(
array($forum_config['o_board_title'], forum_link($forum_url['index'])),
array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])),
array($lang_admin_common['Extensions'], forum_link($forum_url['admin_extensions_manage'])),
array((strpos($id, 'hotfix_') === 0) ? $lang_admin_common['Manage hotfixes'] : $lang_admin_common['Manage extensions'], (strpos($id, 'hotfix_') === 0) ? forum_link($forum_url['admin_extensions_hotfixes']) : forum_link($forum_url['admin_extensions_manage'])),
(strpos($id, 'hotfix_') === 0) ? $lang_admin_ext['Uninstall hotfix'] : $lang_admin_ext['Uninstall extension']
);
// If the user has confirmed the uninstall
if (isset($_POST['uninstall_comply']))
{
($hook = get_hook('aex_uninstall_comply_form_submitted')) ? eval($hook) : null;
$notices = array();
// Run uninstall code
eval($ext_data['uninstall']);
// Now delete the extension and its hooks from the db
$query = array(
'DELETE' => 'extension_hooks',
'WHERE' => 'extension_id=\''.$forum_db->escape($id).'\''
);
($hook = get_hook('aex_uninstall_comply_qr_uninstall_delete_hooks')) ? eval($hook) : null;
$forum_db->query_build($query) or error(__FILE__, __LINE__);
$query = array(
'DELETE' => 'extensions',
'WHERE' => 'id=\''.$forum_db->escape($id).'\''
);
($hook = get_hook('aex_uninstall_comply_qr_delete_extension')) ? eval($hook) : null;
$forum_db->query_build($query) or error(__FILE__, __LINE__);
// Empty the PHP cache
forum_clear_cache();
// Regenerate the hooks cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
require FORUM_ROOT.'include/cache.php';
generate_hooks_cache();
// Display notices if there are any
if (!empty($notices))
{
($hook = get_hook('aex_uninstall_notices_pre_header_load')) ? eval($hook) : null;
define('FORUM_PAGE_SECTION', 'extensions');
define('FORUM_PAGE', 'admin-extensions-manage');
require FORUM_ROOT.'header.php';
// START SUBST -
ob_start();
($hook = get_hook('aex_uninstall_notices_output_start')) ? eval($hook) : null;
?>
""
'.$cur_notice.''."\n";
?>
', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST -
require FORUM_ROOT.'footer.php';
}
else
{
($hook = get_hook('aex_uninstall_comply_pre_redirect')) ? eval($hook) : null;
if (strpos($id, 'hotfix_') === 0)
redirect(forum_link($forum_url['admin_extensions_hotfixes']), $lang_admin_ext['Hotfix uninstalled'].' '.$lang_admin_common['Redirect']);
else
redirect(forum_link($forum_url['admin_extensions_manage']), $lang_admin_ext['Extension uninstalled'].' '.$lang_admin_common['Redirect']);
}
}
else // If the user hasn't confirmed the uninstall
{
($hook = get_hook('aex_uninstall_pre_header_load')) ? eval($hook) : null;
define('FORUM_PAGE_SECTION', 'extensions');
if (strpos($id, 'hotfix_') === 0)
define('FORUM_PAGE', 'admin-extensions-hotfixes');
else
define('FORUM_PAGE', 'admin-extensions-manage');
require FORUM_ROOT.'header.php';
// START SUBST -
ob_start();
($hook = get_hook('aex_uninstall_output_start')) ? eval($hook) : null;
?>
""
', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST -
require FORUM_ROOT.'footer.php';
}
}
// Enable or disable an extension
else if (isset($_GET['flip']))
{
$id = preg_replace('/[^0-9a-z_]/', '', $_GET['flip']);
// We validate the CSRF token. If it's set in POST and we're at this point, the token is valid.
// If it's in GET, we need to make sure it's valid.
if (!isset($_POST['csrf_token']) && (!isset($_GET['csrf_token']) || $_GET['csrf_token'] !== generate_form_token('flip'.$id)))
csrf_confirm_form();
($hook = get_hook('aex_flip_selected')) ? eval($hook) : null;
// Fetch the current status of the extension
$query = array(
'SELECT' => 'e.disabled',
'FROM' => 'extensions AS e',
'WHERE' => 'e.id=\''.$forum_db->escape($id).'\''
);
($hook = get_hook('aex_flip_qr_get_disabled_status')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if (!$forum_db->num_rows($result))
message($lang_common['Bad request']);
// Are we disabling or enabling?
$disable = $forum_db->result($result) == '0';
// Check dependancies
if ($disable)
{
$query = array(
'SELECT' => 'e.id',
'FROM' => 'extensions AS e',
'WHERE' => 'e.disabled=0 AND e.dependencies LIKE \'%|'.$forum_db->escape($id).'|%\''
);
($hook = get_hook('aex_flip_qr_get_disable_dependencies')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if ($forum_db->num_rows($result) != 0)
{
$dependency = $forum_db->fetch_assoc($result);
message(sprintf($lang_admin_ext['Disable dependency'], $dependency['id']));
}
}
else
{
$query = array(
'SELECT' => 'e.dependencies',
'FROM' => 'extensions AS e',
'WHERE' => 'e.id=\''.$forum_db->escape($id).'\''
);
($hook = get_hook('aex_flip_qr_get_enable_dependencies')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$dependencies = $forum_db->fetch_assoc($result);
$dependencies = explode('|', substr($dependencies['dependencies'], 1, -1));
$query = array(
'SELECT' => 'e.id',
'FROM' => 'extensions AS e',
'WHERE' => 'e.disabled=0'
);
($hook = get_hook('aex_flip_qr_check_dependencies')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$installed_ext = array();
while ($row = $forum_db->fetch_assoc($result))
$installed_ext[] = $row['id'];
foreach ($dependencies as $dependency)
{
if (!empty($dependency) && !in_array($dependency, $installed_ext))
message(sprintf($lang_admin_ext['Disabled dependency'], $dependency));
}
}
$query = array(
'UPDATE' => 'extensions',
'SET' => 'disabled='.($disable ? '1' : '0'),
'WHERE' => 'id=\''.$forum_db->escape($id).'\''
);
($hook = get_hook('aex_flip_qr_update_disabled_status')) ? eval($hook) : null;
$forum_db->query_build($query) or error(__FILE__, __LINE__);
// Regenerate the hooks cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
require FORUM_ROOT.'include/cache.php';
generate_hooks_cache();
($hook = get_hook('aex_flip_pre_redirect')) ? eval($hook) : null;
if ($section == 'hotfixes')
redirect(forum_link($forum_url['admin_extensions_hotfixes']), ($disable ? $lang_admin_ext['Hotfix disabled'] : $lang_admin_ext['Hotfix enabled']).' '.$lang_admin_common['Redirect']);
else
redirect(forum_link($forum_url['admin_extensions_manage']), ($disable ? $lang_admin_ext['Extension disabled'] : $lang_admin_ext['Extension enabled']).' '.$lang_admin_common['Redirect']);
}
($hook = get_hook('aex_new_action')) ? eval($hook) : null;
// Generate an array of installed extensions
$inst_exts = array();
$query = array(
'SELECT' => 'e.*',
'FROM' => 'extensions AS e',
'ORDER BY' => 'e.title'
);
($hook = get_hook('aex_qr_get_all_extensions')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
while ($cur_ext = $forum_db->fetch_assoc($result))
$inst_exts[$cur_ext['id']] = $cur_ext;
// Hotfixes list
if ($section == 'hotfixes')
{
// Setup breadcrumbs
$forum_page['crumbs'] = array(
array($forum_config['o_board_title'], forum_link($forum_url['index'])),
array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])),
array($lang_admin_common['Extensions'], forum_link($forum_url['admin_extensions_manage'])),
array($lang_admin_common['Manage hotfixes'], forum_link($forum_url['admin_extensions_hotfixes']))
);
($hook = get_hook('aex_section_hotfixes_pre_header_load')) ? eval($hook) : null;
define('FORUM_PAGE_SECTION', 'extensions');
define('FORUM_PAGE', 'admin-extensions-hotfixes');
require FORUM_ROOT.'header.php';
// START SUBST -
ob_start();
($hook = get_hook('aex_section_hotfixes_output_start')) ? eval($hook) : null;
?>
'."\n\t\t\t".'
'.forum_htmlencode($hotfix['content']).'
'."\n\t\t\t".'
'."\n\t\t\t\t".'- '.sprintf($lang_admin_ext['Extension by'], 'PunBB').'
'."\n\t\t\t\t".'- '.$lang_admin_ext['Hotfix description'].'
'."\n\t\t\t".'
'."\n\t\t\t\t".'
'.$lang_admin_ext['Install hotfix'].'
'."\n\t\t".'
';
++$num_exts;
}
}
}
($hook = get_hook('aex_section_hotfixes_pre_display_available_ext_list')) ? eval($hook) : null;
if ($num_exts)
echo "\t\t".implode("\n\t\t", $forum_page['ext_item'])."\n";
else
{
?>
$ext)
{
if (strpos($id, 'hotfix_') !== 0)
continue;
$forum_page['ext_actions'] = array(
'flip' => '
'.($ext['disabled'] != '1' ? $lang_admin_ext['Disable'] : $lang_admin_ext['Enable']).'',
'uninstall' => '
'.$lang_admin_ext['Uninstall'].''
);
($hook = get_hook('aex_section_hotfixes_pre_ext_actions')) ? eval($hook) : null;
?>
'.$lang_admin_ext['Extension disabled'].' )' ?>
', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST -
require FORUM_ROOT.'footer.php';
}
// Extensions list
else
{
if ($forum_config['o_check_for_versions'] == 1)
{
// Check for the new versions of the extensions istalled
$repository_urls = array('http://punbb.informer.com/extensions');
($hook = get_hook('aex_add_extensions_repository')) ? eval($hook) : null;
$repository_url_by_extension = array();
foreach (array_keys($inst_exts) as $id)
($hook = get_hook('aex_add_repository_for_'.$id)) ? eval($hook) : null;
if (is_readable(FORUM_CACHE_DIR.'cache_ext_version_notifications.php'))
include FORUM_CACHE_DIR.'cache_ext_version_notifications.php';
//Get latest timestamp in cache
if (isset($forum_ext_repos))
{
$min_timestamp = 10000000000;
foreach ( $forum_ext_repos as $rep)
$min_timestamp = min($min_timestamp, $rep['timestamp']);
}
$update_hour = (isset($forum_ext_versions_update_cache) && (time() - $forum_ext_versions_update_cache > 60 * 60));
// Update last versions if there is no cahe or some extension was added/removed or one day has gone since last update
$update_new_versions_cache = !defined('FORUM_EXT_VERSIONS_LOADED') || (isset($forum_ext_last_versions) && array_diff($inst_exts, $forum_ext_last_versions) != array()) || $update_hour || ( $update_hour && isset($min_timestamp) && (time() - $min_timestamp > 60*60*24));
($hook = get_hook('aex_before_update_checking')) ? eval($hook) : null;
if ($update_new_versions_cache)
{
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
require_once FORUM_ROOT.'include/cache.php';
generate_ext_versions_cache($inst_exts, $repository_urls, $repository_url_by_extension);
include FORUM_CACHE_DIR.'cache_ext_version_notifications.php';
}
}
// Setup breadcrumbs
$forum_page['crumbs'] = array(
array($forum_config['o_board_title'], forum_link($forum_url['index'])),
array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])),
array($lang_admin_common['Extensions'], forum_link($forum_url['admin_extensions_manage'])),
array($lang_admin_common['Manage extensions'], forum_link($forum_url['admin_extensions_manage']))
);
($hook = get_hook('aex_section_manage_pre_header_load')) ? eval($hook) : null;
define('FORUM_PAGE_SECTION', 'extensions');
define('FORUM_PAGE', 'admin-extensions-manage');
require FORUM_ROOT.'header.php';
// START SUBST -
ob_start();
($hook = get_hook('aex_section_install_output_start')) ? eval($hook) : null;
?>
read()) !== false)
{
if ($entry{0} != '.' && is_dir(FORUM_ROOT.'extensions/'.$entry))
{
if (preg_match('/[^0-9a-z_]/', $entry))
{
$forum_page['ext_error'][] = '
'."\n\t\t\t\t".'
'.sprintf($lang_admin_ext['Extension loading error'], forum_htmlencode($entry)).'
'."\n\t\t\t\t".'
'.$lang_admin_ext['Illegal ID'].'
'."\n\t\t\t".'
';
++$num_failed;
continue;
}
else if (!file_exists(FORUM_ROOT.'extensions/'.$entry.'/manifest.xml'))
{
$forum_page['ext_error'][] = '
'."\n\t\t\t\t".'
'.sprintf($lang_admin_ext['Extension loading error'], forum_htmlencode($entry)).'
'."\n\t\t\t\t".'
'.$lang_admin_ext['Missing manifest'].'
'."\n\t\t\t".'
';
++$num_failed;
continue;
}
// Parse manifest.xml into an array
$ext_data = is_readable(FORUM_ROOT.'extensions/'.$entry.'/manifest.xml') ? xml_to_array(file_get_contents(FORUM_ROOT.'extensions/'.$entry.'/manifest.xml')) : '';
if (empty($ext_data))
{
$forum_page['ext_error'][] = '
'."\n\t\t\t\t".'
'.sprintf($lang_admin_ext['Extension loading error'], forum_htmlencode($entry)).'
'."\n\t\t\t\t".'
'.$lang_admin_ext['Failed parse manifest'].'
'."\n\t\t\t".'
';
++$num_failed;
continue;
}
// Validate manifest
$errors = validate_manifest($ext_data, $entry);
if (!empty($errors))
{
$forum_page['ext_error'][] = '
'."\n\t\t\t\t".'
'.sprintf($lang_admin_ext['Extension loading error'], forum_htmlencode($entry)).'
'."\n\t\t\t\t".'
'.implode(' ', $errors).'
'."\n\t\t\t".'
';
++$num_failed;
}
else
{
if (!array_key_exists($entry, $inst_exts) || version_compare($inst_exts[$entry]['version'], $ext_data['extension']['version'], '!='))
{
$forum_page['ext_item'][] = '
';
++$num_exts;
}
}
}
}
$d->close();
($hook = get_hook('aex_section_install_pre_display_available_ext_list')) ? eval($hook) : null;
if ($num_exts)
echo "\t\t".implode("\n\t\t", $forum_page['ext_item'])."\n";
else
{
?>
$ext)
{
if (strpos($id, 'hotfix_') === 0)
continue;
$forum_page['ext_actions'] = array(
'flip' => '
'.($ext['disabled'] != '1' ? $lang_admin_ext['Disable'] : $lang_admin_ext['Enable']).'',
'uninstall' => '
'.$lang_admin_ext['Uninstall'].''
);
if ($forum_config['o_check_for_versions'] == 1 && isset($forum_ext_last_versions[$id]) && version_compare($ext['version'], $forum_ext_last_versions[$id]['version'], '<'))
$forum_page['ext_actions']['latest_ver'] = '
'.$lang_admin_ext['Download latest version'].'';
($hook = get_hook('aex_section_manage_pre_ext_actions')) ? eval($hook) : null;
if ($ext['disabled'] == '1')
$forum_page['ext_item'][] = '
'."\n\t\t".'
'.forum_htmlencode($ext['title']).' ( '.$lang_admin_ext['Extension disabled'].' )
'."\n\t\t".'
'."\n\t\t\t".'- '.sprintf($lang_admin_ext['Extension by'], forum_htmlencode($ext['author'])).'
'."\n\t\t\t".'- '.sprintf($lang_admin_ext['Version'], $ext['version']).'
'."\n\t\t\t".(($ext['description'] != '') ? '- '.forum_htmlencode($ext['description']).'
' : '')."\n\t\t\t".'
'."\n\t\t".'
'.implode(' ', $forum_page['ext_actions']).'
'."\n\t".'
';
else
$forum_page['ext_item'][] = '
'."\n\t\t".'
'.forum_htmlencode($ext['title']).'
'."\n\t\t".'
'."\n\t\t\t".'- '.sprintf($lang_admin_ext['Extension by'], forum_htmlencode($ext['author'])).'
'."\n\t\t\t".'- '.sprintf($lang_admin_ext['Version'], $ext['version']).'
'."\n\t\t\t".(($ext['description'] != '') ? '- '.forum_htmlencode($ext['description']).'
' : '')."\n\t\t".'
'."\n\t\t".'
'.implode(' ', $forum_page['ext_actions']).'
'."\n\t".'
';
$installed_count++;
}
if ($installed_count > 0)
{
?>
', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST -
require FORUM_ROOT.'footer.php';
}