Jump to content

Integrating WordPress into phpVMS news


AGuyFawkesMask

Recommended Posts

Happy Friday, everyone.

I've been pondering ways to decrease the inefficiencies during normal operations at my VA and one of the things I've become determined to engineer is a connection between my WordPress blog and the phpVMS news feature. I'm currently using my blog for all news-related announcements, ranging from press releases to NOTAMs, and I'm using the phpVMS news feature strictly for NOTAMs. In the pilot center, the "News" section appears as a "Dispatch Center" relaying various information from across my entire site, once of them being NOTAMs. These NOTAMs appear as a link, but upon a user selecting a NOTAM, they are directed to the blog where the NOTAM is published. This has all been accomplished via the phpvms_news table via adding a new field to the table (Field: redirect_link).

However, I currently have to copy the title of the post and post URL and then fill out the "Add News" form in the Admin Center whenever I publish a NOTAM via my blog. To eliminate this inefficiency, I'm interested in syncing the phpVMS news feature with my WordPress blog such that whenever I publish a blog post containing the category "NOTAM," it will simultaneously post it in the phpvms_news table.

This can't be too difficult to do, the only issue is that I've never experimented with WordPress before and would appreciate it if, as I develop the snippet, someone could guide me through the process and advise if I'm getting anything wrong.

Thanks in advance--I appreciate the help!

Link to comment
Share on other sites

  • 2 weeks later...
  • Administrators

What you'll have to do is have a script that goes through the records Wordpress posts table, looks for your keywords (you can use substr_count), and then adds it into the phpvms_news table. You might add a extra column to the phpvms_news table called wordpress_post_id, so you can tell whether you've already cross posted it.

Wordpress might have hooks, or a simple admin module, that can run that after you create a new post.

Something like:

  1. SELECT * FROM wordpress posts
  2. loop through posts, find keyword

    1. If found keyword, see if post_id is already in the phpvms_news
      1. If not, then add it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...