Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added support for disabling adds via config file

  • Loading branch information...
commit d411cd55a61bcd8aeab52e81dcd69582665ba0d0 1 parent 2b3b061
westmaas authored spladug committed
Showing with 5 additions and 2 deletions.
  1. +3 −0  r2/example.ini
  2. +2 −2 r2/r2/lib/pages/pages.py
View
3  r2/example.ini
@@ -36,6 +36,9 @@ FEEDSECRET = abcdefghijklmnopqrstuvwxyz0123456789
INDEXTANK_API_URL =
+# -- feature toggles --
+disable_ads = false
+
# -- important settings --
# the domain that this app serves itself up as
domain = reddit.local
View
4 r2/r2/lib/pages/pages.py
@@ -216,7 +216,7 @@ def rightbox(self):
if not isinstance(c.site, FakeSubreddit) and not c.cname:
#don't show the subreddit info bar on cnames
ps.append(SubredditInfoBar())
- if c.user.pref_show_adbox or not c.user.gold:
+ if (c.user.pref_show_adbox or not c.user.gold) and not g.disable_ads:
ps.append(Ads())
no_ads_yet = False
@@ -265,7 +265,7 @@ def rightbox(self):
ps.append(SideContentBox(_('admin box'), self.sr_admin_menu()))
- if no_ads_yet:
+ if no_ads_yet and not g.disable_ads:
if c.user.pref_show_adbox or not c.user.gold:
ps.append(Ads())
Please sign in to comment.
Something went wrong with that request. Please try again.