function account_header($title) { global $PHP_SELF, $LOGIN_USER, $LOGIN_LEVEL; html_header("{$title}"); html_start_links(1); html_link("{$LOGIN_USER}", "{$PHP_SELF}"); html_link("Change Password", "{$PHP_SELF}?P"); if ($LOGIN_LEVEL == AUTH_ADMIN) { html_link("Manage Accounts", "{$PHP_SELF}?A"); } if ($LOGIN_LEVEL > AUTH_USER) { html_link("New/Pending", "{$PHP_SELF}?L"); } html_link("Logout", "{$PHP_SELF}?X"); html_end_links(); }
function show_prevnext_msg($group, $group_filter, $start, $count, $msg, $threaded) { global $PHP_SELF, $options; print "<p><table width='100%' border='0' cellpadding='0' cellspacing='0'>\n" . "<tr><td width='25%'>"; if ($msg > 1) { $i = $msg - 1; html_start_links(); html_link("Previous Message", "{$PHP_SELF}?s{$start}+g{$group}+v{$i}{$options}"); html_end_links(); } print "</td><td align='center' width='50%'>"; if (!ereg(".*\\.announce", $group) && !ereg(".*\\.commit", $group)) { html_start_links(); html_link("New Message", "{$PHP_SELF}?s{$start}+g{$group}+n{$options}"); html_link("Reply", "{$PHP_SELF}?s{$start}+g{$group}+r{$msg}{$options}"); html_end_links(); } print "</td><td align='right' width='25%'>"; if ($msg < $count) { $i = $msg + 1; html_start_links(); html_link("Next Message", "{$PHP_SELF}?s{$start}+g{$group}+v{$i}{$options}"); html_end_links(); } print "</td></tr>\n" . "</table></p>\n"; }
$file = ""; } $site = mirror_closest(); if (array_key_exists("VERSION", $_GET)) { $version = $_GET["VERSION"]; } else { $data = explode(" ", $files[0]); $version = $data[1]; } // Show the standard header... if ($site != "" && $file != "") { html_header("Download", "{$site}/{$file}"); } else { html_header("Download"); } html_start_links(1); $curversion = ""; for ($i = 0; $i < sizeof($files); $i++) { // Grab the data for the current file... $data = explode(" ", $files[$i]); $fversion = $data[1]; if ($fversion != $curversion) { $curversion = $fversion; html_link("v{$fversion}", "{$PHP_SELF}?VERSION={$fversion}"); } } html_link("Subversion", "{$PHP_SELF}#SVN"); html_end_links(); // Show files or sites... if ($file != "") { print "<h1>Download</h1>\n";
print "<center><table>\n"; print "<tr><td></td><th align='left'>{$question}</th></tr>\n"; for ($i = 0; $i < 10; $i++) { if ($row["answer{$i}"] != "") { $percent = (int) (100 * $row["count{$i}"] / $votes); $size = (int) (300 * $row["count{$i}"] / $max_count); $answer = htmlspecialchars($row["answer{$i}"]); $count = $row["count{$i}"]; print "<tr><td align='right'>{$answer}</td><td>" . "<img src='{$rootpath}images/graph.gif' width='{$size}' " . "height='12'> {$count} / {$percent}%</td></tr>\n"; } } print "<tr><td></td><th align='right'>{$votes} total votes.</th></tr>\n"; print "</table></center>\n"; } print "<hr noshade/>\n" . "<h2><a name='_USER_COMMENTS'>User Comments</a></h2>\n"; html_start_links(); html_link("Submit Comment", "comment.php?r0+ppoll.php_r{$poll}"); html_end_links(); show_comments("poll.php_r{$poll}"); db_free($result); html_footer(); break; case 'v': // Vote on a poll $answers = ""; if ($REQUEST_METHOD == "POST") { if (array_key_exists("ANSWER", $_POST)) { $answer = (int) $_POST["ANSWER"]; $answers = ",count{$answer}=count{$answer}+1"; } else { for ($i = 0; $i < 10; $i++) {
function // O - Number of comments show_comments($url, // I - URL for comment $path = "", // I - Path component $parent_id = 0, // I - Parent comment $heading = 3) // I - Heading level { global $_COOKIE, $LOGIN_LEVEL; $result = db_query("SELECT * FROM comment WHERE " ."url = '" . db_escape($url) ."' " ."AND parent_id = $parent_id " ."ORDER BY id"); if (array_key_exists("MODPOINTS", $_COOKIE)) $modpoints = $_COOKIE["MODPOINTS"]; else $modpoints = 5; if ($parent_id == 0 && $modpoints > 0) print("<P>You have $modpoints moderation points available.</P>\n"); if ($heading > 6) $heading = 6; $safeurl = urlencode($url); $num_comments = 0; $div = 0; while ($row = db_next($result)) { if ($row["status"] > 0) { if ($heading > 3 && !$div) { print("<div style='margin-left: 3em;'>\n"); $div = 1; } $num_comments ++; $create_date = date("H:i M d, Y", $row['create_date']); $create_user = sanitize_email($row['create_user']); $contents = format_text($row['contents']); print("<h$heading><a name='_USER_COMMENT_$row[id]'>From</a> " ."$create_user, $create_date (score=$row[status])</h$heading>\n" ."$contents\n"); html_start_links(); if ($LOGIN_LEVEL >= AUTH_DEVEL) { html_link("Edit", "${path}comment.php?e$row[id]+p$safeurl"); html_link("Delete", "${path}comment.php?d$row[id]+p$safeurl"); } html_link("Reply", "${path}comment.php?r$row[id]+p$safeurl"); if ($modpoints > 0) { if ($row['status'] > 0) html_link("Moderate Down", "${path}comment.php?md$row[id]+p$safeurl"); if ($row['status'] < 5) html_link("Moderate Up", "${path}comment.php?mu$row[id]+p$safeurl"); } html_end_links(); } $num_comments += show_comments($url, $path, $row['id'], $heading + 1); } db_free($result); if ($div) print("</div>\n"); return ($num_comments); }