开发者

WordPress deep integration with (Zend) php project

We have a large project built in php 5.2 (we use Zend framework), and we would like to integrate wordpress with our running code in order to:

  • allow our users to post articles (blog posts in specific categories, with comments and all the cool wordpress features)
  • use wordpress in order to build a simple questions & answers feature by using a commercial theme (from templatic)

We have no problem integrating a simple wordpress blog with our code (http://stackoverflow.com/q/3796586/578670). Our problem in both cases is that we need deep integration between wordpress and our class hierarchy:

  1. Single sign on using our authentication methods (we will disable the registration and login features in the wordpress installation)
  2. Use our user data in wordpress: user names, descriptions, avatars, and other profile data with links to the profile pages of our site
  3. Track posts, comments and other activity from users in order to present summaries in their profile pages, use them in our internal "user ranking" calculations and/or for badges, etc
  4. Use our own rich editor for creating new posts or embed the wordpress rich editor to our site (without the rest of the admin fea开发者_如何学编程tures)

I searched, but I could only find simple solutions for showing posts or user data, so I would appreciate any help you can give me.


I did a similar project awhile back; to the best of my knowledge:

  1. This is difficult to figure out without knowing how you authenticate. How I'd do it is via something like OpenID so you don't have to deal with a bunch of passwords/duplicate user entries, but given it seems you have legacy data, easiest might be just to write a piece of code that continually updates the WP user table with data from your Zend framework. If you need more info on how to go about this, please comment and I'll add more detail (Up to and including the SQL query I used to import users from a proprietary DB into WP with BuddyPress).

  2. See above. If your user data contains more fields than WP does by default, consider installing BuddyPress to allow custom profile fields. You can then build support for this into the bridge script mentioned above.

  3. BuddyPress might be good for creating these summaries (Assuming all of this data is handled by WP). That said, I'm not entirely sure how you'd pass these stats to the Zend site -- you'll probably have to write a bunch of manual stat-gathering queries that execute when a stats page is loaded.

  4. This question doesn't make much sense -- what do you mean, "without the rest of the admin features"? If you give a user "Author" permissions in WP, they can use the post editor without having access to any of the site's admin functionality. Just set up your user roles properly and direct people to /wp-admin/? Why would you want to "embed" the editors other places? You can probably write a plugin that displays your RTF text editor interface instead of WP's default one, but it's not like posts from that will go to your Zend framework; adding Wordpress' editor to Zend pages won't make them save to WordPress -- they'll just be HTML formatted and saved to the same place as before.

Personally though, unless the Zend framework does a LOT of really extensive, specialized work, I'd try and replicate the entire thing in WP (Since you'll be importing most of the Zend framework data anyway). Most of what you specified (User rankings; achievements) can be done with free WP plugins. Just my two.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜