function view() { // parse the search params $kind = get_http_var('type', ""); $q = get_http_var('q'); if (!$kind) { $j = get_http_var('j', ""); $a = get_http_var('a', ""); if ($j) { $q = $j; $kind = 'journo'; } if ($a) { $q = $a; $kind = 'article'; } } $art_page = get_http_var('p', 0); $journo_page = get_http_var('jp', 0); // special 'by' param for article searches $by = get_http_var('by', ""); if ($by && $kind != 'journo') { $q .= " author:" . $by; } $sort_order = get_http_var('o'); $article_results = null; if ($q != "" && $kind != 'journo') { $as = new ArticleSearch($q, $sort_order, $art_page, 'p'); $article_results = $as->perform(); } $journo_results = null; if ($q != "" && $kind != 'article') { $js = new JournoSearch($q, $journo_page, 'jp'); $journo_results = $js->perform(); } // hackhackhack /* if( $s['fmt'] == 'csv' ) { search_articles_output_csv($article_results->data); return; } */ tmpl($q, $kind, $sort_order, $journo_results, $article_results); }
<?php require '../vendor/autoload.php'; header('Content-Type: application/xml; charset=utf-8'); echo cache('rss.xml', function () { return tmpl('rss', ['posts' => posts()]); }); exit;
function test_tmpl_extend_template() { tmpl()->render('extender'); $this->assertOutput("extender extends base"); }
if (preg_match('/^page\\/[1-9][0-9]*$/', $request)) { $page = (int) explode('/', $request)[1]; $isPage = true; } else { $page = 1; $isPage = false; } $output = cache($request, function () use($request, $page, $isPage) { if ($request && !$isPage) { foreach (posts() as $post) { if (config('post.url') . $post['meta']['slug'] == $request) { $filter = compose('markdown', 'pygments', 'graphviz'); $post['post'] = $filter($post['post']); return tmpl('post', $post); } } } else { $posts = page($page); if ($posts->key() !== null) { return tmpl('main', ['posts' => $posts, 'page' => $page]); } } return false; }); if ($output === false) { header('HTTP/1.0 404 Not Found'); echo tmpl('404'); } else { echo $output; } exit;
} //$ignoreChecked = ($currentVenue->ignorecheckin == 1 ? " checked='checked'" : ""); echo "<td><input type='hidden' class='geoLatCoord' value='" . $currentVenue->geolat . "' /><input type='hidden' class='geoLongCoord' value='" . $currentVenue->geolong . "' />"; echo "<select class='startPointSelector'" . $startPointDisabled . "><option value='-1'>select start point...</option>"; echo "<option value='home'" . selectValueChecker($currentVenue->startpoint, "home") . ">Homebase</option>"; echo "<option value='prev'" . selectValueChecker($currentVenue->startpoint, "prev") . ">Previous Check In</option></select></td>\n"; echo "<td class='mileageCell'>" . round($currentVenue->mileage, 2) . "</td>\n"; echo "<td><select class='transportationModeSelector'" . $transportModeDisabled . "><option value='0'>select transportation...</option>"; echo "<option value='self'" . selectValueChecker($currentVenue->transportmode, "self") . ">Self-Powered</option>"; echo "<option value='mass'" . selectValueChecker($currentVenue->transportmode, "mass") . ">Mass Transportation</option>"; echo "<option value='car'" . selectValueChecker($currentVenue->transportmode, "car") . ">Car</option></select></td>\n"; $lastStopChecked = $currentVenue->laststop == 1 ? " checked='checked'" : ""; echo "<td class='lastStopCell'><input type='checkbox' class='lastStopCheckbox'" . $lastStopChecked . $lastStopDisabled . " /></td>\n"; echo "<td class='ignoreCheckInCell'><input type='checkbox' class='ignoreCheckinCheckbox'" . $ignoreChecked . " /></td>\n"; echo "<td><input type='button' value='update' class='updateDestinationInfoButton' /><span class='progressIndicator'> </span></td>"; //echo("<td class='rowStatus'> </td>"); //used to display update status messaging echo "</tr>\n"; } } ?> </tbody> </table> <?php } } ?> <?php tmpl('footer');