Has anybody of you tried to get inside of the code to solve the prob?
look at /administrator/components/com_smf/
functions.smf.php
function isSMFInstalled()
{
global $database, $mosConfig_absolute_path, $mosConfig_db, $smf_prefix;
include_once( $mosConfig_absolute_path . '/administrator/components/com_smf/config.smf.php' );
$result = mysql_list_tables($mosConfig_db);
while ($row = mysql_fetch_row($result)) {
if (substr($row[0],0,4) == $smf_prefix) {
return true;
}
}
return false;
}
And what do you think of it? Look here:
if (substr($row[0],0,4) == $smf_prefix) {It's written here that prefix should be no longer than 4 symbols.
What's that? That's a glitch and a cosiquence of author is not trying to cover all the angles.
Here's a 5 minute hack for me i've made. It's not universal and doesn't prevent user from entering incorrect data (simply change the above mentioned line to this one shown below):
if ((strpos($row[0],$smf_prefix)!==false)&&(strpos($row[0],$smf_prefix)==0)) {
So, finally u should get this:
function isSMFInstalled()
{
global $database, $mosConfig_absolute_path, $mosConfig_db, $smf_prefix;
include_once( $mosConfig_absolute_path . '/administrator/components/com_smf/config.smf.php' );
$result = mysql_list_tables($mosConfig_db);
while ($row = mysql_fetch_row($result)) {
if ((strpos($row[0],$smf_prefix)!==false)&&(strpos($row[0],$smf_prefix)==0)) {
return true;
}
}
return false;
}
What has been changed:
1. here we check whether the prefix could be found in table's name
2. then if it is found we check whether the found string is at the very beginning of the name
Some side-effects here:
suppose i have prefix "msu_smf_"
so if i enter...
..."msu_smf_" - match => correct prefix
..."msu_smf" - match => component thinks the prefix is correct
..."msu_sdf" - no match => incorrect prefix
As u may see the hack doesn't prevent admin from making easy mistakes.
But it works. The purpose was to make one-line hack without any extra sub-routines.