summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@controlyourself.ca>2009-04-08 22:58:21 +0000
committerSarven Capadisli <csarven@controlyourself.ca>2009-04-08 22:58:21 +0000
commitdcee7f2f6230be385972af4abc9ea8653bf42668 (patch)
treeec41f0747a689a35505b34c29fbdf08c83d7cd4b /lib
parent03a4a4bebf2197097e672e094535ee067fe25441 (diff)
parent85873b1f2b5b6a3e065cf5d227df31380b6f239e (diff)
Merge branch '0.7.x' into 0.8.x
Diffstat (limited to 'lib')
-rw-r--r--lib/featureduserssection.php9
-rw-r--r--lib/util.php13
2 files changed, 20 insertions, 2 deletions
diff --git a/lib/featureduserssection.php b/lib/featureduserssection.php
index aed94b1a5..4b9238d47 100644
--- a/lib/featureduserssection.php
+++ b/lib/featureduserssection.php
@@ -57,9 +57,14 @@ class FeaturedUsersSection extends ProfileSection
$quoted[] = "'$nick'";
}
+ $table = "user";
+ if(common_config('db','quote_identifiers')) {
+ $table = '"' . $table . '"';
+ }
+
$qry = 'SELECT profile.* ' .
- 'FROM profile JOIN user on profile.id = user.id ' .
- 'WHERE user.nickname in (' . implode(',', $quoted) . ') ' .
+ 'FROM profile JOIN '. $table .' on profile.id = '. $table .'.id ' .
+ 'WHERE '. $table .'.nickname in (' . implode(',', $quoted) . ') ' .
'ORDER BY profile.created DESC ';
$limit = PROFILES_PER_SECTION + 1;
diff --git a/lib/util.php b/lib/util.php
index 78b5a36f8..612aa3109 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1379,3 +1379,16 @@ function common_compatible_license($from, $to)
// XXX: better compatibility check needed here!
return ($from == $to);
}
+
+/**
+ * returns a quoted table name, if required according to config
+ */
+function common_database_tablename($tablename)
+{
+
+ if(common_config('db','quote_identifiers')) {
+ $tablename = '"'. $tablename .'"';
+ }
+ //table prefixes could be added here later
+ return $tablename;
+} \ No newline at end of file