/[drupal]/contributions/modules/feedburner/feedburner.user.inc
ViewVC logotype

Contents of /contributions/modules/feedburner/feedburner.user.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Fri Jul 27 05:12:19 2007 UTC (2 years, 4 months ago) by davereid
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
File MIME type: text/x-php
User functions
1 <?php
2 // $Id$
3
4 require_once('./'. drupal_get_path('module', 'feedburner') .'/feedburner.admin.inc');
5
6 /**
7 * Implementation of hook_user().
8 *
9 * Allows the user to set FeedBurner redirection for his/her own blog's feed.
10 */
11 function _feedburner_user($op, &$edit, &$account, $category = null) {
12 if (module_exists('blog') && user_access('edit own blog') && variable_get('feedburner_blogs', false)) {
13 $user_blog = 'blog/'. $account->uid .'/feed';
14 switch ($op) {
15 case 'form':
16 if ($category == 'account') {
17 $feed = _feedburner_load($user_blog);
18 $form['feedburner'] = array(
19 '#type' => 'fieldset',
20 '#title' => t('Blog FeedBurner Redirection'),
21 '#weight' => 1,
22 '#collapsible' => true,
23 '#description' => t('Requests for your blog\'s feed (%url) will be redirected to this FeedBurner feed. Leave this blank to disable redirection.', array('%url' => url($user_blog, null, null, true))),
24 );
25 $form['feedburner']['fb_uri'] = array(
26 '#type' => 'textfield',
27 '#maxlength' => 100,
28 '#size' => 30,
29 '#default_value' => $feed['fb_uri'],
30 '#field_prefix' => _feedburner_url(),
31 '#description' => t('This URI is case-sensitive and alphanumeric.'),
32 '#validate' => array('_feedburner_build_edit_validate' => array('fb_uri')),
33 );
34 return $form;
35 }
36 break;
37 case 'update':
38 if (_feedburner_save($user_blog, ($edit['status'] == 0 ? null : $edit['fb_uri'])) == true) {
39 _feedburner_verify_feed($edit['fb_uri']);
40 }
41 unset($edit['fb_uri']);
42 break;
43 case 'delete':
44 _feedburner_save($user_blog);
45 break;
46 } // switch
47 }
48 }

  ViewVC Help
Powered by ViewVC 1.1.2