Пример #1
0
            if (in_array($post->ID, $GLOBALS['wp_posts_listed'])) {
                continue;
            } else {
                $GLOBALS['wp_posts_listed'][] = $post->ID;
            }
        }
        /**
         * In this template we are only doing posts list
         * for posts list we will to pre-load the post template so get the template
         * inside a string to pass it to the component building functions
         */
        $contents = null;
        if (WiziappConfig::getInstance()->usePostsPreloading()) {
            $GLOBALS['WiziappLog']->write('info', "Preloading the posts", "themes.default.index");
            ob_start();
            include '_content.php';
            $contents = ob_get_contents();
            // Inject the doLoad method to avoid timing issues when getting the post in this bundle
            $contents = str_replace('</body>', $injectLoadedScript . '</body>', $contents);
            ob_end_clean();
        }
        wiziapp_appendComponentByLayout($cPage, $wiziapp_block, $post->ID, $contents);
    }
    ob_end_clean();
    // End capturing output from loop events
    // In case something in the template changed, add the modified date to the etag
    $GLOBALS['WiziappEtagOverride'] .= date("F d Y H:i:s.", filemtime(dirname(__FILE__) . '/_content.php'));
    $GLOBALS['WiziappEtagOverride'] .= date("F d Y H:i:s.", filemtime(dirname(__FILE__) . '/index.php'));
} else {
    $GLOBALS['WiziappLog']->write('error', "No posts???", "themes.default.index");
}
Пример #2
0
/**
* @todo Add paging support here
* 
*/
function wiziapp_buildGalleryPluginPage($plugin, $item_id)
{
    $GLOBALS['WiziappLog']->write('info', "Got a request for a gallery from {$plugin} item is: {$item_id}", "screens.wiziapp_buildGalleryPluginPage");
    $images = array();
    // Check if we support this plugin
    $plugin = strtolower($plugin);
    $images = apply_filters("wiziapp_get_{$plugin}_album", $images, $item_id);
    $screen_conf = $GLOBALS['WiziappScreens']->getScreenLayout('images');
    $page = array();
    foreach ($images as $image) {
        wiziapp_appendComponentByLayout($page, $screen_conf['items'], $image, true);
    }
    $title = __('Gallery', 'wiziapp');
    $screen = wiziapp_prepareScreen($page, $title, 'gallery');
    $screen['screen']['default'] = 'grid';
    $screen['screen']['sub_type'] = 'image';
    echo json_encode($screen);
}