function renderNav($items) { foreach ($items as $item) { if (val('type', $item) == 'group') { $heading = val('text', $item); if (!$heading) { $item['cssClass'] .= ' nav-group-noheading'; } ?> <div type="group" class="nav-group <?php echo val('cssClass', $item); ?> "> <?php if ($heading) { echo '<h3>' . val('text', $item) . '</h3>'; } if (val('items', $item)) { renderNav(val('items', $item)); } echo '</div>'; } if (val('type', $item) == 'link') { ?> <a role="menuitem" class="nav-link <?php echo val('cssClass', $item); ?> " tabindex="-1" href="<?php echo url(val('url', $item)); ?> "> <?php if (val('badge', $item)) { echo '<span class="Aside"><span class="Count">' . val('badge', $item) . '</span></span>'; } ?> <?php if (val('icon', $item)) { echo icon(val('icon', $item)); } ?> <?php echo '<span class="text">' . val('text', $item) . '</span>'; ?> </a> <?php } if (val('type', $item) == 'dropdown') { echo val('dropdownmenu', $item); } if (val('type', $item) == 'divider') { echo '<hr/>'; } } }
function renderNav($links) { global $file; $html = ''; foreach ($links as $link) { $title = $link['title']; if ($link['file'] == $file) { $title = '<strong>' . $title . '</strong>'; } $html .= '<li><a href="' . basename(__FILE__) . '?file=' . $link['file'] . '">' . $title . '</a>'; if (isset($link['children']) === true && count($link['children']) > 0) { $html .= '<ul>' . renderNav($link['children']) . '</ul>'; } $html .= '</li>'; } return $html; }
/** * Given a group of pages, render a <ul> navigation * * This is here to demonstrate an example of a shared function and usage is completely optional. * * @param array|PageArray $items * @param int $maxDepth How many levels of navigation below current should it go? * @param string $fieldNames Any extra field names to display (separate multiple fields with a space) * @param string $class CSS class name for containing <ul> * @return string * */ function renderNav($items, $maxDepth = 0, $fieldNames = '', $class = 'nav') { // if we were given a single Page rather than a group of them, we'll pretend they // gave us a group of them (a group/array of 1) if ($items instanceof Page) { $items = array($items); } // $out is where we store the markup we are creating in this function $out = ''; // cycle through all the items foreach ($items as $item) { // markup for the list item... // if current item is the same as the page being viewed, add a "current" class to it $out .= $item->id == wire('page')->id ? "<li class='current'><i class='fa fa-angle-double-right'></i> " : "<li><i class='fa fa-angle-right'></i> "; // markup for the link $out .= "<a href='{$item->url}'>{$item->title}</a>"; // if there are extra field names specified, render markup for each one in a <div> // having a class name the same as the field name if ($fieldNames) { foreach (explode(' ', $fieldNames) as $fieldName) { $value = $item->get($fieldName); if ($value) { $out .= " <div class='{$fieldName}'>{$value}</div>"; } } } // if the item has children and we're allowed to output tree navigation (maxDepth) // then call this same function again for the item's children if ($item->hasChildren() && $maxDepth) { if ($class == 'nav') { $class = 'nav nav-tree'; } $out .= renderNav($item->children, $maxDepth - 1, $fieldNames, $class); } // close the list item $out .= "</li>"; } // if output was generated above, wrap it in a <ul> if ($out) { $out = "<ul class='{$class}'>{$out}</ul>"; } // return the markup we generated above return $out; }
<?php /** * Home template * */ include_once "./blog.inc"; $categories = $pages->get('/categories/'); $content = $page->body . renderPosts("limit={$page->quantity}"); $subnav = renderNav($categories->title, $categories->children); include "./main.inc";
<?php /** * Category template * */ include_once "./blog.inc"; $posts = $pages->find("template=post, categories={$page}, limit=10"); if ($input->urlSegment1) { // rss feed if ($input->urlSegment1 != 'rss') { throw new Wire404Exception(); } renderRSS($posts); return; } $n = $posts->getTotal(); $headline = $page->title; $content = $page->body . renderPosts($posts, true); $subnav = renderNav($page->parent->title, $page->siblings, $page); include "./main.inc";
/** * Given a group of pages, render a <ul> navigation * * @param array|PageArray $items * @param int $depth How many levels of navigation below current should it go? * @param string $fieldNames Any extra field names to display (separate multiple fields with a space) * @return string * */ function renderNav($items, $maxDepth = 0, $fieldNames = '') { // if we were given a single Page rather than a group of them, we'll pretend they // gave us a group of them (a group/array of 1) if ($items instanceof Page) { $items = array($items); } $out = ''; foreach ($items as $item) { // if current item is the same as the page being viewed, add a "current" class to it $out .= $item->id == wire('page')->id ? "<li class='current'>" : "<li>"; $out .= "<a href='{$item->url}'>{$item->title}</a>"; // if there are extra field names specified, render markup for each one in a <div> // having a class name the same as the field name if ($fieldNames) { foreach (explode(' ', $fieldNames) as $fieldName) { $value = $item->get($fieldName); if ($value) { $out .= " <div class='{$fieldName}'>{$value}</div>"; } } } // if the item has children and we're allowed to output tree navigation (maxDepth) // then call this same function again for the item's children if ($item->hasChildren() && $maxDepth) { $out .= renderNav($item->children, $maxDepth - 1, $fieldNames); } $out .= "</li>"; } if ($out) { $out = "<ul>{$out}</ul>"; } return $out; }
include INFUSIONS . "fusionboard4/includes/func.php"; if (file_exists(INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php")) { include INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php"; } else { include INFUSIONS . "fusionboard4/locale/English.php"; } if (!iMEMBER) { redirect(FORUM); } define("USER_CP", TRUE); /* User CP Navigation Styling */ echo "<style type='text/css'>\n.navtitle { font-size:13px;font-weight:bold; padding:5px; }\n.navsection { font-weight:bold; }\n.bold { font-weight:bold; }\n.fields { text-align:left; width:440px; border: 1px; border-style:solid; border-color:#ccc; padding:8px; margin:5px; }\n.users { padding:6px; border:1px solid #ccc; width:230px; height:70px; }\n</style>\n"; $_GET['section'] = isset($_GET['section']) ? stripinput($_GET['section']) : "intro"; $section = isset($_GET['section']) ? stripinput($_GET['section']) : "intro"; opentable($locale['fb922']); renderNav(false, false, array(INFUSIONS . "fusionboard4/usercp.php", $locale['fb922'])); add_to_title(" :: " . $locale['fb922']); if (isset($_COOKIE["fusion_box_usercp"])) { if ($_COOKIE["fusion_box_usercp"] == "none") { $state = "off"; } else { $state = "on"; } } else { $state = "on"; } echo "<img src='" . get_image("panel_" . ($state == "on" ? "off" : "on")) . "' id='b_usercp' class='panelbutton' alt='' onclick=\"javascript:flipBox('usercp')\" />"; echo "<table width='100%' cellspacing='0' cellpadding='5' border='0'>\n"; echo "<tr>\n<td style='width:200px;vertical-align:top;" . ($state == "off" ? "display:none" : "") . "'id='box_usercp'>\n"; /* User CP Navigation Start */ echo "<table width='100%' cellspacing='1' cellpadding='0' class='tbl-border'>\n";
$sidebar = str_replace("[no-sidebar]", "", $sidebar); } else { $sidebar = "<p>[account]</p><p>[controls]</p><p>[nav]</p>" . $page->sidebar; } $precontent = null; // We refer to our homepage a few times in our site, so we preload a copy // here in a $homepage variable for convenience. $homepage = $pages->get('/'); // Include shared functions (if any) include_once "./_func.php"; if (strpos($sidebar, "[controls]") !== false) { $sidebar = str_replace("[controls]", renderModulesControls(), $sidebar); } if (strpos($sidebar, "[account]") !== false) { $sidebar = str_replace("[account]", renderAccount(), $sidebar); } if (strpos($sidebar, "[nav]") !== false) { // if the rootParent (section) page has more than 1 child, then render // section navigation in the sidebar if ($page->rootParent->hasChildren > 0 && $page->parent->id) { $sidebar = str_replace("[nav]", renderNav($page->rootParent, 3), $sidebar); } else { $sidebar = str_replace("[nav]", "", $sidebar); } } // What happens after this? // ------------------------ // 1. ProcessWire loads your page's template file (i.e. basic-page.php). // 2. ProcessWire loads the _main.php file // // See the README.txt file for more information.
// values that you plan to bundle in a selector string like we are doing here. $q = $sanitizer->selectorValue($q); // Search the title and body fields for our query text. // Limit the results to 50 pages. $selector = "title|body~={$q}, limit=50"; // If user has access to admin pages, lets exclude them from the search results. // Note that 2 is the ID of the admin page, so this excludes all results that have // that page as one of the parents/ancestors. This isn't necessary if the user // doesn't have access to view admin pages. So it's not technically necessary to // have this here, but we thought it might be a good way to introduce has_parent. if ($user->isLoggedin()) { $selector .= ", has_parent!=2"; } // Find pages that match the selector $matches = $pages->find($selector); $cnt = $matches->count; // did we find any matches? if ($cnt) { // yes we did: output a headline indicating how many were found. // note how we handle singular vs. plural for multi-language, with the _n() function $content = "<h2>" . sprintf(_n('Found %d page', 'Found %d pages', $cnt), $cnt) . "</h2>"; // we'll use our renderNav function (in _func.php) to render the navigation $content .= renderNav($matches, 0, 'summary'); } else { // we didn't find any $content = "<h2>" . __('Sorry, no results were found.') . "</h2>"; } } else { // no search terms provided $content = "<h2>" . __('Please enter a search term in the search box (upper right corner)') . "</h2>"; }
<?php // basic-page.php template file // Primary content is the page's body copy $content = $page->body; // If the page has children, then render navigation to them under the body. // See the _func.php for the renderNav example function. if ($page->hasChildren) { $content .= renderNav($page->children, 0, 'summary'); } // if the rootParent (section) page has more than 1 child, then render // section navigation in the sidebar if ($page->rootParent->hasChildren > 1) { $sidebar = renderNav($page->rootParent, 3) . $page->sidebar; }
*/ if (!defined("USER_CP")) { require_once "../../maincore.php"; require_once THEMES . "templates/header.php"; include LOCALE . LOCALESET . "forum/main.php"; include INFUSIONS . "fusionboard4/includes/func.php"; if (file_exists(INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php")) { include INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php"; } else { include INFUSIONS . "fusionboard4/locale/English.php"; } if (!$fb4['group_enable']) { redirect(FORUM . "index.php"); } opentable($locale['uc250']); renderNav(false, false, array(INFUSIONS . "fusionboard4/groups.php", $locale['uc250'])); add_to_title(" :: " . $locale['uc250']); echo "<table width='100%' cellspacing='1' cellpadding='0' border='0' class='tbl-border'>\n"; } echo "<style type='text/css'>\n.grouptext { font-size:14px;font-family:Tahoma;width:300px;margin-top:3px;margin-left:7px; }\n</style>\n"; if (isset($_GET['action']) && $_GET['action'] == "create" && checkgroup($fb4['group_create'])) { if (isset($_POST['addGroup'])) { $group_name = isset($_POST['group_name']) ? addslash(stripinput($_POST['group_name'])) : ""; $group_desc = isset($_POST['group_desc']) ? addslash(stripinput($_POST['group_desc'])) : ""; $group_type = isset($_POST['group_type']) && isNum($_POST['group_type']) ? $_POST['group_type'] : 1; $group_wall = isset($_POST['group_wall']) && isNum($_POST['group_wall']) ? $_POST['group_wall'] : 0; $group_visibility = isset($_POST['group_visibility']) && isNum($_POST['group_visibility']) ? $_POST['group_visibility'] : 0; $group_moderate = isset($_POST['group_moderate']) && isNum($_POST['group_moderate']) ? $_POST['group_moderate'] : 0; $result = dbquery("insert into " . DB_USER_GROUPS . " (group_name, group_description) VALUES('{$group_name}', '{$group_desc}')"); $group_id = mysql_insert_id(); $result = dbquery("insert into " . DB_PREFIX . "fb_groups (group_id, group_leader, group_officers, group_access, group_visibility, group_wall, group_description, group_recentnews, group_created, group_image, group_moderate) VALUES('{$group_id}', '" . $userdata['user_id'] . "', '', '{$group_type}', '{$group_visibility}', '{$group_wall}', '{$group_desc}', '', '" . time() . "', '', '{$group_moderate}')");
<?php /** * Categories (list) template * */ /** * Render a list of categories, optionally showing a few posts from each * * @param PageArray $categories * @param int Number of posts to show from each category (default=0) * @return string * */ function renderCategories(PageArray $categories, $showNumPosts = 0) { foreach ($categories as $category) { $category->posts = wire('pages')->find("template=post, categories={$category}, limit={$showNumPosts}, sort=-date"); } $t = new TemplateFile(wire('config')->paths->templates . 'markup/categories.php'); $t->set('categories', $categories); return $t->render(); } /*********************************************/ include_once "./blog.inc"; $limit = 3; // number of posts to show per category $headline = $page->title; $content = $page->body . renderCategories($page->children, $limit); $subnav = renderNav($page->title, $page->children, $page); include "./main.inc";
<?php // home.php (homepage) template file. // See README.txt for more information // Primary content is the page body copy and navigation to children. // See the _func.php file for the renderNav() function example $content = $page->body . renderNav($page->children); // if there are images, lets choose one to output in the sidebar if (count($page->images)) { // if the page has images on it, grab one of them randomly... $image = $page->images->getRandom(); // resize it to 400 pixels wide $image = $image->width(400); // output the image at the top of the sidebar... $sidebar = "<img src='{$image->url}' alt='{$image->description}' />"; // ...and append sidebar text under the image $sidebar .= $page->sidebar; } else { // no images... // append sidebar text if the page has it $sidebar = $page->sidebar; }
include INFUSIONS . "fusionboard4/locale/English.php"; } if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); } $data = dbarray(dbquery("SELECT tt.thread_lastpost\n\tFROM " . DB_FORUMS . " tf\n\tINNER JOIN " . DB_THREADS . " tt ON tf.forum_id = tt.forum_id\n\tWHERE " . groupaccess('tf.forum_access') . "\n\tORDER BY tt.thread_lastpost DESC LIMIT " . ($settings['numofthreads'] - 1) . ", " . $settings['numofthreads'])); if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; } $today = getdate(time() + $settings['timeoffset'] * 3600); $dayBeginning = time() - ($today['hours'] * 3600 + $today['minutes'] * 60 + $today['seconds']); $result = dbquery("SELECT tu2.user_id as original_id, tu2.user_name as original_name, tt.thread_id, tt.thread_subject, tt.thread_views, tt.thread_lastuser, tt.thread_lastpost,\n\ttt.thread_poll, tf.forum_id, tf.forum_name, tf.forum_access, tt.thread_lastpostid, tt.thread_postcount, tu.user_id, tu.user_name\n\tFROM " . DB_THREADS . " tt\n\tINNER JOIN " . DB_FORUMS . " tf ON tt.forum_id=tf.forum_id\n\tINNER JOIN " . DB_USERS . " tu ON tt.thread_lastuser=tu.user_id\n\tINNER JOIN " . DB_USERS . " tu2 ON tt.thread_author=tu2.user_id\n\tWHERE " . groupaccess('tf.forum_access') . " and tt.thread_lastpost > {$dayBeginning} \n\tORDER BY tt.thread_lastpost DESC LIMIT " . $_GET['rowstart'] . ",15"); $rows = dbrows($result); opentable($locale['fb920']); add_to_title(" :: " . $locale['fb920']); renderNav(false, false, array(INFUSIONS . "fusionboard4/today.php", $locale['fb920'])); if ($rows) { $i = 0; echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n"; echo "<td class='tbl2' width='1%'> </td>\n"; echo "<td width='40%' class='tbl2'><strong>" . $locale['global_044'] . "</strong></td>\n"; echo "<td width='20%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_047'] . "</strong></td>\n"; echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_045'] . "</strong></td>\n"; echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_046'] . "</strong></td>\n"; echo "</tr>\n"; while ($data = dbarray($result)) { $row_color = $i % 2 == 0 ? "tbl1" : "tbl2"; echo "<tr>\n<td class='" . $row_color . "' style='white-space:nowrap'>"; if ($fb4['forum_icons']) { $iconQuery = dbquery("select * from " . $db_prefix . "fb_forums where forum_id='" . $data['forum_id'] . "'"); if (dbrows($iconQuery)) {
if (!checkrights("FB4") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); } $current_version = "4.0.1"; // Check if locale file is available matching the current site locale setting. if (file_exists(INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php")) { // Load the locale file matching the current site locale setting. include INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php"; } else { // Load the infusion's default locale file. include INFUSIONS . "fusionboard4/locale/English.php"; } include INFUSIONS . "fusionboard4/includes/func.php"; $_GET['section'] = isset($_GET['section']) ? $_GET['section'] : "titles"; opentable($locale['fb202']); renderNav(false, false, array(INFUSIONS . "fusionboard4/admin.php" . $aidlink . "&section=" . $_GET['section'], $locale['fb202'])); echo "<script src='" . INFUSIONS . "fusionboard4/includes/js/fb4.js' type='text/javascript'></script>\n\t<br /><table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n"; echo "<td class='" . (eregi("titles", $_GET['section']) ? "tbl1" : "tbl2") . "' style='padding-left:10px;padding-right:10px;'><span class='small'><a href='" . FUSION_SELF . $aidlink . "&section=titles'>" . $locale['fb200'] . "</a></span></td>\n"; echo "<td class='" . (eregi("labels", $_GET['section']) ? "tbl1" : "tbl2") . "' style='padding-left:10px;padding-right:10px;'><span class='small'><a href='" . FUSION_SELF . $aidlink . "&section=labels'>" . $locale['fb821'] . "</a></span></td>\n"; echo "<td class='" . (eregi("ratings", $_GET['section']) ? "tbl1" : "tbl2") . "' style='padding-left:10px;padding-right:10px;'><span class='small'><a href='" . FUSION_SELF . $aidlink . "&section=ratings'>" . $locale['fb850'] . "</a></span></td>\n"; echo "<td class='" . (eregi("awards", $_GET['section']) ? "tbl1" : "tbl2") . "' style='padding-left:10px;padding-right:10px;'><span class='small'><a href='" . FUSION_SELF . $aidlink . "&section=awards'>" . $locale['fb201'] . "</a></span></td>\n"; echo "<td class='" . (eregi("images", $_GET['section']) ? "tbl1" : "tbl2") . "' style='padding-left:10px;padding-right:10px;'><span class='small'><a href='" . FUSION_SELF . $aidlink . "&section=images'>" . $locale['fb204'] . "</a></span></td>\n"; echo "<td class='" . (eregi("forums", $_GET['section']) ? "tbl1" : "tbl2") . "' style='padding-left:10px;padding-right:10px;'><span class='small'><a href='" . FUSION_SELF . $aidlink . "&section=forums'>" . $locale['fb206'] . "</a></span></td>\n"; echo "<td class='" . (eregi("warnings", $_GET['section']) ? "tbl1" : "tbl2") . "' style='padding-left:10px;padding-right:10px;'><span class='small'><a href='" . FUSION_SELF . $aidlink . "&section=warnings'>" . $locale['fbw103'] . "</a></span></td>\n"; echo "<td class='" . (eregi("settings", $_GET['section']) ? "tbl1" : "tbl2") . "' style='padding-left:10px;padding-right:10px;'><span class='small'><a href='" . FUSION_SELF . $aidlink . "&section=settings'>" . $locale['fb203'] . "</a></span></td>\n"; echo "</tr>\n</table>\n<br />\n"; closetable(); if ($_GET['section'] == "titles") { if (isset($_POST['goTitle'])) { $title_title = addslash(stripinput($_POST['title_title'])); $title_access = isNum($_POST['title_access']) ? $_POST['title_access'] : "101";
<?php // sitemap.php template file // Generate navigation that descends up to 4 levels into the tree. // See the _func.php for the renderNav() function definition. $content = renderNav($homepage, 4);
<?php // home.php (homepage) template file. // Primary content is the page body copy $content = $page->body; // Append navigation to child pages underneath the body copy // See the _func.php file for the renderNav() function example $content .= renderNav($page->children); // if there are images, lets choose one to output in the sidebar if (count($page->images)) { // if the page has images on it, grab one of them randomly... $image = $page->images->getRandom(); // resize it to 400 pixels wide $image = $image->width(400); // output the image at the top of the sidebar $sidebar = "<img src='{$image->url}' alt='{$image->description}' />"; // if image has a description, display it underneath if ($image->description) { $sidebar .= "<blockquote>{$image->description}</blockquote>"; } // append sidebar text content if page has it $sidebar .= $page->sidebar; } else { // no images... // make sidebar contain text content if page has it $sidebar = $page->sidebar; }
foreach ($_POST['check_mark'] as $thisnum) { if (isnum($thisnum)) { $thread_ids .= ($thread_ids ? "," : "") . $thisnum; } } } if ($thread_ids) { $result = dbquery("UPDATE " . DB_THREADS . " SET thread_locked='1' WHERE thread_id IN (" . $thread_ids . ")"); } redirect(FUSION_SELF . "?forum_id=" . $_GET['forum_id'] . "&rowstart=" . $_GET['rowstart']); } /* fusionboard4 mod end */ $rows = dbcount("(thread_id)", DB_THREADS, "forum_id='" . $_GET['forum_id'] . "' AND thread_sticky='0'"); opentable($locale['450']); echo "<!--pre_forum-->\n"; renderNav(true); renderSubforums($_GET['forum_id']); if ($rows > $threads_per_page || iMEMBER && $can_post) { if (isset($_POST['goSearch'])) { $order_by = isset($_POST['order_by']) ? stripinput($_POST['order_by']) : ""; $sort_by = isset($_POST['sort_by']) && $_POST['sort_by'] == "desc" ? "desc" : "asc"; $timelimit = isset($_POST['time']) && isNum($_POST['time']) ? $_POST['time'] : ""; $get = "&order_by={$order_by}&sort_by={$sort_by}&time={$timelimit}"; } elseif (isset($_GET['order_by'])) { $order_by = isset($_GET['order_by']) ? stripinput($_GET['order_by']) : ""; $sort_by = isset($_GET['sort_by']) && $_GET['sort_by'] == "desc" ? "desc" : "asc"; $timelimit = isset($_GET['time']) && isNum($_GET['time']) ? $_GET['time'] : ""; $get = "&order_by={$order_by}&sort_by={$sort_by}&time={$timelimit}"; } else { $get = ""; }
<?php // home.php (homepage) template file. // Primary content is the page body copy and navigation to children. // See the _func.php file for the renderNav() function example $content = $page->body . renderNav($page->children, 0, 'summary'); // if there are images, lets choose one to output in the sidebar if (count($page->images)) { // if the page has images on it, grab one of them randomly... $image = $page->images->getRandom(); // resize it to 400 pixels wide $image = $image->width(400); // output the image at the top of the sidebar $sidebar = "<img src='{$image->url}' alt='{$image->description}' />{$page->sidebar}"; } else { // no images... // append sidebar content if the page has it $sidebar = $page->sidebar; }
<?php /* fusionBoard 4.0 php-Invent Team http://www.php-invent.com Developer: Ian Unruh (SoBeNoFear) ianunruh@gmail.com */ require_once "../../maincore.php"; require_once THEMES . "templates/header.php"; include LOCALE . LOCALESET . "forum/main.php"; include INFUSIONS . "fusionboard4/includes/func.php"; if (file_exists(INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php")) { include INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php"; } else { include INFUSIONS . "fusionboard4/locale/English.php"; } add_to_title(" :: " . $locale['fb909']); opentable($locale['fb909']); renderNav(false, false, array(INFUSIONS . "fusionboard4/rules.php", $locale['fb909'])); if ($fb4['forum_rules']) { echo stripslash($fb4['forum_rules']); } else { echo "<div align='center'>" . $locale['fb917'] . "</div>\n"; } closetable(); require_once THEMES . "templates/footer.php";
$superuserRole = $roles->get('superuser'); $authors = $users->find("roles={$authorRole}|{$superuserRole}, sort=title"); $authorLinks = array(); foreach ($authors as $a) { // we set a separate URL (url2) to reflect the public url of the author, since // the author's $author->url is actually a page in the admin $a->url2 = $page->url . $a->name . '/'; $authorLinks[$a->url2] = $a->get('title|name'); } if ($input->urlSegment1) { // author specified: display biography and posts by this author $name = $sanitizer->pageName($input->urlSegment1); $author = $users->get($name); if (!$author->id || !$author->hasRole($authorRole) && !$author->isSuperuser()) { throw new Wire404Exception(); } $posts = $pages->find("template=post, created_users_id={$author}, sort=-date, limit=10"); $authorName = $author->get('title|name'); $t = new TemplateFile($config->paths->templates . "markup/author.php"); $t->set('authorName', $authorName); $t->set('authorURL', ''); $t->set('author', $author); $headline = $page->title; $content = $t->render() . renderPosts($posts, true); $subnav = renderNav($page->title, $authorLinks, $page->url . $author->name . '/'); } else { // no author specified: display list of authors $headline = $page->title; $content = $page->body . renderAuthors($authors); } include "./main.inc";
$date = $page->getUnformatted('date'); $nextPost = $page->parent->child("date>{$date}, sort=date"); $prevPost = $page->parent->child("date<{$date}, sort=-date"); $out = "<section class='next-prev'><div class='next-prev-posts container'><div class='small-12 columns'>"; if ($prevPost->id > 0) { $out .= "<p class='prev-post left text-left'><span class='font-bold uppercase'>Previous Recipe</span><br><a href='{$prevPost->url}'>{$prevPost->title}</a></p>"; } if ($nextPost->id > 0) { $out .= "<p class='next-post right text-right'><span class='font-bold uppercase'>Next Recipe</span><br><a href='{$nextPost->url}'>{$nextPost->title}</a></p>"; } $out .= "</div></div></div></section>"; return $out; } // render our blog post and comments // $content = renderPosts($page) . renderComments($page->comments) . renderNextPrevPosts($page); $content = renderPosts($page) . renderNextPrevPosts($page); // get date info for creating link to archives page in subnav $date = $page->getUnformatted('date'); $year = date('Y', $date); $month = date('n', $date); // if there are categories and/or tags, then make a separate nav for them if (count($page->categories)) { $subnav .= renderNav(__('Related Categories'), $page->categories); } if (count($page->tags)) { $subnav .= renderNav(__('Related Tags'), $page->tags); } // subnav contains authors, archives and categories links $subnavItems = array("{$config->urls->root}authors/{$page->createdUser->name}/" => $page->createdUser->get('title|name'), "{$config->urls->root}archives/{$year}/{$month}/" => strftime('%B %Y', $date)); $subnav .= renderNav(__('See Also'), $subnavItems); include "./_post.inc";
$input->whitelist('q', $q); // Sanitize for placement within a selector string. This is important for any // values that you plan to bundle in a selector string like we are doing here. $q = $sanitizer->selectorValue($q); // Search the title and body fields for our query text. // Limit the results to 50 pages. $selector = "title|body~={$q}, limit=50"; // If user has access to admin pages, lets exclude them from the search results. // Note that 2 is the ID of the admin page, so this excludes all results that have // that page as one of the parents/ancestors. This isn't necessary if the user // doesn't have access to view admin pages. So it's not technically necessary to // have this here, but we thought it might be a good way to introduce has_parent. if ($user->isLoggedin()) { $selector .= ", has_parent!=2"; } // Find pages that match the selector $matches = $pages->find($selector); // did we find any matches? if ($matches->count) { // yes we did $content = "<h2>Found {$matches->count} pages matching your query:</h2>"; // we'll use our renderNav function (in _func.php) to render the navigation $content .= renderNav($matches); } else { // we didn't find any $content = "<h2>Sorry, no results were found.</h2>"; } } else { // no search terms provided $content = "<h2>Please enter a search term in the search box (upper right corner)</h2>"; }
if (file_exists(INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php")) { include INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php"; } else { include INFUSIONS . "fusionboard4/locale/English.php"; } if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); } add_to_title($locale['global_200'] . $locale['400']); if ($fb4['show_latest']) { include INFUSIONS . "fb_threads_list_panel/fb_threads_list_panel.php"; } else { echo "<script src='" . INFUSIONS . "fusionboard4/includes/js/boxover.js' type='text/javascript'></script>\n"; } opentable($locale['400']); renderNav(false, false, array(FORUM . "index.php", $locale['fb916'])); $forum_list = ""; $current_cat = ""; $result = dbquery("SELECT f.*, f3.forum_icon, f4.forum_collapsed, f2.forum_name AS forum_cat_name, u.user_id, u.user_name\n\tFROM " . DB_FORUMS . " f\n\tLEFT JOIN " . DB_FORUMS . " f2 ON f.forum_cat = f2.forum_id\n\tLEFT JOIN " . DB_USERS . " u ON f.forum_lastuser = u.user_id\n\tLEFT JOIN " . DB_PREFIX . "fb_forums f3 on f3.forum_id=f.forum_id\n\tLEFT JOIN " . DB_PREFIX . "fb_forums f4 on f4.forum_id=f2.forum_id\n\tWHERE " . groupaccess('f.forum_access') . " AND f.forum_cat!='0' AND f3.forum_parent='0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"); $rows = dbrows($result); $i = 0; if (dbrows($result) != 0) { while ($data = dbarray($result)) { if ($data['forum_cat_name'] != $current_cat) { if ($i > 0) { echo "</table>" . ($collapsible ? "</div>" : "") . "<br />\n"; } $current_cat = $data['forum_cat_name']; echo "<!--pre_forum_idx--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n"; $state = $data['forum_collapsed'] ? "off" : "on"; $boxname = "forum" . $data['forum_id'];
<?php include './_head.php'; // include header markup ?> <div id='content'><?php // output 'headline' if available, otherwise 'title' echo "<h1>" . $page->get('headline|title') . "</h1>"; // output bodycopy echo $page->body; // render navigation to child pages renderNav($page->children); // TIP: Notice that this <div id='content'> section is // identical between home.php and basic-page.php. You may // want to move this to a separate file, like _content.php // and then include('./_content.php'); here instead, on both // the home.php and basic-page.php template files. Then when // you make yet more templates that need the same thing, you // can simply include() it from them. ?> </div><!-- end content --> <div id='sidebar'><?php // rootParent is the parent page closest to the homepage // you can think of this as the "section" that the user is in // so we'll assign it to a $section variable for clarity $section = $page->rootParent; // if there's more than 1 page in this section... if ($section->hasChildren > 1) { // output sidebar navigation
} $subnav = renderNav($page->title, $yearsNav, $page->url . "{$year}/") . renderNav($year, $monthsNav, $page->url . "{$year}/{$month}/"); } else { if ($input->urlSegment1) { // year $year = (int) $input->urlSegment1; $headline = $page->title; $archives = getArchives(); $yearsNav = ''; foreach ($archives as $key => $y) { $yearsNav[$y['url']] = $y['name']; if ($key != $year) { unset($archives[$key]); } } $subnav = renderNav($page->title, $yearsNav, $page->url . "{$year}/"); $content = '<section class="recipes-list"> <div class="container">'; $content .= renderArchives($archives); $content .= '</div> </section>'; } else { // root, no date specified $headline = $page->title; $content = '<section class="recipes-list"> <div class="container">'; $content .= $page->body . renderArchives(getArchives()); $content .= '</div> </section>'; } }
<?php /* fusionBoard 4.0 php-Invent Team http://www.php-invent.com Developer: Ian Unruh (SoBeNoFear) ianunruh@gmail.com */ opentable($locale['500']); echo "<!--pre_forum_thread-->\n"; renderNav(false, $announcementCheck); echo "<table cellpadding='0' cellspacing='0' width='100%'>\n"; echo "<tr>"; if ($rows > $posts_per_page || ($can_post || $can_reply)) { echo "<td align='left' style='padding:0px 0px 4px 5px;white-space:nowrap;' width='1%'>\n"; if (iMEMBER && ($can_post || $can_reply)) { if (!$fdata['thread_locked'] && $can_reply) { echo "<a href='post.php?action=reply&forum_id=" . $fdata['forum_id'] . "&thread_id=" . $_GET['thread_id'] . "'><img src='" . get_image("reply") . "' alt='" . $locale['565'] . "' style='border:0px' /></a> \n"; } if ($can_post) { echo "<nobr><a href='post.php?action=newthread&forum_id=" . $fdata['forum_id'] . "'><img src='" . get_image("newthread") . "' alt='" . $locale['566'] . "' style='border:0px' /></a> \n"; } echo "</td><td>"; } if ($rows > $posts_per_page) { echo "<nobr>" . makePageNav($_GET['rowstart'], $posts_per_page, $rows, 3, FUSION_SELF . "?thread_id=" . $_GET['thread_id'] . "&") . ""; } echo "</td>"; }
/** * Render breadcrumb navigation * */ function renderBreadcrumbs(PageArray $items) { // if the page has a headline that's different from the title, add it to the bredcrumbs $page = wire('page'); if ($page->headline) { $items->add($page); } $options = array('class' => 'breadcrumbs', 'active' => 'unavailable'); return renderNav($items, $options); }