Forum

SMF 2.0 with eFicti...
 
Notifications
Clear all

SMF 2.0 with eFiction

Kindred
(@kindred)
Active Member

-edit-    This post is intended as a query to whoever wrote the original bridge files for efiction->smf (1.1.x).

I used to run eFiction with Joomla, ages ago... I have since gotten rid of Joomla, since I refuse to change out of SMF.
I am working on the bridge for SMF, using SMF 2.0

please do note that smf 2.0 is very different from smf 1.1.x and it is likely that any integration designed for smf 1.1.x will not work with smf 2.0

Things I note:

in 2.0.x, the database table names are all lower case.
id_member
also, the ones in mixed case, like realName are now separated by _
real_name
email_address

also, the code in SMF/Sources/QueryString.php is now


// Same goes for numeric keys.
foreach (array_merge(array_keys($_POST), array_keys($_GET), array_keys($_FILES)) as $key)
if (is_numeric($key))
die('Numeric request keys are invalid.');

// Numeric keys in cookies are less of a problem. Just unset those.
foreach ($_COOKIE as $key => $value)
if (is_numeric($key))
unset($_COOKIE[$key]);

so, in theory, this should become...


// Added for eFiction.  We do need $blocks set.
$blocks = isset($_GET['action']) && $_GET['action'] == "blocks" ? true : false;

// Same goes for numeric keys. 
foreach (array_merge(array_keys($_POST), array_keys($_GET), array_keys($_FILES)) as $key)
// added blocks check for eFiction.
if (is_numeric($key) && !$blocks)
die('Numeric request keys are invalid.');

// Numeric keys in cookies are less of a problem. Just unset those.
foreach ($_COOKIE as $key => $value)
// added blocks check for eFiction.
if (is_numeric($key) && !$blocks)
unset($_COOKIE[$key]);

So, having correctly updated efiction/includes/queries.php and smf/Sources/QueryString.php, the login is not working.   The system correctly logs me in to SMF, but does not recognize me as being logged in to eFction. It does not work if I log in to SMF first and go to eFciton... (should recognize the existing login) nor does it work if I go to eFiction and click "LOGIN" (takes me back to SMF, correctly logged in, but upon returning to eFiction, not logged in)

Also, the quick login in eFiction still points to eFiction/user.php?action=login instead of smf/index.php?action=login2

I think several of the bridged functions could possibly be better handled using SMF's SSI.php rather than doing direct database writes...   

I will also note that SMF has some very nice, simple integration functions built into it now, specifically for bridging to other systems...   
these allow things like linking registration and , profile updates, etc... between other systems and SMF.

also also, the createPost function would allow a post to be created for new eFiction submissions!

Quote
Topic starter Posted : 26/10/2008 5:19 pm
Tammy
(@tammy)
Member Moderator

I wrote the original bridge.  It was written as a very basic EXAMPLE.  It was never intended to be the be all and end all just enough to get someone started.

ReplyQuote
Posted : 30/10/2008 4:21 am
susieqzyo
(@susieqzyo)
Active Member

Kindred,

have you gotten a working bridge to SMF 2.0?  if so, would you be willing to share it?  I'm pretty new to php, and I was wondering if you could give me a jump start on how to use those integration hooks in SMF.

Thanks!

ReplyQuote
Posted : 31/12/2008 12:02 am
Kindred
(@kindred)
Active Member

no, I have been unfortunately working 11-13 hours a day for my RL job.

I am going to start taking another look at making an efiction bridge for SMF 2.0 RC1 after the new year

ReplyQuote
Topic starter Posted : 31/12/2008 6:13 am
Senkusha
(@senkusha)
Eminent Member

I am also trying to bridge SMF 2.x with eFiction.

I've made the necessary changes to queries.php and modified the 2.0 version of QueryString.php (per the above post).

I get the following errors when trying to go to my eFiction page ( http://www.ayeka.net/fanfiction/index.php )

Notice: Undefined index: db_query in .../forum/Sources/Load.php on line 144

Fatal error: Function name must be a string in .../forum/Sources/Load.php on line 144

I've looked at that line in SMF:


//Load the $modSettings array.
function reloadSettings()
{
    global $modSettings, $boarddir, $smcFunc, $txt, $db_character_set, $context;

    // Most database systems have not set UTF-8 as their default input charset.
    if (!empty($db_character_set))
    {
        smcFunc['db_query']('set_character_set', '
            SET NAMES ' . $db_character_set,
            array(
            )
        );
...

I'm not sure how to fix this problem.  Please, can anybody help me?

Thanks!

ReplyQuote
Posted : 01/08/2009 1:00 am
Senkusha
(@senkusha)
Eminent Member

I just installed and re-bridged to SMF, I'm getting this error again, but I don't remember how I got it fixed.  Anybody help?

ReplyQuote
Posted : 13/02/2010 1:50 am
Senkusha
(@senkusha)
Eminent Member

Can anybody help me with this?

ReplyQuote
Posted : 18/02/2010 12:22 am
Lyndsie
(@lyndsie)
Member Moderator

I think it's having problems with the formatting of this: smcFunc['db_query']()  It's reading that entire thing before the parentheses as the function name and probably hates it because the [ and ' aren't valid for a function name. I'm not familiar with what's going on there with the square brackets and what they're trying to accomplish.

Also it looks like it can't really do anything with the 'db_query' part either. That warning usually means it has no value.

I'd try commenting out that entire section of the if statement and see what happens. It's related to character encoding so it probably wouldn't break your site entirely if it's commented out, although I'm pretty certain eFic's not UTF-8, so it could cause some issues. (I don't know much about character encoding.)

ReplyQuote
Posted : 18/02/2010 5:34 am
Tammy
(@tammy)
Member Moderator

Looks like it's missing a $ in front of smcFunc maybe.

ReplyQuote
Posted : 18/02/2010 6:47 am
Lyndsie
(@lyndsie)
Member Moderator

Yeah, I guess the brackets makes sense if that's an array.

ReplyQuote
Posted : 18/02/2010 7:38 pm
Senkusha
(@senkusha)
Eminent Member

Well, I tried commenting it out, but that didn't stop the errors, the next group of code broke too, so I reverted my changes to the Load.php.  I do remember that it was something very simple to tweak, like a configuration or a switch somewhere, but stupid me, I never replied to my own problem indicating the solution. That won't happen this time. 

I also tried messing with the default character set, which had no impact, I tried both UTF-8 (since I turned that on when I setup SMF) as well as Latin (ISO---whatever it is)  Also I toggled both registered_globals and long_arrays in my php.ini file, neither one seemed to solve the problem either.

Since it is an array element it appears to be blowing up on, maybe there is a variable in the bridge somewhere that's not set correctly?

Thanks!

ReplyQuote
Posted : 18/02/2010 9:29 pm
Senkusha
(@senkusha)
Eminent Member

Is there any hope of an SMF 2.0 bridge with eFiction?  I'm tired of banging my  head against a wall.

ReplyQuote
Posted : 06/04/2010 10:46 pm
Share: