<?php /* * stats.php - WikiWW statistics page * PHP by: Jacob I. Torrey * Design by: Jacob I. Torrey */ include 'lib/misc.inc.php'; include 'lib/classes.class.php'; include 'lib/cache.lib.php'; $c = new Cache(); $c->startCache(5); print statichtmlheader(); ?> </head><body> <div id="title"> <h1>Wiki Wide Web Statistics</h1> </div> <div id="central"> <?php print menu(); ?> <p class="indent">Below are some statistics generated about Wiki Wide Web:</p> <ul> <li>Number of users: <?php $db = new DB(); $db->query("SELECT count(uid) FROM user;"); $num = $db->fetchRow();
print "<description>" . ucfirst($_GET['username']) . "'s Wiki Wide Web Feed</description>\r\n"; print "<language>en-us</language>\r\n"; $db = new DB(); $db->query("SELECT diff.did, site.address, diff.comment, UNIX_TIMESTAMP(diff.time) FROM diff, site WHERE diff.uid = '{$u->uid}' AND site.sid = diff.sid ORDER BY diff.time DESC LIMIT " . NUMITEMS . ";"); while ($row = $db->fetchRow()) { print "<item>\r\n"; print "<title>Diff #{$row[0]} - {$row[2]}</title>\r\n"; print "<link>{$row[1]}</link>\r\n"; print "<description>" . ucfirst($_GET['username']) . " modified {$row[1]} on " . date(DATE_RFC822, $row[3]) . "</description>\r\n"; print "<pubDate>" . date(DATE_RFC822, $row[3]) . "</pubDate>\r\n"; print "</item>\r\n"; } $db->close(); print '</channel></rss>'; } else { print statichtmlheader() . "\r\n"; ?> <style type="text/css"> h1 { text-align: center; } a { color: black; font-weight: bold; } </style> <link rel="alternate" type="text/xml" title="RSS 2.0" href="/rss/user/<?php print $_GET['username']; ?> " />
<?php require 'lib/misc.inc.php'; require 'lib/classes.class.php'; print statichtmlheader() . "\r\n<body id=\"edit\">"; if (!isset($_GET['address'])) { print 'Sorry, you need to enter an address to edit</body></html>'; die; } $s = new Site($_GET['address']); if (!$s->loaded) { $s->checkWWW(); } if ($s->lock) { print "Sorry, this page is locked</body></html>"; die; } ?> <h1 class="center">Edit this page</h1> <?php if (isset($_SESSION['userdata'])) { $source = WikiWideWebize($s, getSource($_GET['address'])); ?> <form action="/doedit" method="post"> <input type="hidden" name="address" value="<?php print $_GET['address']; ?> " /> <textarea rows="15" cols="80" name="source"><?php print $source;
<?php /* Wiki Wide Web tools Author: Jacob Torrey */ require '../lib/classes.class.php'; require '../lib/misc.inc.php'; print statichtmlheader() . "<body>\r\n"; if (isset($_SESSION['userdata'])) { $u = unserialize($_SESSION['userdata']); if ($u->admin) { print "<a href=\"newnews.php\">Add a news article</a><br />\r\n"; print "<a href=\"clean.php\">Clean the DB</a.<br />\r\n"; } } print "<a href=\"wikiwideweb/wikiwideweb.xpi\">Wiki Wide Development Extension</a><br />\r\n"; print "</body></html>";