// stop here on scripts/validate.php if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'HEAD') { return; } $text = ''; // insert anchor prefix if ($canvas['anchor_prefix']) { $text .= $canvas['anchor_prefix']; } // display very few things if we are on a follow-up page (comments, files, etc.) if ($zoom_type) { $text .= $canvas['introduction']; } else { // buttons to display previous and next pages, if any if ($canvas['neighbours']) { $text .= Skin::neighbours($neighbours, 'manual'); } // only at the first page if ($page == 1) { // the owner profile, if any, at the beginning of the first page if ($canvas['owner_profile_prefix']) { $text .= $canvas['owner_profile_prefix']; } // article rating if ($canvas['rating']) { $text .= $canvas['rating']; } } // the introduction text, if any $text .= $canvas['introduction']; // text related to the overlay
$canvas['links_count'] = $count; } // // trailer information // // add trailer information from the overlay, if any if (is_object($overlay)) { $canvas['trailer'] .= $overlay->get_text('trailer', $item); } // add trailer information from this item, if any if (isset($item['trailer']) && trim($item['trailer'])) { $canvas['trailer'] .= Codes::beautify($item['trailer']); } // buttons to display previous and next pages, if any if ($neighbours) { $canvas['trailer'] .= Skin::neighbours($neighbours, 'manual'); } // insert anchor suffix if (is_object($anchor)) { $canvas['trailer'] .= $anchor->get_suffix(); } // reflect content canvas from anchor if (!isset($item['canvas']) && is_object($anchor)) { $item['canvas'] = $anchor->get_articles_canvas(); } // reflect content canvas from anchor if (empty($item['canvas'])) { $item['canvas'] = 'standard'; } elseif (!Safe::file('../canvas/' . $item['canvas'] . '.php')) { $item['canvas'] = 'standard'; }
} // display in a separate panel if ($users) { $label = i18n::s('Persons'); if ($users_count) { $label .= ' (' . $users_count . ')'; } $panels[] = array('users', $label, 'users_panel', $users); } // // assemble all tabs // $context['text'] .= Skin::build_tabs($panels); // buttons to display previous and next pages, if any if (isset($neighbours) && $neighbours) { $context['text'] .= Skin::neighbours($neighbours, 'manual'); } // // the extra panel -- most content is cached, except commands specific to current surfer // // page tools // // commands to add pages if (Articles::allow_creation($item, $anchor)) { Skin::define_img('ARTICLES_ADD_IMG', 'articles/add.gif'); $url = 'articles/edit.php?anchor=' . urlencode('section:' . $item['id']); if (is_object($content_overlay) && ($label = $content_overlay->get_label('new_command', 'articles'))) { } else { $label = i18n::s('Add a page'); } $context['page_tools'][] = Skin::build_link($url, ARTICLES_ADD_IMG . $label, 'basic', i18n::s('Add new content to this section'));
} $context['text'] .= Skin::finalize_list($links, 'assistant_bar'); // page help $help = ''; // information to members if (Surfer::is_member()) { $help .= '<p>' . sprintf(i18n::s('This has been posted by %s %s.'), Users::get_link($item['edit_name'], $item['edit_address'], $item['edit_id']), Skin::build_date($item['edit_date'])) . "</p>\n"; } $help .= '<p><ins>' . i18n::s('Text inserted since that version.') . '</ins></p>' . '<p><del>' . i18n::s('Text suppressed from this version.') . '</del></p>' . '<p>' . i18n::s('Caution: restoration can not be reversed!') . '</p>'; $context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help'); // // the navigation sidebar // $text = ''; // buttons to display previous and next pages, if any if (is_object($anchor)) { $neighbours = $anchor->get_neighbours('version', $item); $text .= Skin::neighbours($neighbours, 'sidebar'); } // build a nice sidebar box if ($text) { $text =& Skin::build_box(i18n::s('Navigation'), $text, 'neighbours', 'neighbours'); } $context['components']['neighbours'] = $text; // // referrals, if any, in a sidebar // $context['components']['referrals'] =& Skin::build_referrals(Versions::get_url($item['id'])); } // render the skin render_skin();
// draw one day if ($items = Dates::list_for_day($year, $month, $day, 'decorated')) { $text .= Skin::build_list($items, 'decorated'); } else { $text .= '<p>' . i18n::s('Nothing has been recorded for this date.') . '</p>'; } // robots cannot navigate if (!Surfer::is_crawler()) { // previous day $previous = gmstrftime('%Y/%m/%d', gmmktime(0, 0, 0, $month, $day - 1, $year)); // next day $next = gmstrftime('%Y/%m/%d', gmmktime(0, 0, 0, $month, $day + 1, $year)); // neighbours $neighbours = array(Dates::get_url($previous, 'day'), Skin::build_date($previous, 'standalone'), Dates::get_url($next, 'day'), Skin::build_date($next, 'standalone'), Dates::get_url($year . '/' . $month, 'month'), Dates::get_month_label($year . '/' . $month)); // links to display previous and next days $text .= Skin::neighbours($neighbours, 'slideshow'); } // cache, whatever change, for 1 minute Cache::put($cache_id, $text, 'stable', 60); } // in the main panel $context['text'] .= $text; } } // side bar with the list of most recent pages $cache_id = 'dates/day.php#extra'; if (!($text = Cache::get($cache_id))) { if ($items =& Articles::list_by('publication', 0, COMPACT_LIST_SIZE, 'compact')) { $text =& Skin::build_box(i18n::s('Recent pages'), Skin::build_list($items, 'compact'), 'boxes'); } Cache::put($cache_id, $text, 'articles');
$context['text'] .= $anchor->get_prefix(); } // retrieve slideshow links if we have an anchor if (is_object($anchor)) { // retrieve information from cache, if any $cache_id = 'images/view.php?id=' . $item['id'] . '#navigation'; if ($data = Cache::get($cache_id)) { $data = Safe::unserialize($data); } else { $data = $anchor->get_neighbours('image', $item); // save in cache $text = serialize($data); Cache::put($cache_id, $text, 'images'); } // links to display previous and next pages, if any $context['text'] .= Skin::neighbours($data, 'slideshow'); // a meta link to prefetch the next page if (isset($data[2]) && $data[2]) { $context['page_header'] .= "\n" . '<link rel="next" href="' . $context['url_to_root'] . $data[2] . '" title="' . encode_field($data[3]) . '" />'; } } // image description $context['text'] .= Skin::build_block($item['description'], 'description'); // build the path to the image file $url = $context['url_to_root'] . Files::get_path($item['anchor'], 'images') . '/' . $item['image_name']; $img = '<img src="' . $url . '" alt="" title="' . $item['image_name'] . '" />'; // add an url, if any if ($item['link_url']) { // transform local references, if any $attributes = Links::transform_reference($item['link_url']); if ($attributes[0]) {
// a sidebar $sidebar =& Skin::build_box(i18n::s('sidebar box'), DUMMY_TEXT, 'sidebar'); // $context['text'] - section with sidebar box $text .= Skin::build_box(i18n::s('with a sidebar box'), $sidebar . '<p>' . DUMMY_TEXT . '</p><p>' . DUMMY_TEXT . '</p>'); // a folded box $folder =& Skin::build_box(i18n::s('folded box'), DUMMY_TEXT, 'folded'); // $context['text'] - section with folded box $text .= Skin::build_box(i18n::s('with a folded box'), DUMMY_TEXT . $folder . DUMMY_TEXT); // a menu bar $menu_bar = array('skins/test.php' => i18n::s('Test page'), 'skins/' => i18n::s('Themes'), 'scripts/' => i18n::s('Server software')); // $context['text'] - section with a menu bar $text .= Skin::build_box(i18n::s('with a menu bar'), DUMMY_TEXT . Skin::build_list($menu_bar, 'menu_bar') . DUMMY_TEXT); // page neighbours $neighbours = array('#previous', i18n::s('Previous'), '#next', i18n::s('Next'), '', '<a class="pager-item">1</a> <a class="pager-current">2</a>'); // $context['text'] - section with neighbours $text .= Skin::build_box(i18n::s('with neighbours'), DUMMY_TEXT . Skin::neighbours($neighbours, 'slideshow')); // user profile at page bottom $user = array(); $user['id'] = $user_id; $user['nick_name'] = 'Geek101'; $user['introduction'] = DUMMY_TEXT; $text .= Skin::build_profile($user, 'suffix'); // finalize this panel $panels[] = array('b', i18n::s('Text'), 'b_panel', Codes::beautify($text)); // gadgets panel // $text = DUMMY_TEXT; // $context['text'] - with gadgets -- see index.php and sections/view.php $text .= "\n" . '<p id="gadgets_prefix"> </p>' . "\n" . Skin::build_box(i18n::s('gadget') . ' 1', DUMMY_TEXT, 'gadget') . Skin::build_box(i18n::s('gadget') . ' 2', DUMMY_TEXT, 'gadget') . Skin::build_box(i18n::s('gadget') . ' 3', DUMMY_TEXT, 'gadget') . Skin::build_box(i18n::s('gadget') . ' 4', DUMMY_TEXT, 'gadget') . Skin::build_box(i18n::s('gadget') . ' 5', DUMMY_TEXT, 'gadget') . Skin::build_box(i18n::s('gadget') . ' 6', DUMMY_TEXT, 'gadget') . '<p id="gadgets_suffix"> </p>' . "\n"; // finalize this panel $panels[] = array('g', i18n::s('Gadgets'), 'g_panel', Codes::beautify($text));
} // display links if ($box['text']) { $article .= Skin::build_content('links', i18n::s('Links'), $box['text'], $box['bar']); } // add trailer information from the overlay, if any if (is_object($overlay)) { $article .= $overlay->get_text('trailer', $item); } // add trailer information from this item, if any if (isset($item['trailer']) && trim($item['trailer'])) { $article .= Codes::beautify($item['trailer']); } // links to previous and next pages, if any if (isset($neighbours) && $neighbours) { $article .= Skin::neighbours($neighbours, 'manual'); } // insert anchor suffix if (is_object($anchor)) { $article .= $anchor->get_suffix(); } // display in a separate panel if ($article) { $panels[] = array('article', i18n::s('Article'), 'article_panel', $article); } // // append tabs from the overlay, if any -- they have been captured in articles/view.php // if (isset($context['tabs']) && is_array($context['tabs'])) { $panels = array_merge($panels, $context['tabs']); }