Gazelle/sections/wiki/wiki_browse.php

84 lines
3.2 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
2011-10-17 08:00:16 +00:00
show_header($Title);
2011-03-28 14:21:28 +00:00
$Letter = strtoupper(substr($_GET['letter'],0,1));
$sql = "SELECT SQL_CALC_FOUND_ROWS
w.ID,
w.Title,
w.Date,
2012-03-28 08:00:20 +00:00
w.Author
2011-03-28 14:21:28 +00:00
FROM wiki_articles AS w
2012-03-28 08:00:20 +00:00
WHERE w.MinClassRead <= '".$LoggedUser['EffectiveClass']."'";
2011-03-28 14:21:28 +00:00
if($Letter!=='1') {
$sql .= " AND UPPER(LEFT(w.Title,1)) = '".db_string($Letter)."'";
} else {
$Letter = 'All';
}
$sql .= " ORDER BY Title";
$DB->query($sql);
$Title = 'Browse articles';
if($Letter) { $Title.= ' ('.$Letter.')'; }
?>
<div class="thin">
<? if($Letter) { ?>
<h2>Browse articles (<?=$Letter?>)</h2>
<table width="100%" style="margin-bottom:10px;">
<tr class="colhead">
<td>Article</td>
<td>Last Updated</td>
<td>Last edited by</td>
</tr>
2012-03-28 08:00:20 +00:00
<? while(list($ID, $Title, $Date, $UserID) = $DB->next_record()) {?>
2011-03-28 14:21:28 +00:00
<tr>
<td><a href="wiki.php?action=article&id=<?=$ID?>"><?=$Title?></a></td>
<td><?=$Date?></td>
2012-03-28 08:00:20 +00:00
<td><?=format_username($UserID, false, false, false)?></td>
2011-03-28 14:21:28 +00:00
</tr>
<? } ?>
</table>
<? } ?>
<div class="box pad center">
<p>Search the wiki for user created tutorials and information.</p>
<form action="wiki.php" method="get">
<input type="hidden" name="action" value="search">
<input type="hidden" name="nojump" value="1" />
<input type="text" name="search" size="80" />
<input value="Search" type="submit" class="hidden" />
</form>
<br />
<p>Additionally you can manually browse through the articles by their first letter.</p>
<span>
<a href="wiki.php?action=browse&amp;letter=a">A</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=b">B</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=c">C</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=d">D</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=e">E</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=f">F</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=g">G</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=h">H</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=i">I</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=j">J</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=k">K</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=l">L</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=m">M</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=n">N</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=o">O</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=p">P</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=q">Q</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=r">R</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=s">S</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=t">T</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=u">U</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=v">V</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=w">W</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=x">X</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=y">Y</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=z">Z</a>&nbsp;&nbsp;
<a href="wiki.php?action=browse&amp;letter=1">All</a>&nbsp;&nbsp;
</span>
</div>
</div>
<? show_footer(); ?>