mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 15:28:37 -05:00
Added support for disabling adds via config file
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -216,7 +216,7 @@ class Reddit(Templated):
|
||||
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 @@ class Reddit(Templated):
|
||||
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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user