Fixed incorrect naming of config names;

Removed install code that shouldn't be there anymore
This commit is contained in:
Marc Alexander
2011-01-12 11:24:39 +00:00
parent 7cf48db1ba
commit d38a815055
4 changed files with 15 additions and 35 deletions

View File

@@ -57,7 +57,7 @@ class portal_modulename_module
global $config, $template;
$template->assign_vars(array(
'EXAMPLE' => $config['portal_' . $module_id . '_configname'],
'EXAMPLE' => $config['board3_configname_' . $module_id],
));
return 'modulename_center.html';
@@ -68,7 +68,7 @@ class portal_modulename_module
global $config, $template;
$template->assign_vars(array(
'EXAMPLE' => $config['portal_' . $module_id . '_configname2'],
'EXAMPLE' => $config['board3_configname2_' . $module_id],
));
return 'modulename_side.html';
@@ -80,8 +80,8 @@ class portal_modulename_module
'title' => 'ACP_CONFIG_MODULENAME',
'vars' => array(
'legend1' => 'ACP_MODULENAME_CONFIGLEGEND',
'portal_' . $module_id . '_configname' => array('lang' => 'MODULENAME_CONFIGNAME', 'validate' => 'string', 'type' => 'text:10:200', 'explain' => false),
'portal_' . $module_id . '_configname2' => array('lang' => 'MODULENAME_CONFIGNAME2', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'board3_configname_' . $module_id => array('lang' => 'MODULENAME_CONFIGNAME', 'validate' => 'string', 'type' => 'text:10:200', 'explain' => false),
'board3_configname2_' . $module_id => array('lang' => 'MODULENAME_CONFIGNAME2', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
),
);
}
@@ -91,8 +91,8 @@ class portal_modulename_module
*/
function install($module_id)
{
set_config('portal_' . $module_id . '_configname', 'Hello World!');
set_config('portal_' . $module_id . '_configname2', 1337);
set_config('board3_configname_' . $module_id, 'Hello World!');
set_config('board3_configname2_' . $module_id, 1337);
return true;
}
@@ -101,8 +101,8 @@ class portal_modulename_module
global $db;
$del_config = array(
'portal_' . $module_id . '_configname',
'portal_' . $module_id . '_configname2',
'board3_configname_' . $module_id,
'board3_configname2_' . $module_id,
);
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
WHERE ' . $db->sql_in_set('config_name', $del_config);

View File

@@ -84,22 +84,12 @@ class portal_forumlist_module
*/
function install($module_id)
{
set_config('portal_' . $module_id . '_configname', 'Hello World!');
set_config('portal_' . $module_id . '_configname2', 1337);
return true;
}
function uninstall($module_id)
{
global $db;
$del_config = array(
'portal_' . $module_id . '_configname',
'portal_' . $module_id . '_configname2',
);
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
WHERE ' . $db->sql_in_set('config_name', $del_config);
return $db->sql_query($sql);
return true;
}
}

View File

@@ -100,22 +100,12 @@ class portal_stylechanger_module
*/
function install($module_id)
{
set_config('portal_' . $module_id . '_configname', 'Hello World!');
set_config('portal_' . $module_id . '_configname2', 1337);
return true;
}
function uninstall($module_id)
{
global $db;
$del_config = array(
'portal_' . $module_id . '_configname',
'portal_' . $module_id . '_configname2',
);
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
WHERE ' . $db->sql_in_set('config_name', $del_config);
return $db->sql_query($sql);
return true;
}
}

View File

@@ -62,7 +62,7 @@ class portal_topposters_module
AND user_posts <> 0
AND username <> ''
ORDER BY user_posts DESC";
$result = $db->sql_query_limit($sql, $config['portal_topposters']);
$result = $db->sql_query_limit($sql, $config['board3_topposters_' . $module_id]);
while (($row = $db->sql_fetchrow($result)))
{
@@ -82,8 +82,8 @@ class portal_topposters_module
return array(
'title' => 'TOPPOSTERS_CONFIG',
'vars' => array(
'legend1' => 'TOPPOSTERS',
'portal_topposters' => array('lang' => 'NUM_TOPPOSTERS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'legend1' => 'TOPPOSTERS',
'board3_topposters_' . $module_id => array('lang' => 'NUM_TOPPOSTERS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
),
);
}
@@ -93,7 +93,7 @@ class portal_topposters_module
*/
function install($module_id)
{
set_config('portal_topposters', 5);
set_config('board3_topposters_' . $module_id, 5);
return true;
}
@@ -102,7 +102,7 @@ class portal_topposters_module
global $db;
$del_config = array(
'portal_topposters',
'board3_topposters_' . $module_id,
);
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
WHERE ' . $db->sql_in_set('config_name', $del_config);