Permalink
Browse files

added configuration option to support etherpad lite

  • Loading branch information...
1 parent 7f96c07 commit fdbf31279aaa414a0489f460a789b04da3613a4e @johndbritton committed Mar 15, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 padsearch.php
View
@@ -11,12 +11,20 @@
$database_password = '';
// PUBLIC ETHERPAD URL
$etherpad_baseurl = 'http://example.com/';
+ // ETHERPAD LITE
+ $etherpad_lite = false;
// END CONFIGURATION OPTIONS
$db = mysql_connect($database_host, $database_user, $database_password);
mysql_select_db($database_name);
- $result = mysql_query("SELECT DISTINCT `ID` FROM `PAD_META`;");
+ $result = null;
+
+ if($etherpad_lite) {
+ $result = mysql_query("select distinct SUBSTRING(`key` FROM 5) as ID from store where `key` like 'pad:%' and `key` not like 'pad:%:%';");
+ else {
+ $result = mysql_query("SELECT DISTINCT `ID` FROM `PAD_META`;");
+ }
while($row = mysql_fetch_array($result)) {
$pads[] = $row['ID'];
@@ -56,4 +64,4 @@
</script>
</div>
</body>
-</html>
+</html>

0 comments on commit fdbf312

Please sign in to comment.