diff --git a/web/html/account.php b/web/html/account.php index 9caada42..9c1eb313 100644 --- a/web/html/account.php +++ b/web/html/account.php @@ -8,7 +8,7 @@ include("pkgfuncs_po.inc"); # Add to handle the i18n of My Packages include("account_po.inc"); # use some form of this for i18n support set_lang(); # this sets up the visitor's language check_sid(); # see if they're still logged in -html_header(); # print out the HTML header +html_header(__("Accounts")); # print out the HTML header # Main page processing here diff --git a/web/html/index.php b/web/html/index.php index 99cccbc6..617b16a3 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -7,10 +7,7 @@ include("pkgfuncs_po.inc"); # Add to handle the i18n of My Packages include("aur.inc"); set_lang(); check_sid(); - -# Any cookies have been sent, can now display HTML -# -html_header(); +html_header(__("Home")); # Big Top Level Table (Table 1) echo "
\n"; diff --git a/web/html/packages.php b/web/html/packages.php index bc398ee5..1600e41c 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -7,7 +7,24 @@ include("pkgfuncs.inc"); # package specific functions include("search_po.inc"); # use some form of this for i18n support set_lang(); # this sets up the visitor's language check_sid(); # see if they're still logged in -html_header(); # print out the HTML header + +# set the title to something useful depending on +# what "page" we're on +# +if (isset($_GET['ID'])) { + $id = pkgname_from_id($_GET['ID']); + if (!empty($id)) { + $title = $id; + } +} else if (isset($_GET['K'])) { + $title = "Search: " . $_GET['K']; +} else if (isset($_GET['do_MyPackages'])) { + $title = __("My Packages"); +} else { + $title = __("Packages"); +} + +html_header($title); # print out the HTML header # enable debugging # diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 638654bc..801348b1 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -8,7 +8,7 @@ include("pkgfuncs.inc"); # package functions include("config.inc"); # configuration file with dir locations set_lang(); # this sets up the visitor's language check_sid(); # see if they're still logged in -html_header(); # print out the HTML header +html_header("Submit"); # print out the HTML header echo "
\n"; echo "
".__("Submit")."
\n"; echo "
\n"; diff --git a/web/lib/aur.inc b/web/lib/aur.inc index c18365cc..a9095cd9 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -334,7 +334,7 @@ function set_lang() { # common header # -function html_header() { +function html_header($title="") { global $_SERVER; global $_COOKIE; global $_POST; @@ -405,6 +405,8 @@ function html_header() { } } + $title = htmlspecialchars($title, ENT_QUOTES); + include('header.php'); return; } diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 46bc5226..d4f3ae7c 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -250,6 +250,23 @@ function pkgnotify_from_sid($sid="") { return $pkgs; } +# get name of package based on pkgid +# +function pkgname_from_id($id="") { + if (!empty($id)) { + $dbh = db_connect(); + $id = intval($id); + $q = "SELECT Name FROM Packages WHERE ID = " . mysql_real_escape_string($id); + $result = db_query($q, $dbh); + if (mysql_num_rows($result) > 0) { + $id = mysql_result($result, 0); + } else { + $id = ""; + } + } + return $id; +} + # display package details # function package_details($id=0, $SID="") { @@ -638,7 +655,7 @@ function pkg_search_page($SID="") { # The search form # - print "
\n"; + print "\n"; print "\n"; print "
\n"; @@ -714,58 +731,6 @@ function pkg_search_page($SID="") { print " \n"; print "\n"; - /* Sort by */ - - print "\n"; - print " ".__("Sort by"); - print "
\n"; - print " \n"; - print "\n"; - - print "\n"; - print " ".__("Sort order"); - print "
\n"; - print " \n"; - print "\n"; - - /* End of Sort by */ - print "\n"; print " ".__("Per page"); print "
\n"; diff --git a/web/template/header.php b/web/template/header.php index 8e022118..b27015ae 100644 --- a/web/template/header.php +++ b/web/template/header.php @@ -4,7 +4,7 @@ "> - AUR (<?php print $LANG; ?>) + AUR (<?php print $LANG; ?>)<?php if ($title != "") { print " - " . $title; } ?>