Commit graph

18 commits

Author SHA1 Message Date
nodivbyzero
eccd328d42 Handle empty resultset getting recent 10 packages
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-03-21 07:45:26 +01:00
Marcel Korpel
1664a24198 Remove 'new' tag from updates table
It was hard to make it consistent with the other new icons from Open
Iconic and it hadn't much use after all.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-31 20:12:56 +01:00
Lukas Fleischer
c751921aff Do not use the term "unsupported" for AUR packages
We no longer use the term [unsupported] to refer to the "repository" of
AUR packages. Update texts and variable names accordingly.

Fixes FS#45381.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:24 +02:00
Lukas Fleischer
29bffe64ad stats.inc.php: Improve definition of "added"
Until now, a package is listed under "Packages added in the past 7 days"
if it was added at most one week ago and if the last modification time
matches the submission time stamp. A package is considered "updated" if
it was modified at most one week ago and the modification time stamp
differs from the submission time stamp.

Since we are using Git to store packages now, there always is a delay
between package creation (which is handled in git-serve) and last
modification (which is handled by git-update). Thus, by the above
definitions, almost every package is considered "updated".

Since there is no reason for excluding packages that were both added and
updated within the past seven days from the "Packages added in the past
7 days" counter, we can drop the check whether the last modification
time matches the submission time stamp. Also, to identify packages that
were actually updated, we now only count packages that were modified at
least one hour after the initial submission.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-07-14 11:17:19 +02:00
Lukas Fleischer
3e75d9bb34 stats.inc.php: Show the 15 most recent updates
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-12 00:02:08 +02:00
Lukas Fleischer
cb00a66855 Fix package statistics
Exclude hidden package bases from the package statistics.

Reported-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 14:42:20 +02:00
Lukas Fleischer
d1df490370 Hide fresh package bases from stats and results
Do not show package bases that have just been created in the package
update statistics or in the search results.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-12-28 17:44:25 +01:00
Balló György
92e827330c Count users in "Trusted User & Developer" group as TU
This reflects the changes in 3610f3c.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-08-02 15:25:46 +02:00
Lukas Fleischer
b7941073ac Add provisional support for package bases
This adds a PackageBases table to the database schema and moves the
following fields from the Packages table to PackageBases:

* CategoryID
* NumVotes
* OutOfDateTS
* SubmittedTS
* ModifiedTS
* SubmitterUID
* MaintainerUID

It also fixes all database accesses to comply with the new layout.

Having a separate PackageBases table is the first step to split package
support. By now, we create one PackageBases entry per package (where the
package base has the same name as the corresponding package). When
adding full support for split packages later, the package base name will
be derived from the pkgbase variable and a single package base will be
shared amongst all packages built from one source package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:35 +02:00
canyonknight
4235d24039 Remove documentation references to database parameter
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-02-10 12:10:38 +01:00
canyonknight
8d6c872297 Remove unnecessary database connection parameter from all functions
All functions now have a database connection method that will use
the same database connection. This imitates the functionality of
passing a database connection as an argument and makes it redundant.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-02-10 12:10:38 +01:00
canyonknight
07edcdab17 stats.inc.php: Remove unnecessary account type lookup
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-19 12:21:16 +01:00
canyonknight
964ea083e6 stats.inc.php: Document all functions using PHPDoc format
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-24 02:04:03 +02:00
canyonknight
e171f6f34e Migrate all DB code to use PDO
All DB code currently uses the quickly aging mysql_* functions. These
functions are strongly discouraged and may eventually be deprecated.

Transition all code to utilize the PDO data access abstraction layer. PDO
allows for consistent query code across multiple databases. This could
potentially allow for someone to use a database other than MySQL with
minimal code changes.

All functions and behaviors are reproduced as faithfully as possible with
PDO equivalents and some changes in code.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 00:58:46 +02:00
Dan McGee
97085daadc user_table optimization
Rather than looking up by username, it makes more sense to look the
stats up by user ID to reduce the number of needed joins.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-05-06 12:12:51 +02:00
Lukas Fleischer
132856a938 Unify function declaration style
Always put the opening brace on the same line as the beginning of the
function declaration.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-03-24 10:34:35 +01:00
Lukas Fleischer
323d418f02 Wrap mysql_real_escape_string() in a function
Wrap mysql_real_escape_string() in a wrapper function db_escape_string()
to ease porting to other databases, and as another step to pulling more
of the database code into a central location.

This is a rebased version of a patch by elij submitted about half a year
ago.

Thanks-to: elij <elij.mx@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-24 17:57:54 +02:00
elij
888db089c5 rename *.inc files to *.inc.php and adjust imports and references
Lukas: Add note to "UPGRADING".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-06-22 15:15:04 +02:00
Renamed from web/lib/stats.inc (Browse further)