summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dibb <beandog@gentoo.org>2010-04-21 09:41:17 -0600
committerSteve Dibb <beandog@gentoo.org>2010-04-21 09:41:17 -0600
commit80b1dec07f920f4e5e8d31bfdaf2c5c648d73056 (patch)
treef7642a81faffd4faaeb1842bb3a3a9d12e4f8665
parentcosmetics (diff)
downloadznurt-org-frontend-80b1dec07f920f4e5e8d31bfdaf2c5c648d73056.tar.gz
znurt-org-frontend-80b1dec07f920f4e5e8d31bfdaf2c5c648d73056.tar.bz2
znurt-org-frontend-80b1dec07f920f4e5e8d31bfdaf2c5c648d73056.zip
recent updates
-rw-r--r--categories.php4
-rw-r--r--category.php5
-rw-r--r--class.db.category.php15
-rw-r--r--class.db.package.changelog.php6
-rw-r--r--class.db.package.manifest.php1
-rw-r--r--inc.header1.php24
-rw-r--r--inc.header2.php17
-rw-r--r--inc.header3.php2
-rw-r--r--inc.i18n.php6
-rw-r--r--license.php2
-rw-r--r--licenses.php2
-rw-r--r--linguas.php3
-rw-r--r--nav.meta.php10
-rw-r--r--xml.php5
14 files changed, 67 insertions, 35 deletions
diff --git a/categories.php b/categories.php
index bb08275..55f669e 100644
--- a/categories.php
+++ b/categories.php
@@ -6,7 +6,7 @@
require_once 'class.db.category.php';
- $sql = "SELECT name, description FROM category ORDER BY name;";
+ $sql = "SELECT c.name, cd.description FROM category c LEFT OUTER JOIN category_description cd ON cd.category = c.id AND cd.lingua = ".$db->quote($lingua)." ORDER BY c.name;";
$arr = $db->getAssoc($sql);
$str = gettext('CATEGORIES');
@@ -14,7 +14,7 @@
echo "<div class='about'>\n";
- echo "<hr class='pkg_rule' style='margin-bottom: 15px; margin-top: 15px;'/>\n";
+ echo "<hr class='pkg_rule' style='margin-bottom: 15px; margin-top: 15px;'>\n";
echo "<table style='padding-bottom: 25px;' cellpadding='4' cellspacing='0'>\n";
diff --git a/category.php b/category.php
index ddc7c6a..16b0749 100644
--- a/category.php
+++ b/category.php
@@ -7,13 +7,14 @@
$obj = new DBCategory($category_id);
$name = $obj->name;
- $description = $obj->description;
+ $description = $obj->getDescription($lingua);
$url = $base_uri."categories";
echo "<h4>$name</h4>";
- echo "<div class='description'>$description</div>";
+ if($description)
+ echo "<div class='description'>$description</div>";
$sql = "SELECT package_name, package, id AS ebuild FROM ebuilds WHERE category = ".$db->quote($category_id).";";
$arr = $db->getAll($sql);
diff --git a/class.db.category.php b/class.db.category.php
index 8ad8456..acd8ceb 100644
--- a/class.db.category.php
+++ b/class.db.category.php
@@ -46,6 +46,21 @@
}
}
+ public function getDescription($lingua = "en") {
+
+ if($this->description)
+ return $this->description;
+
+ $db =& MDB2::singleton();
+
+ $sql = "SELECT description FROM category_description WHERE category = ".$db->quote($this->id)." AND lingua = ".$db->quote($lingua).";";
+
+ $this->description = $db->getOne($sql);
+
+ return $this->description;
+
+ }
+
}
?> \ No newline at end of file
diff --git a/class.db.package.changelog.php b/class.db.package.changelog.php
index dccca30..ea56584 100644
--- a/class.db.package.changelog.php
+++ b/class.db.package.changelog.php
@@ -15,6 +15,7 @@
$db =& MDB2::singleton();
$this->table = 'package_changelog';
+ $this->package = $package;
// Go ahead and query as much as we can
$sql = "SELECT * FROM ".$this->table." WHERE package = ".$db->quote($package).";";
@@ -36,10 +37,11 @@
public function __set($var, $value) {
$db =& MDB2::singleton();
-
+
if(in_array($var, $this->arr_keys)) {
$arr_update = array($var => $value);
- $db->autoExecute($this->table, $arr_update, MDB2_AUTOQUERY_UPDATE, "package = ".$db->quote($this->package));
+
+ $foo = $db->autoExecute($this->table, $arr_update, MDB2_AUTOQUERY_UPDATE, "package = ".$db->quote($this->package));
$this->arr_db[$var] = $value;
}
}
diff --git a/class.db.package.manifest.php b/class.db.package.manifest.php
index daf9f93..6e692a4 100644
--- a/class.db.package.manifest.php
+++ b/class.db.package.manifest.php
@@ -15,6 +15,7 @@
$db =& MDB2::singleton();
$this->table = 'package_manifest';
+ $this->package = $package;
// Go ahead and query as much as we can
$sql = "SELECT * FROM ".$this->table." WHERE package = ".$db->quote($package).";";
diff --git a/inc.header1.php b/inc.header1.php
index 16c8a26..cfcc174 100644
--- a/inc.header1.php
+++ b/inc.header1.php
@@ -128,25 +128,25 @@
$gentoo_changelog = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/$url_category/$url_package/ChangeLog";
$gentoo_cvs = "http://sources.gentoo.org/viewcvs.py/gentoo-x86/$url_category/$url_package/?hideattic=0";
$gentoo_bugs = "https://bugs.gentoo.org/buglist.cgi?query_format=&amp;short_desc_type=allwords&amp;short_desc=$url_package&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED";
- $gentoo_wiki = "http://en.gentoo-wiki.com/w/index.php?title=Special%3ASearch&search=".urlencode(str_replace("-", " ", $package_name));
+ $gentoo_wiki = "http://en.gentoo-wiki.com/w/index.php?title=Special%3ASearch&amp;search=".urlencode(str_replace("-", " ", $package_name));
$gentoo_forums = "http://forums.gentoo.org/search.php?search_terms=all&amp;show_results=topics&amp;search_keywords=$url_package&amp;mode=results";
$bugs = $base_uri."$url_category/$url_package/bugs";
$changelog = $base_uri."$url_category/$url_package/changelog";
- $ml = "http://www.mail-archive.com/search?q=$url_package&l=gentoo-user%40lists.gentoo.org";
+ $ml = "http://www.mail-archive.com/search?q=$url_package&amp;l=gentoo-user%40lists.gentoo.org";
if($lingua == "cs")
- $ml = "http://search.gmane.org/?query=$url_package&group=gmane.linux.gentoo.user.czech-slovak";
+ $ml = "http://search.gmane.org/?query=$url_package&amp;group=gmane.linux.gentoo.user.czech-slovak";
elseif($lingua == "de")
- $ml = "http://search.gmane.org/?query=$url_package&group=gmane.linux.gentoo.user.german";
+ $ml = "http://search.gmane.org/?query=$url_package&amp;group=gmane.linux.gentoo.user.german";
elseif($lingua == "fr")
- $ml = "http://search.gmane.org/?query=$url_package&group=gmane.linux.gentoo.user.french";
+ $ml = "http://search.gmane.org/?query=$url_package&amp;group=gmane.linux.gentoo.user.french";
elseif($lingua == "hu")
- $ml = "http://search.gmane.org/?query=$url_package&group=gmane.linux.gentoo.user.hungarian";
+ $ml = "http://search.gmane.org/?query=$url_package&amp;group=gmane.linux.gentoo.user.hungarian";
elseif($lingua == "id")
- $ml = "http://search.gmane.org/?query=$url_package&group=gmane.linux.gentoo.user.indonesia";
+ $ml = "http://search.gmane.org/?query=$url_package&amp;group=gmane.linux.gentoo.user.indonesia";
elseif($lingua == "ru")
- $ml = "http://search.gmane.org/?query=$url_package&group=gmane.linux.gentoo.user.russian";
+ $ml = "http://search.gmane.org/?query=$url_package&amp;group=gmane.linux.gentoo.user.russian";
if($view == 'ebuild') {
$dependencies = $base_uri."$url_category/$url_pf/dependencies";
@@ -178,7 +178,7 @@
/** New **/
// $html .= "<!-- start package -->\n";
$html .= "<div class='package'>\n";
- $html .= "\t<hr class='pkg_rule' />\n";
+ $html .= "\t<hr class='pkg_rule'>\n";
$html .= "\t\t<div class='pkg_container'>\n";
$html .= "\t\t\t<div class='pkg_name'><a class='pkg_link' href='$base_uri$url_category/$url_package' title='$cp'>$package_name</a></div>\n";
@@ -199,12 +199,12 @@
$html .= "\t\t\t\t\t\t\t<td><b></b></td>\n";
foreach($arr_display_arch as $name) {
- $class = "";
+ $class = "nowrap";
if($name == end($arr_display_arch))
- $class = "last_cell";
+ $class = "$class last_cell";
// FIXME CSS in style tag
- $html .= "\t\t\t<th class='$class' style='white-space: nowrap;'>$name</li>\n";
+ $html .= "\t\t\t<th class='$class'>$name</th>\n";
}
$html .= "\t\t\t\t\t\t</tr>\n";
diff --git a/inc.header2.php b/inc.header2.php
index f9fe8c0..f79b6c0 100644
--- a/inc.header2.php
+++ b/inc.header2.php
@@ -9,9 +9,9 @@
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="description" content="" />
- <meta name="keywords" content="" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta name="description" content="">
+ <meta name="keywords" content="">
<link rel="stylesheet" href="<?=$base_uri;?>css/master.css" type="text/css" media="screen" title="no title" charset="utf-8">
<? if($lingua == 'es') { ?>
@@ -26,7 +26,7 @@
<? if($lingua == 'cs') { ?>
<link rel="stylesheet" href="<?=$base_uri;?>css/cs.css" type="text/css" media="screen" title="no title" charset="utf-8">
<? } ?>
- <link rel="icon" type="image/vnd.microsoft.icon" href="<?=$base_uri;?>favicon.ico" />
+ <link rel="icon" type="image/vnd.microsoft.icon" href="<?=$base_uri;?>favicon.ico">
<title>gentoo linux ~ <?=$html_title;?></title>
<?
@@ -59,4 +59,11 @@
?>
- <script type='text/javascript' src='<?=$base_uri;?>prototype.js'></script> \ No newline at end of file
+ <script type='text/javascript' src='<?=$base_uri;?>prototype.js'></script>
+ <script type='text/javascript'>
+ function disableAutocomplete() {
+ if($('searchForm')) {
+ $('searchForm').writeAttribute('autocomplete', 'off');
+ }
+ }
+ </script> \ No newline at end of file
diff --git a/inc.header3.php b/inc.header3.php
index cbdabcb..c3a614a 100644
--- a/inc.header3.php
+++ b/inc.header3.php
@@ -1,2 +1,2 @@
</head>
-<body id='<?=$body;?>'> \ No newline at end of file
+<body id='<?=$body;?>' onload="disableAutocomplete();"> \ No newline at end of file
diff --git a/inc.i18n.php b/inc.i18n.php
index 8372616..53ca607 100644
--- a/inc.i18n.php
+++ b/inc.i18n.php
@@ -9,6 +9,7 @@
'fr_FR' => 'French',
'tr_TR' => 'Turkish',
'it_IT' => 'Italian',
+ 'ru_RU' => 'Russian',
);
if($_SERVER['HTTP_HOST'] == "cs.znurt.org") {
@@ -28,9 +29,12 @@
} elseif($_SERVER['HTTP_HOST'] == "it.znurt.org" || $lingua == "it") {
$lingua = "it";
$locale = "it_IT";
- } elseif($_SERVER['HTTP_HOST'] == "tr.znurt.org") {
+ } elseif($_SERVER['HTTP_HOST'] == "tr.znurt.org" || $lingua == "tr") {
$lingua = "tr";
$locale = "tr_TR";
+ } elseif($_SERVER['HTTP_HOST'] == "ru.znurt.org" || $lingua == "ru") {
+ $lingua = "ru";
+ $locale = "ru_RU";
} else
$lingua = "en";
diff --git a/license.php b/license.php
index fba5a16..2307744 100644
--- a/license.php
+++ b/license.php
@@ -14,7 +14,7 @@
$sql = "SELECT category_name, package_name, description FROM view_package_licenses WHERE license_name = ".$db->quote($license_name)." ORDER BY category_name, package_name;";
$arr = $db->getAll($sql);
- echo "<hr class='pkg_rule' style='margin-bottom: 15px; margin-top: 15px;'/>\n";
+ echo "<hr class='pkg_rule' style='margin-bottom: 15px; margin-top: 15px;'>\n";
echo "<table class='licenses' cellpadding='4' cellspacing='0'>\n";
diff --git a/licenses.php b/licenses.php
index 84edcab..b7ca440 100644
--- a/licenses.php
+++ b/licenses.php
@@ -12,7 +12,7 @@
echo "<h4>".gettext("SOFTWARE LICENSES")."</h4>\n";
- echo "<hr class='pkg_rule' style='margin-bottom: 15px; margin-top: 15px;'/>\n";
+ echo "<hr class='pkg_rule' style='margin-bottom: 15px; margin-top: 15px;'>\n";
echo "<table class='licenses' cellpadding='4' cellspacing='0'>\n";
diff --git a/linguas.php b/linguas.php
index 03eeb8e..5d931f3 100644
--- a/linguas.php
+++ b/linguas.php
@@ -7,7 +7,7 @@
$str = gettext("LINGUAS");
echo "<h4>$str</h4>\n";
- echo "<hr class='pkg_rule' style='margin-bottom: 15px; margin-top: 15px;'/>\n";
+ echo "<hr class='pkg_rule' style='margin-bottom: 15px; margin-top: 15px;'>\n";
echo "<div class='about'>\n";
@@ -21,6 +21,7 @@
'French' => array('http://fr.znurt.org/', 'fr'),
'German' => array('http://de.znurt.org/', 'de'),
'Italian' => array('http://it.znurt.org/', 'it'),
+ 'Russian' => array('http://ru.znurt.org/', 'ru'),
'Spanish' => array('http://es.znurt.org/', 'es'),
'Turkish' => array('http://tr.znurt.org/', 'tr',),
);
diff --git a/nav.meta.php b/nav.meta.php
index b06bd8b..f360e1e 100644
--- a/nav.meta.php
+++ b/nav.meta.php
@@ -1,14 +1,14 @@
<div class="meta">
<span class="copyright">
- <a href="<?=$base_uri.$url_about;?>"><?=gettext('About');?></a> &nbsp; | &nbsp; <a href="<?=$base_uri;?>bugs"><?=gettext('Bugs');?></a> &nbsp; | &nbsp; <a href="<?=$base_uri;?>requests"><?=gettext('Requests');?></a>
- <br/><br/>
+ <a href="<?=$base_uri.$url_about;?>"><?=gettext('About');?></a> &nbsp; | &nbsp; <a href="http://spaceparanoids.org/trac/znurt/report/1"><?=gettext('Bugs');?></a>
+ <br><br>
<?
if($lingua == "de") {
- echo "Fragen, Kommentare, Korrekturen, Jobangebote?<br/>E-Mail an <a href='mailto:beandog@gentoo.org'>beandog@gentoo.org</a>\n";
+ echo "Fragen, Kommentare, Korrekturen, Jobangebote?<br>E-Mail an <a href='mailto:beandog@gentoo.org'>beandog@gentoo.org</a>\n";
} else {
- echo "Questions, Comments, Corrections, Job Offers?<br/>Email <a href='mailto:beandog@gentoo.org'>beandog@gentoo.org</a>\n";
+ echo "Questions, Comments, Corrections, Job Offers?<br>Email <a href='mailto:beandog@gentoo.org'>beandog@gentoo.org</a>\n";
}
?>
@@ -16,7 +16,7 @@
</span>
- <p><a href="https://www.sevenl.net/"><img src="<?=$base_uri;?>img/sevenl.png" alt="Managed Dedicated Server Hosting By SevenL" width="125" height="35" style='border: 1px solid #999999; margin-top: 15px;' /></a></p>
+ <p><a href="https://www.sevenl.net/"><img src="<?=$base_uri;?>img/sevenl.png" alt="Managed Dedicated Server Hosting By SevenL" width="125" height="35" style='border: 1px solid #999999; margin-top: 15px;'></a></p>
</div>
diff --git a/xml.php b/xml.php
index 8bdb8a3..77ea0b1 100644
--- a/xml.php
+++ b/xml.php
@@ -4,6 +4,7 @@
require_once 'inc.header1.php';
require_once 'class.db.package.php';
+ require_once 'class.db.package.changelog.php';
require_once 'class.db.category.php';
require_once 'class.portage.package.changelog.php';
@@ -115,13 +116,13 @@
$e = new DBEbuild($ebuild);
$p = new DBPackage($package);
$c = new DBCategory($p->category);
- $ch = new PackageChangelog($p->changelog);
+ $ch = new DBPackageChangelog($package);
$package_name = $p->name;
$category_name = $c->name;
$pf = $e->pf;
$ebuild_portage_mtime = $e->portage_mtime;
- $recent_changes = htmlspecialchars($ch->getRecentChanges());
+ $recent_changes = htmlspecialchars($ch->recent_changes);
$description = htmlspecialchars($p->description);
$entries[$x] = $row;