Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Kristian Klausen
aurweb
Commits
e3587ddf
Commit
e3587ddf
authored
Mar 06, 2005
by
eric
Browse files
started working on pkgedit for comments
parent
aae43d9a
Changes
8
Hide whitespace changes
Inline
Side-by-side
support/schema/aur-schema.sql
View file @
e3587ddf
...
...
@@ -187,9 +187,11 @@ CREATE TABLE PackageComments (
UsersID
INTEGER
UNSIGNED
NOT
NULL
,
Comments
TEXT
NOT
NULl
DEFAULT
''
,
CommentTS
BIGINT
UNSIGNED
NOT
NULL
DEFAULT
0
,
DelUsersID
INTEGER
UNSIGNED
NOT
NULL
DEFAULT
0
,
INDEX
(
UsersID
),
INDEX
(
PackageID
),
FOREIGN
KEY
(
UsersID
)
REFERENCES
Users
(
ID
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
DelUsersID
)
REFERENCES
Users
(
ID
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
PackageID
)
REFERENCES
Packages
(
ID
)
ON
DELETE
CASCADE
);
support/schema/dummy-data.sql.bz2
View file @
e3587ddf
No preview for this file type
support/schema/gendummydata.py
View file @
e3587ddf
...
...
@@ -267,9 +267,9 @@ for p in seen_pkgs.keys():
#
num_comments
=
random
.
randrange
(
PKG_CMNTS
[
0
],
PKG_CMNTS
[
1
])
for
i
in
range
(
0
,
num_comments
):
fortune
=
esc
(
commands
.
getoutput
(
FORTUNE_CMD
).
replace
(
"'"
,
"
"
).
replace
(
"
\n
"
,
"
"
))
fortune
=
esc
(
commands
.
getoutput
(
FORTUNE_CMD
).
replace
(
"'"
,
""
))
now
=
NOW
+
random
.
randrange
(
400
,
86400
*
3
)
s
=
"INSERT INTO PackageComments (PackageID, UsersID, Comments, CommentTS) VALUES (%d, %d, '%s', %d);
\n
"
%
(
seen_pkgs
[
p
],
uuid
,
fortune
,
now
)
s
=
"INSERT INTO PackageComments (PackageID, UsersID, Comments, CommentTS) VALUES (%d, %d, '%s', %d);
\n
"
%
(
seen_pkgs
[
p
],
genUID
()
,
fortune
,
now
)
out
.
write
(
s
)
if
location_id
==
1
:
# Unsupported - just a PKGBUILD and maybe other stuff
...
...
web/html/packages.php
View file @
e3587ddf
...
...
@@ -133,7 +133,6 @@ if (isset($_REQUEST["do_Flag"])) {
$disown
.
=
", "
.
$pid
;
}
}
$atype
=
account_from_sid
(
$_COOKIE
[
"AURSID"
]);
if
(
$atype
==
"Trusted User"
||
$atype
==
"Developer"
)
{
$field
=
"AURMaintainerUID"
;
}
elseif
(
$atype
==
"User"
)
{
...
...
@@ -185,7 +184,6 @@ if (isset($_REQUEST["do_Flag"])) {
$delete
.
=
", "
.
$pid
;
}
}
$atype
=
account_from_sid
(
$_COOKIE
[
"AURSID"
]);
if
(
$atype
==
"Trusted User"
||
$atype
==
"Developer"
)
{
$field
=
"AURMaintainerUID"
;
}
elseif
(
$atype
==
"User"
)
{
...
...
@@ -282,7 +280,6 @@ if (isset($_REQUEST["do_Flag"])) {
$adopt
.
=
", "
.
$pid
;
}
}
$atype
=
account_from_sid
(
$_COOKIE
[
"AURSID"
]);
if
(
$atype
==
"Trusted User"
||
$atype
==
"Developer"
)
{
$field
=
"AURMaintainerUID"
;
}
elseif
(
$atype
==
"User"
)
{
...
...
web/html/pkgedit.php
0 → 100644
View file @
e3587ddf
<?
include
(
"aur.inc"
);
# access AUR common functions
include
(
"pkgfuncs.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
$DBUG
=
0
;
if
(
$DBUG
)
{
print
"<pre>
\n
"
;
print_r
(
$_REQUEST
);
print
"</pre>
\n
"
;
}
if
(
isset
(
$_COOKIE
[
"AURSID"
]))
{
$atype
=
account_from_sid
(
$_COOKIE
[
"AURSID"
]);
}
else
{
$atype
=
""
;
}
if
(
!
$atype
)
{
print
__
(
"You must be logged in before you can edit package information."
);
print
"<br />
\n
"
;
}
else
{
if
(
!
$_REQUEST
[
"ID"
])
{
print
__
(
"Missing package ID."
);
print
"<br />
\n
"
;
}
else
{
# Main script processing here... basic error checking done.
#
if
(
$_REQUEST
[
"add_Comment"
])
{
if
(
$_REQUEST
[
"comment"
])
{
}
else
{
}
}
}
}
html_footer
(
"
\$
Id$"
);
# Use the $Id$ keyword
# NOTE: when checking in a new file, use
# 'svn propset svn:keywords "Id" filename.php'
# to tell svn to expand the "Id" keyword.
# vim: ts=2 sw=2 et ft=php
?>
web/html/pkgmgmnt.php
deleted
100644 → 0
View file @
aae43d9a
<?
include
(
"aur.inc"
);
# access AUR common functions
include
(
"mgmnt_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
# vistor has requested package management for a specific package
#
print
__
(
"Manage package ID: %s"
,
array
(
$_REQUEST
[
"ID"
]))
.
"<br />
\n
"
;
# NOTE: managing an orphaned package will automatically force adoption
#
html_footer
(
"
\$
Id$"
);
# vim: ts=2 sw=2 noet ft=php
?>
web/lang/pkgfuncs_po.inc
View file @
e3587ddf
...
...
@@ -11,6 +11,36 @@
include_once
(
"translator.inc"
);
global
$_t
;
$_t
[
"en"
][
"Comment by: %h%s%h on %h%s%h"
]
=
"Comment by: %h%s%h on %h%s%h"
;
# $_t["es"]["Category"] = "--> Traduccin espaola aqu. <--";
# $_t["fr"]["Category"] = "--> Traduction franaise ici. <--";
# $_t["de"]["Category"] = "--> Deutsche bersetzung hier. <--";
$_t
[
"en"
][
"Add Comment"
]
=
"Add Comment"
;
# $_t["es"]["Category"] = "--> Traduccin espaola aqu. <--";
# $_t["fr"]["Category"] = "--> Traduction franaise ici. <--";
# $_t["de"]["Category"] = "--> Deutsche bersetzung hier. <--";
$_t
[
"en"
][
"Comments"
]
=
"Comments"
;
# $_t["es"]["Category"] = "--> Traduccin espaola aqu. <--";
# $_t["fr"]["Category"] = "--> Traduction franaise ici. <--";
# $_t["de"]["Category"] = "--> Deutsche bersetzung hier. <--";
$_t
[
"en"
][
"Sources"
]
=
"Sources"
;
# $_t["es"]["Category"] = "--> Traduccin espaola aqu. <--";
# $_t["fr"]["Category"] = "--> Traduction franaise ici. <--";
# $_t["de"]["Category"] = "--> Deutsche bersetzung hier. <--";
$_t
[
"en"
][
"Dependencies"
]
=
"Dependencies"
;
# $_t["es"]["Category"] = "--> Traduccin espaola aqu. <--";
# $_t["fr"]["Category"] = "--> Traduction franaise ici. <--";
# $_t["de"]["Category"] = "--> Deutsche bersetzung hier. <--";
$_t
[
"en"
][
"Package Details"
]
=
"Package Details"
;
# $_t["es"]["Category"] = "--> Traduccin espaola aqu. <--";
# $_t["fr"]["Category"] = "--> Traduction franaise ici. <--";
# $_t["de"]["Category"] = "--> Deutsche bersetzung hier. <--";
$_t
[
"en"
][
"Category"
]
=
"Category"
;
# $_t["es"]["Category"] = "--> Traduccin espaola aqu. <--";
# $_t["fr"]["Category"] = "--> Traduction franaise ici. <--";
...
...
web/lib/pkgfuncs.inc
View file @
e3587ddf
...
...
@@ -148,6 +148,27 @@ function create_dummy($pname="", $sid="") {
}
# grab package comments
#
function
package_comments
(
$pkgid
=
0
)
{
$comments
=
array
();
if
(
$pkgid
)
{
$dbh
=
db_connect
();
$q
=
"SELECT UserName, Comments, CommentTS "
;
$q
.
=
"FROM PackageComments, Users "
;
$q
.
=
"WHERE PackageComments.UsersID = Users.ID"
;
$q
.
=
" AND PackageID = "
.
mysql_escape_string
(
$pkgid
);
$q
.
=
" AND DelUsersID = 0"
;
# only display non-deleted comments
$q
.
=
" ORDER BY CommentTS ASC"
;
$result
=
db_query
(
$q
,
$dbh
);
if
(
!
$result
)
{
return
array
();}
while
(
$row
=
mysql_fetch_assoc
(
$result
))
{
$comments
[]
=
$row
;
}
}
return
$comments
;
}
# grab package sources
#
function
package_sources
(
$pkgid
=
0
)
{
...
...
@@ -217,7 +238,7 @@ function package_details($id=0) {
print
"<table cellspacing='3' class='boxSoft'>
\n
"
;
print
"<tr>
\n
"
;
print
" <td class='boxSoftTitle' align='right'>"
;
print
"<span class='f3'>Package Details</span></td>
\n
"
;
print
"<span class='f3'>
"
.
__
(
"
Package Details
"
)
.
"
</span></td>
\n
"
;
print
"</tr>
\n
"
;
print
"<tr>
\n
"
;
print
" <td class='boxSoft'>
\n
"
;
...
...
@@ -267,7 +288,7 @@ function package_details($id=0) {
print
" <td valign='top' style='padding-right: 10'>"
;
print
"<table class='boxSoft' style='width: 200px'>"
;
print
"<tr><td class='boxSoftTitle'><span class='f3'>"
;
print
"Dependencies</span></td></tr>
\n
"
;
print
__
(
"Dependencies
"
)
.
"
</span></td></tr>
\n
"
;
print
"<tr><td class='boxSoft'>"
;
$deps
=
package_dependencies
(
$row
[
"ID"
]);
# $deps[0] = array('id','name', 'dummy');
while
(
list
(
$k
,
$darr
)
=
each
(
$deps
))
{
...
...
@@ -289,7 +310,7 @@ function package_details($id=0) {
print
" <td valign='top'>"
;
print
"<table class='boxSoft' style='width: 200px'>"
;
print
"<tr><td class='boxSoftTitle'><span class='f3'>"
;
print
"Sources</span></td></tr>
\n
"
;
print
__
(
"Sources
"
)
.
"
</span></td></tr>
\n
"
;
print
"<tr><td class='boxSoft'>"
;
$sources
=
package_sources
(
$row
[
"ID"
]);
# $sources[0] = 'src';
while
(
list
(
$k
,
$src
)
=
each
(
$sources
))
{
...
...
@@ -302,12 +323,53 @@ function package_details($id=0) {
else
{
//It is presumably an internal source
print
"<a href='"
.
dirname
(
$row
[
'URLPath'
])
.
"/"
.
$row
[
'Name'
]
.
"/"
.
$src
.
"'>"
.
$src
.
"</a><br />
\n
"
;
print
"<a href='"
.
dirname
(
$row
[
'URLPath'
])
.
"/"
.
$row
[
'Name'
];
print
"/"
.
$src
.
"'>"
.
$src
.
"</a><br />
\n
"
;
}
}
print
"</td></tr>
\n
"
;
print
"</table></td>"
;
print
"</tr>
\n
"
;
# Display package comments
#
$comments
=
package_comments
(
$row
[
"ID"
]);
if
(
!
empty
(
$comments
))
{
while
(
list
(
$indx
,
$carr
)
=
each
(
$comments
))
{
print
"<tr>
\n
"
;
print
" <td colspan='2'>"
;
print
"<img src='/images/pad.gif' height='2'></td></tr>
\n
"
;
print
"<tr>
\n
"
;
print
" <td valign='top' style='padding-right: 10' colspan='2'>"
;
print
"<table class='boxSoft' width='100%'>"
;
print
"<tr><td class='boxSoftTitle'><span class='f3'>"
;
print
__
(
"Comment by: %h%s%h on %h%s%h"
,
array
(
"<b>"
,
$carr
[
"UserName"
],
"</b>"
,
"<i>"
,
date
(
"Ymd [H:i:s]"
,
$carr
[
"CommentTS"
]),
"</i>"
));
print
"</span></td></tr>
\n
"
;
print
"<tr><td class='boxSoft'>"
;
print
"<pre>
\n
"
;
print
str_replace
(
'"'
,
"""
,
stripslashes
(
$carr
[
"Comments"
]));
print
"</pre>
\n
"
;
print
"</td></tr>
\n
"
;
print
"</table>
\n
"
;
print
" </td>
\n
"
;
print
"</tr>
\n
"
;
}
}
print
"<tr>
\n
"
;
print
" <td colspan='2'><img src='/images/pad.gif' height='2'>"
;
print
"</td></tr>
\n
"
;
print
"<tr>
\n
"
;
print
" <td colspan='2'>"
;
print
"<form action='/pkgedit.php' method='post'>
\n
"
;
print
"<input type='hidden' name='ID' value='"
.
$row
[
"ID"
]
.
"'>
\n
"
;
print
"<input type='submit' class='button' name='add_Comment' value=
\"
"
;
print
__
(
"Add Comment"
)
.
"
\"
>"
;
print
"</form>
\n
"
;
print
" </td>"
;
print
"</tr>
\n
"
;
print
"</table>
\n
"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment