Added support for disabling adds via config file

This commit is contained in:
westmaas
2010-11-06 17:14:23 -04:00
committed by Neil Williams
parent 2b3b0616c1
commit d411cd55a6
2 changed files with 5 additions and 2 deletions

View File

@@ -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 File

@@ -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())