Work on links interface...

pull/193/head
Michael R Sweet 21 years ago
parent 6aec8c479b
commit 7389cc6fc0
  1. 28
      www/index.php
  2. 1103
      www/links.php
  3. 6
      www/phplib/globals.php
  4. 4
      www/phplib/html.php
  5. 67
      www/poll.php

@ -1,6 +1,6 @@
<?php <?php
// //
// "$Id: index.php,v 1.5 2004/05/20 03:38:42 mike Exp $" // "$Id: index.php,v 1.6 2004/05/20 15:45:55 mike Exp $"
// //
// Mini-XML home page... // Mini-XML home page...
// //
@ -15,16 +15,7 @@ print("<h1 align='center'>Mini-XML Home Page</h1>");
print("<p><table width='100%' height='100%' border='0' cellpadding='0' " print("<p><table width='100%' height='100%' border='0' cellpadding='0' "
."cellspacing='0'>\n" ."cellspacing='0'>\n"
."<tr><td valign='top' width='33%'>"); ."<tr><td valign='top' width='30%'>");
html_start_table(array("Current Poll [&nbsp;<a href='poll.php'>"
."Show&nbsp;All</a>&nbsp;]"));
html_start_row();
print("<td>");
show_poll(get_recent_poll());
print("</td>");
html_end_row();
html_end_table();
html_start_table(array("Quick Info"), "100%", "100%"); html_start_table(array("Quick Info"), "100%", "100%");
html_start_row(); html_start_row();
@ -56,13 +47,22 @@ print("<td>"
html_end_row(); html_end_row();
html_end_table(); html_end_table();
html_start_table(array("Current Poll [&nbsp;<a href='poll.php'>"
."Show&nbsp;All</a>&nbsp;]"));
html_start_row();
print("<td>");
show_poll(get_recent_poll());
print("</td>");
html_end_row();
html_end_table();
print("</td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td>" print("</td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td>"
."<td valign='top' width='67%'>" ."<td valign='top' width='70%'>"
."<h2>Recent Articles [&nbsp;<a href='articles.php'>Show&nbsp;All</a>" ."<h2>Recent Articles [&nbsp;<a href='articles.php'>Show&nbsp;All</a>"
."&nbsp;]</h2>\n"); ."&nbsp;]</h2>\n");
$result = db_query("SELECT * FROM article WHERE is_published = 1 " $result = db_query("SELECT * FROM article WHERE is_published = 1 "
."ORDER BY modify_date DESC LIMIT 4"); ."ORDER BY modify_date DESC LIMIT 8");
$count = db_count($result); $count = db_count($result);
if ($count == 0) if ($count == 0)
@ -97,6 +97,6 @@ print("</td></tr>\n"
html_footer(); html_footer();
// //
// End of "$Id: index.php,v 1.5 2004/05/20 03:38:42 mike Exp $". // End of "$Id: index.php,v 1.6 2004/05/20 15:45:55 mike Exp $".
// //
?> ?>

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
<?php <?php
// //
// "$Id: globals.php,v 1.7 2004/05/20 12:31:54 mike Exp $" // "$Id: globals.php,v 1.8 2004/05/20 15:45:55 mike Exp $"
// //
// Global PHP constants and variables... // Global PHP constants and variables...
// //
@ -21,7 +21,7 @@ $PAGE_MAX = 10; // Max items per page
// PHP transition stuff... // PHP transition stuff...
// //
global $_COOKIE, $_FILES, $_GET, $_POST, $_SERVER; global $_COOKIE, $_FILES, $_POST, $_SERVER;
$argc = $_SERVER["argc"]; $argc = $_SERVER["argc"];
$argv = $_SERVER["argv"]; $argv = $_SERVER["argv"];
@ -36,6 +36,6 @@ else
$PHP_URL = "http://$_SERVER[SERVER_NAME]:$_SERVER[SERVER_PORT]$_SERVER[PHP_SELF]"; $PHP_URL = "http://$_SERVER[SERVER_NAME]:$_SERVER[SERVER_PORT]$_SERVER[PHP_SELF]";
// //
// End of "$Id: globals.php,v 1.7 2004/05/20 12:31:54 mike Exp $". // End of "$Id: globals.php,v 1.8 2004/05/20 15:45:55 mike Exp $".
// //
?> ?>

@ -1,6 +1,6 @@
<?php <?php
// //
// "$Id: html.php,v 1.11 2004/05/20 03:38:42 mike Exp $" // "$Id: html.php,v 1.12 2004/05/20 15:45:55 mike Exp $"
// //
// PHP functions for standardized HTML output... // PHP functions for standardized HTML output...
// //
@ -113,6 +113,8 @@ html_header($title = "", // I - Additional document title
."<a href='${path}articles.php'>Articles</a> | " ."<a href='${path}articles.php'>Articles</a> | "
."<a href='${path}documentation.php'>Documentation</a> | " ."<a href='${path}documentation.php'>Documentation</a> | "
."<a href='${path}software.php'>Download</a> | " ."<a href='${path}software.php'>Download</a> | "
."<a href='${path}links.php'>Links</a> | "
."<a href='${path}poll.php'>Polls</a> | "
."<a href='${path}str.php'>Support</a>&nbsp;]</td>" ."<a href='${path}str.php'>Support</a>&nbsp;]</td>"
."<td align='right'>[&nbsp;"); ."<td align='right'>[&nbsp;");

@ -1,6 +1,6 @@
<?php <?php
// //
// "$Id: poll.php,v 1.2 2004/05/20 12:31:54 mike Exp $" // "$Id: poll.php,v 1.3 2004/05/20 15:45:55 mike Exp $"
// //
// Poll page... // Poll page...
// //
@ -71,37 +71,44 @@ switch ($op)
print("<h1>Polls</h1>\n"); print("<h1>Polls</h1>\n");
html_start_table(array("ID", "Question::2")); if (db_count($result) == 0)
while ($row = db_next($result))
{ {
$id = $row['id']; print("<p>No polls found.</p>\n");
$votes = $row['votes'];
$question = htmlspecialchars($row['question']);
$ccount = count_comments("poll.php_r$id");
if ($ccount == 1)
$ccount .= " comment";
else
$ccount .= " comments";
html_start_row();
print("<td align='center'>#$row[id]</td>"
."<td align='center' width='67%'>$question");
if (!$row['is_published'])
print(" <img src='images/private.gif' width='16' height='16' "
."align='middle' alt='private'/>");
print("</td><td nowrap><a href='$PHP_SELF?c$id'>Vote</a> | "
."<a href='$PHP_SELF?r$id'>Results</a>");
if ($LOGIN_LEVEL > AUTH_USER)
print(" | <a href='$PHP_SELF?e$id'>Edit</a>");
print(" ($votes total votes, $ccount)</td>");
html_end_row();
} }
else
{
html_start_table(array("ID", "Question::2"));
html_end_table(); while ($row = db_next($result))
{
$id = $row['id'];
$votes = $row['votes'];
$question = htmlspecialchars($row['question']);
$ccount = count_comments("poll.php_r$id");
if ($ccount == 1)
$ccount .= " comment";
else
$ccount .= " comments";
html_start_row();
print("<td align='center'>#$row[id]</td>"
."<td align='center' width='67%'>$question");
if (!$row['is_published'])
print(" <img src='images/private.gif' width='16' height='16' "
."align='middle' alt='private'/>");
print("</td><td nowrap><a href='$PHP_SELF?c$id'>Vote</a> | "
."<a href='$PHP_SELF?r$id'>Results</a>");
if ($LOGIN_LEVEL > AUTH_USER)
print(" | <a href='$PHP_SELF?e$id'>Edit</a>");
print(" ($votes total votes, $ccount)</td>");
html_end_row();
}
html_end_table();
}
db_free($result); db_free($result);
@ -383,6 +390,6 @@ switch ($op)
db_close(); db_close();
// //
// End of "$Id: poll.php,v 1.2 2004/05/20 12:31:54 mike Exp $". // End of "$Id: poll.php,v 1.3 2004/05/20 15:45:55 mike Exp $".
// //
?> ?>

Loading…
Cancel
Save