Ejemplo n.º 1
0
    function weaverii_generate_wphead()
    {
        /* this guy does ALL the work for generating theme look - it writes out the over-rides to the standard style.css */
        global $weaverii_cur_page_ID;
        global $post;
        $weaverii_cur_page_ID = 0;
        // need this for 404 page when this is not valid
        if (is_object($post)) {
            $weaverii_cur_page_ID = get_the_ID();
        }
        // we're on a page now, so set the post id for the rest of the session
        printf("\n<!-- This site is using %s %s (%s) subtheme: %s -->\n", WEAVERII_THEMENAME, WEAVERII_VERSION, weaverii_getopt('wii_style_version'), weaverii_getopt('wii_subtheme'));
        printf("<!-- Page ID: %s -->\n", $weaverii_cur_page_ID);
        // emit Weaver II's required dynamic JavaScript
        // support for Masonry script
        // weaverii_masonry('invoke-code');
        // handle 3 stylesheet situations
        //  default: used weaver-style.css
        //  no weaver-style.css: when first installed, there will not be a weaver-style.css, so use inline instead
        //  force inline: user wants inline css
        if (weaverii_use_inline_css(weaverii_get_css_filename())) {
            // generate inline CSS
            require_once 'generatecss.php';
            // include only now at runtime.
            echo '<style type="text/css">' . "\n";
            $output = weaverii_f_open('php://output', 'w+');
            weaverii_output_style($output);
            echo "</style> <!-- end of main options style section -->\n";
        }
        if (weaverii_dev_mode() && weaverii_getopt_checked('_wii_diag_borders')) {
            ?>
<style type="text/css">
#content,#colophon,#branding,.widget,#infobar,.widget-area {border: 1px solid #F00 !important;}
#wrapper,#container,#main{border: 1px solid blue;}
</style>
<?php 
        }
        /* now head options */
        echo weaverii_getopt('_wii_althead_opts');
        echo weaverii_getopt('wii_head_opts');
        /* let the user have the last word! */
        $per_page_code = weaverii_get_per_page_value('page-head-code');
        if (!empty($per_page_code)) {
            echo $per_page_code;
        }
        weaverii_mobile_style();
        if (weaverii_is_checked_page_opt('ttw-hide-site-title')) {
            /* best to just do this inline */
            echo '<style type="text/css">#site-title,#site-description,#header-extra-html{display:none;}</style>' . "\n";
        }
        weaverii_fix_IE();
        echo "\n<!-- End of Weaver II options -->\n";
    }
Ejemplo n.º 2
0
function weaverii_sc_info()
{
    global $current_user;
    $out = '<strong>' . WEAVERII_THEMEVERSION . ' Info</strong><hr />';
    get_currentuserinfo();
    if (isset($current_user->display_name)) {
        $out .= '<em>User:</em> ' . $current_user->display_name . '<br />';
    }
    $out .= '&nbsp;&nbsp;' . wp_register('', '<br />', false);
    $out .= '&nbsp;&nbsp;' . wp_loginout('', false) . '<br />';
    global $weaverii_mobile;
    $device = $weaverii_mobile;
    $out .= '<em>Browser:</em> ' . ($device ? $device['browser'] . '/' . $device['type'] . '/' . $device['os'] : 'Non-Mobile Browser') . '<br />';
    $agent = 'Not Available';
    if (isset($_SERVER["HTTP_USER_AGENT"])) {
        $agent = $_SERVER['HTTP_USER_AGENT'];
    }
    $out .= '<em>User Agent</em>: <small>' . $agent . '</small>';
    $out .= '<div id="example"></div>
<script type="text/javascript">
var txt = "";
var myWidth;
if( typeof( window.innerWidth ) == "number" ) {
//Non-IE
myWidth = window.innerWidth;
} else if( document.documentElement &&
( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in "standards compliant mode"
myWidth = document.documentElement.clientWidth;
} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
}
txt+= "<em>Browser Width: </em>" + myWidth + " px<br>";
document.getElementById("example").innerHTML=txt;
</script>';
    if (!weaverii_use_inline_css(weaverii_get_css_filename())) {
        $out .= '<em>Using CSS file:</em> ' . weaverii_get_css_filename();
    } else {
        $out .= '<em>Using Inline CSS</em>';
    }
    $out .= '<br /><em>Mobile Mode: </em> ' . weaverii_getopt('_wii_mode_mobile');
    $out .= '<br /><em>Feed title:</em> ' . get_bloginfo_rss('name') . get_wp_title_rss();
    $out .= '<br /><em>You are using</em> WordPress ' . $GLOBALS['wp_version'] . '<br /><em>PHP Version:</em> ' . phpversion();
    $out .= '<br /><em>Memory:</em> ' . round(memory_get_usage() / 1024 / 1024, 2) . 'M of ' . (int) ini_get('memory_limit') . 'M <hr />';
    return $out;
}
Ejemplo n.º 3
0
<![endif]-->

<?php 
// ++++ CSS AND CUSTOM SCRIPTS ++++
$icon = weaverii_getopt('_wii_favicon_url');
if ($icon != '') {
    $url = apply_filters('weaverii_css', parse_url($icon, PHP_URL_PATH));
    echo "<link rel=\"shortcut icon\"  href=\"{$url}\" />\n";
}
$icon = weaverii_getopt('_wii_apple_touch_icon_url');
if ($icon != '') {
    $url = apply_filters('weaverii_css', parse_url($icon, PHP_URL_PATH));
    echo "<link rel=\"apple-touch-icon\"  href=\"{$url}\" />\n";
}
weaverii_facebook_meta();
if (!weaverii_use_inline_css(weaverii_get_css_filename())) {
    // don't generate inline CSS
    $vers = weaverii_getopt('wii_style_version');
    if (!$vers) {
        $vers = '1';
    } else {
        $vers = sprintf("%d", $vers);
    }
    wp_register_style('weaverii-style-sheet', weaverii_get_css_url(), array($sheet_name), $vers);
    wp_enqueue_style('weaverii-style-sheet');
}
weaverii_pro_wp_head();
// anything needed for Pro Version
wp_head();
?>
</head>