Skip to content


Add option to make subreddit traffic stats page public #309

wants to merge 1 commit into from

2 participants

reddit member

This looks good to me. As discussed before, we'll merge it up when we make the traffic page bypass the old traffic app and go straight to the db. As is, I don't think the old app could hold up to publicly available traffic pages.


Can I get a status update on this PR? Thanks :)



Given that traffic is not on it's own app anymore can the site handle these pages publicly? I personally would really like to see this feature go through.

reddit member

Merged (finally) as 5430a4c. Thanks!

@spladug spladug closed this

Woo (finally ;))!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 8, 2012
  1. @bboe
4 r2/r2/controllers/
@@ -1263,6 +1263,7 @@ def POST_upload_sr_img(self, file, header, sponsor, name, form_id, img_type):
over_18 = VBoolean('over_18'),
allow_top = VBoolean('allow_top'),
show_media = VBoolean('show_media'),
+ public_traffic = VBoolean('public_traffic'),
show_cname_sidebar = VBoolean('show_cname_sidebar'),
type = VOneOf('type', ('public', 'private', 'restricted', 'archived')),
link_type = VOneOf('link_type', ('any', 'link', 'self')),
@@ -1280,7 +1281,8 @@ def POST_site_admin(self, form, jquery, name, ip, sr,
redir = False
kw = dict((k, v) for k, v in kw.iteritems()
if k in ('name', 'title', 'domain', 'description', 'over_18',
- 'show_media', 'show_cname_sidebar', 'type', 'link_type', 'lang',
+ 'show_media', 'public_traffic',
+ 'show_cname_sidebar', 'type', 'link_type', 'lang',
"css_on_cname", "header_title",
2 r2/r2/controllers/
@@ -533,7 +533,7 @@ def _edit_normal_reddit(self, location, num, after, reverse, count, created,
pane = self._make_spamlisting(location, num, after, reverse, count)
if c.user.pref_private_feeds:
extension_handling = "private"
- elif is_moderator and location == 'traffic':
+ elif ( or is_moderator) and location == 'traffic':
pane = RedditTraffic()
elif is_moderator and location == 'flair':
pane = FlairPane(num, after, reverse, name, user)
1 r2/r2/models/
@@ -65,6 +65,7 @@ class ModAction(tdb_cassandra.UuidThing, Printable):
'over_18': _('toggle viewers must be over 18'),
'allow_top': _('toggle allow in default set'),
'show_media': _('toggle show thumbnail images of content'),
+ 'public_traffic': _('toggle public traffic stats page'),
'domain': _('domain'),
'show_cname_sidebar': _('toggle show sidebar from cname'),
'css_on_cname': _('toggle custom CSS from cname'),
1 r2/r2/models/
@@ -76,6 +76,7 @@ class Subreddit(Thing, Printable):
flair_enabled = True,
flair_position = 'right', # one of ('left', 'right')
flair_self_assign_enabled = False,
+ public_traffic = False,
_essentials = ('type', 'name', 'lang')
_data_int_props = Thing._data_int_props + ('mod_actions', 'reported')
8 r2/r2/templates/createsubreddit.html
@@ -163,6 +163,14 @@
${_("show thumbnail images of content")}
+ <li>
+ <input class="nomargin" type="checkbox"
+ name="public_traffic" id="public_traffic"
+ ${ and and "checked='checked'" or ""}/>
+ <label for="public_traffic">
+ ${_("make the traffic stats page available to everyone")}
+ </label>
+ </li>
Something went wrong with that request. Please try again.