Fossil SCM
Change the names of config parameters for adunits to use "-" instead of "_". Allow configuration sync of adunits as part of the skin.
Commit
4bf5cdc873df8983ccee520cf170e7e25a21f34f
Parent
e33fc88630c4ac3…
3 files changed
+3
+2
-2
+2
-2
+3
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -83,10 +83,13 @@ | ||
| 83 | 83 | { "background-mimetype", CONFIGSET_SKIN }, |
| 84 | 84 | { "background-image", CONFIGSET_SKIN }, |
| 85 | 85 | { "index-page", CONFIGSET_SKIN }, |
| 86 | 86 | { "timeline-block-markup", CONFIGSET_SKIN }, |
| 87 | 87 | { "timeline-max-comment", CONFIGSET_SKIN }, |
| 88 | + { "adunit", CONFIGSET_SKIN }, | |
| 89 | + { "adunit-omit-if-admin", CONFIGSET_SKIN }, | |
| 90 | + { "adunit-omit-if-user", CONFIGSET_SKIN }, | |
| 88 | 91 | #ifdef FOSSIL_ENABLE_TCL |
| 89 | 92 | { "tcl", CONFIGSET_SKIN|CONFIGSET_TKT|CONFIGSET_XFER }, |
| 90 | 93 | #endif |
| 91 | 94 | |
| 92 | 95 | { "project-name", CONFIGSET_PROJ }, |
| 93 | 96 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -83,10 +83,13 @@ | |
| 83 | { "background-mimetype", CONFIGSET_SKIN }, |
| 84 | { "background-image", CONFIGSET_SKIN }, |
| 85 | { "index-page", CONFIGSET_SKIN }, |
| 86 | { "timeline-block-markup", CONFIGSET_SKIN }, |
| 87 | { "timeline-max-comment", CONFIGSET_SKIN }, |
| 88 | #ifdef FOSSIL_ENABLE_TCL |
| 89 | { "tcl", CONFIGSET_SKIN|CONFIGSET_TKT|CONFIGSET_XFER }, |
| 90 | #endif |
| 91 | |
| 92 | { "project-name", CONFIGSET_PROJ }, |
| 93 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -83,10 +83,13 @@ | |
| 83 | { "background-mimetype", CONFIGSET_SKIN }, |
| 84 | { "background-image", CONFIGSET_SKIN }, |
| 85 | { "index-page", CONFIGSET_SKIN }, |
| 86 | { "timeline-block-markup", CONFIGSET_SKIN }, |
| 87 | { "timeline-max-comment", CONFIGSET_SKIN }, |
| 88 | { "adunit", CONFIGSET_SKIN }, |
| 89 | { "adunit-omit-if-admin", CONFIGSET_SKIN }, |
| 90 | { "adunit-omit-if-user", CONFIGSET_SKIN }, |
| 91 | #ifdef FOSSIL_ENABLE_TCL |
| 92 | { "tcl", CONFIGSET_SKIN|CONFIGSET_TKT|CONFIGSET_XFER }, |
| 93 | #endif |
| 94 | |
| 95 | { "project-name", CONFIGSET_PROJ }, |
| 96 |
+2
-2
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1395,14 +1395,14 @@ | ||
| 1395 | 1395 | @ <p>Edit HTML text for an ad unit that will be inserted after the |
| 1396 | 1396 | @ menu bar and above the content of every page.</p> |
| 1397 | 1397 | textarea_attribute("", 20, 80, "adunit", "adunit", ""); |
| 1398 | 1398 | @ <br /> |
| 1399 | 1399 | onoff_attribute("Omit ads to administrator", |
| 1400 | - "adunit_omit_if_admin", "adunit_omit_if_admin", 0); | |
| 1400 | + "adunit-omit-if-admin", "oia", 0); | |
| 1401 | 1401 | @ <br /> |
| 1402 | 1402 | onoff_attribute("Omit ads to logged-in users", |
| 1403 | - "adunit_omit_if_logged_in", "adunit_omit_if_logged_in", 0); | |
| 1403 | + "adunit-omit-if-user", "oiu", 0); | |
| 1404 | 1404 | @ <br /> |
| 1405 | 1405 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1406 | 1406 | @ <input type="submit" name="clear" value="Delete Ad-Unit" /> |
| 1407 | 1407 | @ </div></form> |
| 1408 | 1408 | style_footer(); |
| 1409 | 1409 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1395,14 +1395,14 @@ | |
| 1395 | @ <p>Edit HTML text for an ad unit that will be inserted after the |
| 1396 | @ menu bar and above the content of every page.</p> |
| 1397 | textarea_attribute("", 20, 80, "adunit", "adunit", ""); |
| 1398 | @ <br /> |
| 1399 | onoff_attribute("Omit ads to administrator", |
| 1400 | "adunit_omit_if_admin", "adunit_omit_if_admin", 0); |
| 1401 | @ <br /> |
| 1402 | onoff_attribute("Omit ads to logged-in users", |
| 1403 | "adunit_omit_if_logged_in", "adunit_omit_if_logged_in", 0); |
| 1404 | @ <br /> |
| 1405 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1406 | @ <input type="submit" name="clear" value="Delete Ad-Unit" /> |
| 1407 | @ </div></form> |
| 1408 | style_footer(); |
| 1409 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1395,14 +1395,14 @@ | |
| 1395 | @ <p>Edit HTML text for an ad unit that will be inserted after the |
| 1396 | @ menu bar and above the content of every page.</p> |
| 1397 | textarea_attribute("", 20, 80, "adunit", "adunit", ""); |
| 1398 | @ <br /> |
| 1399 | onoff_attribute("Omit ads to administrator", |
| 1400 | "adunit-omit-if-admin", "oia", 0); |
| 1401 | @ <br /> |
| 1402 | onoff_attribute("Omit ads to logged-in users", |
| 1403 | "adunit-omit-if-user", "oiu", 0); |
| 1404 | @ <br /> |
| 1405 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1406 | @ <input type="submit" name="clear" value="Delete Ad-Unit" /> |
| 1407 | @ </div></form> |
| 1408 | style_footer(); |
| 1409 |
+2
-2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -207,15 +207,15 @@ | ||
| 207 | 207 | /* |
| 208 | 208 | ** Append ad unit text if appropriate. |
| 209 | 209 | */ |
| 210 | 210 | static void style_ad_unit(void){ |
| 211 | 211 | const char *zAd; |
| 212 | - if( g.perm.Admin && db_get_boolean("adunit_omit_if_admin",0) ){ | |
| 212 | + if( g.perm.Admin && db_get_boolean("adunit-omit-if-admin",0) ){ | |
| 213 | 213 | return; |
| 214 | 214 | } |
| 215 | 215 | if( g.zLogin && strcmp(g.zLogin,"anonymous")!=0 |
| 216 | - && db_get_boolean("adunit_omit_if_logged_in",0) ){ | |
| 216 | + && db_get_boolean("adunit-omit-if-user",0) ){ | |
| 217 | 217 | return; |
| 218 | 218 | } |
| 219 | 219 | zAd = db_get("adunit", 0); |
| 220 | 220 | if( zAd ) cgi_append_content(zAd, -1); |
| 221 | 221 | } |
| 222 | 222 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -207,15 +207,15 @@ | |
| 207 | /* |
| 208 | ** Append ad unit text if appropriate. |
| 209 | */ |
| 210 | static void style_ad_unit(void){ |
| 211 | const char *zAd; |
| 212 | if( g.perm.Admin && db_get_boolean("adunit_omit_if_admin",0) ){ |
| 213 | return; |
| 214 | } |
| 215 | if( g.zLogin && strcmp(g.zLogin,"anonymous")!=0 |
| 216 | && db_get_boolean("adunit_omit_if_logged_in",0) ){ |
| 217 | return; |
| 218 | } |
| 219 | zAd = db_get("adunit", 0); |
| 220 | if( zAd ) cgi_append_content(zAd, -1); |
| 221 | } |
| 222 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -207,15 +207,15 @@ | |
| 207 | /* |
| 208 | ** Append ad unit text if appropriate. |
| 209 | */ |
| 210 | static void style_ad_unit(void){ |
| 211 | const char *zAd; |
| 212 | if( g.perm.Admin && db_get_boolean("adunit-omit-if-admin",0) ){ |
| 213 | return; |
| 214 | } |
| 215 | if( g.zLogin && strcmp(g.zLogin,"anonymous")!=0 |
| 216 | && db_get_boolean("adunit-omit-if-user",0) ){ |
| 217 | return; |
| 218 | } |
| 219 | zAd = db_get("adunit", 0); |
| 220 | if( zAd ) cgi_append_content(zAd, -1); |
| 221 | } |
| 222 |