Skip to content

Instantly share code, notes, and snippets.

@hiddentrak
hiddentrak / WPController
Created February 15, 2011 14:01
Controller for calling Flashpress services
package com.hiddentrak.site.wp
{
import flash.events.EventDispatcher;
import flash.events.NetStatusEvent;
import flash.net.NetConnection;
import flash.net.ObjectEncoding;
import flash.net.Responder;
import flash.net.registerClassAlias;
import flash.system.Security;
@hiddentrak
hiddentrak / MagicFieldsWpMethodsService
Created February 15, 2011 12:02
Add Magic Fields support to FlashPress
/**
* This function returns a Magic Fields group
* @param string $name_group The name of the group you are looking for
* @param integer $post_id The Wordpress post id
*/
public function getMagicFieldsGroup( $name_group, $post_id=NULL ) {
$group = get_group( $name_group, $post_id );
$order = get( 'order', 1, 1, true, $post_id );
$g = false;
$g -> {'sections'} = array();
@hiddentrak
hiddentrak / NextGenAlbumVO
Created February 15, 2011 10:23
Add NextGen Gallery plugin support to FlashPress
<?php
/**
* Vo Object for NextGen Album Object
*
* @package flashpress.vo
* @author Myles Bieniasz
**/
class NextGenAlbumVO {
var $_explicitType = "flashpress.vo.NextGenAlbumVO";
//regex that finds and replaces tokens in a string
public function replaceTokens(str : String,paramObj : Object) : String {
//token structure ${tokenName}
var myRegEx : RegExp = /\$\{([a-zA-Z0-9]+)\}/g;
return str.replace(myRegEx, function():String {
return (paramObj[arguments[1]]) ? paramObj[arguments[1]] : "";
});
}