Esempio n. 1
0
File: index.php Progetto: rair/yacs
// news
$context['components']['news'] = $text;
// list extra boxes
$text = '';
if ($anchor = Sections::lookup('extra_boxes')) {
    // the maximum number of boxes is a global parameter
    if (!isset($context['site_extra_maximum']) || !$context['site_extra_maximum']) {
        $context['site_extra_maximum'] = 7;
    }
    // articles to be displayed as extra boxes
    if ($items =& Articles::list_for_anchor_by('publication', $anchor, 0, $context['site_extra_maximum'], 'boxes')) {
        foreach ($items as $title => $attributes) {
            $text .= Skin::build_box($title, $attributes['content'], 'boxes', $attributes['id']) . "\n";
        }
    }
}
// boxes
$context['components']['boxes'] = $text;
// referrals, if any
if (Surfer::is_associate() || isset($context['with_referrals']) && $context['with_referrals'] == 'Y') {
    $context['components']['referrals'] =& Skin::build_referrals('index.php');
}
//
// compute navigation information -- $context['navigation']
//
// a meta link to a feeding page
$context['page_header'] .= "\n" . '<link rel="alternate" href="' . $context['url_to_root'] . Feeds::get_url('rss') . '" title="RSS" type="application/rss+xml" />';
// a meta link to our blogging interface
$context['page_header'] .= "\n" . '<link rel="EditURI" href="' . $context['url_to_home'] . $context['url_to_root'] . 'services/describe.php" title="RSD" type="application/rsd+xml" />';
// render the skin
render_skin();
Esempio n. 2
0
File: index.php Progetto: rair/yacs
        // cache this to speed subsequent queries
        Cache::put($cache_id, $text, 'files');
    }
    $context['text'] .= $text;
}
// page tools
if (Surfer::is_member()) {
    $context['page_tools'][] = Skin::build_link('files/review.php', i18n::s('Review files'), 'basic');
}
if (Surfer::is_associate()) {
    $context['page_tools'][] = Skin::build_link('files/configure.php', i18n::s('Configure'), 'basic');
    $context['page_tools'][] = Skin::build_link('files/check.php', i18n::s('Maintenance'), 'basic');
}
// get news from rss
$title = i18n::s('Podcast');
$label = sprintf(i18n::s('You can list new public files through RSS by going %s'), Skin::build_link(Feeds::get_url('files'), 'here', 'xml'));
$context['components']['channels'] = Skin::build_box($title, $label, 'channels');
// page extra content
$cache_id = 'files/index.php#extra';
if (!($text = Cache::get($cache_id))) {
    // side bar with the list of most popular files
    if ($items = Files::list_by_hits(0, COMPACT_LIST_SIZE, 'compact')) {
        $text .= Skin::build_box(i18n::s('Popular'), Skin::build_list($items, 'compact'), 'boxes');
    }
    // side boxes for related categories, if any
    if ($categories = Categories::list_by_date_for_display('file:index', 0, 7, 'raw')) {
        foreach ($categories as $id => $attributes) {
            // link to the category page from the box title
            $label =& Skin::build_box_title(Skin::strip($attributes['title']), Categories::get_permalink($attributes), i18n::s('View the category'));
            // box content
            if ($items =& Members::list_articles_by_date_for_anchor('category:' . $id, 0, COMPACT_LIST_SIZE, 'compact')) {
Esempio n. 3
0
File: index.php Progetto: rair/yacs
    // cache, whatever change, for 5 minutes
    Cache::put($cache_id, $text, 'stable', 300);
}
$context['text'] .= $text;
//
// extra panel
//
// page tools
if (Surfer::is_associate()) {
    $context['page_tools'][] = Skin::build_link('feeds/configure.php', i18n::s('Configure'), 'basic');
}
// an extra box with popular standard icons for newsfeeds
$text = '';
Skin::define_img('FEEDS_OPML_IMG', 'feeds/opml.png');
$text .= Skin::build_link(Feeds::get_url('opml'), FEEDS_OPML_IMG, '') . BR;
Skin::define_img('FEEDS_ATOM_IMG', 'feeds/atom.png');
$text .= Skin::build_link(Feeds::get_url('atom'), FEEDS_ATOM_IMG, '') . BR;
Skin::define_img('FEEDS_RSS_IMG', 'feeds/rss_2.0.png');
$text .= Skin::build_link(Feeds::get_url('rss'), FEEDS_RSS_IMG, '') . BR;
Skin::define_img('FEEDS_RDF_IMG', 'feeds/rss_1.0.png');
$text .= Skin::build_link(Feeds::get_url('rdf'), FEEDS_RDF_IMG, '') . BR;
$context['components']['channels'] = Skin::build_box(i18n::s('Pick a feed'), '<p>' . $text . '</p>', 'channels');
// public aggregrators
if (!isset($context['without_internet_visibility']) || $context['without_internet_visibility'] != 'Y') {
    $link = $context['url_to_home'] . $context['url_to_root'] . Feeds::get_url('rss');
    $context['components']['channels'] .= Skin::build_box(i18n::s('Aggregate this site'), '<p>' . join(BR, Skin::build_subscribers($link)) . '</p>', 'channels');
}
// referrals, if any
$context['components']['referrals'] = Skin::build_referrals('feeds/index.php');
// render the skin
render_skin();
Esempio n. 4
0
 // the preamble
 $text = '<?xml version="1.0" encoding="' . $context['charset'] . '"?>' . "\n" . '<opml version="2.0">' . "\n";
 // the head
 $text .= '<head>' . "\n";
 // the title
 $text .= '	<title>' . encode_field(strip_tags($context['channel_title'])) . "</title>\n";
 // the body
 $text .= '</head>' . "\n" . '<body>' . "\n";
 // the main rss feed of this site
 $text .= '	<outline type="rss" text="' . encode_field($context['channel_title']) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Feeds::get_url('rss') . '"' . " />\n";
 // full articles
 $text .= '	<outline type="rss" text="' . encode_field(i18n::c('Pages with full content') . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Feeds::get_url('articles') . '"' . " />\n";
 // newest comments
 $text .= '	<outline type="rss" text="' . encode_field(i18n::c('Comments') . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Feeds::get_url('comments') . '"' . " />\n";
 // the file rss feed for podcasting, etc.
 $text .= '	<outline type="rss" text="' . encode_field(i18n::c('Files and podcasts') . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Feeds::get_url('files') . '"' . " />\n";
 // one feed per section
 if ($items = Sections::list_by_title_for_anchor(NULL, 0, COMPACT_LIST_SIZE, 'raw')) {
     foreach ($items as $id => $attributes) {
         $text .= '	<outline type="rss" text="' . encode_field(strip_tags($attributes['title']) . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Sections::get_url($id, 'feed') . '"' . " />\n";
     }
 }
 // one feed per category
 if ($items = Categories::list_by_date(0, COMPACT_LIST_SIZE, 'raw')) {
     foreach ($items as $id => $attributes) {
         $text .= '	<outline type="rss" text="' . encode_field(strip_tags($attributes['title']) . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Categories::get_url($id, 'feed') . '"' . " />\n";
     }
 }
 // one feed per user
 if ($items = Users::list_by_posts(0, COMPACT_LIST_SIZE, 'raw')) {
     foreach ($items as $id => $attributes) {