View source
<?php
function fb_social_likebox_menu() {
$items = array();
$items['admin/settings/fb/social/likebox'] = array(
'type' => MENU_LOCAL_TASK,
'title' => 'likebox',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'fb_social_likebox_settings_form',
),
'file' => 'fb_social_likebox.admin.inc',
'access callback' => 'user_access',
'access arguments' => array(
'administer site configuration',
),
);
return $items;
}
function fb_social_likebox_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks['likebox'] = array(
'info' => t('fb like box'),
);
return $blocks;
case 'view':
switch ($delta) {
case 'likebox':
return array(
'subject' => t(''),
'content' => theme('fb_social_likebox_block_likebox_view'),
);
}
break;
}
}
function fb_social_likebox_theme() {
return array(
'fb_social_likebox_block_likebox_view' => array(),
);
}
function theme_fb_social_likebox_block_likebox_view() {
global $_fb_script_init;
$_fb_script_init = TRUE;
$attrs = array(
'href' => variable_get('fb_social_likebox_href', ''),
'width' => variable_get('fb_social_likebox_width', 292),
'height' => variable_get('fb_social_likebox_height', 63),
'colorscheme' => variable_get('fb_social_likebox_color', 'light'),
'connections' => variable_get('fb_social_likebox_connections', 10),
'stream' => variable_get('fb_social_likebox_stream', 1) ? "true" : "false",
'header' => variable_get('fb_social_likebox_header', 1) ? "true" : "false",
);
if ($width = variable_get('fb_social_likebox_height', '')) {
$attrs['height'] = $width;
}
$attrs = drupal_attributes($attrs);
return '<fb:like-box ' . $attrs . '></fb:like-box>';
}