summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2004-09-09 10:24:10 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2004-09-09 10:24:10 +0000
commite21c8812eaf35f5e3fad9521de4c918dd47a114f (patch)
tree0446d0cb0aabd845da156f75bacf682ebf2414de /modules
parentb84b6e42cf2f6d64772f20d695258c83f0652fa1 (diff)
downloadbrdo-e21c8812eaf35f5e3fad9521de4c918dd47a114f.tar.gz
brdo-e21c8812eaf35f5e3fad9521de4c918dd47a114f.tar.bz2
Tiny change to drupal_directory_page() in drupal.module to allow the site list to be sorted on any column (alphabetical is prone to abuse by prefixing the site name with quotes, dashes, hash, ...).
Diffstat (limited to 'modules')
-rw-r--r--modules/drupal.module4
-rw-r--r--modules/drupal/drupal.module4
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/drupal.module b/modules/drupal.module
index b5f417f72..388b8dac6 100644
--- a/modules/drupal.module
+++ b/modules/drupal.module
@@ -111,8 +111,8 @@ function drupal_directory_ping($arguments) {
* This function may be called from a custom page on sites that are
* Drupal directory servers.
*/
-function drupal_directory_page() {
- $result = db_query('SELECT * FROM {directory} ORDER BY name');
+function drupal_directory_page($sort = 'name') {
+ $result = db_query('SELECT * FROM {directory} ORDER BY '. $sort);
while ($site = db_fetch_object($result)) {
$output .= "<a href=\"$site->link\">$site->name</a> - $site->slogan<div style=\"padding-left: 20px;\">$site->mission</div><br />";
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module
index b5f417f72..388b8dac6 100644
--- a/modules/drupal/drupal.module
+++ b/modules/drupal/drupal.module
@@ -111,8 +111,8 @@ function drupal_directory_ping($arguments) {
* This function may be called from a custom page on sites that are
* Drupal directory servers.
*/
-function drupal_directory_page() {
- $result = db_query('SELECT * FROM {directory} ORDER BY name');
+function drupal_directory_page($sort = 'name') {
+ $result = db_query('SELECT * FROM {directory} ORDER BY '. $sort);
while ($site = db_fetch_object($result)) {
$output .= "<a href=\"$site->link\">$site->name</a> - $site->slogan<div style=\"padding-left: 20px;\">$site->mission</div><br />";