Fixed incorrect naming of config names;
Removed install code that shouldn't be there anymore
This commit is contained in:
@@ -57,7 +57,7 @@ class portal_modulename_module
|
|||||||
global $config, $template;
|
global $config, $template;
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'EXAMPLE' => $config['portal_' . $module_id . '_configname'],
|
'EXAMPLE' => $config['board3_configname_' . $module_id],
|
||||||
));
|
));
|
||||||
|
|
||||||
return 'modulename_center.html';
|
return 'modulename_center.html';
|
||||||
@@ -68,7 +68,7 @@ class portal_modulename_module
|
|||||||
global $config, $template;
|
global $config, $template;
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'EXAMPLE' => $config['portal_' . $module_id . '_configname2'],
|
'EXAMPLE' => $config['board3_configname2_' . $module_id],
|
||||||
));
|
));
|
||||||
|
|
||||||
return 'modulename_side.html';
|
return 'modulename_side.html';
|
||||||
@@ -80,8 +80,8 @@ class portal_modulename_module
|
|||||||
'title' => 'ACP_CONFIG_MODULENAME',
|
'title' => 'ACP_CONFIG_MODULENAME',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_MODULENAME_CONFIGLEGEND',
|
'legend1' => 'ACP_MODULENAME_CONFIGLEGEND',
|
||||||
'portal_' . $module_id . '_configname' => array('lang' => 'MODULENAME_CONFIGNAME', 'validate' => 'string', 'type' => 'text:10:200', 'explain' => false),
|
'board3_configname_' . $module_id => 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_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)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('portal_' . $module_id . '_configname', 'Hello World!');
|
set_config('board3_configname_' . $module_id, 'Hello World!');
|
||||||
set_config('portal_' . $module_id . '_configname2', 1337);
|
set_config('board3_configname2_' . $module_id, 1337);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +101,8 @@ class portal_modulename_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'portal_' . $module_id . '_configname',
|
'board3_configname_' . $module_id,
|
||||||
'portal_' . $module_id . '_configname2',
|
'board3_configname2_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
@@ -84,22 +84,12 @@ class portal_forumlist_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('portal_' . $module_id . '_configname', 'Hello World!');
|
|
||||||
set_config('portal_' . $module_id . '_configname2', 1337);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function uninstall($module_id)
|
function uninstall($module_id)
|
||||||
{
|
{
|
||||||
global $db;
|
return true;
|
||||||
|
|
||||||
$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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,22 +100,12 @@ class portal_stylechanger_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('portal_' . $module_id . '_configname', 'Hello World!');
|
|
||||||
set_config('portal_' . $module_id . '_configname2', 1337);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function uninstall($module_id)
|
function uninstall($module_id)
|
||||||
{
|
{
|
||||||
global $db;
|
return true;
|
||||||
|
|
||||||
$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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class portal_topposters_module
|
|||||||
AND user_posts <> 0
|
AND user_posts <> 0
|
||||||
AND username <> ''
|
AND username <> ''
|
||||||
ORDER BY user_posts DESC";
|
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)))
|
while (($row = $db->sql_fetchrow($result)))
|
||||||
{
|
{
|
||||||
@@ -82,8 +82,8 @@ class portal_topposters_module
|
|||||||
return array(
|
return array(
|
||||||
'title' => 'TOPPOSTERS_CONFIG',
|
'title' => 'TOPPOSTERS_CONFIG',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'TOPPOSTERS',
|
'legend1' => 'TOPPOSTERS',
|
||||||
'portal_topposters' => array('lang' => 'NUM_TOPPOSTERS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'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)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('portal_topposters', 5);
|
set_config('board3_topposters_' . $module_id, 5);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ class portal_topposters_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'portal_topposters',
|
'board3_topposters_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
Reference in New Issue
Block a user