function fb_app_insert in Drupal for Facebook 5.2
Same name and namespace in other branches
- 5 fb_app.module \fb_app_insert()
File
- ./
fb_app.module, line 340 - Defines a custom node type that stores a facebook application configuration.
Code
function fb_app_insert($node) {
//drupal_set_message("fb_app_insert" . dpr($node,1));
$fb_app = (object) $node->fb_app;
fb_app_get_app_properties($fb_app);
// Get canvas and possible other props
$fb_app->data = serialize($node->fb_app_data);
$fb_app->nid = $node->nid;
db_query("INSERT INTO {fb_app} (nid, label, apikey, secret, id, canvas, require_login, create_account, unique_account, data) VALUES (%d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, '%s')", $node->nid, $fb_app->label, $fb_app->apikey, $fb_app->secret, $fb_app->id, $fb_app->canvas_name, $fb_app->require_login, $fb_app->create_account, $fb_app->unique_account, $fb_app->data);
watchdog('fb_app', t('Created Facebook Application %label.', array(
'%label' => $fb_app->label,
)), WATCHDOG_NOTICE, l($node->title, 'node/' . $node->nid));
fb_app_set_app_properties($fb_app);
// Set callback URL, etc.
}