'IPv6 Greeter', 'description' => 'Setting for IPv6 Greeter', 'page callback' => 'drupal_get_form', 'page arguments' => array('ipv6_greeter_admin_settings'), 'access arguments' => array('administer IPv6 Greeter'), 'file' => 'ipv6_greeter.admin.inc', ); return $items; } /** * Internal function to generate code for ipv6_greeter block * * @return * String containing HTML code for the block */ function _ipv6_greeter_create_content() { drupal_add_css((drupal_get_path('module', 'ipv6_greeter') .'/ipv6_greeter.css')); $client_ip = ip_address(); $is_client_ipv6 = filter_var($client_ip, FILTER_VALIDATE_IP, array("flags" => FILTER_FLAG_IPV6)); if ($is_client_ipv6) { $content = "

"; $content .= t("You've got IPv6!
!client_ip", array('!client_ip' => $client_ip)); $content .= "

"; } else { if (variable_get('ipv6_greeter_greetIPv4', '1') == '1') { $ipv6 = l('IPv6', 'http://en.wikipedia.org/wiki/IPv6', array( 'attributes' => array('title' => 'Wikipedia - IPv6')) ); $content = "

"; $content .= t("You're not on $ipv6, yet!"); $content .= "

"; } } return $content; }