$specialPages = array('rss.xml' => 'showRss', 'sitemap.xml' => 'showSiteMap'); if (!$pageFound && isset($url[1]) && isset($specialPages[$url[1]])) { $pageFound = call_user_func($specialPages[$url[1]], $META); exit; } if (isset($url[1]) && isset($url[2])) { if ($url[1] == 'tag') { $pageFound = showTagPages($META, $url[2], isset($url[3]) ? (int) $url[3] : 1, 0, false); } else { if ($url[1] == 'p') { $pageFound = showPage($META, (int) $url[2] - 1); } } } if (!$pageFound && isset($url[1]) && isset($META[$url[1]])) { $pageFound = showPost($META[$url[1]][1], "", $META[$url[1]][0], $META[$url[1]][2], $META[$url[1]][3]); } if (!$pageFound) { showPage($META, 0); } //showPost("DiglettCMS", "" , "content/main.txt", "", ""); function showRss($META) { echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss version=\"2.0\">\n\n<channel>\n"; echo "<title>" . getSiteTitle() . "<title>\n"; echo "<link>" . getBaseUrl() . "<link>\n"; echo "<description>" . getSiteDescription() . "<description>\n"; foreach ($META as $k => $m) { if (file_exists($m[0])) { echo "\t<item>\n\t\t<title>" . $m[1] . "</title>\n\t\t<link>" . getBaseUrl() . $k . "</link>\n\t\t<description>" . file_get_contents($m[0]) . "</description>\n\t\t<pubDate>" . date("D, d M y H:i:s O", strtotime($m[4])) . "</pubDate>\n\t</item>\n"; }
function showUserPosts($userid, $start, $count, $includeFollowees) { $r = redisLink(); $key = $userid == -1 ? "global:timeline" : "uid:{$userid}:posts"; if ($includeFollowees) { $posts = getRelevantPosts($userid, $start, $count); } else { $posts = $r->lrange($key, $start, $start + $count); } $c = 0; foreach ($posts as $p) { if (showPost($p)) { $c++; } if ($c == $count) { break; } } return count($posts) == $count + 1; }
<tr bgcolor="' . $config['site']['darkborder'] . '"><td valign="top">' . availableBBCCode() . '</td><td><textarea rows="10" cols="50" name="text">' . htmlspecialchars($text) . '</textarea><br />(Max. 15,000 letters)</td></tr> <tr bgcolor="' . $config['site']['lightborder'] . '"><td valign="top">Options:</td><td><label><input type="checkbox" name="smile" value="1"'; if ($smile == 1) { $main_content .= ' checked="checked"'; } $main_content .= '/>Disable Smileys in This Post </label></td></tr></table><center><input type="submit" value="Post Reply" /></center></form>'; $threads = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_smile') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = " . (int) $thread_id . " ORDER BY " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " DESC LIMIT 10")->fetchAll(); $main_content .= '<table width="100%"><tr bgcolor="' . $config['site']['vdarkborder'] . '"><td colspan="2"><font color="white"><b>Last 5 posts from thread: ' . htmlspecialchars($thread['post_topic']) . '</b></font></td></tr>'; foreach ($threads as $thread) { if (is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>' . $thread['name'] . '</td><td>' . showPost(htmlspecialchars($thread['post_topic']), htmlspecialchars($thread['post_text']), $thread['post_smile']) . '</td></tr>'; } $main_content .= '</table>'; } } else { $main_content .= 'Thread with ID ' . $thread_id . ' doesn\'t exist.'; } } else { $main_content .= 'Your account is banned, deleted or you don\'t have any player with level ' . $level_limit . ' on your account. You can\'t post.'; } } else { $main_content .= 'Login first.'; } } if ($action == 'edit_post') { if ($logged) {
function showUserPosts($userid,$start,$count) { $r = redisLink(); $key = ($userid == -1) ? "global:timeline" : "uid:$userid:posts"; $posts = $r->lrange($key,$start,$start+$count); $c = 0; foreach($posts as $p) { if (showPost($p)) $c++; if ($c == $count) break; } return count($posts) == $count+1; }
<div class="Border_3"> <div class="BoxContent" style="background-image:url(' . $layout_name . '/images/general/scroll.gif);">'; foreach ($last_featuredArticle as $fArticle) { $featuredArticle .= '<a id="Link" style="position: absolute; margin-bottom: 10px; top: 2px;" href="?subtopic=forum&action=show_thread&id=' . $fArticle['id'] . '">» read more</a><div id="TeaserText">' . substr(showPost('', $fArticle['post_text'], $fArticle['post_smile']), 0, 400) . '...</div>'; } $featuredArticle .= '</div> </div> </div> <div class="Border_1" style="background-image:url(' . $layout_name . '/images/general/border-1.gif);"></div> <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url(' . $layout_name . '/images/general/corner-bl.gif);"></div></div> <div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url(' . $layout_name . '/images/general/corner-br.gif);"></div></div> </div>'; } $last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_text') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_smile') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('replies') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_date') . ' FROM ' . $SQL->tableName('players') . ', ' . $SQL->tableName('z_forum') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('author_guid') . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . '!=\'News Ticker\'' . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . '!=\'Featured Article\'' . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('section') . ' = 1 AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('first_post') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ' ORDER BY ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('last_post') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll(); if (isset($last_threads[0])) { foreach ($last_threads as $thread) { $main_content .= '<div class="NewsHeadline" style="margin-bottom: 10px;"> <div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/general/newsheadline_background.gif)"> <img src="' . $layout_name . '/images/general/newsicon_community_big.gif" class="NewsHeadlineIcon" alt=""> <div class="NewsHeadlineDate">' . date('M d Y', $thread['post_date']) . ' - </div> <div class="NewsHeadlineText">' . htmlspecialchars($thread['post_topic']) . '</div> </div> </div> <table style="clear:both" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody> <tr>' . showPost('', $thread['post_text'], $thread['post_smile']) . '</tr><tr><td><div style="text-align:right;margin:10px 10px 0 0;"><a href="?subtopic=forum&action=show_thread&id=' . $thread['id'] . '">» Comment on this news</a></div></td></tr></tbody> </table> <br>'; } } else { $main_content .= '<h3>No news. Go forum and make new thread on board News.</h3>'; }
<tr bgcolor="' . $config['site']['darkborder'] . '"><td valign="top"><b>Mensagem:<br></b><font size="1"><br />Você poderá usar as tags:<br />[player]Nome[/player]<br />[url=http://endereco.com/]Endereço[/url]<br />[img]http://images.com/images3.gif[/img]<br />[code]Código[/code]<br />[b]<b>Texto</b>[/b]<br />[i]<i>Texto</i>[/i]<br />[u]<u>Texto</u>[/u]<br />Há também algumas carinhas:<br />;) , :) , :D , :( , :rolleyes:<br />:cool: , :eek: , :o , :p</font></td><td><textarea rows="10" cols="40" name="text">' . strip_tags($text) . '</textarea><br />(Máximo: 15,000 letras)</td></tr> <tr bgcolor="' . $config['site']['lightborder'] . '"><td valign="top">Opções:</td><td><label><input type="checkbox" name="smile" value="1"'; if ($smile == 1) { $main_content .= ' checked="checked"'; } $main_content .= '/>Desativar carinhas nesse post </label></td></tr></table><center><input type="submit" value="Publicar resposta" /></center></form>'; $threads = $SQL->query("SELECT `players`.`name`, `z_forum`.`post_text`, `z_forum`.`post_topic`, `z_forum`.`post_smile` FROM `players`, `z_forum` WHERE `players`.`id` = `z_forum`.`author_guid` AND `z_forum`.`first_post` = " . (int) $thread_id . " ORDER BY `z_forum`.`post_date` DESC LIMIT 10")->fetchAll(); $main_content .= '<table width="100%"><tr bgcolor="' . $config['site']['vdarkborder'] . '"><td colspan="2"><font color="white"><b>Últimos posts do tópico: ' . $thread['post_topic'] . '</b></font></td></tr>'; foreach ($threads as $thread) { if (is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<tr bgcolor="' . $bgcolor . '"><td style="vertical-align: baseline;">' . $thread['name'] . '</td><td>' . showPost($thread['post_topic'], $thread['post_text'], $thread['post_smile']) . '</td></tr>'; } $main_content .= '</table>'; } } else { $main_content .= 'O tópico com ID ' . $thread_id . ' não existe.'; } } else { $main_content .= 'Esse tópico está fechado. Você não pode publicar.'; } } else { $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%"> <tr BGCOLOR="' . $config['site']['vdarkborder'] . '"> <td CLASS="white"><b>Forum</b></td> </tr> <tr BGCOLOR=' . $config['site']['darkborder'] . '>
</div> <section id="wa_right"> <!--The posts and featured section--> <article id="wa_reading_wrapper" class="<?php if (is_single()) { echo "wa_isSingle"; } ?> "> <div class="wa_scroller"> <?php //if there is a single post, let it show if (is_single() && have_posts()) { require_once "api/functions.php"; echo showPost(get_the_id(), null, null, null, "single"); echo get_the_id(); } ?> </div> </article> </section> <div class="wa_clearfix"></div> <!--[if lt IE 7 ]> <script src="js/libs/dd_belatedpng.js"></script> <script> DD_belatedPNG.fix('img, .png_bg');</script> <![endif]-->
function showUserPosts($userid, $start, $count) { $r = redisLink(); $key = $userid == -1 ? "timeline" : "posts:{$userid}"; $posts = $r->lrange($key, $start, $start + $count); $c = 0; foreach ($posts as $p) { if (showPost($p)) { $c++; } if ($c == $count) { break; } } return count($posts) == $count + 1; }
//set array $dataArray["content"] = $contentPage; $dataArray["people"] = $contentAuthors; echo json_encode($dataArray); } else { if ($type === "post") { //get the id of the post $requested_id = $_GET['id']; //get the slug of the post $requested_slug = $_GET['slug']; //set the offset of the post $offset = $_GET['offset']; //grab the sent category $category = $_GET['category']; //show the post showPost($requested_id, $requested_slug, $offset, $category, "ajax"); } else { if ($type === "featured") { //it'll be the featured content //get the theme options $theme_options = get_option('tcv3_theme_options'); //array of IDs to exclude $excludedIDs = array(); //for tag $tagName = ""; //lopp it through three times to gather the data for ($counter = 0; $counter < 3; $counter++) { switch ($counter) { case 0: $option_tag = "featured1_tag"; $option_cat = "featured1_cat";
} } if ($err) { error($err); } } extract($_POST); extract($_GET); $iniv = array('action', 'res', 'no', 'pwd', 'page'); foreach ($iniv as $iniva) { if (!isset(${$iniva})) { ${$iniva} = ""; } } init(); switch ($action) { case 'post': addPost(); break; case 'delete': deletePost($no, $pwd); default: if ($res) { // 回應模式輸出 $page = isset($_GET['page']) ? $_GET['page'] : 'RE_PAGE_MAX'; if (!($page == 'all' || $page == 'RE_PAGE_MAX')) { $page = intval($_GET['page']); } } showPost($res, $page); }
<a href="index.php?subtopic=latestnews&lang=br"><img src="images/flags/br.png" alt=""></a> <a href="index.php?subtopic=latestnews&lang=pl"><img src="images/flags/pl.png" alt=""></a> </td> </tr> </table><br>'; } if ($_REQUEST['lang'] == 'en') { $last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_text') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_smile') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('replies') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_date') . ' FROM ' . $SQL->tableName('players') . ', ' . $SQL->tableName('z_forum') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('author_guid') . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('section') . ' = 1 AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('first_post') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ' ORDER BY ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('last_post') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll(); } elseif ($_REQUEST['lang'] == 'br') { $last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_text') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_smile') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('replies') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_date') . ' FROM ' . $SQL->tableName('players') . ', ' . $SQL->tableName('z_forum') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('author_guid') . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('section') . ' = 20 AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('first_post') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ' ORDER BY ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('last_post') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll(); } elseif ($_REQUEST['lang'] == 'pl') { $last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_text') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_smile') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('replies') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_date') . ' FROM ' . $SQL->tableName('players') . ', ' . $SQL->tableName('z_forum') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('author_guid') . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('section') . ' = 30 AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('first_post') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ' ORDER BY ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('last_post') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll(); } else { $last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_text') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_smile') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('replies') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_date') . ' FROM ' . $SQL->tableName('players') . ', ' . $SQL->tableName('z_forum') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('author_guid') . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('section') . ' = 1 AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('first_post') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ' ORDER BY ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('last_post') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll(); } #$last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_text') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_smile') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('replies') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_date') . ' FROM ' . $SQL->tableName('players') . ', ' . $SQL->tableName('z_forum') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('author_guid') . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('section') . ' = 1 AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('first_post') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ' ORDER BY ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('last_post') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll(); if (isset($last_threads[0])) { $main_content .= '<table width="100%">'; foreach ($last_threads as $thread) { $main_content .= '<tr><td><b>' . htmlspecialchars($thread['post_topic']) . '</a></td><td style="text-align:right">' . date('d.m.y H:i:s', $thread['post_date']) . '</td></tr>'; $main_content .= '<tr><td colspan="2">' . showPost('', $thread['post_text'], $thread['post_smile']) . '</td></tr>'; $main_content .= '<tr><td>by <a href="?subtopic=characters&name=' . urlencode($thread['name']) . '">' . htmlspecialchars($thread['name']) . '</a></td><td style="text-align:right"><a href="?subtopic=forum&action=show_thread&id=' . $thread['id'] . '">[Comments: ' . $thread['replies'] . ']</a></td></tr>'; $main_content .= '<tr style="background-color:black;width:100%;height:3px"><td colspan="2"></td></tr>'; } $main_content .= '</table>'; } else { $main_content .= '<h3>No news. Go forum and make new thread on board News.</h3>'; }