Exemplo n.º 1
0
function init($args)
{
    $albumName = $args['name'];
    $themeList = getThemeNames();
    $albumDefault = getCurrentTheme($albumName);
    $outString = "";
    foreach ($themeList as $name => $html) {
        $outString .= "<theme ";
        if ($name == $albumDefault) {
            $outString .= "default=\"true\"";
        }
        $outString .= ">{$name}</theme>";
    }
    outputXML("<status>success</status>{$outString}");
}
Exemplo n.º 2
0
function flowplayer_playlistJS()
{
    $theme = getCurrentTheme();
    $css = SERVERPATH . '/' . THEMEFOLDER . '/' . internalToFilesystem($theme) . '/flowplayer3_playlist.css';
    if (file_exists($css)) {
        $css = WEBPATH . '/' . THEMEFOLDER . '/' . $theme . '/flowplayer3_playlist.css';
    } else {
        $css = WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/flowplayer3/flowplayer3_playlist.css';
    }
    ?>
	<script type="text/javascript" src="<?php 
    echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
    ?>
/flowplayer3/jquery.tools.min.js"></script>
	<link rel="stylesheet" type="text/css" href="<?php 
    echo pathurlencode($css);
    ?>
" />
	<?php 
}
Exemplo n.º 3
0
    static function themeJS()
    {
        $theme = getCurrentTheme();
        $css = SERVERPATH . '/' . THEMEFOLDER . '/' . internalToFilesystem($theme) . '/jquery.bxslider.css';
        if (file_exists($css)) {
            $css = WEBPATH . '/' . THEMEFOLDER . '/' . $theme . '/jquery.bxslider.css';
        } else {
            $css = WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/bxslider_thumb_nav/jquery.bxslider.css';
        }
        ?>

		<script type="text/javascript" src="<?php 
        echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/bxslider_thumb_nav/jquery.bxslider.min.js"></script>
		<link rel="stylesheet" type="text/css" href="<?php 
        echo html_encode($css);
        ?>
" />
		<?php 
    }
Exemplo n.º 4
0
    static function themeJS()
    {
        $theme = getCurrentTheme();
        $css = SERVERPATH . '/' . THEMEFOLDER . '/' . internalToFilesystem($theme) . '/jcarousel.css';
        if (file_exists($css)) {
            $css = WEBPATH . '/' . THEMEFOLDER . '/' . $theme . '/jcarousel.css';
        } else {
            $css = WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/jcarousel_thumb_nav/jcarousel.css';
        }
        ?>
		<script>
			(function($) {
				var userAgent = navigator.userAgent.toLowerCase();

				$.browser = {
					version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, '0'])[1],
					safari: /webkit/.test(userAgent),
					opera: /opera/.test(userAgent),
					msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
					mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
				};

			})(jQuery);
		</script>
		<script type="text/javascript" src="<?php 
        echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/jcarousel_thumb_nav/jquery.jcarousel.pack.js"></script>
		<link rel="stylesheet" type="text/css" href="<?php 
        echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/jcarousel_thumb_nav/jquery.jcarousel.css" />
		<link rel="stylesheet" type="text/css" href="<?php 
        echo html_encode($css);
        ?>
" />
		<?php 
    }
Exemplo n.º 5
0
function elegance_widgets_init()
{
    // Sidebar Widget
    // Location: the sidebar
    register_sidebar(array('name' => theme_locals("sidebar"), 'id' => 'main-sidebar', 'description' => theme_locals("sidebar_desc"), 'before_widget' => '<div id="%1$s" class="widget">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
    // Header Widget Area
    // Location: at the top of pages
    register_sidebar(array('name' => __('Header', getCurrentTheme()), 'id' => 'header', 'description' => __('Header widget area', getCurrentTheme()), 'before_widget' => '<div id="%1$s" class="header-widget">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>'));
    // Cart Holder Widget
    // Location: the sidebar
    register_sidebar(array('name' => __("Cart Holder", "themeWoo"), 'id' => 'cart-holder', 'description' => __("Widget for cart in Header", "themeWoo"), 'before_widget' => '<div id="%1$s" class="cart-holder">', 'after_widget' => '</div></div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="widget_shopping_cart_content">'));
    // Footer Widget Area 1
    // Location: at the top of the footer, above the copyright
    register_sidebar(array('name' => theme_locals("footer_1"), 'id' => 'footer-sidebar-1', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s" class="footer-widget-item">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
    // Footer Widget Area 2
    // Location: at the top of the footer, above the copyright
    register_sidebar(array('name' => theme_locals("footer_2"), 'id' => 'footer-sidebar-2', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s" class="footer-widget-item">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
    // Footer Widget Area 3
    // Location: at the top of the footer, above the copyright
    register_sidebar(array('name' => theme_locals("footer_3"), 'id' => 'footer-sidebar-3', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s" class="footer-widget-item">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
    // Footer Widget Area 4
    // Location: at the top of the footer, above the copyright
    register_sidebar(array('name' => theme_locals("footer_4"), 'id' => 'footer-sidebar-4', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s" class="footer-widget-item">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
}
Exemplo n.º 6
0
    static function header_js()
    {
        $theme = getCurrentTheme();
        $css = SERVERPATH . '/' . THEMEFOLDER . '/' . internalToFilesystem($theme) . '/slideshow.css';
        if (file_exists($css)) {
            $css = WEBPATH . '/' . THEMEFOLDER . '/' . $theme . '/slideshow.css';
        } else {
            $css = WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/slideshow/slideshow.css';
        }
        ?>
		<script	src="<?php 
        echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/slideshow/jquery.cycle.all.js" type="text/javascript"></script>
		<link rel="stylesheet" type="text/css" href="<?php 
        echo $css;
        ?>
" />
		<?php 
    }
Exemplo n.º 7
0
/**
 * Prints a form for posting comments
 *
 * @param bool $showcomments defaults to true for showing list of comments
 * @param string $addcommenttext alternate text for "Add a comment:"
 * @param bool $addheader set true to display comment count header
 * @param string $comment_commententry_mod use to add styles, classes to the comment form div
 * @param bool $desc_order default false, set to true to change the comment order to descending ( = newest to oldest)
 */
function printCommentForm($showcomments = true, $addcommenttext = NULL, $addheader = true, $comment_commententry_mod = '', $desc_order = false)
{
    global $_zp_gallery_page, $_zp_current_admin_obj, $_zp_current_comment, $_zp_captcha, $_zp_authority, $_zp_HTML_cache, $_zp_current_image, $_zp_current_album, $_zp_current_page, $_zp_current_article;
    if (getOption('email_new_comments')) {
        $email_list = $_zp_authority->getAdminEmail();
        if (empty($email_list)) {
            setOption('email_new_comments', 0);
        }
    }
    if (is_null($addcommenttext)) {
        $addcommenttext = '<h3>' . gettext('Add a comment:') . '</h3>';
    }
    switch ($_zp_gallery_page) {
        case 'album.php':
            if (!getOption('comment_form_albums')) {
                return;
            }
            $obj = $_zp_current_album;
            break;
        case 'image.php':
            if (!getOption('comment_form_images')) {
                return;
            }
            $obj = $_zp_current_image;
            break;
        case 'pages.php':
            if (!getOption('comment_form_pages')) {
                return;
            }
            $obj = $_zp_current_page;
            break;
        case 'news.php':
            if (!getOption('comment_form_articles') || !is_NewsArticle()) {
                return;
            }
            $obj = $_zp_current_article;
            break;
        default:
            return;
            break;
    }
    $comments_open = $obj->getCommentsAllowed();
    ?>
	<!-- printCommentForm -->
	<div id="commentcontent">
		<?php 
    $num = getCommentCount();
    if ($showcomments) {
        if ($num == 0) {
            if ($addheader) {
                echo '<h3 class="empty">' . gettext('No Comments') . '</h3>';
            }
            $display = '';
        } else {
            if ($addheader) {
                echo '<h3>' . sprintf(ngettext('%u Comment', '%u Comments', $num), $num) . '</h3>';
            }
            if (getOption('comment_form_toggle')) {
                ?>
					<div id="comment_toggle"><!-- place holder for toggle button --></div>
					<script type="text/javascript">
						// <!-- <![CDATA[
						function toggleComments(hide) {
							if (hide) {
								$('div.comment').hide();
								$('.Pagination').hide();
								$('#comment_toggle').html('<button class="button buttons" onclick="toggleComments(false);"><?php 
                echo gettext('show comments');
                ?>
</button>');
							} else {
								$('div.comment').show();
								$('.Pagination').show();
								$('#comment_toggle').html('<button class="button buttons" onclick="toggleComments(true);"><?php 
                echo gettext('hide comments');
                ?>
</button>');
							}
						}
						$(document).ready(function () {
							toggleComments(window.location.hash.search(/#zp_comment_id_/));
						});
						// ]]> -->
					</script>
					<?php 
                $display = ' style="display:none"';
            } else {
                $display = '';
            }
        }
        $hideoriginalcomments = '';
        if (getOption('comment_form_pagination') && COMMENTS_PER_PAGE < $num) {
            $hideoriginalcomments = ' style="display:none"';
            // hide original comment display to be replaced by jQuery pagination
        }
        if (getOption('comment_form_pagination') && COMMENTS_PER_PAGE < $num) {
            ?>
				<div class="Pagination"></div><!-- this is the jquery pagination nav placeholder -->
				<div id="Commentresult"></div>
				<?php 
        }
        ?>
			<div id="comments"<?php 
        echo $hideoriginalcomments;
        ?>
>
				<?php 
        while (next_comment($desc_order)) {
            if (!getOption('comment_form_showURL')) {
                $_zp_current_comment['website'] = '';
            }
            ?>
					<div class="comment" <?php 
            echo $display;
            ?>
>
						<div class="commentinfo">
							<h4 id="zp_comment_id_<?php 
            echo $_zp_current_comment['id'];
            ?>
"><?php 
            printCommentAuthorLink();
            ?>
: <?php 
            echo gettext('on');
            ?>
 <?php 
            echo getCommentDateTime();
            printEditCommentLink(gettext('Edit'), ', ', '');
            ?>
</h4>
						</div><!-- class "commentinfo" -->
						<div class="commenttext"><?php 
            echo html_encodeTagged(getCommentBody(), false);
            ?>
</div><!-- class "commenttext" -->
					</div><!-- class "comment" -->
					<?php 
        }
        ?>
			</div><!-- id "comments" -->
			<?php 
    }
    if (getOption('comment_form_pagination') && COMMENTS_PER_PAGE < $num) {
        ?>
			<div class="Pagination"></div><!-- this is the jquery pagination nav placeholder -->
			<?php 
    }
    ?>
		<!-- Comment Box -->
		<?php 
    if ($comments_open) {
        if (MEMBERS_ONLY_COMMENTS && !zp_loggedin(POST_COMMENT_RIGHTS)) {
            echo gettext('Only registered users may post comments.');
        } else {
            $disabled = array('name' => '', 'website' => '', 'anon' => '', 'private' => '', 'comment' => '', 'street' => '', 'city' => '', 'state' => '', 'country' => '', 'postal' => '');
            $stored = array_merge(array('email' => '', 'custom' => ''), $disabled, getCommentStored());
            $custom = getSerializedArray($stored['custom']);
            foreach ($custom as $key => $value) {
                if (!empty($value)) {
                    $stored[$key] = $value;
                }
            }
            foreach ($stored as $key => $value) {
                $disabled[$key] = false;
            }
            if (zp_loggedin()) {
                if (extensionEnabled('userAddressFields')) {
                    $address = userAddressFields::getCustomData($_zp_current_admin_obj);
                    foreach ($address as $key => $value) {
                        if (!empty($value)) {
                            $disabled[$key] = true;
                            $stored[$key] = $value;
                        }
                    }
                }
                $name = $_zp_current_admin_obj->getName();
                if (!empty($name)) {
                    $stored['name'] = $name;
                    $disabled['name'] = ' disabled="disabled"';
                } else {
                    $user = $_zp_current_admin_obj->getUser();
                    if (!empty($user)) {
                        $stored['name'] = $user;
                        $disabled['name'] = ' disabled="disabled"';
                    }
                }
                $email = $_zp_current_admin_obj->getEmail();
                if (!empty($email)) {
                    $stored['email'] = $email;
                    $disabled['email'] = ' disabled="disabled"';
                }
                if (!empty($address['website'])) {
                    $stored['website'] = $address['website'];
                    $disabled['website'] = ' disabled="disabled"';
                }
            }
            $data = zp_apply_filter('comment_form_data', array('data' => $stored, 'disabled' => $disabled));
            $disabled = $data['disabled'];
            $stored = $data['data'];
            foreach ($data as $check) {
                foreach ($check as $v) {
                    if ($v) {
                        $_zp_HTML_cache->disable();
                        //	shouldn't cache partially filled in pages
                        break 2;
                    }
                }
            }
            if (!empty($addcommenttext)) {
                echo $addcommenttext;
            }
            ?>
				<div id="commententry" <?php 
            echo $comment_commententry_mod;
            ?>
>
					<?php 
            $theme = getCurrentTheme();
            $form = getPlugin('comment_form/comment_form.php', $theme);
            require $form;
            ?>
				</div><!-- id="commententry" -->
				<?php 
        }
    } else {
        ?>
			<div id="commententry">
				<h3><?php 
        echo gettext('Closed for comments.');
        ?>
</h3>
			</div><!-- id="commententry" -->
			<?php 
    }
    ?>
	</div><!-- id="commentcontent" -->
	<?php 
    if (getOption('comment_form_rss') && getOption('RSS_comments')) {
        ?>
		<br clear="all" />
		<?php 
        if (class_exists('RSS')) {
            switch ($_zp_gallery_page) {
                case "image.php":
                    printRSSLink("Comments-image", "", gettext("Subscribe to comments"), "");
                    break;
                case "album.php":
                    printRSSLink("Comments-album", "", gettext("Subscribe to comments"), "");
                    break;
                case "news.php":
                    printRSSLink("Comments-news", "", gettext("Subscribe to comments"), "");
                    break;
                case "pages.php":
                    printRSSLink("Comments-page", "", gettext("Subscribe to comments"), "");
                    break;
            }
        }
    }
    ?>
	<!-- end printCommentForm -->
	<?php 
}
Exemplo n.º 8
0
    static function cycleJS()
    {
        ?>
		<script	src="<?php 
        echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/slideshow2/jquery.cycle2.min.js" type="text/javascript"></script>
		<script	src="<?php 
        echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/slideshow2/jquery.cycle2.center.min.js" type="text/javascript"></script>
		<!-- effect plugins -->

		<?php 
        if (getOption('cycle-slideshow_effect') == 'flipHorz' || getOption('cycle-slideshow_effect') == 'flipVert') {
            ?>
			<script	src="<?php 
            echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
            ?>
/slideshow2/jquery.cycle2.flip.min.js" type="text/javascript"></script>
		<?php 
        }
        ?>

		<!--[if lt IE 9]>
			<script	src="<?php 
        echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/slideshow2/jquery.cycle2.ie-fade.min.js" type="text/javascript"></script>
		<![endif]-->

		<?php 
        if (getOption('cycle-slideshow_effect') == 'shuffle') {
            ?>
			<script	src="<?php 
            echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
            ?>
/slideshow2/jquery.cycle2.shuffle.min.js" type="text/javascript"></script>
		<?php 
        }
        ?>

		<?php 
        if (getOption('cycle-slideshow_effect') == 'tileSlide' || getOption('cycle-slideshow_effect') == 'tileBlind') {
            ?>
			<script	src="<?php 
            echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
            ?>
/slideshow2/jquery.cycle2.tile.min.js" type="text/javascript"></script>
		<?php 
        }
        ?>

		<?php 
        if (getOption('cycle-slideshow_effect') == 'scrollVert') {
            ?>
			<script	src="<?php 
            echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
            ?>
/slideshow2/jquery.cycle2.scrollVert.min.js" type="text/javascript"></script>
		<?php 
        }
        ?>

		<script	src="<?php 
        echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/slideshow2/jquery.cycle2.carousel.min.js" type="text/javascript"></script>

		<!--  swipe with iOS fix -->
		<?php 
        if (getOption('cycle-slideshow_swipe')) {
            ?>
			<script	src="<?php 
            echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
            ?>
/slideshow2/jquery.cycle2.swipe.min.js" type="text/javascript"></script>
			<script	src="<?php 
            echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
            ?>
/slideshow2/ios6fix.js" type="text/javascript"></script>
		<?php 
        }
        $theme = getCurrentTheme();
        $css = SERVERPATH . '/' . THEMEFOLDER . '/' . internalToFilesystem($theme) . '/slideshow2.css';
        if (file_exists($css)) {
            $css = WEBPATH . '/' . THEMEFOLDER . '/' . $theme . '/slideshow2.css';
        } else {
            $css = WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/slideshow2/slideshow2.css';
        }
        ?>
				
		<link rel="stylesheet" type="text/css" href="<?php 
        echo $css;
        ?>
" />
		<!--[if lte IE 7]>
			<link rel="stylesheet" type="text/css" href="<?php 
        echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/slideshow2/fonts/ie7.css" />
			<script	src="<?php 
        echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
        ?>
/slideshow2/fonts/ie7.js" type="text/javascript"></script>
		<![endif]-->
		<?php 
    }
Exemplo n.º 9
0
<?php

//
//add_filter( 'registration_redirect', '__my_registration_redirect' );
//function __my_registration_redirect()
//{
//    header('Location: '.home_url( "/check-your-email" ));
//}
/*
 * Set Proper Parent/Child theme paths for inclusion
 */
@define('PARENT_DIR', get_template_directory());
@define('CHILD_DIR', get_stylesheet_directory());
@define('PARENT_URL', get_template_directory_uri());
@define('CHILD_URL', get_stylesheet_directory_uri());
@define('CURRENT_THEME', getCurrentTheme());
@define('CHERRY_VER', cherry_get_theme_version('CherryFramework'));
@define('FILE_WRITEABLE', is_writeable(PARENT_DIR . '/style.css'));
/**
 *
 * Variables array init
 *
 **/
$variablesArray = array('textColor' => '#000000', 'bodyBackground' => '#000000', 'baseFontFamily' => '#000000', 'baseFontSize' => '#000000', 'baseLineHeight' => '#000000', 'linkColor' => '#000000', 'linkColorHover' => '#000000', 'mainBackground' => '#ffffff');
/**
 *
 * JS global variables
 *
 **/
function cherry_js_global_variables()
{
Exemplo n.º 10
0
/**
 * Returns the fully qualified file name of the plugin file.
 *
 * Note: order of selection is:
 * 	1-theme folder file (if $inTheme is set)
 *  2-user plugin folder file
 *  3-zp-extensions file
 * first file found is used
 *
 * @param string $plugin is the name of the plugin file, typically something.php
 * @param bool $inTheme tells where to find the plugin.
 *   true means look in the current theme
 *   false means look in the zp-core/plugins folder.
 * @param bool $webpath return a WEBPATH rather than a SERVERPATH
 *
 * @return string
 */
function getPlugin($plugin, $inTheme = false, $webpath = false)
{
    global $_zp_themeroot;
    $pluginFile = NULL;
    if ($inTheme === true) {
        $inTheme = getCurrentTheme();
    }
    if ($inTheme) {
        $_zp_themeroot = WEBPATH . '/' . THEMEFOLDER . '/' . $inTheme;
        $pluginFile = '/' . THEMEFOLDER . '/' . internalToFilesystem($inTheme . '/' . $plugin);
        if (!file_exists(SERVERPATH . $pluginFile)) {
            $pluginFile = false;
        }
    }
    if (!$pluginFile) {
        $pluginFile = '/' . USER_PLUGIN_FOLDER . '/' . internalToFilesystem($plugin);
        if (!file_exists(SERVERPATH . $pluginFile)) {
            $pluginFile = '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/' . internalToFilesystem($plugin);
            if (!file_exists(SERVERPATH . $pluginFile)) {
                $pluginFile = false;
            }
        }
    }
    if ($pluginFile) {
        if ($webpath) {
            return WEBPATH . filesystemToInternal($pluginFile);
        } else {
            return SERVERPATH . $pluginFile;
        }
    }
    return false;
}
Exemplo n.º 11
0
/**
 * Prints a form for posting comments
 *
 * @param bool $showcomments defaults to true for showing list of comments
 * @param string $addcommenttext alternate text for "Add a comment:"
 * @param bool $addheader set true to display comment count header
 * @param string $comment_commententry_mod use to add styles, classes to the comment form div
 */
function printCommentForm($showcomments = true, $addcommenttext = NULL, $addheader = true, $comment_commententry_mod = '')
{
    global $_zp_gallery_page, $_zp_themeroot, $_zp_current_admin_obj, $_zp_current_comment;
    if (is_null($addcommenttext)) {
        $addcommenttext = '<h3>' . gettext('Add a comment:') . '</h3>';
    }
    switch ($_zp_gallery_page) {
        case 'album.php':
            if (!getOption('comment_form_albums')) {
                return;
            }
            $comments_open = OpenedForComments(ALBUM);
            $formname = '/comment_form.php';
            break;
        case 'image.php':
            if (!getOption('comment_form_images')) {
                return;
            }
            $comments_open = OpenedForComments(IMAGE);
            $formname = '/comment_form.php';
            break;
        case 'pages.php':
            if (!getOption('comment_form_pages')) {
                return;
            }
            $comments_open = zenpageOpenedForComments();
            $formname = '/comment_form.php';
            break;
        case 'news.php':
            if (!getOption('comment_form_articles')) {
                return;
            }
            $comments_open = zenpageOpenedForComments();
            $formname = '/comment_form.php';
            break;
        default:
            return;
            break;
    }
    $arraytest = '/^a:[0-9]+:{/';
    // this screws up Eclipse's brace count!!!
    ?>
<!-- printCommentForm -->
	<div id="commentcontent">
		<?php 
    $num = getCommentCount();
    if ($showcomments) {
        if ($num == 0) {
            if ($addheader) {
                echo '<h3 class="empty">' . gettext('No Comments') . '</h3>';
            }
            $display = '';
        } else {
            if ($addheader) {
                echo '<h3>' . sprintf(ngettext('%u Comment', '%u Comments', $num), $num) . '</h3>';
            }
            if (getOption('comment_form_toggle')) {
                ?>
					<script type="text/javascript">
						// <!-- <![CDATA[
						function toggleComments(hide) {
							if (hide) {
								$('div.comment').hide();
								$('#comment_toggle').html('<button type="button" onclick="javascript:toggleComments(false);"><?php 
                echo gettext('show comments');
                ?>
</button>');
							} else {
								$('div.comment').show();
								$('#comment_toggle').html('<button type="button" onclick="javascript:toggleComments(true);"><?php 
                echo gettext('hide comments');
                ?>
</button>');
							}
						}
						$(document).ready(function() {
							toggleComments(true);
						});
						// ]]> -->
					</script>
					<?php 
                $display = ' style="display:none"';
            } else {
                $display = '';
            }
        }
        ?>
		<div id="comments">
			<div id="comment_toggle"><!-- place holder for toggle button --></div>
			<?php 
        while (next_comment()) {
            if (!getOption('comment_form_showURL')) {
                $_zp_current_comment['website'] = '';
            }
            ?>
				<div class="comment" <?php 
            echo $display;
            ?>
>
					<a name="c_<?php 
            echo $_zp_current_comment['id'];
            ?>
"></a>
					<div class="commentinfo">
						<h4><?php 
            printCommentAuthorLink();
            ?>
: on <?php 
            echo getCommentDateTime();
            printEditCommentLink('Edit', ', ', '');
            ?>
</h4>
					</div><!-- class "commentinfo" -->
					<div class="commenttext"><?php 
            echo getCommentBody();
            ?>
</div><!-- class "commenttext" -->
				</div><!-- class "comment" -->
				<?php 
        }
        ?>
		</div><!-- id "comments" -->
		<?php 
    }
    ?>
		<!-- Comment Box -->
		<?php 
    if ($comments_open) {
        $stored = array_merge(getCommentStored(), array('street' => '', 'city' => '', 'state' => '', 'country' => '', 'postal' => ''));
        $raw = $stored['custom'];
        if (preg_match($arraytest, $raw)) {
            $custom = unserialize($raw);
            foreach ($custom as $key => $value) {
                if (!empty($value)) {
                    $stored[$key] = $value;
                }
            }
        }
        $disabled = array('name' => '', 'website' => '', 'anon' => '', 'private' => '', 'comment' => '', 'street' => '', 'city' => '', 'state' => '', 'country' => '', 'postal' => '');
        foreach ($stored as $key => $value) {
            $disabled[$key] = false;
        }
        if (zp_loggedin()) {
            $raw = $_zp_current_admin_obj->getCustomData();
            if (preg_match($arraytest, $raw)) {
                $address = unserialize($raw);
                foreach ($address as $key => $value) {
                    if (!empty($value)) {
                        $disabled[$key] = true;
                        $stored[$key] = $value;
                    }
                }
            }
            $name = $_zp_current_admin_obj->getName();
            if (!empty($name)) {
                $stored['name'] = $name;
                $disabled['name'] = ' disabled="disabled"';
            } else {
                $user = $_zp_current_admin_obj->getUser();
                if (!empty($user)) {
                    $stored['name'] = $user;
                    $disabled['name'] = ' disabled="disabled"';
                }
            }
            $email = $_zp_current_admin_obj->getEmail();
            if (!empty($email)) {
                $stored['email'] = $email;
                $disabled['email'] = ' disabled="disabled"';
            }
            if (!empty($address['website'])) {
                $stored['website'] = $address['website'];
                $disabled['website'] = ' disabled="disabled"';
            }
        }
        $data = zp_apply_filter('comment_form_data', array('data' => $stored, 'disabled' => $disabled));
        $disabled = $data['disabled'];
        $stored = $data['data'];
        if (MEMBERS_ONLY_COMMENTS && !zp_loggedin(POST_COMMENT_RIGHTS)) {
            echo gettext('Only registered users may post comments.');
        } else {
            if (!empty($addcommenttext)) {
                echo $addcommenttext;
            }
            ?>
				<div id="commententry" <?php 
            echo $comment_commententry_mod;
            ?>
>
				<?php 
            $theme = getCurrentTheme();
            $form = getPlugin('comment_form' . $formname, $theme);
            require $form;
            ?>
				</div><!-- id="commententry" -->
				<?php 
        }
    } else {
        ?>
			<div id="commententry">
				<h3><?php 
        echo gettext('Closed for comments.');
        ?>
</h3>
			</div><!-- id="commententry" -->
			<?php 
    }
    ?>
		</div><!-- id="commentcontent" -->
	<?php 
    if (getOption('comment_form_rss')) {
        ?>
	<br clear="all" />
	<?php 
        switch ($_zp_gallery_page) {
            case "image.php":
                printRSSLink("Comments-image", "", gettext("Subscribe to comments"), "");
                break;
            case "album.php":
                printRSSLink("Comments-album", "", gettext("Subscribe to comments"), "");
                break;
            case "news.php":
                printZenpageRSSLink("Comments-news", "", "", gettext("Subscribe to comments"), "");
                break;
            case "pages.php":
                printZenpageRSSLink("Comments-page", "", "", gettext("Subscribe to comments"), "");
                break;
        }
    }
    ?>
<!-- end printCommentForm -->
<?php 
}
Exemplo n.º 12
0
 /**
  * Render an error page.
  *
  * @param  \Exception $e
  * @return \Illuminate\Http\Response
  */
 protected function renderErrorPage(Exception $e)
 {
     $objTheme = Theme::uses(getCurrentTheme())->layout('1-column');
     $code = method_exists($e, 'getStatusCode') ? $e->getStatusCode() : 500;
     if (config('app.debug') === true) {
         $message = $e->getMessage() . ':' . $e->getLine();
     } else {
         $message = 'Whoops, looks like something went wrong.';
     }
     return $objTheme->scope('partials.theme.errors.' . ($code === 500 ? 'whoops' : $code), compact('code', 'message'))->render($code ?: 500);
 }