コード例 #1
0
ファイル: account.php プロジェクト: jokepinocchio/MiniXML
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();
}
コード例 #2
0
ファイル: forums.php プロジェクト: jokepinocchio/MiniXML
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";
}
コード例 #3
0
ファイル: software.php プロジェクト: jokepinocchio/MiniXML
} 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 "<p>Your download should begin shortly. If not, please " . "<a href='{$site}/{$file}'>click here</a> to download the file " . "from the current mirror.</p>\n" . "<form action='{$PHP_SELF}' method='GET' name='download'>\n" . "<input type='hidden' name='FILE' value='" . htmlspecialchars($file, ENT_QUOTES) . "'>\n" . "<input type='hidden' name='VERSION' value='" . htmlspecialchars($version, ENT_QUOTES) . "'>\n";
    reset($MIRRORS);
    while (list($key, $val) = each($MIRRORS)) {
        print "<input type='radio' name='SITE' value='{$key}' " . "onClick='document.download.submit();'";
        if ($site == $key) {
            print "  checked";
        }
        print ">{$val['0']}<br>\n";
    }
    print "<p><input type='submit' value='Change Mirror Site'>\n" . "</form>\n";
} else {
    // Show files...
コード例 #4
0
ファイル: common.php プロジェクト: jokepinocchio/MiniXML
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);
}