Fossil SCM

Change the names of config parameters for adunits to use "-" instead of "_". Allow configuration sync of adunits as part of the skin.

drh 2012-06-20 14:40 trunk
Commit 4bf5cdc873df8983ccee520cf170e7e25a21f34f
--- src/configure.c
+++ src/configure.c
@@ -83,10 +83,13 @@
8383
{ "background-mimetype", CONFIGSET_SKIN },
8484
{ "background-image", CONFIGSET_SKIN },
8585
{ "index-page", CONFIGSET_SKIN },
8686
{ "timeline-block-markup", CONFIGSET_SKIN },
8787
{ "timeline-max-comment", CONFIGSET_SKIN },
88
+ { "adunit", CONFIGSET_SKIN },
89
+ { "adunit-omit-if-admin", CONFIGSET_SKIN },
90
+ { "adunit-omit-if-user", CONFIGSET_SKIN },
8891
#ifdef FOSSIL_ENABLE_TCL
8992
{ "tcl", CONFIGSET_SKIN|CONFIGSET_TKT|CONFIGSET_XFER },
9093
#endif
9194
9295
{ "project-name", CONFIGSET_PROJ },
9396
--- 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 @@
13951395
@ <p>Edit HTML text for an ad unit that will be inserted after the
13961396
@ menu bar and above the content of every page.</p>
13971397
textarea_attribute("", 20, 80, "adunit", "adunit", "");
13981398
@ <br />
13991399
onoff_attribute("Omit ads to administrator",
1400
- "adunit_omit_if_admin", "adunit_omit_if_admin", 0);
1400
+ "adunit-omit-if-admin", "oia", 0);
14011401
@ <br />
14021402
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);
14041404
@ <br />
14051405
@ <input type="submit" name="submit" value="Apply Changes" />
14061406
@ <input type="submit" name="clear" value="Delete Ad-Unit" />
14071407
@ </div></form>
14081408
style_footer();
14091409
--- 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 @@
207207
/*
208208
** Append ad unit text if appropriate.
209209
*/
210210
static void style_ad_unit(void){
211211
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) ){
213213
return;
214214
}
215215
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) ){
217217
return;
218218
}
219219
zAd = db_get("adunit", 0);
220220
if( zAd ) cgi_append_content(zAd, -1);
221221
}
222222
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button