Ejemplo n.º 1
0
function weaver_page_content()
{
    // display page content with featured image thumbnail
    /* Check if it has a thumbnail,  and if it's a small one */
    global $post;
    global $weaverii_header;
    if (has_post_thumbnail() && !weaver_getopt_checked('ttw_hide_page_featured') && ($image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'post-thumbnail')) && $image[1] < $weaverii_header['width']) {
        the_post_thumbnail('thumbnail');
    }
    weaver_the_content();
}
Ejemplo n.º 2
0
function weaver_sidebar_css($sout)
{
    /* output the CSS to support different sidebars at different widths */
    $sidebars = weaver_getopt('ttw_sidebars');
    $themewidth = weaver_getopt('ttw_header_image_width');
    if (!$themewidth) {
        $themewidth = '940';
    }
    $sidebarwidth = weaver_getopt('ttw_sidebar_width');
    $sb_adjust = (int) weaver_getopt('ttw_border_adjust_sidebar');
    $fw_use = 4;
    $fw_new_count = weaver_getopt('ttw_footer_widget_count');
    if (!empty($fw_new_count)) {
        $val = (int) $fw_new_count;
        // try to get an int
        if ($val > 0 && $val < 4) {
            // ignore all but valid values
            $fw_use = $val;
        }
    }
    /* SIDEBAR layout - need to calculate and override items if change width.
     *	First, calculate and emit everything that is constant for each alternative:
     *	Footer width, site-info, site-generator, site-title, site-description.
     */
    $mw = (int) $themewidth;
    /* main width */
    $fw = (int) (($mw + $fw_use * 5 - 2) / $fw_use - 25);
    /* footer widget width ((mainwidth+(num*5)/num)-25  */
    $si = (int) (($mw - 40) * 0.5);
    /* site info = 60% of mainwidth-40*/
    $sg = (int) ($mw - 50 - $si);
    /* site generator - left over space */
    $caw = (int) $mw - 40;
    /* mainwidth - 40 */
    $ocw = (int) ($mw * 0.9);
    /* one column width */
    $tbmult = 0.85;
    // usually make top/bottom widget areas 85%
    if (weaver_getopt('ttw_wide_top_bottom')) {
        $tbmult = 1;
    }
    if (weaver_getopt_checked('ttw_header_first')) {
        weaver_f_write($sout, sprintf("#masthead {margin:0 auto;width:%dpx;}\n", $mw));
    }
    if ($mw != WVR_WIDTH) {
        /* non-default width means override footer, etc. */
        weaver_f_write($sout, sprintf("#access .menu-header, #access2 .menu-header, #access3 .menu-header, div.menu, #colophon, #branding, #main, #wrapper { width: %dpx; }\n", $mw));
        weaver_f_write($sout, sprintf("#footer-widget-area .widget-area {width: %dpx !important; }\n", $fw));
        weaver_f_write($sout, sprintf("#site-info { width: %dpx;}\n", $si));
        weaver_f_write($sout, sprintf("#site-generator {text-align:right; width: %dpx; }\n", $sg));
        weaver_f_write($sout, sprintf("#site-title {width: 55%%;} "));
        weaver_f_write($sout, sprintf("#site-description {text-align:right; padding-right: 20px; width: 40%%;}\n"));
        weaver_f_write($sout, sprintf("#access, #access2, #access3 {width: %dpx; }\n", $mw));
        weaver_f_write($sout, sprintf("#access .menu-header, #access2 .menu-header, #access3 .menu-header, div.menu {width: %dpx;}\n", $mw - 12));
        weaver_f_write($sout, sprintf("#content .attachment img {max-width: %dpx;}\n", $caw));
        weaver_f_write($sout, sprintf(".single-attachment #content {width: %dpx;}\n", $caw));
        weaver_f_write($sout, sprintf(".one-column #content {margin: 0 auto !important; width: %dpx;}\n", $ocw));
        weaver_f_write($sout, sprintf("#main {margin-bottom:4px;}\n"));
        weaver_f_write($sout, sprintf(".one-column #ttw-top-widget, .one-column #ttw-bot-widget, .one-column #ttw-site-top-widget,\n .one-column #ttw-site-bot-widget, .one-column #per-page-widget { margin-left:%dpx !important; margin-right:auto !important; width: %dpx !important;}\n", (int) ($mw * 0.045), $ocw));
        $altcontainer = $mw - 240;
        // alt templates
        weaver_f_write($sout, sprintf(".right-alt #container {width: %dpx;}\n.right-alt #content {width: %dpx;}\n.right-alt #content img {max-width: %dpx;}\n", $altcontainer, $altcontainer - 20, $altcontainer - 30));
        weaver_f_write($sout, sprintf(".left-alt #content {width: %dpx;}\n.left-alt #contentl img {max-width: %dpx;}", $altcontainer - 42, $altcontainer - 50));
    } elseif ($fw_use != 4) {
        weaver_f_write($sout, sprintf("#footer-widget-area .widget-area {width: %dpx !important; }\n", $fw));
    }
    if ($sidebars == weaver_SB_none) {
        /* no sidebars - simply hide them */
        if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1) {
            $sidebarwidth = 0;
            /* use default if not set */
            /* contentwidth + primary_secondary_width == (mainwidth-50) */
            $contentw = (int) ($mw - 50 - $sidebarwidth);
            /* from formula */
            $containerw = (int) ($contentw + 38);
            /* contentwidth + 38 */
            if (weaver_getopt('ttw_wide_top_bottom')) {
                $ttwwid = $contentw;
            } else {
                $ttwwid = (int) ($contentw - 70);
            }
            /* contentwidth - 70 */
            weaver_f_write($sout, sprintf("#container { float: left; margin: 0 0px 4px 0; width: %dpx; }\n", $containerw));
            weaver_f_write($sout, sprintf("#content {width: %dpx; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n", $contentw));
            weaver_f_write($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw));
            weaver_f_write($sout, sprintf("#primary, #secondary { visibility:hidden; width:0px; height: 0px;}\n"));
            weaver_f_write($sout, sprintf(".one-column #ttw-top-widget, .one-column #ttw-bot-widget, .one-column #ttw-site-top-widget, .one-column #ttw-site-bot-widget { margin-left:80px !important; margin-right:auto !important; width: %dpx !important;}\n", (int) ($contentw * 0.85)));
            if (weaver_getopt('ttw_wide_top_bottom')) {
                weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx; margin-left: 20px;}\n", $ttwwid));
            } else {
                weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx;}\n", $ttwwid));
            }
        } else {
            /* using defaults, so make shorter */
            weaver_f_write($sout, sprintf("#container { width:940px; margin: 0px 0px -30px 0px; }\n#content { width: 860px; margin: 0 100px 30px 0px; overflow:hidden; padding-top: 10px;}\n#content img { max-width: 860px;}\n#primary { visibility:hidden; width:0px; height: 0px;}\n#secondary { visibility:hidden; width:0px; height: 0px;}\n#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: 800px;}\n"));
        }
    } elseif ($sidebars == weaver_SB_2c) {
        /* 2 sidebars, main central column */
        if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) {
            if (!$sidebarwidth) {
                $sidebarwidth = 220;
            }
            /* use default if not set */
            /* contentwidth = mainwidth - 40 - (2*sidebarwidth ) */
            $contentw = (int) ($mw - 40 - $sidebarwidth * 2);
            /* from formula */
            $containerw = (int) $mw;
            /* same a mw */
            $ttwwid = (int) ($contentw * $tbmult);
            /* 85%  or 100% */
            if ($tbmult == 1) {
                $ttwmargin = $sidebarwidth + 20;
                $ttwwid -= 10;
            } else {
                $ttwmargin = (int) ($sidebarwidth + $contentw * 0.115);
            }
            if (weaver_getopt('ttw_useborders')) {
                $second_left = (int) $sidebarwidth + 6;
            } else {
                $second_left = (int) $sidebarwidth + 4;
            }
            weaver_f_write($sout, sprintf("\n#container { width:%dpx; float:left; margin:0 0 4px 0px;}\n", $containerw));
            weaver_f_write($sout, sprintf("#content { width: %dpx; margin: 0px 0px 5px %dpx; overflow:hidden; padding: 5px 20px 4px 20px; }\n", $contentw, $sidebarwidth));
            weaver_f_write($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw));
            weaver_f_write($sout, sprintf("#primary { width:%dpx; float:left; margin: 0 0 4px -%dpx; }\n", $sidebarwidth - 6 - $sb_adjust, $mw));
            weaver_f_write($sout, sprintf("#secondary { width:%dpx; float:left; margin: 0 0 4px -%dpx;}\n", $sidebarwidth - 6 - $sb_adjust, $second_left));
            weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx; margin-left: %dpx;}\n", $ttwwid, $ttwmargin));
        } else {
            /* using defaults, so make shorter */
            weaver_f_write($sout, sprintf("#container { width:940px; float:left; margin:0 0 4px 0px; }\n#content { width: 460px; margin: 0px 0px 5px 220px; overflow:hidden; padding: 5px 20px 4px 20px; }\n#content img { max-width: 460px;}\n#primary { width:214px; float:left; margin: 0 0 4px -940px; }\n#secondary { width:214px; float:left; margin: 0 0 4px -226px;}\n#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: 400px; margin-left: 265px;}\n"));
        }
    } elseif ($sidebars == weaver_SB_2r) {
        if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) {
            if (!$sidebarwidth) {
                $sidebarwidth = 220;
            }
            /* use default if not set */
            $sb2 = (int) ($sidebarwidth * 0.75);
            $contentw = (int) ($mw - 60 - $sidebarwidth - $sb2);
            /* from formula */
            if (weaver_getopt('ttw_useborders')) {
                $containerw = (int) ($contentw + 36);
            } else {
                $containerw = (int) ($contentw + 40);
            }
            $ttwwid = (int) ($contentw * $tbmult);
            if ($tbmult == 1) {
                $ttwmargin = 0;
                $ttwwid += 5;
            } else {
                $ttwmargin = (int) ($contentw * 0.115);
            }
            weaver_f_write($sout, sprintf("#container { width:%dpx; float:left; margin:0 0px 4px 0px;}\n", $containerw));
            weaver_f_write($sout, sprintf("#content {width: %dpx; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n", $contentw));
            weaver_f_write($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw));
            weaver_f_write($sout, sprintf("#primary { width:%dpx; float:left; margin:0 0px 4px 0px;}\n", $sidebarwidth - $sb_adjust));
            weaver_f_write($sout, sprintf("#secondary { width:%dpx; float:left; margin:0 0 4px 0px;}\n", $sb2));
            weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx;margin-left:%dpx;}\n", $ttwwid, $ttwmargin));
        } else {
            /* using defaults, so make shorter */
            weaver_f_write($sout, sprintf("#container { width:525px; float:left; margin:0 0px 4px 0px;}\n#content { width: 490px; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n#content img { max-width: 490px;}\n#primary { width:220px; float:left; margin:0 0px 4px 0px;}\n#secondary { width:170px; float:left; margin:0 0 4px 0px;}\n#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: 420px; margin-left: 40px;}\n"));
        }
    } elseif ($sidebars == weaver_SB_2l) {
        if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) {
            if (!$sidebarwidth) {
                $sidebarwidth = 220;
            }
            /* use default if not set */
            $sb2 = (int) ($sidebarwidth * 0.75);
            $contentw = (int) ($mw - 60 - $sidebarwidth - $sb2);
            /* from formula */
            if (weaver_getopt('ttw_useborders')) {
                $containerw = (int) ($contentw + 36);
            } else {
                $containerw = (int) ($contentw + 40);
            }
            $ttwwid = (int) ($contentw * $tbmult);
            if ($tbmult == 1) {
                $ttwmargin = 18;
            } else {
                $ttwmargin = (int) ($contentw * 0.115);
            }
            weaver_f_write($sout, sprintf("#container { width:%dpx; float:right; margin:0 0 4px 0px;}\n", $containerw));
            weaver_f_write($sout, sprintf("#content { width: %dpx; overflow:hidden; float:right; padding: 5px 10px 5px 0px; margin:0 10px 4px 0px;}\n", $contentw));
            weaver_f_write($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw));
            weaver_f_write($sout, sprintf("#primary { width:%dpx; float:left; margin:0 0px 4px 0px;}\n", $sidebarwidth - 4 - $sb_adjust));
            weaver_f_write($sout, sprintf("#secondary { width:%dpx; float:left; margin:0 0 4px 0px; clear:none;}\n", $sb2));
            weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx;margin-left:%dpx;}\n", $ttwwid, $ttwmargin));
            weaver_f_write($sout, sprintf(".one-column #content {margin-right: 20px !important; padding-left:20px; width: %dpx;}\n", $ocw + 20));
        } else {
            /* using defaults, so make shorter */
            weaver_f_write($sout, sprintf("#container { width:530px; float:right; margin:0 0 4px 0px;}\n#content { width: 490px; overflow:hidden; float:right;  padding: 5px 10px 5px 0px; margin:0 10px 4px 0px;}\n#content img { max-width: 490px;}\n#primary { width:216px; float:left; margin:0 0px 4px 0px;}\n#secondary { width:170px; float:left; margin:0 0 4px 0px; clear:none;}\n#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: 420px;}\n.one-column #content {margin-right: 20px !important; padding-left:20px; width: 850px;}\n"));
        }
    } elseif ($sidebars == weaver_SB_1l) {
        if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) {
            if (!$sidebarwidth) {
                $sidebarwidth = 220;
            }
            /* use default if not set */
            $contentw = (int) ($mw - 70 - $sidebarwidth);
            /* from formula */
            $ttwwid = (int) ($contentw * $tbmult);
            if ($tbmult == 1) {
                $ttwmargin = 30;
            } else {
                $ttwmargin = (int) ($contentw * 0.115);
            }
            weaver_f_write($sout, sprintf("#container { float: right; margin: 0 -%dpx 4px 0; width: 100%%;}\n", $sidebarwidth + 20));
            weaver_f_write($sout, sprintf("#content { margin: 0px %dpx 4px 0px; width: %dpx; padding: 10px 25px 5px 25px;}\n", $sidebarwidth + 20, $contentw));
            weaver_f_write($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw));
            weaver_f_write($sout, sprintf("#container.one-column-iframe #content {margin:0 0 0 -%dpx;padding:0px;width:100%%;}\n", $sidebarwidth + 20));
            weaver_f_write($sout, sprintf("#primary, #secondary { float: left;  width: %dpx; padding-left: 15px; margin-bottom:4px;}\n", $sidebarwidth + 3 - $sb_adjust));
            weaver_f_write($sout, sprintf("#secondary { clear: left; }\n"));
            weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx; margin-left: %dpx;}\n", $ttwwid, $ttwmargin));
            //weaver_f_write($sout, sprintf(".one-column #ttw-top-widget, .one-column #ttw-bot-widget, .one-column #ttw-site-top-widget, .one-column #ttw-site-bot-widget, .one-column #per-page-widget { margin-left:-%dpx !important; margin-right:auto !important; width: %dpx !important;}\n",
            //		  (int)($sidebarwidth-20), (int)($mw*.88-10)));
        } else {
            /* using defaults, so make shorter */
            weaver_f_write($sout, sprintf("#container { float: right; margin: 0 -240px 4px 0; width: 100%%;}\n#content { margin: 0px 240px 4px 0px; width: 640px; padding: 10px 25px 5px 25px;}\n#container.one-column-iframe #content {margin:0 0 0 -240px;padding:0;width:100%%;}\n#content img { max-width: 640px;}\n#primary, #secondary { float: left;  width: 223px; padding-left: 15px; margin-bottom:4px;}\n#secondary { clear: left;}\n#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: 580px;}\n"));
        }
    } elseif ($sidebars == weaver_SB_1rw) {
        if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) {
            if (!$sidebarwidth) {
                $sidebarwidth = 300;
            }
            /* use default if not set */
            /* contentwidth + primary_secondary_width == (mainwidth-50) */
            $contentw = (int) ($mw - 50 - $sidebarwidth);
            /* from formula */
            $containerw = (int) ($contentw + 38);
            /* contentwidth + 38 */
            $ttwwid = (int) ($contentw - 70);
            /* contentwidth - 70 */
            if ($tbmult == 1) {
                $ttwwid = $contentw;
            }
            weaver_f_write($sout, sprintf("#container { float: left; margin: 0 0px 4px 0; width: %dpx; }\n", $containerw));
            weaver_f_write($sout, sprintf("#content {width: %dpx; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n", $contentw));
            weaver_f_write($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw));
            weaver_f_write($sout, sprintf("#primary, #secondary { float: right; overflow: hidden; width: %dpx; margin: 0 0 4px 0;}\n", $sidebarwidth - $sb_adjust));
            if ($tbmult == 1) {
                weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx; margin-left: 1px; margin-right: 1px;}\n", $ttwwid));
            } else {
                weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx;}\n", $ttwwid));
            }
        } else {
            /* using defaults, so make shorter */
            weaver_f_write($sout, sprintf("#main {margin-bottom:4px;}\n#container { float: left; margin: 0 0px 4px 0; width: 628px; }\n#content {width: 590px; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n#content img { max-width: 590px;}\n#primary, #secondary { float: right; overflow: hidden; width: 300px; margin: 0 0 4px 0;}\n#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: 520px;}\n"));
        }
    } else {
        /* default right sidebar */
        if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) {
            if (!$sidebarwidth) {
                $sidebarwidth = 220;
            }
            /* use default if not set */
            /* contentwidth + primary_secondary_width == (mainwidth-50) */
            $contentw = (int) ($mw - 50 - $sidebarwidth);
            /* from formula */
            $containerw = (int) ($contentw + 38);
            /* contentwidth + 38 */
            $ttwwid = (int) ($contentw - 70);
            /* contentwidth - 70 */
            if ($tbmult == 1) {
                $ttwwid = $contentw;
            }
            weaver_f_write($sout, sprintf("#container { float: left; margin: 0 0px 4px 0; width: %dpx; }\n", $containerw));
            weaver_f_write($sout, sprintf("#content {width: %dpx; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n", $contentw));
            weaver_f_write($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw));
            weaver_f_write($sout, sprintf("#primary, #secondary { float: right; overflow: hidden; width: %dpx; margin: 0 0 4px 0;}\n", $sidebarwidth - $sb_adjust));
            weaver_f_write($sout, sprintf(".one-columnsb1r #content {margin-left: %dpx; padding: 0; width: %dpx;}\n", (int) ($mw * 0.05), $ocw));
            if ($tbmult == 1) {
                weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx; margin-left: 1px; margin-right: 1px;}\n", $ttwwid));
            } else {
                weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {width: %dpx;}\n", $ttwwid));
            }
        }
    }
}
Ejemplo n.º 3
0
            printf(__('Proudly powered by %s.', WEAVER_TRANS), 'WordPress');
            ?>
</a>
 <?php 
            echo WEAVER_THEMENAME;
            ?>
 by WeaverTheme.com
 </div></td> <?php 
        }
        ?>
</tr></table>
		</div><!-- #colophon -->
	</div><!-- #footer -->
    <?php 
    }
    weaver_put_area('postfooter');
}
/* end of ttw-hide-footer */
if (!weaver_getopt_checked('ttw_footer_last')) {
    echo "</div><!-- #wrapper -->\n";
}
?>

<?php 
echo do_shortcode(weaver_getopt('ttw_end_opts')) . "\n";
/* and this is the end options insertion */
wp_footer();
?>
</body>
</html>
Ejemplo n.º 4
0
        /* header insert defined? */
        echo do_shortcode(weaver_getopt('ttw_custom_header_insert'));
    }
    /* The Dynamic Headers shows headers on a per page basis - will also optionally add site link */
    if (function_exists('show_media_header')) {
        show_media_header();
    }
    /* **Dynamic Headers** built-in support for plugin */
    ?>

	    </div><!-- #branding -->

	    <?php 
    /* ======== BOTTOM MENU ======== */
    get_template_part('nav', 'bottom');
    ?>

	</div><!-- #masthead -->
    </div><!-- #header -->

    <?php 
}
/* end of hide whole header */
weaver_put_area('postheader');
if (weaver_getopt_checked('ttw_header_first')) {
    echo "<div id=\"wrapper\" class=\"hfeed\">\n";
}
?>

    <div id="main">
Ejemplo n.º 5
0
function weaver_adv_admin_opts()
{
    ?>
		<a name="adminopts" id="adminopts"></a>
		<label><span style="color:#00f; font-weight:bold; font-size: larger;"><b>Administrative Options</b></span></label><br/>
		These options control some administrative options and appearance features.
		<br />

<br /> <small><span style="color:red;"><b>IMPORTANT NOTE:</b></span> Weaver includes support for Rounded Corners and Shadows for Internet Explorer 7/8
via an add-on script called PIE. The script has been <strong>enabled</strong> by default. PIE doesn't work with the rounded menus. It also may have
a few incompatibilities with some Flash content and other images that might require z-index adjustment.
If you have difficulties or don't like the way your site renders in IE 7/8, you can disable the support.</small>

<br />
    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_PIE');
    ?>
" id="ttw_hide_PIE" <?php 
    checked(weaver_getopt_checked('ttw_hide_PIE'));
    ?>
 />
    <label>Disable IE rounded corners support - </label><small>If you are having issues with IE and rounded corners, please disable this option.</small><br />

<br />
    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_editor_style');
    ?>
" id="ttw_hide_editor_style" <?php 
    checked(weaver_getopt_checked('ttw_hide_editor_style'));
    ?>
 />
	<label>Disable Page/Post Editor Styling - </label><small>Checking this box will disable the Weaver sub-theme based styling in the Page/Post editor.
	If you have a theme using transparent backgrounds, this option will likely improve the Post/Page editor visibility.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_show_preview');
    ?>
" id="ttw_show_preview" <?php 
    checked(weaver_getopt_checked('ttw_show_preview'));
    ?>
 />
	<label>Show Site Preview - </label><small>Checking this box will show a Site Preview at the bottom of the screen which might slow down response a bit.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_updatemsg');
    ?>
" id="ttw_hide_updatemsg" <?php 
    checked(weaver_getopt_checked('ttw_hide_updatemsg'));
    ?>
 />
	<label>Hide Update Messages - </label><small>Checking this box will hide the Weaver version update announcements on the Weaver Admin page.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_theme_thumbs');
    ?>
" id="ttw_hide_theme_thumbs" <?php 
    checked(weaver_getopt_checked('ttw_hide_theme_thumbs'));
    ?>
 />
	<label>Hide Theme Thumbnails - </label><small>Checking this box will hide the Sub-theme preview thumbnails on the Weaver Themes tab which might speed up response a bit.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_auto_css_rules');
    ?>
" id="ttw_hide_auto_css_rules" <?php 
    checked(weaver_getopt_checked('ttw_hide_auto_css_rules'));
    ?>
 />
	<label>Don't auto-display CSS rules - </label><small>Checking this box will disable the auto-display of Main Option elements that have CSS settings.</small><br />

    <input name="<?php 
    weaver_sapi_advanced_name('ttw_css_rows');
    ?>
" id="ttw_css_rows" type="text" style="width:30px;height:20px;" class="regular-text" value="<?php 
    echo weaver_esc_textarea(weaver_getopt('ttw_css_rows'));
    ?>
" />
    <label>Set CSS+ text box height - </label><small>You can increase the default height of the CSS+ input area.</small>
<br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_notab_mainoptions');
    ?>
" id="ttw_notab_mainoptions" <?php 
    checked(weaver_getopt_checked('ttw_notab_mainoptions'));
    ?>
 />
	<label>Show All Main Options at once - </label><small>If you want to see all the main options at once (not displayed by tabs), check this box.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_force_inline_css');
    ?>
" id="ttw_force_inline_css" <?php 
    checked(weaver_getopt_checked('ttw_force_inline_css'));
    ?>
 />
	<label>Use Inline CSS - </label><small>Checking this box will have Weaver generate CSS inline rather than use the style-weaver.css external style sheet.</small><br />

<?php 
    if (get_option('ttw_options')) {
        ?>
	<input type="checkbox" name="<?php 
        weaver_sapi_advanced_name('wvr_hide_if_are_oldWeaver_opts');
        ?>
" id="wvr_hide_if_are_oldWeaver_opts" <?php 
        checked(weaver_getopt_checked('wvr_hide_if_are_oldWeaver_opts'));
        ?>
 />
	<label>Hide import notice if settings from old Weaver versions exist - </label><small>This option controls the display of the import old Weaver settings box.</small><br />
<?php 
    }
    $type = get_filesystem_method(array());
    if ($type == 'ftpext' && !function_exists('weaver_fileio_plugin')) {
        ?>
	<br /><br /><label><span style="color:#00f; font-weight:bold; font-size: larger;"><b>FTP File Access</b></span></label><br/>
	<p>Your system requires internal FTP access for full file access functionality. You do not have the Weaver File Access
	Plugin installed. If you don't have the ftp access credentials defined in your wp-config.php file, you will have options
	here to provide the required values.
<?php 
        if (!(defined('FTP_HOST') && defined('FTP_USER') && defined('FTP_PASS'))) {
            _e('Please enter your FTP credentials to proceed.', WEAVER_TRANSADMIN);
            echo ' ';
            _e('If you do not remember your credentials, you should contact your web host.', WEAVER_TRANSADMIN);
            echo "</p>\n";
            ?>
	<br /><label><?php 
            _e('Hostname', WEAVER_TRANSADMIN);
            ?>
: &nbsp;&nbsp;&nbsp;</label><input name="<?php 
            weaver_sapi_advanced_name('ftp_hostname');
            ?>
" id="ftp_hostname" type="text" style="width:300px;height:20px;" class="regular-text" value="<?php 
            echo weaver_esc_textarea(weaver_getopt('ftp_hostname'));
            ?>
" />
    <small>Specify the name of your host. Usually something like 'example.com'.</small>
    <br /><label><?php 
            echo __('FTP Username', WEAVER_TRANSADMIN);
            ?>
: </label><input name="<?php 
            weaver_sapi_advanced_name('ftp_username');
            ?>
" id="ftp_username" type="text" style="width:300px;height:20px;" class="regular-text" value="<?php 
            echo weaver_esc_textarea(weaver_getopt('ftp_username'));
            ?>
" />
    <small>Specify your FTP Username.</small>
    <br /><label><?php 
            _e('FTP Password', WEAVER_TRANSADMIN);
            ?>
: </label><input name="<?php 
            weaver_sapi_advanced_name('ftp_password');
            ?>
" id="ftp_password" type="password" style="width:300px;height:20px;" class="regular-text" value="<?php 
            echo weaver_esc_textarea(weaver_decrypt(weaver_getopt('ftp_password')));
            ?>
" />
    <small>Specify your FTP Password. This will be saved in an encrypted form.</small>
<br />
<?php 
        } else {
            ?>
	    <p><em>FTP Credentials used from your wp-config.php file.</em></p>
<?php 
        }
        ?>
<br /><label>Hide FTP Access Start up Dialog: </label>
<input type="checkbox" name="<?php 
        weaver_sapi_advanced_name('ftp_hide_check_message');
        ?>
" id="ftp_hide_check_message" <?php 
        checked(weaver_getopt_checked('ftp_hide_check_message'));
        ?>
 />
	<small>If you check this, then the FTP File Access message box will not be displayed when you enter Weaver Admin. Weaver will continue to operate in
	reduced functionality mode: no editor styling, no save/restore, Inline CSS.</small><br />
<?php 
    }
    ?>

    <br /><?php 
    weaver_sapi_submit('saveadvanced', 'Save All Advanced Options');
    ?>
<br /><br />
    <?php 
    /* The following three hidden inputs allow the SAPI to save the values. If you don't do this here, then the values will
       be set to false, and lost! SAPI is not tolerant of submitting a form that doesn't include every setting for the form group. */
    ?>
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_subtheme');
    ?>
" id="ttw_subtheme" type="hidden" value="<?php 
    echo weaver_getopt('ttw_subtheme');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_theme_image');
    ?>
" id="ttw_theme_image" type="hidden" value="<?php 
    echo weaver_getopt('ttw_theme_image');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_theme_description');
    ?>
" id="ttw_theme_description" type="hidden" value="<?php 
    echo weaver_getopt('ttw_theme_description');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_themename');
    ?>
" id="ttw_themename" type="hidden" value="<?php 
    echo weaver_getopt('ttw_themename');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_version_id');
    ?>
" id="ttw_version_id" type="hidden" value="<?php 
    echo weaver_getopt('ttw_version_id');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_style_version');
    ?>
" id="ttw_style_version" type="hidden" value="<?php 
    echo weaver_getopt('ttw_style_version');
    ?>
" />

    <hr />
    <p><em>Note: </em>Clear all settings moved to Save/Restore tab<p>
<?php 
}
Ejemplo n.º 6
0
function weaver_ftp_form()
{
    // display warning message, and ftp info
    $readme = get_template_directory_uri() . '/help.html';
    ?>
      <br /><br /><br /><div style="background-color:#FFEEEE; border: 5px ridge red; margin: 10px 60px 0px 20px; padding:15px;">
<strong style="color:#f00; line-height:150%;">*** IMPORTANT NOTICE! ***</strong> <small style="padding-left:20px;">(But don't panic!)</small>
<?php 
    weaver_help_link('help.html#File_access_plugin', 'Weaver File Access Plugin');
    ?>
	<p>Your web host configuration needs "FTP" file access for full Weaver functionality. You need to use one of the following options. There are more details in the help file. <?php 
    weaver_help_link('help.html#File_access_plugin', 'Weaver File Access Plugin');
    ?>
</p>
	<ul style="list-style-type:disc !important;list-style-position:inside !important;">
	  <li><strong>For a shared web host</strong>: Provide FTP credentials to enable file access. You can do this by filling the form below, or by adding the proper information to your wp-config.php file as described in the help file. <small>Note: most shared hosts do not need FTP file access, and won't generate this message.</small></li>
      <li><strong>For a private server or VPS</strong>: Provide FTP credentials, or install the <a href="http://wordpress.org/extend/plugins/weaver-file-access-plugin/" target="_blank">Weaver File Access Plugin</a>. The Weaver File Access Plugin will provide the required file access with the most efficiency.</li>
      <li><strong>For compatibility with existing Weaver installations:</strong> install the <a href="http://wordpress.org/extend/plugins/weaver-file-access-plugin/" target="_blank">Weaver File Access Plugin</a>. This will provide the required file access with the most compatibility with previous versions, but with a very small security risk. See the help file.
      If you have an existing Weaver installation, you may find switching file access methods (Weaver File Access Plugin to FTP, or the opposite) may result in file or directory access permission issues. See the help file.</li>
      <li><strong>For reduced functionality mode:</strong> Check the <em>Hide FTP Access Start up Dialog</em> below.
      Weaver <strong>will continue to operate</strong> in reduced functionality mode (no editor styling, no save/restore, Inline CSS)
	until you provide FTP credentials, or download and activate the <em>Weaver File Access Plugin</em>, either from <a href="http://wordpress.org/extend/plugins/weaver-file-access-plugin/" target="_blank">WordPress.org</a>, or <a href="http://wpweaver.info/themes/weaver/weaver-file-access-plugin/" target="_blank">WPWeaver.info</a>.</li>
</ul>
	<ul style="list-style-type:disc !important;list-style-position:inside !important;">
	    <li>If your host requires secure FTP or SSH access, you will need to provide the proper credentials using the wp-config.php file.</li>
      <li>Installing the <a href="http://wordpress.org/extend/plugins/weaver-file-access-plugin/" target="_blank">Weaver File Access Plugin</a> will allow full Weaver functionality on any host, but sometimes with a small security risk</li>
</ul>
	<p><strong>Please read more details in the
<?php 
    echo '<a href="' . $readme . '#File_access_plugin" target="_blank">';
    ?>
	Weaver File Access Plugin</a> topic from the <em>Weaver Help tab</em></strong>.
	</p>
	</div><br />


    <form name="weaver_set_ftp_form" method="post">
      <p><span style="color:#00f; font-weight:bold; font-size: larger;"><strong>Provide FTP File Access Credentials</strong></span></p>
	<?php 
    if (!(defined('FTP_HOST') && defined('FTP_USER') && defined('FTP_PASS'))) {
        echo "<p>\n";
        _e('Please enter your FTP credentials to proceed.', WEAVER_TRANSADMIN);
        echo ' ';
        _e('If you do not remember your credentials, you should contact your web host.', WEAVER_TRANSADMIN);
        echo "</p>\n";
        ?>
	<label><?php 
        _e('Hostname', WEAVER_TRANSADMIN);
        ?>
: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><input name="ftp_hostnamex" id="ftp_hostnamex" type="text" style="width:300px;height:20px;" class="regular-text" value="<?php 
        echo weaver_esc_textarea(weaver_getopt('ftp_hostname'));
        ?>
" />
    <small>Specify the name of your host. Usually something like 'example.com'.</small>
    <br /><label><?php 
        echo __('FTP Username', WEAVER_TRANSADMIN);
        ?>
: </label><input name="ftp_usernamex" id="ftp_usernamex" type="text" style="width:300px;height:20px;" class="regular-text" value="<?php 
        echo weaver_esc_textarea(weaver_getopt('ftp_username'));
        ?>
" />
    <small>Specify your FTP Username.</small>
    <br /><label><?php 
        _e('FTP Password', WEAVER_TRANSADMIN);
        ?>
: </label><input name="ftp_passwordx" id="ftp_passwordx" type="password" style="width:300px;height:20px;" class="regular-text" value="<?php 
        echo weaver_esc_textarea(weaver_decrypt(weaver_getopt('ftp_password')));
        ?>
" />
    <small>Specify your FTP Password. This will be saved in an encrypted form.</small>
<br />
<?php 
    } else {
        ?>
<p><em>Credentials provided in the wp-config.php file.</em> There must be some kind of problem because you shouldn't be seeing
this page unless you need to provide FTP access credentials. Perhaps the password is not included in wp-config.php.</p>
<?php 
    }
    ?>
<p>If you continue to get this message even after entering your credentials, please double check the values. If that
	that continues to fail, you can install the
	<a href="http://wordpress.org/extend/plugins/weaver-file-access-plugin/" target="_blank">Weaver File Access Plugin</a> instead.</p><br />

<p><span style="color:#00f; font-weight:bold; font-size: larger;"><strong>Install Weaver File Access Plugin</strong></span><br />
      The easiest way to install the <em>Weaver File Access Plugin</em> is to open the Plugins&rarr;Add New panel, and enter
      <em>Weaver File Access Plugin</em> into the search box. Then install and activate the plugin.
</p>

<p><span style="color:#00f; font-weight:bold; font-size: larger;"><strong>Continue with reduced file access</strong></span><br />
      If want to continue to use Weaver without full file access, check
the box below. You can still use all of Weaver's options. You just won't be able to use the Save/Restore features, the
Page/Post editor will use plain styling, and CSS rules will be included Inline on your site's pages. <em>You can still
install the Weaver File Access Plugin, or provide FTP credentials later.</em></p>

<label><strong>Hide FTP Access Start up Dialog:</strong> </label><input type="checkbox" name="ftp_hide_check_messagex" id="ftp_hide_check_messagex" <?php 
    checked(weaver_getopt_checked('ftp_hide_check_message'));
    ?>
 />
	<small>If you check this, then this FTP File Access message box when you enter Weaver Admin will not be displayed. Weaver will function in
	reduced functionality mode: no editor styling, no save/restore, Inline CSS.</small><br /><br />

<input class="button-primary" type="submit" name="ftp_save_form" value="Save FTP File Access Options"/>
	<?php 
    weaver_nonce_field('ftp_save_form');
    ?>
    </form>



    </div> <!-- #wrap -->
<?php 
}