May 12th, 2012 — 7:08am
For this project, I needed to create a way for admins to recommend items to other users. In other words, bookmark a page for someone else.
Drupal 7 already has a great module for bookmarking, called Flag. It allows users to ‘flag’ content to say they like it (similar to Facebook) or to bookmark it for future reference. But it does not come out for the box with links to flag for other users.
For this site, I needed to create several admin pages with forms – one to send bookmarks to a user, and another to bookmark pages for a specific user. We won’t discuss those here, as they are easy to create for yourself (hook_menu and write up simple forms to search for pages to recommend).
Continue reading »
1 comment » | Programming
April 29th, 2012 — 5:04pm
BooDroo is a site built using Drupal 7. Some of the modules being used are: Commerce, Date, Organic groups, Mobile codes, Rules, and Views. I also created custom modules to communicate with Twilio (a service converting online information into a SMS sent to mobile phones) and to process Commerce carts through Google Checkout. SMS are also saved as content so that users can view messages online, as well as via text messaging.
What is BooDroo you ask? BooDroo is a group text messaging platform that lets you communicate instantly and directly with large groups of people. A group is created to send SMS to many subscribers at once, allowing a company to advertise or a coach to update his players on the changed practice time.
Drupal fortunately has many modules to help build the site, instead of needing to build it all from scratch. Organic groups are used to tie SMS messages to each group. This allows groups to be private if they wish. Mobile codes is used to add QR codes to each group. Making it easier for admins to get more users to join their group. Commerce is used to process the cart and checkout process.
Using rules, recurring charges are made through Google Checkout to a customer’s account to continue SMS conversion service each month.
1 comment » | Programming
January 29th, 2012 — 6:39am
Creating a node with PHP in Drupal 7 is easy. This can be used to insert one node from a custom form or to insert a batch of nodes from an array of data.
Just follow these instructions to populate a node with PHP.
// start with a blank object
$node = new stdClass();
$node->type = 'node-type';
// adds defaults for node type
node_object_prepare($node);
$node->title = 'Any title';
// set language to default 'und'
$node->language = LANGUAGE_NONE;
// sets node author (can use $node->name instead)
$node->uid = 1;
// set the body field
$node->body[$node->language][0]['value'] = 'text';
$node->body[$node->language][0]['format'] = 'filtered_html';
// most other fields can be added this way
$node->field_name[$node->language][0]['value'] = 'value';
// updates author and publish date
node_submit($node);
node_save($node);
1 comment » | Programming