Friday, March 26, 2010

Welcome Speech On Company's Anniversary

[jQuery] Drag'n Drop - Plugin crazy!

I just discovered this plugin, I will look over the week next .. ... In fact, I no longer useful, we must use this kind of plugin with caution if you do not want to lose visitors in a process too complicated.

Drag Drop Plugin - jQuery

Welcome Speech On Company's Anniversary

[jQuery] Drag'n Drop - Plugin crazy!

I just discovered this plugin, I will look over the week next .. ... In fact, I no longer useful, we must use this kind of plugin with caution if you do not want to lose visitors in a process too complicated.

Drag Drop Plugin - jQuery

Wednesday, March 24, 2010

Diff Betweencarl Zeissandg

[symfony] [FACEBOOK] Retrieving the profile information: Facebook Connect

To retrieve user information when registering to your site or by pressing a button to automatically fill in my profile " must create a function that will do that for us.

I put this function in the class sfFacebook is for me the most logical

public static function updateSfGuardUserWithFacebookAccount ($ sfGuardUser ) {
; sfGuardUserProfile $ = $ sfGuardUser -> getProfile ();
$ info = sfFacebook: getFacebookApi () -> ; users_getInfo ( $sfGuardUserProfile ->getFacebookUid(), array( "first_name", "last_name", "username", "birthday_date", "email_hashes", "proxied_email", "sex", "pic", "pic_small", "relationship_status", "current_location", "activities", "interests", "music", "tv", "movies", "books", "website" ));
         $sfGuardUserProfile ->setFirstName( $infos [0]["first_name"]);
         $sfGuardUserProfile -> setLastName ($ info [0] ["last_name"]);
$ sfGuardUserProfile -> setEmailHash (serialize ($ info [0] ["email_hashes "]));
$ sfGuardUserProfile -> setEmail ($ info [0] [" proxied_email "]);
; $ sfGuardUserProfile -> setBirthdayDate ($ info [0] ["birthday_date"]);
$ sfGuardUserProfile -> setSex ($ info [0] ["sex"]);
$ sfGuardUserProfile -> setPic ($ info [0] ["pic"]);
$ sfGuardUserProfile -> setPicSmall ($ info [0] [" pic_small "]);
$ sfGuardUserProfile -> SetRelationshipStatus ($ info [0] ["relationship_status"]);
$ sfGuardUserProfile -> setActivities ($ info [0] ['activities "]);
$ sfGuardUserProfile -> setInterests ($ info [0] ['interests']);
; $ sfGuardUserProfile -> setMusic ($ info [0] ["music"]);
$ sfGuardUserProfile -> setTv ($ info [0] ["tv"]);
$ sfGuardUserProfile -> setMovies ($ info [0] ["movies"]);
$ sfGuardUserProfile -> setBooks ($ info [0] ['books "]);
$ sfGuardUserProfile -> setWebsite ($ info [0] ["website"]);
$ sfGuardUserProfile -> save ();
return true ;}
Then you simply call this function, either with the shutter onlogin = "" facebook connect button, or with a jquery function:


updateProfileWithFacebook function () {$
. ajax ({
url: '/ sfFacebookConnectAuth / UpdateGuardWithFBProfile'
success: function (profile) {$ (". Profile"). Html (profile);
makeEditableField ();},
error: function (e) {alert ("An error occurred. We can not contact the Facebook servers. Please accept our apologies for this inconvenience and try later. "e);}}
);}
You can find the list of recoverable information here
Enjoy!

Diff Betweencarl Zeissandg

[symfony] [FACEBOOK] Retrieving the profile information: Facebook Connect

To retrieve user information when registering to your site or by pressing a button to automatically fill in my profile " must create a function that will do that for us.

I put this function in the class sfFacebook is for me the most logical

public static function updateSfGuardUserWithFacebookAccount ($ sfGuardUser ) {
; sfGuardUserProfile $ = $ sfGuardUser -> getProfile ();
$ info = sfFacebook: getFacebookApi () -> ; users_getInfo ( $sfGuardUserProfile ->getFacebookUid(), array( "first_name", "last_name", "username", "birthday_date", "email_hashes", "proxied_email", "sex", "pic", "pic_small", "relationship_status", "current_location", "activities", "interests", "music", "tv", "movies", "books", "website" ));
         $sfGuardUserProfile ->setFirstName( $infos [0]["first_name"]);
         $sfGuardUserProfile -> setLastName ($ info [0] ["last_name"]);
$ sfGuardUserProfile -> setEmailHash (serialize ($ info [0] ["email_hashes "]));
$ sfGuardUserProfile -> setEmail ($ info [0] [" proxied_email "]);
; $ sfGuardUserProfile -> setBirthdayDate ($ info [0] ["birthday_date"]);
$ sfGuardUserProfile -> setSex ($ info [0] ["sex"]);
$ sfGuardUserProfile -> setPic ($ info [0] ["pic"]);
$ sfGuardUserProfile -> setPicSmall ($ info [0] [" pic_small "]);
$ sfGuardUserProfile -> SetRelationshipStatus ($ info [0] ["relationship_status"]);
$ sfGuardUserProfile -> setActivities ($ info [0] ['activities "]);
$ sfGuardUserProfile -> setInterests ($ info [0] ['interests']);
; $ sfGuardUserProfile -> setMusic ($ info [0] ["music"]);
$ sfGuardUserProfile -> setTv ($ info [0] ["tv"]);
$ sfGuardUserProfile -> setMovies ($ info [0] ["movies"]);
$ sfGuardUserProfile -> setBooks ($ info [0] ['books "]);
$ sfGuardUserProfile -> setWebsite ($ info [0] ["website"]);
$ sfGuardUserProfile -> save ();
return true ;}
Then you simply call this function, either with the shutter onlogin = "" facebook connect button, or with a jquery function:


updateProfileWithFacebook function () {$
. ajax ({
url: '/ sfFacebookConnectAuth / UpdateGuardWithFBProfile'
success: function (profile) {$ (". Profile"). Html (profile);
makeEditableField ();},
error: function (e) {alert ("An error occurred. We can not contact the Facebook servers. Please accept our apologies for this inconvenience and try later. "e);}}
);}
You can find the list of recoverable information here
Enjoy!

Monday, March 15, 2010

Delayed Vaccination Schedule Toronto

[symfony] [FACEBOOK] propose to identify visitors with a single click: FACEBOOK CONNECT

Connect to a site click is so convenient! No need for your users to spend 2 minutes to complete the registration form and go click on the link in the email received confirmation ball blah! We knew
OpenID which already allowed to do that, however, OpenID does not speak to many people while Facebook! omiprésent and is completely on the web.

Facebook thinks of us, the developers of 2.0 sites for us to make this task possible.
symfony thinks of us, lazy developers, for us to make this task easy and complete!

also before installing our famous plugin, you must have installed the plugin sfDoctrineGuard (also works with other version of sfGuard)
sfGuard BEFORE INSTALLING INCLUDE FACEBOOK CONNECT
Once that is done, you install the plugin sfFacebookConnect
For other (more) information, you can visit the page Plugin sfFacebook





  svn co http://svn.symfony-project.com/plugins/sfFacebookConnectPlugin/trunk sfFacebookConnectPlugin  
Then you create a application on Facebook / developpers
You must complete the following fields:
Connect Url: http://
mon.url / / / must end with a slash
Base Domain:
mon.url
CAUTION: This is selected in a certain way. It takes several things: that your mon.url either online (no particular file to be included on the online site, Facebook is going to ping, that is). If you want, like me, programming and testing the plugin locally, you can modify your hosts file (located here in linux: / etc / hosts) and add the line 127.0.0.1 local . mon.url
So you keep your internet access to your online site and you'll have access to your local site with the address local. mon.url . Obviously, your virtual host must be functional but it I do not do it for you.

Once the application is created, we will ensure that our config files allows the plugin to be used: In the file
settings.yml add sfFacebookConnectAuth line enabled_modules:

all:
. settings:
enabled_modules: [default, sfGuardAuth, sfFacebookConnectAuth]
login_module: BasesfFacebookConnectAuthActions
LOGIN_ACTION: executeAjaxSignin
Then edit your app.yml:
all:
  facebook:
    api_key:  votre_api_key
    api_secret: votre_api_secret 
    api_id: votre_app_id
    redirect_after_connect: false
    redirect_after_connect_url: ''
    connect_signin_url: 'sfFacebookConnectAuth/signin'
    app_url: '/my-app'
    guard_adapter: ~
    js_framework: jQuery

  sf_guard_plugin:
    profile_class: sfGuardUserProfile
    profile_field_name: user_id
    profile_facebook_uid_name: facebook_uid
    profile_email_name: email
    profile_email_hash_name: email_hash

facebook_connect:
load_routing: true
user_permissions: []

Then go to the file / plugins / sfDoctrineGuardPlugin / config / doctrine / schema.yml
So that we can store the profile information of the new user, you will have a new table in the database, table and link it with sf_guard_user_profile table sf_guard_user ... So
changes to:


sfGuardUserProfile:
  tableName:     sf_guard_user_profile
  columns:
    user_id:          { type: integer(4), notnull: true }
    first_name:       { type: string(30) }
    last_name:        { type: string(30) }
    facebook_uid:     { type: string(20) }
    email:            { type: string(255) }
    email_hash:       { type: string(255) }
    birthday_date :   { type: string(255) }
    sex:          { type: string(255) }
    pic:          { type: string(255) }
    pic_small:          { type: string(255) }
    relationship_status : { type: string(255) }
    current_location  : { type: string(255) }
    activities  : { type: string(255) }
    interests  : { type: string(255) }
    music  : { type: string(255) }
    tv  : { type: string(255) }
    movies  : { type: string(255) }
    books  : { type: string(255) }
    local  : { type: string(255) }
    books  : { type: string(255) }
    website  : { type: string(255) }

  indexes:
    facebook_uid_index:
      fields: [facebook_uid]
      unique: true
    email_index:
      fields: [email]
      unique: true
    email_hash_index:
      fields: [email_hash]
      unique: true
  relations:
    sfGuardUser:
      type: one
      foreignType: one
      class: sfGuardUser
      local: user_id
   foreign: id
onDelete: cascade
foreignAlias: Profile
Obviously, we must tell Doctrine to build the new table and Relationships :
symfony doctrine: build - all - and-save - no-confirmation
Then go to / apps / frontend / lib / myUser.class.php
extend the class and made class
myUser {} extends sfFacebookUser
Well, the plugin is finished.
USE NOW!
I guess and hope that you are using a layout with Facebook Connect, the use of layout greatly facilitates the integration of the plugin. Open your
/ apps / frontend / templates / layout.php
Insert these lines in the head tag:

\u0026lt;script type = "text / javascript" src = "/ sfFacebookConnectPlugin / js / animation / animation . js "> \u0026lt;/ script>
\u0026lt;? php use_helper ('sfFacebookConnect');>
\u0026lt;? php include_bottom_facebook_connect_script ();?>

Then we want to provide a link to the user to connect 1-click to our site.
So we will verify that the user is not connected to the site to offer him this button: Also in
layout because it is an element that vraissemblablement, we want to see on each page:

\u0026lt; php if (! $ sf_user-> isAuthenticated ()) {
?>
\u0026lt;fb:login-button v="2" size="medium"> Log with Facebook \u0026lt;/ fb: login-button>
\u0026lt;? php
} else {
echo "hello";}
?>
At this level, a simple click on the button, check whether the user is already logged on to facebook otherwise he will propose to enter their credentials. If identified correctly in the form facebook, it is immediately identified on your site.
And if we will see in the database, we see a new user named Facebook-012345678 has been created and it also has a profile. But there
(Surprise! Ho!) The profile is blank. Only the uid is recovered.


I have long sought a solution but in fact it sounds logical. We do not know in advance what you want to recover for your application and database is said that you only want to connect a user.
But I want to get a lot more than that, that's why I created a template for sf_guard_user_profile with all these fields (sex, etc. ...). brithday_date


To do this, you can follow this tutorial: Retrieve user information FacebookConnect
http://www.symfony-project.org/more-with-symfony/1_4/fr/12-Developing Facebook-for-
http://blog.fruitsoftware.com/2010/01/facebook-connect-friends-et-autres-plaisirs/

Delayed Vaccination Schedule Toronto

[symfony] [FACEBOOK] propose to identify visitors with a single click: FACEBOOK CONNECT

Connect to a site click is so convenient! No need for your users to spend 2 minutes to complete the registration form and go click on the link in the email received confirmation ball blah! We knew
OpenID which already allowed to do that, however, OpenID does not speak to many people while Facebook! omiprésent and is completely on the web.

Facebook thinks of us, the developers of 2.0 sites for us to make this task possible.
symfony thinks of us, lazy developers, for us to make this task easy and complete!

also before installing our famous plugin, you must have installed the plugin sfDoctrineGuard (also works with other version of sfGuard)
sfGuard BEFORE INSTALLING INCLUDE FACEBOOK CONNECT
Once that is done, you install the plugin sfFacebookConnect
For other (more) information, you can visit the page Plugin sfFacebook





  svn co http://svn.symfony-project.com/plugins/sfFacebookConnectPlugin/trunk sfFacebookConnectPlugin  
Then you create a application on Facebook / developpers
You must complete the following fields:
Connect Url: http://
mon.url / / / must end with a slash
Base Domain:
mon.url
CAUTION: This is selected in a certain way. It takes several things: that your mon.url either online (no particular file to be included on the online site, Facebook is going to ping, that is). If you want, like me, programming and testing the plugin locally, you can modify your hosts file (located here in linux: / etc / hosts) and add the line 127.0.0.1 local . mon.url
So you keep your internet access to your online site and you'll have access to your local site with the address local. mon.url . Obviously, your virtual host must be functional but it I do not do it for you.

Once the application is created, we will ensure that our config files allows the plugin to be used: In the file
settings.yml add sfFacebookConnectAuth line enabled_modules:

all:
. settings:
enabled_modules: [default, sfGuardAuth, sfFacebookConnectAuth]
login_module: BasesfFacebookConnectAuthActions
LOGIN_ACTION: executeAjaxSignin
Then edit your app.yml:
all:
  facebook:
    api_key:  votre_api_key
    api_secret: votre_api_secret 
    api_id: votre_app_id
    redirect_after_connect: false
    redirect_after_connect_url: ''
    connect_signin_url: 'sfFacebookConnectAuth/signin'
    app_url: '/my-app'
    guard_adapter: ~
    js_framework: jQuery

  sf_guard_plugin:
    profile_class: sfGuardUserProfile
    profile_field_name: user_id
    profile_facebook_uid_name: facebook_uid
    profile_email_name: email
    profile_email_hash_name: email_hash

facebook_connect:
load_routing: true
user_permissions: []

Then go to the file / plugins / sfDoctrineGuardPlugin / config / doctrine / schema.yml
So that we can store the profile information of the new user, you will have a new table in the database, table and link it with sf_guard_user_profile table sf_guard_user ... So
changes to:


sfGuardUserProfile:
  tableName:     sf_guard_user_profile
  columns:
    user_id:          { type: integer(4), notnull: true }
    first_name:       { type: string(30) }
    last_name:        { type: string(30) }
    facebook_uid:     { type: string(20) }
    email:            { type: string(255) }
    email_hash:       { type: string(255) }
    birthday_date :   { type: string(255) }
    sex:          { type: string(255) }
    pic:          { type: string(255) }
    pic_small:          { type: string(255) }
    relationship_status : { type: string(255) }
    current_location  : { type: string(255) }
    activities  : { type: string(255) }
    interests  : { type: string(255) }
    music  : { type: string(255) }
    tv  : { type: string(255) }
    movies  : { type: string(255) }
    books  : { type: string(255) }
    local  : { type: string(255) }
    books  : { type: string(255) }
    website  : { type: string(255) }

  indexes:
    facebook_uid_index:
      fields: [facebook_uid]
      unique: true
    email_index:
      fields: [email]
      unique: true
    email_hash_index:
      fields: [email_hash]
      unique: true
  relations:
    sfGuardUser:
      type: one
      foreignType: one
      class: sfGuardUser
      local: user_id
   foreign: id
onDelete: cascade
foreignAlias: Profile
Obviously, we must tell Doctrine to build the new table and Relationships :
symfony doctrine: build - all - and-save - no-confirmation
Then go to / apps / frontend / lib / myUser.class.php
extend the class and made class
myUser {} extends sfFacebookUser
Well, the plugin is finished.
USE NOW!
I guess and hope that you are using a layout with Facebook Connect, the use of layout greatly facilitates the integration of the plugin. Open your
/ apps / frontend / templates / layout.php
Insert these lines in the head tag:

\u0026lt;script type = "text / javascript" src = "/ sfFacebookConnectPlugin / js / animation / animation . js "> \u0026lt;/ script>
\u0026lt;? php use_helper ('sfFacebookConnect');>
\u0026lt;? php include_bottom_facebook_connect_script ();?>

Then we want to provide a link to the user to connect 1-click to our site.
So we will verify that the user is not connected to the site to offer him this button: Also in
layout because it is an element that vraissemblablement, we want to see on each page:

\u0026lt; php if (! $ sf_user-> isAuthenticated ()) {
?>
\u0026lt;fb:login-button v="2" size="medium"> Log with Facebook \u0026lt;/ fb: login-button>
\u0026lt;? php
} else {
echo "hello";}
?>
At this level, a simple click on the button, check whether the user is already logged on to facebook otherwise he will propose to enter their credentials. If identified correctly in the form facebook, it is immediately identified on your site.
And if we will see in the database, we see a new user named Facebook-012345678 has been created and it also has a profile. But there
(Surprise! Ho!) The profile is blank. Only the uid is recovered.


I have long sought a solution but in fact it sounds logical. We do not know in advance what you want to recover for your application and database is said that you only want to connect a user.
But I want to get a lot more than that, that's why I created a template for sf_guard_user_profile with all these fields (sex, etc. ...). brithday_date


To do this, you can follow this tutorial: Retrieve user information FacebookConnect
http://www.symfony-project.org/more-with-symfony/1_4/fr/12-Developing Facebook-for-
http://blog.fruitsoftware.com/2010/01/facebook-connect-friends-et-autres-plaisirs/

Wednesday, March 10, 2010

What Happens If Herpies Is Not Treated

[symfony] Insert the login form in the frontend

Here's a pretty awesome blog I just found it particularly explains how to insert login form in the frontend.

http://www.clementdelmas.fr/blog/developpement-web/symfony/formulaire-dauthentification-pour-frontend-avec-sfguardplugin/comment-page-1 # comment-9


Form authentication frontend with sfGuardPlugin

In the series "I dug up tutorials that I wrote last year" Here is a tutorial for symfony . It was written for 1.2 but I still think it should be compatible to 1.4 (to check anyway). The purpose of this tutorial is to show you how to simply and quickly, a form of authentication for the frontend application in a component, all with sfGuardPlugin (phew!). I invite you to read the passage, the plugin documentation and excerpt from guide to symfony 1.2 , which will always help you / supplement this article.

Creating component

We create a component that contains the action code we want to execute the partial. To do this, create a new file in the module components.class.php related component (File sfGuardAuth / shares). Then edit the file and add the creation of the form:
\u0026lt;?
php class extends sfGuardAuthComponents sfComponents
{
public function executeSideSignin ($ request) {

$ Class = sfConfig:: get ('app_sf_guard_plugin_signin_form', 'sfGuardFormSignin');
$ this-> signinForm = new $ class ();}

}

? >

Creation of the template is created from the template component (in our case _sideSignin.php sfGuardAuth in the folder / templates)
that will display the login form, and it publishes:

\u0026lt;h2> Identification Form \u0026lt;/ h2>
\u0026lt;form id = "signinForm" action = "\u0026lt;? php echo url_for('@sf_guard_signin') ?>" method="post" class="clearfix">
    <div id="signinFields">
        <label for="signin_username">Login</label>
        <input type="text" name="signin[username]" id="signin_username" />
        <br />
        <label for="signin_password">Mot de passe</label>
        <input type="password" name="signin[password]" id="signin_password" />
        <br />
        <input type = "checkbox" name = "contemporary design [remember]," id = "signin_remember" />
\u0026lt;Label for="signin_remember"> The souvenir de moi \u0026lt; ; / label>
\u0026lt;/ div> \u0026lt;div
id="signinSubmit">
\u0026lt; ? php echo $ signinForm-> renderHiddenFields ();
?>
\u0026lt;! - A href ="#"> Forgot your password? \u0026lt;/ A> 'SideSignin');
", cache and refresh the page ...
To test whether the user is already authenticated, it uses this function:
if (! $ Sf_user-> isAuthenticated ())
; include_component ('sfGuardAuth', 'sideSignin');>

Thank

clementdelmas.fr

What Happens If Herpies Is Not Treated

[symfony] Insert the login form in the frontend

Here's a pretty awesome blog I just found it particularly explains how to insert login form in the frontend.

http://www.clementdelmas.fr/blog/developpement-web/symfony/formulaire-dauthentification-pour-frontend-avec-sfguardplugin/comment-page-1 # comment-9


Form authentication frontend with sfGuardPlugin

In the series "I dug up tutorials that I wrote last year" Here is a tutorial for symfony . It was written for 1.2 but I still think it should be compatible to 1.4 (to check anyway). The purpose of this tutorial is to show you how to simply and quickly, a form of authentication for the frontend application in a component, all with sfGuardPlugin (phew!). I invite you to read the passage, the plugin documentation and excerpt from guide to symfony 1.2 , which will always help you / supplement this article.

Creating component

We create a component that contains the action code we want to execute the partial. To do this, create a new file in the module components.class.php related component (File sfGuardAuth / shares). Then edit the file and add the creation of the form:
\u0026lt;?
php class extends sfGuardAuthComponents sfComponents
{
public function executeSideSignin ($ request) {

$ Class = sfConfig:: get ('app_sf_guard_plugin_signin_form', 'sfGuardFormSignin');
$ this-> signinForm = new $ class ();}

}

? >

Creation of the template is created from the template component (in our case _sideSignin.php sfGuardAuth in the folder / templates)
that will display the login form, and it publishes:

\u0026lt;h2> Identification Form \u0026lt;/ h2>
\u0026lt;form id = "signinForm" action = "\u0026lt;? php echo url_for('@sf_guard_signin') ?>" method="post" class="clearfix">
    <div id="signinFields">
        <label for="signin_username">Login</label>
        <input type="text" name="signin[username]" id="signin_username" />
        <br />
        <label for="signin_password">Mot de passe</label>
        <input type="password" name="signin[password]" id="signin_password" />
        <br />
        <input type = "checkbox" name = "contemporary design [remember]," id = "signin_remember" />
\u0026lt;Label for="signin_remember"> The souvenir de moi \u0026lt; ; / label>
\u0026lt;/ div> \u0026lt;div
id="signinSubmit">
\u0026lt; ? php echo $ signinForm-> renderHiddenFields ();
?>
\u0026lt;! - A href ="#"> Forgot your password? \u0026lt;/ A> 'SideSignin');
", cache and refresh the page ...
To test whether the user is already authenticated, it uses this function:
if (! $ Sf_user-> isAuthenticated ())
; include_component ('sfGuardAuth', 'sideSignin');>

Thank

clementdelmas.fr