Plugin for the development of VK iframe applications
I want to bring to your attention a plugin developed by me for creating applications for the social network VKontakte.
In the plugin implemented:
Php-class for making secure requests to VKontakte api - sfVkontakteTools;
JS library - a wrapper for installing the application, installing the correct settings, uploading photos and publishing on the wall - vkApp;
Automatically save the profile of the current user and his friends to your database.
To use the plugin you need: Symfony version 1.3 or 1.4, ORM Doctrine, as well as jQuery. A simple example of application features:
HTML:
< div id ='content' ></ div > < a id ='post-photo' href ='javascript:void(0);' > post_photo </ a >< br /> < a id ='post-wall' href ='javascript:void(0);' > post wall </ a >
Js:
$( function () { app = new vkApp( function (){ // app, $( '#content' ).append(app.User.first_name + ' ' + app.User.last_name);
// onclick - $( '#post-photo' ).click( function () { app.upload_photo( function (){}, { album_title: 'new album' // album_id: ##album id to post to ## }) });
// onclick - $( '#post-wall' ).click( function () { app.post_walls( function (){}, { message: 'test' , uids: [## array of wall ids for post on ##] }); }); }); });
PHP:
$ this ->getUser()->sendNotification(array( 'uids' => $ this ->getUser()->id, 'message' => 'it works!' ));
* This source code was highlighted with Source Code Highlighter .
The project repository is on GitHub, here is the link . In the same place - quite extensive and detailed documentation in Russian and English, so I will not describe the details here. I will add just a few more links:
The most important development plan for the plugin is to remove the dependency on jQuery, and make js-wrappers for the rest of the non-atomic API methods, such as uploading video, audio and installing a profile photo. ')
I look forward to your comments and comments.