Skip to content

Commit

Permalink
added configuration option to support etherpad lite
Browse files Browse the repository at this point in the history
  • Loading branch information
johndbritton committed Mar 15, 2012
1 parent 7f96c07 commit fdbf312
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions padsearch.php
Expand Up @@ -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'];
Expand Down Expand Up @@ -56,4 +64,4 @@
</script>
</div>
</body>
</html>
</html>

0 comments on commit fdbf312

Please sign in to comment.