Home arrow Forum
SMF database incorrect prefix
  Welcome, Guest. Please login or register.
January 07, 2009, 11:39:58 PM
Home New Posts Search Calendar


Login with username, password and session length
Forum  |  MamboHacks.com  |  Mambo-SMF Integration 1.2.0 Support  |  Topic: SMF database incorrect prefix « previous next »
Pages: [1] Go Down Print
Author Topic: SMF database incorrect prefix  (Read 7726 times)
aravot
Jr. Member
**

Karma: +0/-0
Offline Offline

Posts: 89


test/test


View Profile WWW
SMF database incorrect prefix
« on: March 30, 2005, 04:57:08 PM »

Mambo-SMF Integration 1.2b it seems that a different prefix other than smf_ cannot be used.

Logged
cowboy
Administrator
Hero Member
*****

Karma: +30/-0
Offline Offline

Posts: 663



View Profile WWW
Re: SMF database incorrect prefix
« Reply #1 on: March 30, 2005, 06:37:00 PM »

SMFMamboMod is tested w/ 1.0.2 and 1.0.3.

Your smf version is 1.1beta.
I don't know if MamboSMFMod is even compatible with that version.

So I cannot help you on this particular issue until I try SMF 1.1 beta.
Logged
aravot
Jr. Member
**

Karma: +0/-0
Offline Offline

Posts: 89


test/test


View Profile WWW
Re: SMF database incorrect prefix
« Reply #2 on: March 30, 2005, 10:05:00 PM »

The problem is not the SMF1.1 but the database prefix I tried it with SMF 1.0.3 same result, your mod requires the SMF database prefix to be "smf_" I use different prefix for my SMF database example: 'forum_'
Logged
Goosemoose
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 10


View Profile
Re: SMF database incorrect prefix
« Reply #3 on: March 31, 2005, 12:26:12 AM »

It works for me and I use rfc_ , there must be something else going on.
Logged
aravot
Jr. Member
**

Karma: +0/-0
Offline Offline

Posts: 89


test/test


View Profile WWW
Re: SMF database incorrect prefix
« Reply #4 on: March 31, 2005, 01:42:57 PM »

I double checked everything seems OK.

I have both Mambo and SMF installed in a subdomain, DIR structure

mysite.com
------------->mambo (subdomain)
------------------------>mambo
------------------------>smf

I don't know but maybe cause I have two installation of SMF one in the main domain using smf_ prefix and one in the subdamin for testing purpose using smf103_

The website for testing

username: test
password: pastest

admin if you want PM me and I'll send you database/website login info.
« Last Edit: March 31, 2005, 01:52:15 PM by aravot » Logged
firewired
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 5


View Profile
Re: SMF database incorrect prefix
« Reply #5 on: April 01, 2005, 08:48:04 PM »

I'm having the same problem. Mambo seems blind to the yabbse_ prefix of my existing board. I'm on SMF 1.02 and Integration 1.3, and aside from that issue, everything else installed properly.

What exactly are the consequences of the database prefix not being recognized the bridge?
Website: PinoyDVD
Logged
tFF
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4



View Profile
Re: SMF database incorrect prefix
« Reply #6 on: April 06, 2005, 04:13:17 PM »

Has anybody of you tried to get inside of the code to solve the prob?
look at /administrator/components/com_smf/
functions.smf.php
Code:
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):
Code:
if ((strpos($row[0],$smf_prefix)!==false)&&(strpos($row[0],$smf_prefix)==0)) {

So, finally u should get this:
Code:
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.
Logged
cowboy
Administrator
Hero Member
*****

Karma: +30/-0
Offline Offline

Posts: 663



View Profile WWW
Re: SMF database incorrect prefix
« Reply #7 on: April 06, 2005, 04:26:03 PM »

Nice work aravot. You actually fixed it  Cheesy.

I will have this added on the final release.
Logged
tFF
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4



View Profile
Re: SMF database incorrect prefix
« Reply #8 on: April 06, 2005, 04:31:55 PM »

Whom are you talking to? Aravot or me (tFF)?
What fix do you mean aravot has made?
Logged
cowboy
Administrator
Hero Member
*****

Karma: +30/-0
Offline Offline

Posts: 663



View Profile WWW
Re: SMF database incorrect prefix
« Reply #9 on: April 06, 2005, 04:36:29 PM »

Ooopsss... haha

Nice work tFF. That's actually a fix  Grin.
I will have this added on the final release.
Logged
aravot
Jr. Member
**

Karma: +0/-0
Offline Offline

Posts: 89


test/test


View Profile WWW
Re: SMF database incorrect prefix
« Reply #10 on: April 06, 2005, 04:59:38 PM »

Thanks for the complement but it was tFF
Logged
Pages: [1] Go Up Print 
Forum  |  MamboHacks.com  |  Mambo-SMF Integration 1.2.0 Support  |  Topic: SMF database incorrect prefix « previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Forum | Powered by SMF 1.0.5 & Mambo-SMF.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!
None of the text or images in this public website may be copied without the expressed written consent of the authors.
Copyright 2005 by MamboHacks.com. Powered by Mambo. All rights reserved.
TERMS OF USE