drupal session 3 - biginlucerne.com - lessons learned
DESCRIPTION
Together with clou kreativ (www.cloukreativ.ch) we create www.biginlucerne.com, a photo contest in Lucerne, Switzerland. We used Drupal as a tool to allow users upload, rate, comment, share images. In this presentation Slava Rys explains some core functions, problems that occured during development as well as some insight about how the site was built. Also find additional comments on www.netnode.ch/blogTRANSCRIPT
![Page 1: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/1.jpg)
drupal session 3
Biginlucerne.com - Lessons Learned
Topic: Biginlucerne.com - Lessons LearnedDate: 13.02.2012Presenter: Slava RysTwitter: @merdekitiBlog: http://www.netnode.ch/blog
http://www.netnode.ch - pure drupal - drupal development services
![Page 2: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/2.jpg)
What we’ll know in 15min?
•How biginlucerne.com is built using Drupal
•Challanges and solutions
![Page 3: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/3.jpg)
What is biginlucerne.com?
•Photo contest
•Social media campaign for Lucerne tourism
Design & concept bywww.cloukreativ.ch
Clientwww.lucerne.com
![Page 4: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/4.jpg)
Lets talk about key functions
•Facebook integration
•Voting mechanism
•Get next image for voting process
![Page 5: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/5.jpg)
Facebook integrations
Problems & solutions
•Fbconnect — does not work well yet
•Fb — the best module for FB integrations
![Page 6: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/6.jpg)
FB module functions?
•Connect FB account to user
•Development tools
•Views integrations
•Rules integrations
•Example module
•And lot of other functions...
![Page 7: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/7.jpg)
Why is this cool?
•No problem with instalations and setup (all works from the box)
•Easy UI
•Good documantation
![Page 8: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/8.jpg)
The FB module hook
hook_fb_user ($op, $data, &$return) {}
$op:
• FB_USER_OP_PRE_USER- Before account creation, fb_user.module
• FB_USER_OP_POST_USER - After account creation, fb_user.module
• FB_USER_OP_POST_EXTERNAL_LOGIN - user map has changed global user.
• FB_USER_OP_POST_USER_CONNECT - Connected local account to FB account, fb_user.module
• FB_USER_OP_POST_USER_DISCONNECT - Disconnected local account from FB account, fb_user.module
![Page 9: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/9.jpg)
Lets talk about the voting process
Problems & solutions
•The flag module was skipped
•Voting API & rate modules — the best solution for voiting process
![Page 10: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/10.jpg)
Drupal Voting API module is cool!
The Voting API does four key jobs for module developers:
• CRUD: Create/Retrieve/Update/Delete operations for voting data.
• Calculation: Every time a user creates a vote, VotingAPI calculates the results and caches them for you.
• Workflow: By integrating with Actions.module, VotingAPI can trigger workflow steps (like promoting a node to the front page, hiding a comment that's been flagged as spam, or emailing an administrator) when votes are cast and results are tallied.
• Display: VotingAPI integrates with Views.module, allowing you to slice and dice your site's content based on user consensus.
![Page 11: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/11.jpg)
Drupal rate module is cool!
•This module provides flexible voting widgets for nodes and comments.
•Administrators can add multiple widgets. By default, there are 8 widget types
•By using "custom" you can customize the rating buttons and Voting API mode. Widget types can be extended by other modules.
•Flexible API
![Page 12: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/12.jpg)
The Rate module hooks
• hook_rate_templates() {}
• hook_rate_widget_alter(&$widget, $context) {}
• hook_rate_widget_insert(&$widget, $values) {}
• hook_rate_widget_update(&$widget, $values) {}
• hook_rate_widget_delete(&$widget) {
• hook_rate_vote_alter($vote, $context) {}
![Page 13: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/13.jpg)
Code example
![Page 14: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/14.jpg)
Get next image
Performance trick
•The views module was skipped
•Get next image using db_select()
![Page 15: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/15.jpg)
Code example
![Page 16: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/16.jpg)
Biggest problem
•Voting process
•Facebook Open Graph
•Facebook integrations
![Page 17: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/17.jpg)
Discussion
•Questions?
![Page 18: Drupal session 3 - biginlucerne.com - lessons learned](https://reader035.vdocuments.net/reader035/viewer/2022062704/5558b9b4d8b42a7e298b4ea8/html5/thumbnails/18.jpg)