Welcome Guest, Not a member yet? Register   Sign In
Load CodeIgniter into WordPress Multisite Network
#1

[eluser]DanSearle[/eluser]
Hi all, I've found a few posts and plugins that combine CI and WP in different ways, but none that match my case here:

I want WP to process the URLs, and it can also produce almost all the HTML, header footer, menu, etc. I already have a WP theme made and tested, so I don't want to have to port that to CI views.

But I want the WP theme to be able to load some CI libraries that can in turn access a database, process a form POST. Essentially users will be able to log in via a form produced by CI, creating a session for themselves in CI, and WP can then ask CI if this session exists and load other private content.

Also my WP site is a multisite Network, so WP needs to be in the root. I figured I'd put CI in a subfolder of the theme. Each site in the network would have its own theme, but they would all be child themes of this über theme that loads CI.

So the part I think I'm missing is how to start CI up from within that theme - anyone done this before, or can give me a clue?
#2

[eluser]jamesduncan[/eluser]
As of right now - I'm trying to get this plugin to work

http://wordpress.org/extend/plugins/wp-code-igniter/

But so far, Im getting 500 errors - in the process of debugging

But that might be a start

You'll need to pass the CI session to the WP framework

http://ellislab.com/codeigniter/user-gui...sions.html

The CI session class allows you to augment what is passed - but as WP is sessionless, you'll have to figure out a way to make WP understand the CI session - not too sure how to do that

OK well hope this is a start - I have a thread going with some different specifics in the set up of WP and CI - but some of the challenges are the same

Cheers
#3

[eluser]DanSearle[/eluser]
thanks for the reply. That plugin was the first that I tried actually, but I stopped using it as it passed all URLs to CodeIgniter for parsing - and I don't want it to do that.

As to the sessions, I figure CI can track the session and I can write some CI library class that can be queried to ask "am I logged in?", which can be called from the WP page templates or functions file. I haven't got that far yet though...

So far I've set up my Multisite Network, set up a parent and child theme and I'm taking ideas from this wiki page: https://github.com/EllisLab/CodeIgniter/...ide-script

With that I can get CI code to function but it's all still a work in progress ... if I crack it I'll post back how.

// edit - I have CI installed in a folder of my parent theme, and it's initialised from there, more or less as per that wiki.




Theme © iAndrew 2016 - Forum software by © MyBB