duanmao9918 2011-01-17 15:08
浏览 33

WordPress与(Zend)php项目深度集成

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 features)

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.

  • 写回答

1条回答 默认 最新

  • duan0414 2011-01-30 21:31
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私