Archive for the ‘ CMS ’ Category

2 Textile javascript editors for use in your projects

2 Textile javascript editors for use in your projects:

Textile Editor Helper


Sitio web:Textile Editor Helper
Download:Textile_Editor_Helper

Sanskrit


Sitio web:Sanskrit
Download:sanskrit

AS3 Implementing a simple Templating System

A simple as3 templating system based on key=values.

Usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// dinamically declaring properties over our "dynamic" class

var tmp:TemplateVariables = new TemplateVariables();
tmp.helloWorld = "HELLO WORLD";
tmp.date = new Date();
trace( TemplateParser.parse( "${helloWorld} :: ${date}", tmp ) )

// passing an object to the constructor

import es.xperiments.utils.*;
var tmp1:TemplateVariables = new TemplateVariables( { helloWorld:'HELLO WORLD', date:new Date() } );
trace( TemplateParser.parse( "${helloWorld} :: ${date}", tmp1 ) )

// passing an old LoadVars String

import es.xperiments.utils.*;
var tmp2:TemplateVariables = new TemplateVariables( 'helloWorld=HELLO WORLD&date='+new Date() );
trace( TemplateParser.parse( "${helloWorld} :: ${date}", tmp2 ) )

templateparser.as

templatevariables.as

poMMo Subscribe Class

Some months ago I has make this little class to manage subscriptions from flash to poMMo Newsletter Manager.

I need to update it to AS3. While I am updating it, you can use the as2 version or update by yourself!!.

To install copy the files from:

1
2
3
4
5
/user/processFlash.php ==> poomo directory /user/
/user/subscribeFLash.fla ==> poomo directory /user/
/themes/default/inc/messagesFlash.tpl ==> poomo directory /themes/default/inc/
/themes/default/inc/messagesFlash.tpl ==> poomo directory /themes/default/inc/
/inc/helpers/validateFlash.php ==> poomo directory  /inc/helpers/

As2 example code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import com.xperiments.pommo.Pommo;
import com.xperiments.pommo.PommoUserDefinedField;
import com.xperiments.pommo.PommoEvent;

// get Singleton Pommo Instance
var pommo:Pommo = Pommo.getInstance( );

// set url to processFlash.php
pommo.setSubscribeAction('http://www.yoursite.com/pommo/user/processFlash.php' );
// addListener for: "Invalid Email Address"
pommo.addEventListener( PommoEvent.ERROR_INVALID_EMAIL, this );
//addListener for: "Email address already exists. Duplicates are not allowed."
pommo.addEventListener( PommoEvent.ERROR_EMAIL_ALREADY_EXIST, this );
//addListener for: "Error adding subscriber! Please contact the administrator."
pommo.addEventListener( PommoEvent.ERROR_SERVER_ERROR, this );
//addListener for: "Subscription request received."
pommo.addEventListener( PommoEvent.ERROR_REQUEST_RECEIVED, this );
//addListener for: "Welcome Message."
pommo.addEventListener( PommoEvent.ERROR_WELCOME_MESSAGE, this );
//addListener for: "Send mail Failed"
pommo.addEventListener( PommoEvent.ERROR_SENDING_MAIL, this );
// addListener for: "User Field Error"
pommo.addEventListener( PommoEvent.ERROR_USER_FIELD, this );

function onPommoInvalidEmail( evnt:PommoEvent ){ trace( "[ ERROR ] Invalid Email" ) };
function onPommoEmailExist( evnt:PommoEvent ){ trace( "[ ERROR ] Email address already exists. Duplicates are not allowed." ) };
function onPommoServerError( evnt:PommoEvent ){ trace("[ ERROR ] Error adding subscriber! Please contact the administrator." ) };
function onPommoRequestReceived( evnt:PommoEvent ){ trace("[ REQUEST RECEIVED ] "+evnt.message ) };
function onPommoWelcomeMessage( evnt:PommoEvent ){ trace("[ WELCOME ] "+evnt.message ) };
function onPommoSendMailFailed( evnt:PommoEvent ){ trace("[ SEND MAIL FAILED ]") };
function onUserFieldError( evnt:PommoEvent ){ trace("[ USER FIELD ERROR ]"+evnt.errorDesc) };

// to add EXTRA USER FIELDS uncomment this
// var userDefinedField:PommoUserDefinedField = new PommoUserDefinedField( );
// userDefinedField.addField( 'd[2]' , 'English' );

// pommo.subscribe( "test@test.com", userDefinedField );

// add subscriber whitout EXTRA USER FIELDS
pommo.subscribe( "test@test.com");

Download: xpommo