ATXI: AMFPHP + Textpattern Integration · May 3, 08:28 PM

ATXI by AllFlashWebsite.com

Use this AMFPHP service plugin to integrate the Textpattern database with AMFPHP to allow fast data exchange with Flash. This is essentially a faster alternative to the afw_getarticle Textpattern plugin. Edit: My original thought was that remoting would replace the afw_getarticle Textpattern plugin, however afw_getarticle still provides functionality which lets the developer leverage the Textpattern platform for XML generation in a way that ATXI cannot emulate (yet).

Installation

  • AMFPHP must be installed first.
  • Edit ATXI/atxiDB.php You must hard-code your database server, database name, user, password. This information is also stored in your textpattern folder, look for config.php. (This information was entered when you installed Textpattern)
  • Copy ATXI folder to your server IN folder amfphp/services/
  • Compile your flash file, etc…
  • An example mxml file (Flex) from the AWI* package is included. It has not been tested with this release, however it should work.

*NOTE: These files are ported directly from Amfphp Wordpress Integration. However, not all the functions could be ported to Textpattern. Those functions have been commented out in the source code.

Download

Download ATXI here.

State of the Plugin

I plan on adding additional features like Images, Files, etc. This plugin is intended to be expanded by YOU. If you add features, please share!

Compatibility

Tested with Txp-4.0.6.

Functions

getRecentPosts($howMany)

  • Get last published posts, post_id, post_title
  • returns ArrayCollection

getFullPosts($page, $count)

  • Get the full data of the last published posts
  • param $page Started page
  • param $count how many posts by page.
  • returns ArrayCollection

getPostData($postID)

  • Get all post’s data by id
  • returns ArrayCollection

getPostNameCategories($postID)

  • Get post’s categories ids
  • returns ArrayCollection

getLivePostTitlesBySection($section)

  • Titles of all Live Posts in a Section
  • returns Array

getCssByName($name)

  • Style sheet by Name
  • returns String

getImagesByCategory($category)

  • Get all images by category
  • returns ArrayCollection, {id, name, category, ext, w, h, alt, caption, date, author, thumbnail}

getPostCommentsCount($postID)

  • Get howmany comments have the post
  • returns Number

getPostComments($postID)

  • Get all comments by post
  • returns ArrayCollection, {id, author, email, url, date, content}

getRecentComments($limit=“10”)

  • Get the last comments, if no parameter is set, the default number is 10
  • returns ArrayCollection, {id, author, email, url, date, content}

getFullArchives()

  • Get Archives tree order by Year, Month
  • returns ArrayCollection

getArchives($type, $limit=”“)

  • Get the blog’s Archives
  • param String $type [monthly, yearly, daily]
  • param Number $limit

Updates

06.11.08 Added Functions section to this page.
06.11.08 Added getImagesByCategory (atxiClient.php)
06.11.08 Added support for table prefix (atxiDB.php)
07.06.08 Added getLivePostTitlesBySection and getCssByName (atxiClient.php)
07.06.08 Added support for css table (atxiDB.php)

Example Usage

TODO

— Pickle

---

Comment

  1. Hey, great plugin, I love textpattern, and Flex. With amfphp it goes together great. I am currently working on refactoring the Services, and adding tons of functionality, like file upload, image upload, user authentication, and CRUD for all items avaivable to create, edit detele,(links, categories, articles, etc). I will share when I get it close to finished. If you want to take a look at it, and make any suggestions that would be great, just let me know. – Jonnie

    Jonnie Spratley · Jul 22, 08:55 AM · #

  2. Thank you Jonnie, I just shot you an email.

    Pickle · Jul 23, 01:27 AM · #

  3. Just a note for anyone wanting to try this with the AMFPHP1.9 build, remove all the public and privates from this class and it will remove the error you get in the AMF browser. Aside that works a charm. Cheers

    K C Jones · Oct 13, 11:14 PM · #

Textile Help