diff --git a/lib/popularity.php b/lib/popularity.php index b6987138b5..7ab259a391 100644 --- a/lib/popularity.php +++ b/lib/popularity.php @@ -53,12 +53,12 @@ class Popularity { // @fixme there should be a common func for this if (common_config('db', 'type') == 'pgsql') { - if (!empty($this->out->tag)) { - $tag = pg_escape_string($this->out->tag); + if (!empty($this->tag)) { + $tag = pg_escape_string($this->tag); } } else { - if (!empty($this->out->tag)) { - $tag = mysql_escape_string($this->out->tag); + if (!empty($this->tag)) { + $tag = mysql_escape_string($this->tag); } } $weightexpr = common_sql_weight('fave.modified', common_config('popular', 'dropoff')); diff --git a/scripts/deletegroup.php b/scripts/deletegroup.php new file mode 100755 index 0000000000..5a1ac109fd --- /dev/null +++ b/scripts/deletegroup.php @@ -0,0 +1,71 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'i::n::y'; +$longoptions = array('id=', 'nickname=', 'yes'); + +$helptext = <<group_id); +} else { + print "You must provide either an ID or a nickname.\n"; + print "\n"; + print $helptext; + exit(1); +} + +if (!have_option('y', 'yes')) { + print "About to PERMANENTLY delete group '{$group->nickname}' ({$group->id}). Are you sure? [y/N] "; + $response = fgets(STDIN); + if (strtolower(trim($response)) != 'y') { + print "Aborting.\n"; + exit(0); + } +} + +print "Deleting..."; +$group->delete(); +print "DONE.\n";