コード例 #1
0
ファイル: page.php プロジェクト: robehickman/Scripts
    function catch_all()
    {
        if(!isset($this->params[1]))
            throw new e_404("No page sepecified");

        $m_page = instance_model('page');
        $page = $m_page->get_page_by_clean_title($this->params[1]);

        if($page == array())
            throw new e_404("Page not found");

        $view = instance_view('page/template');
        $view = $view->parse_to_variable(array(
            'page' => $page
        ));

        $this->set_template_paramiters(array(
            'content' => $view,
            'title' => $page[0]['Title'],
            'description' => strip_content($page[0]['Content'])
        ));
    }
コード例 #2
0
ファイル: category.php プロジェクト: robehickman/Scripts
        <?php
            if($item['Image'] != '')
                $image = '/res/profiles/' . hen($item['Image']);
            else 
                $image = '/res/static/no_profile.jpg';
        ?>

        <a href='<?php echo  $url ?>'>
            <img src="<?php print $image ?>" 
                alt="<?php print hen($item['Title']) ?>'s profile image" 
                class="cat_profile_image" />
        </a>

        <p class="block_content">
            <?php print strip_content($item['Content']);  ?>
            <a href='<?php echo  $url ?>'> Read More &gt;&gt;</a>
        </p>

        <?php if(count($item['Gallery']) > 0): ?>
        <div class="category_grid">
        <?php foreach($item['Gallery'] as $image): ?>
            <div class="category_box">
                <a href='<?php echo  $url ?>'>
                <img src="<?php echo make_url('res', 'gallery', $item['Clean_title'], 'thumbs', $image['File']) ?>" alt="<?php hen($image['File']) ?>" />
                </a>
            </div>
        <?php endforeach; ?>
        </div>
        <?php endif; ?>
    </div>
コード例 #3
0
/**
 * Get Page Meta Description
 *
 * @since 2.0
 * @uses $metad
 * @uses strip_decode
 *
 * @param bool $echo Optional, default is true. False will 'return' value
 * @return string Echos or returns based on param $echo
 */
function get_page_meta_desc($echo = true)
{
    $metad = getPageGlobal('metad');
    $desc = '';
    if ($metad != '') {
        $desc = encode_quotes(strip_decode($metad));
    } else {
        if (getDef('GSAUTOMETAD', true)) {
            // use content excerpt, NOT filtered
            $desc = strip_decode($content);
            if (getDef('GSCONTENTSTRIP', true)) {
                $desc = strip_content($desc);
            }
            $desc = cleanHtml($desc, array('style', 'script'));
            // remove unwanted elements that strip_tags fails to remove
            $desc = getExcerpt($desc, 160);
            // grab 160 chars
            $desc = strip_whitespace($desc);
            // remove newlines, tab chars
            $desc = encode_quotes($desc);
            $desc = trim($desc);
        }
    }
    $str = exec_filter('metad', $desc);
    // @filter metad (str) meta description in get_page_meta_desc
    return echoReturn($str, $echo);
}
コード例 #4
0
/**
 * Get Page Header HTML
 *
 * This will return header html for a particular page. This will include the 
 * meta desriptions & keywords, canonical and title tags
 *
 * @since 1.0
 * @uses exec_action
 * @uses get_page_url
 * @uses strip_quotes
 * @uses get_page_meta_desc
 * @uses get_page_meta_keywords
 * @uses $metad
 * @uses $title
 * @uses $content
 * @uses $site_full_name from configuration.php
 * @uses GSADMININCPATH
 *
 * @return string HTML for template header
 */
function get_header($full = true)
{
    global $metad;
    global $title;
    global $content;
    include GSADMININCPATH . 'configuration.php';
    // meta description
    if ($metad != '') {
        $desc = get_page_meta_desc(FALSE);
    } else {
        if (getDef('GSAUTOMETAD', true)) {
            // use content excerpt, NOT filtered
            $desc = strip_decode($content);
            if (getDef('GSCONTENTSTRIP', true)) {
                $desc = strip_content($desc);
            }
            $desc = cleanHtml($desc, array('style', 'script'));
            // remove unwanted elements that strip_tags fails to remove
            $desc = getExcerpt($desc, 160);
            // grab 160 chars
            $desc = strip_whitespace($desc);
            // remove newlines, tab chars
            $desc = encode_quotes($desc);
            $desc = trim($desc);
        }
    }
    if (!empty($desc)) {
        echo '<meta name="description" content="' . $desc . '" />' . "\n";
    }
    // meta keywords
    $keywords = get_page_meta_keywords(FALSE);
    if ($keywords != '') {
        echo '<meta name="keywords" content="' . $keywords . '" />' . "\n";
    }
    if ($full) {
        echo '<link rel="canonical" href="' . get_page_url(true) . '" />' . "\n";
    }
    // script queue
    get_scripts_frontend();
    exec_action('theme-header');
}
コード例 #5
0
ファイル: members.php プロジェクト: robehickman/Scripts
    function member()
    {
        if(!isset($this->params[2]))
            throw new e_404("No member sepecified");

        $m_members = instance_model('members');
        $member = $m_members->get_by_clean_title($this->params[2]);

        if($member == array())
            throw new e_404('Member does not exist');

    // Get gallery images
        $m_set     = instance_model('gallery_set');
        $m_gallery = instance_model('gallery');

        $set = $m_set->get_by_user($member[0]['ID']);

        $user_gallery = array();
        if($set != array())
            foreach($set as $row)
                $user_gallery = array_merge($user_gallery, $m_gallery->get_in_set($row['ID'])); 

        $view = instance_view('members/member');
        $view = $view->parse_to_variable(array(
            'member' => $member,
            'gallery' => $user_gallery
        ));

        $this->set_template_paramiters(array(
            'content' => $view,
            'title' => $member[0]['Title'],
            'description' => strip_content($member[0]['Content'])
        ));
    }