Fossil SCM
Add the ability to temporarily disable all ads.
Commit
48d8af20b7a7dd03f3acb21d9e60515fc70d5182bb406d8373cec761aab71bd3
Parent
69d22d3bb192aee…
2 files changed
+3
+1
+3
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1788,10 +1788,13 @@ | ||
| 1788 | 1788 | onoff_attribute("Omit ads to administrator", |
| 1789 | 1789 | "adunit-omit-if-admin", "oia", 0, 0); |
| 1790 | 1790 | @ <br /> |
| 1791 | 1791 | onoff_attribute("Omit ads to logged-in users", |
| 1792 | 1792 | "adunit-omit-if-user", "oiu", 0, 0); |
| 1793 | + @ <br /> | |
| 1794 | + onoff_attribute("Temporarily disable all ads", | |
| 1795 | + "adunit-disable", "oall", 0, 0); | |
| 1793 | 1796 | @ <br /> |
| 1794 | 1797 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1795 | 1798 | @ <input type="submit" name="clear" value="Delete Ad-Unit" /> |
| 1796 | 1799 | @ </div></form> |
| 1797 | 1800 | @ <hr /> |
| 1798 | 1801 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1788,10 +1788,13 @@ | |
| 1788 | onoff_attribute("Omit ads to administrator", |
| 1789 | "adunit-omit-if-admin", "oia", 0, 0); |
| 1790 | @ <br /> |
| 1791 | onoff_attribute("Omit ads to logged-in users", |
| 1792 | "adunit-omit-if-user", "oiu", 0, 0); |
| 1793 | @ <br /> |
| 1794 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1795 | @ <input type="submit" name="clear" value="Delete Ad-Unit" /> |
| 1796 | @ </div></form> |
| 1797 | @ <hr /> |
| 1798 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1788,10 +1788,13 @@ | |
| 1788 | onoff_attribute("Omit ads to administrator", |
| 1789 | "adunit-omit-if-admin", "oia", 0, 0); |
| 1790 | @ <br /> |
| 1791 | onoff_attribute("Omit ads to logged-in users", |
| 1792 | "adunit-omit-if-user", "oiu", 0, 0); |
| 1793 | @ <br /> |
| 1794 | onoff_attribute("Temporarily disable all ads", |
| 1795 | "adunit-disable", "oall", 0, 0); |
| 1796 | @ <br /> |
| 1797 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1798 | @ <input type="submit" name="clear" value="Delete Ad-Unit" /> |
| 1799 | @ </div></form> |
| 1800 | @ <hr /> |
| 1801 |
+1
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -483,10 +483,11 @@ | ||
| 483 | 483 | */ |
| 484 | 484 | static const char *style_adunit_text(unsigned int *pAdFlag){ |
| 485 | 485 | const char *zAd = 0; |
| 486 | 486 | *pAdFlag = 0; |
| 487 | 487 | if( adUnitFlags & ADUNIT_OFF ) return 0; /* Disallow ads on this page */ |
| 488 | + if( db_get_boolean("adunit-disable",0) ) return 0; | |
| 488 | 489 | if( g.perm.Admin && db_get_boolean("adunit-omit-if-admin",0) ){ |
| 489 | 490 | return 0; |
| 490 | 491 | } |
| 491 | 492 | if( !login_is_nobody() |
| 492 | 493 | && fossil_strcmp(g.zLogin,"anonymous")!=0 |
| 493 | 494 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -483,10 +483,11 @@ | |
| 483 | */ |
| 484 | static const char *style_adunit_text(unsigned int *pAdFlag){ |
| 485 | const char *zAd = 0; |
| 486 | *pAdFlag = 0; |
| 487 | if( adUnitFlags & ADUNIT_OFF ) return 0; /* Disallow ads on this page */ |
| 488 | if( g.perm.Admin && db_get_boolean("adunit-omit-if-admin",0) ){ |
| 489 | return 0; |
| 490 | } |
| 491 | if( !login_is_nobody() |
| 492 | && fossil_strcmp(g.zLogin,"anonymous")!=0 |
| 493 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -483,10 +483,11 @@ | |
| 483 | */ |
| 484 | static const char *style_adunit_text(unsigned int *pAdFlag){ |
| 485 | const char *zAd = 0; |
| 486 | *pAdFlag = 0; |
| 487 | if( adUnitFlags & ADUNIT_OFF ) return 0; /* Disallow ads on this page */ |
| 488 | if( db_get_boolean("adunit-disable",0) ) return 0; |
| 489 | if( g.perm.Admin && db_get_boolean("adunit-omit-if-admin",0) ){ |
| 490 | return 0; |
| 491 | } |
| 492 | if( !login_is_nobody() |
| 493 | && fossil_strcmp(g.zLogin,"anonymous")!=0 |
| 494 |