Archive for the ‘ PHP ’ Category

Search in array with SQL staments.

For a project that I’m doing, for various reasons I needed to reduce the number of requests being made by SQL.

I realized that the problem lies basically in the number of SQL queries and come to the conclusion that the ideal would be to have the table in memory and make SQL queries in memory.

Browsing the net I found these two classes to do the same, one for javascript and one for php.

JsonSQL

PhpSQL

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

Soluciones alternativas a Wordpress

No solo de wordpress vive el hombre, disponemos de otras alternativas, con mas o menos funcionalidades.

Dejo un listado de otros CMS:

  1. MovableType
  2. Drupal
  3. Joomla
  4. Serendipity
  5. MODx
  6. Typo3
  7. TYPOlight
  8. Sava CMS (ColdFusion)
  9. MiaCMS
  10. Jahia
  11. DotClear
  12. Umbraco (ASP.NET)
  13. BIGACE
  14. Nucleus CMS
  15. SilverStripe
  16. Radiant (Ruby on Rails)
  17. Frog
  18. Zikula
  19. Kentico (ASP.NET)
  20. XOOPS
  21. CMS Made Simple
  22. Instant Update
  23. Plone
  24. SPIP
  25. Xaraya
  26. phpwcms 

  27. Zope