Merge branch 'master' of git@gitorious.org:statusnet/mainline into testing

This commit is contained in:
Brion Vibber 2010-04-09 12:01:53 -07:00
commit f4ad0acd84
4 changed files with 23 additions and 5 deletions

View File

@ -238,9 +238,13 @@ class GroupMemberListItem extends ProfileListItem
function homepageAttributes() function homepageAttributes()
{ {
$aAttrs = parent::linkAttributes();
if (common_config('nofollow', 'members')) { if (common_config('nofollow', 'members')) {
$aAttrs['rel'] = 'nofollow'; $aAttrs['rel'] = 'nofollow';
} }
return $aAttrs;
} }
/** /**

View File

@ -168,9 +168,13 @@ class PeopleTagListItem extends ProfileListItem
function homepageAttributes() function homepageAttributes()
{ {
$aAttrs = parent::linkAttributes();
if (common_config('nofollow', 'peopletag')) { if (common_config('nofollow', 'peopletag')) {
$aAttrs['rel'] = 'nofollow'; $aAttrs['rel'] = 'nofollow';
} }
return $aAttrs;
} }
} }

View File

@ -181,8 +181,12 @@ class SubscribersListItem extends SubscriptionListItem
function homepageAttributes() function homepageAttributes()
{ {
$aAttrs = parent::linkAttributes();
if (common_config('nofollow', 'subscribers')) { if (common_config('nofollow', 'subscribers')) {
$aAttrs['rel'] = 'nofollow'; $aAttrs['rel'] = 'nofollow';
} }
return $aAttrs;
} }
} }

View File

@ -21,7 +21,7 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
$shortoptions = 'i::n::y'; $shortoptions = 'i::n::y';
$longoptions = array('id=', 'nickname=', 'yes', 'dry-run'); $longoptions = array('id=', 'nickname=', 'yes', 'dry-run', 'all');
$helptext = <<<END_OF_HELP $helptext = <<<END_OF_HELP
strip_geo.php [options] strip_geo.php [options]
@ -31,6 +31,8 @@ Removes geolocation info from the given user's notices.
-n --nickname nickname of the user -n --nickname nickname of the user
-y --yes do not wait for confirmation -y --yes do not wait for confirmation
--dry-run list affected notices without deleting --dry-run list affected notices without deleting
--all run over and decache all messages, even if they don't
have geo data now (helps to fix cache bugs)
END_OF_HELP; END_OF_HELP;
@ -67,10 +69,14 @@ if (!have_option('y', 'yes') && !have_option('--dry-run')) {
} }
// @fixme for a very prolific poster this could be too many. // @fixme for a very prolific poster this could be too many.
print "Finding notices with geolocation data...";
$notice = new Notice(); $notice = new Notice();
$notice->profile_id = $profile->id; $notice->profile_id = $profile->id;
$notice->whereAdd("lat != ''"); if (have_option('--all')) {
print "Finding all notices by $profile->nickname...";
} else {
print "Finding notices by $profile->nickname with geolocation data...";
$notice->whereAdd("lat != ''");
}
$notice->find(); $notice->find();
if ($notice->N) { if ($notice->N) {
@ -101,10 +107,10 @@ if ($notice->N) {
$ok = $update->query($query); $ok = $update->query($query);
if ($ok) { if ($ok) {
// And now we decache him manually, as query() doesn't know what we're doing... // And now we decache him manually, as query() doesn't know what we're doing...
$orig->blow(); $orig->decache();
echo "(removed)"; echo "(removed)";
} else { } else {
echo "(failed?)"; echo "(unchanged?)";
} }
} }
print "\n"; print "\n";