function cc_whmcs_bridge_header() { global $cc_whmcs_bridge_content, $post; if (!isset($post->ID)) { return; } $cf = get_post_custom($post->ID); if (isset($_REQUEST['ccce']) || isset($cf['cc_whmcs_bridge_page']) && $cf['cc_whmcs_bridge_page'][0] == WHMCS_BRIDGE_PAGE) { if (isset($_REQUEST['ajax']) && in_array($_REQUEST['ajax'], array(1, 2))) { return; } if (!isset($cc_whmcs_bridge_content)) { $cc_whmcs_bridge_content = cc_whmcs_bridge_parser(); } if (isset($cc_whmcs_bridge_content['head'])) { echo $cc_whmcs_bridge_content['head']; } echo '<link rel="stylesheet" type="text/css" href="' . CC_WHMCS_BRIDGE_URL . 'cc.css" media="screen" />'; echo '<script type="text/javascript" src="' . CC_WHMCS_BRIDGE_URL . 'cc.js"></script>'; if (get_option('cc_whmcs_bridge_css')) { echo '<style type="text/css">' . get_option('cc_whmcs_bridge_css') . '</style>'; } if (get_option('cc_whmcs_bridge_sso_js')) { echo '<script type="text/javascript">' . stripslashes(get_option('cc_whmcs_bridge_sso_js')) . '</script>'; } } if (get_option('cc_whmcs_bridge_jquery') == 'wp') { echo '<script type="text/javascript">$=jQuery;</script>'; } }
/** @see WP_Widget::widget */ function widget($args, $instance) { global $cc_whmcs_bridge_content; if (!$cc_whmcs_bridge_content) { $cc_whmcs_bridge_content = cc_whmcs_bridge_parser(); } if (!isset($cc_whmcs_bridge_content['carttotal'])) { return; } extract($args); $title = apply_filters('widget_title', $instance['title']); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } echo $cc_whmcs_bridge_content['carttotal']; echo $after_widget; }