Joomla and eFiction...
 
Notifications
Clear all

Joomla and eFiction Bridge - JFiction

24 Posts
4 Users
0 Reactions
5,414 Views
(@guest1696)
Posts: 0
 

Since I'm getting PMs about this, I thought I'd go ahead and at least report something.  πŸ™‚

I started looking into this in December 2006. I had to totally rethink my approach. I am not embedding eFiction within Joomla. Rather, I am synchronizing Joomla and eFiction so that both systems will work standalone while still sharing information. "Visual integration" of eFiction with Joomla will also be attempted.

Here's what I have thus far:

  • Successful installation and un-installation of core component - There is actually a JFiction component (com_jfiction) that installs and removes properly. The Joomla administrative backend is up and running. Not every feature is fully implemented yet, but it's in progress.
  • Synchronized login/logout between Joomla and eFiction - I now have dual login capability. Logging into one system logs me into both.
  • Configuration sharing between systems - Joomla can now "see" eFiction's configuration values, and vice versa. This is important to complete the various other sync activities (i.e., registration).

There is still a LOT to do, but I am putting the hardest coding first. My goal is for this solution to work when Joomla and eFiction are already populated (meaning that members existed in both systems before bridging) and running on separate databases (same server, but with each system having its own database, which some people actually do). If I can get the ugliest scenario to work, the rest should be (relatively) easy.

I may need some suggestions for the template solution - my plan is to create a special Jmenu block that reconstructs Joomla's native main menu within an eFiction tempate. To further "visually integrate" eFiction with Joomla, I'm going to attempt to create a template that hooks into Joomla's current template values to pull in such things as background color, fonts, and other general CSS information.

Tonight, I'm further testing login/logout and now preparing to synchronize registration. Hope this all works out!

Regards,
Brat.


 
Posted : 13/06/2007 10:35 pm
(@calash)
Posts: 180
Estimable Member
 

I am not sure how Joombla handles its templates but I had good success in my vB bridge by loading the template into TPL variables using the variables.php file.  I load the header, navbar, footer, and 3 custom templates that act as the framework for the individual blocks.  Once loaded you can insert them anywhere in your skin files, and since they are using variables.php it is skin specific, so other skins function independently from vB


The World of Necrotania - Story Writing Community

 
Posted : 14/06/2007 10:47 am
(@guest1696)
Posts: 0
 

I am not sure how Joombla handles its templates but I had good success in my vB bridge by loading the template into TPL variables using the variables.php file.  I load the header, navbar, footer, and 3 custom templates that act as the framework for the individual blocks.  Once loaded you can insert them anywhere in your skin files, and since they are using variables.php it is skin specific, so other skins function independently from vB

This is exactly what I want to achieve. With Joomla, menus are echoed using its internal modules, but you can also reconstruct the main menu links from database information (this way, if links are changed in Joomla, the changes would be reflected in eFiction). Templating is done using the $mainframe->getTemplate variable; I'm now reading up on this.

If it's okay with you, I'd like to download your vBulletin skins and take a look at them for more information. Hopefully this will point me in the right direction. Thanks for the input!

Regards,
Brat.


 
Posted : 14/06/2007 2:47 pm
(@calash)
Posts: 180
Estimable Member
 

Go for it πŸ™‚

The key part is the following


$tpl->assignGlobal("vb_header", $header);
$tpl->assignGlobal("vb_footer", $footer);
$tpl->assignGlobal("vb_navbar", $navbar);
$tpl->assignGlobal("vb_efic1", $efic_block_1);
$tpl->assignGlobal("vb_efic2", $efic_block_2);
$tpl->assignGlobal("vb_efic3", $efic_block_3);

The variables are assigned in extra_header.php.  In vB the templates are stored in the database, and they are fairly easy to extract.  Once you load the info into the variables you can put them in the standard TPL files that eFiction uses.

Feel free to tear apart my code if it will help.  The more bndges we have the more popular the script will be πŸ™‚


The World of Necrotania - Story Writing Community

 
Posted : 14/06/2007 3:19 pm
(@guest1696)
Posts: 0
 

Unfortunately, Joomla is not quite that nice.  😐 Templates are retrieved via the use of mainframe variables that do the parsing. However, use of this variable may allow me to "wrap" Joomla around eFiction - gotta research that this weekend.

I do have a quick user sync question; really, it has to do with approach. Because, in my solution, both systems operate standalone, both sets of user tables will be in use. Within both Joomla and eFiction, a member can change username, password and email address. The only true constant (the real identifier as far as the systems are concerned) is the system-generated user ID. I'm considering a few possible solutions to keep things synchronized. One method would be to add an additional record to each system's respective user table that stores the member's ID within the other system. So, in Joomla, I could add a record called eFicID that puts the member's eFiction ID within jos_users (or whatever the Joomla prefix is). Conversely, I could add josID to the fanfiction_authors table. Then, code would dictate that, upon any change to user records, the member's corresponding ID in the other system is used to find him in that system, and the same changes are made.

Another method is to create a separate "sync table" that is simply a side-by-side listing of Joomla and eFiction member IDs (since each member technically has two IDs - one within each system). When a change to a member record (i.e., username, password, email) is made in one system, bridge code would call "sync table" and look up that member's corresponding ID in the other system, and then make those changes in that system as well.

I'm not sure which solution is better, or if there is another approach I hadn't thought of. I do not like to alter existing tables, but this change would be very minor (would not affect the operation of either system's core functions at all) and the changes are easily removed automatically upon de-installation of the bridge. Adding another table absolutely would keep things perfectly intact, but I don't want to generate too much overhead.

Any ideas, suggestions, etc., are welcome. Thanks again!

Regards,
Brat.


 
Posted : 14/06/2007 9:55 pm
(@calash)
Posts: 180
Estimable Member
 

On of my first bridges was an IPB 1.3 -> eFiction bridge that functions similar to what you are looking to do.  Each script had it's own user table, synced together by the username -> penname.  The problem with this approach is that it adds a bunch of queries, ether via a sync cron job or embedded in the code.  You also run into the issue down the road that I did, with the tables not in sync any extra bridging (IE, story list in Joombla) become much more difficult.  Once out of sync, getting them back into sync is a painful process.

My current bridge uses the system Tammy setup and shows in her SMF bridge example.  It replaces the eFiction user table with the CMS?Forum of your choice.  Being a built-in system it is fairly easy to get running.  User preferences are set to default the first time a user visits the eFiction side.  This approach eliminates the redundant data, and with the user ID's in sync some cross-platform communication that would have been more difficult becomes very easy (For example, every user post on my forum has there story count and a link to there eFiction profile.  It will soon also contain a link to there recent story)

Of course this approach has the drawback that if you ever want to separate the two systems it is a difficult task, however this would not be as difficult as the first process.

Of the choices you listed, having a sync table would probably be best.  Any queries could be setup altered to include the sync table via a join statment.  The key is to map out what information you will need and where one script will need to access the other sides info.


The World of Necrotania - Story Writing Community

 
Posted : 15/06/2007 10:28 am
(@tammy)
Posts: 2577
Member Moderator
 

Of course this approach has the drawback that if you ever want to separate the two systems it is a difficult task, however this would not be as difficult as the first process.

Not really.  All you'd be doing is exporting the relevant portions of the CMS user table into the eFiction authors table.  You might be able to do it with a single INSERT SELECT.  At most it would be a couple queries.


 
Posted : 15/06/2007 11:00 am
(@calash)
Posts: 180
Estimable Member
 

I didn't say it was a huge drawback, but it was worth noting.

The main issue is not so much getting the info moved over, but the passwords.  In many cases the password hash will be different between eFiction and the CMS/Forum/Whatever it was bridged to.  The best solution to this is user notification...let them know well in advance that this will happen and they will have to reset there password in eFiction.


The World of Necrotania - Story Writing Community

 
Posted : 15/06/2007 12:32 pm
(@tammy)
Posts: 2577
Member Moderator
 

Yes, that is the biggest problem.


 
Posted : 15/06/2007 1:53 pm
(@guest1696)
Posts: 0
 

Thanks for all the input! πŸ™‚

After really wrestling with this, I decided to keep both systems working as standalone (no swapping of tables, etc.). The points about synchronization are very good - my concern is to keep the users in sync across both applications. Adding another table, I fear, would increase the potential of falling "out of sync". Another complexity is Joomla itself - it is a true application framework that has plugins and such. I cannot truly "slave" eFiction to Joomla for the simple fact that Joomla has to communicate with potentially dozens of other components and even other systems (i.e., the SMF bridge). Additionally, Joomla really tries to clamp down on security - so, to keep the system intact, you pretty much have to use the component approach to properly "talk" to the system.

Taking into consideration all of these issues, including query processing, it looks like the easiest and cleanest method is to just add an extra ID column to each user table. No, I still don't like altering core products - but because of all the other factors, it looks like this is the most sane solution. Again, it is easily removed upon de-installation of the component. Also, it cuts out having yet another table (which again adds to the probability of falling out of sync as it would be an "intermediary" step before getting to the actual data).

I'm testing my latest JFiction alpha with this approach. The additional ID columns were added readily and thus far everything appears to function normally. Also, if eFiction were to have a plugin system implemented at some point, the bridge as constructed could be readily adapted to it (at least that's what I'm trying to do).

Correction - No alteration to eFiction's core member table is required! Just adding the eFiction member ID to Joomla's member table is sufficient.

Again, thanks for all the ideas - it really does help to hear voices other than the ones in my head.  πŸ˜€

Regards,
Brat.


 
Posted : 15/06/2007 2:44 pm
(@calash)
Posts: 180
Estimable Member
 

Glad to help πŸ™‚

In a perfect world, where both eFiction and Joomla are starting with new installs the two id numbers should be in sync..just something to keep in the back of your head.

The method you are using does provide an interesting possibility...multiple pennames per author.  I looked at that a while back, by storing more than one efic ID in the host database (for you Joomla) it would be possible to allow people to create several different pen names, all associated with one account.  It is probably not something to look at for the start of the mod, but if there is interest it would make a nice upgrade down the road.

Good look, looking forward to seeing your finished product πŸ™‚


The World of Necrotania - Story Writing Community

 
Posted : 18/06/2007 10:02 am
(@guest1696)
Posts: 0
 

Glad to help πŸ™‚

In a perfect world, where both eFiction and Joomla are starting with new installs the two id numbers should be in sync..just something to keep in the back of your head.

The method you are using does provide an interesting possibility...multiple pennames per author.  I looked at that a while back, by storing more than one efic ID in the host database (for you Joomla) it would be possible to allow people to create several different pen names, all associated with one account.  It is probably not something to look at for the start of the mod, but if there is interest it would make a nice upgrade down the road.

Good look, looking forward to seeing your finished product πŸ™‚

One quick thing to note about Joomla...

It's member ID numbering starts at 62, not 1. Not sure why the team chose to do that, but effectively that ensures that Joomla pretty much can never really be in sync with other programs  :-P. When I did my old Joomla - LifeType sync, I learned that fact the hard way. So, because I don't want to hack either system more than necessary, I'll let code keep things in order. The plan is, when you alter your penname in one system, it is changed in the other.

The "worst case" scenario is someone who signs up with totally different email, username and password in both systems. That person will be seen as two different people no matter what, as there is nothing in common between the two accounts. In other words, you can only sync when the system can reasonably identify when the two accounts belong to the same person. Of course, for those who are not automatically for this reason, the webmaster can do a manual synch with the problem accounts - the member will have to indicate which account information will dominate. Hopefully, this will not be all that common.

Okay, back to coding I go!

Regards,
Brat.


 
Posted : 19/06/2007 2:42 pm
(@guest1696)
Posts: 0
 

Hello, all. I thought that I'd just give a quick update.

I've made a LOT of progress since the last posting. I've worked out the frontend bridge kinks, including fixing several minor (but annoying) PHP warnings. Login/logout between both platforms is now synchronizing properly. Also, the the efiction ID column for the Joomla member table now installs and de-installs as it should.

The BIG push lately has been with the Joomla side. I've completely rewritten the component administrator, and am writing special plugins to catch the registration, login, and account change processes so that Joomla can keep eFiction in sync. Of course, the last and hardest piece is the actual database synchronization itself. I have written the code, and am adding it today.

Right now, I'm at alpha version 0.6. Once I hit 1.0, I'll deem this "beta" and I'll be ready for closed beta testing.

Regards,
Brat.


 
Posted : 01/07/2007 5:01 pm
(@guest1696)
Posts: 0
 

I've been quiet because I'm working on wrapping this bridge up. I should be ready for beta testing within the next two weeks. This will be a closed beta test so I can get very detailed feedback, which means I'll need about four or five volunteers. If you want to help, please PM me with some information about your current setup (i.e., completely new (empty) installation of both eFiction and Joomla, existing eFiction with new Joomla installation, existing Joomla with new eFiction installation, two pre-existing installations that you now want to bridge).

I'm ironing out the last of the bugs, and preparing the documentation that will go with this bridge.

To be brief, the package will consist of a core component, associated Joomla plugins (formerly called "mambots"), and the eFiction bridged files. Ironically, to date, there are only four of them, as Joomla is tasked with handling the lion's share of the bridge work.

All login, logout, registration, and member account updates are synchronized on both sides. Additionally, I have added "switches" in the component so a webmaster can decide to route all login and registration requests through Joomla.

The bridge is Community Builder-enabled. On the drawing board are eFiction CB plugins so that pertinent eFiction information is displayed within each member's CB profile, along with eFiction modules for Joomla (i.e., last five stories, etc.). I'm not going to start on those until JFiction is in beta.

Thanks in advance to all potential beta testers, and I look forward to hearing from you soon!

Regards,
Brat.


 
Posted : 18/07/2007 1:26 am
(@guest1696)
Posts: 0
 

First off, thanks to all who PM'd me about this bridge. Real world projects have had me hung up for the past couple of months (yikes!).

That said, the Joomla solution, called JFiction, is almost done. JFiction is a comprehensive solution that includes the modified eFiction files (only four, if I remember correctly), Joomla component and several Joomla modules (for showing Featured Stories, Most Read, Recently Added, etc.). JFiction is Community-Builder ready out-of-the-box.

JFiction is designed to work on already existing installations as well as new ones. Data between the systems is synchronized so that, should you decide to separate them and uninstall the bridge, each will work independently of the other.

The last thing I need to do is create the actual CB plugin showing each member's eFiction activity (i.e., Last Stories Posted).
A version ready for testing will be ready about mid-October. The testing will be among only a few webmasters so I can get detailed feedback. Anyone interested in testing this, please let me know as soon as possible.

If you have any questions, please ask!

Regards,
Brat.

[NOTE: Modified to add more information.]


 
Posted : 04/10/2007 5:08 pm
Page 1 / 2
Share: