Thank you very much. This is a very useful information.
Oh yes. This relates to subforums mod that I am in the mid of converting. The code is as follows:
// get the hooks from database
$smfhooks = array();
$request = $smcFunc['db_query']('', '
SELECT variable, value FROM {db_prefix}settings
WHERE variable IN ({array_string:hooks})',
array('hooks' => array_keys($hooklist))
);
if($smcFunc['db_num_rows']($request) > 0)
{
while($row = $smcFunc['db_fetch_assoc']($request))
$smfhooks[$row['variable']] = $row['value'];
$smcFunc['db_free_result']($request);
}
// update the hooks
foreach($hooklist as $hookname => $value)
{
if(isset($smfhooks[$hookname]))
$smfhooks[$hookname] = trim($hooklist[$hookname] .','. trim(str_replace($value, '', $smfhooks[$hookname]), ','), ',');
else
$smfhooks[$hookname] = trim($value);
$smcFunc['db_insert']('replace', '
{db_prefix}settings',
array('variable' => 'string', 'value' => 'string'),
array($hookname, $smfhooks[$hookname]),
array()
);
}
So, is replacing it with $hook correct?