From d37bcc1685bf3e9c1583959ef3e96f59beb055d0 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 10 Aug 2008 17:21:59 +0200 Subject: Support for footnotes --- generators.c | 6 ++++++ items.c | 3 +++ items.h | 1 + sample/src/CIAF_1/index.xml | 4 ++++ sample/src/index.xml | 4 ++++ templates/template-album.tmpl | 7 ++++++- templates/template-index.tmpl | 6 ++++-- 7 files changed, 28 insertions(+), 3 deletions(-) diff --git a/generators.c b/generators.c index 3411b8f..654e01a 100644 --- a/generators.c +++ b/generators.c @@ -315,6 +315,12 @@ write_html_album (TGallerySetup *setup, str_replace (&b, "", s1, NULL); g_free (s1); } + if (strstr (b, "") && items->footnote) { + s1 = g_strdup (items->footnote); + fix_entities (&s1); + str_replace (&b, "", s1, NULL); + g_free (s1); + } if (strstr (b, "") && setup->footer) { s1 = g_strdup (setup->footer); fix_entities (&s1); diff --git a/items.c b/items.c index 77f051f..527a5c4 100644 --- a/items.c +++ b/items.c @@ -73,6 +73,7 @@ parse_album_xml (const char *filename, TAlbum *index) index->ID = xml_file_get_node_value (xml, "/gallery/general/ID/text()"); index->title = xml_file_get_node_value (xml, "/gallery/general/title/text()"); index->desc = xml_file_get_node_value (xml, "/gallery/general/description/text()"); + index->footnote = xml_file_get_node_value (xml, "/gallery/general/footnote/text()"); index->quality = xml_file_get_node_attribute_long (xml, "/gallery/general/images", "quality", -1); index->landscape_width = xml_file_get_node_attribute_long (xml, "/gallery/general/images", "landscape_w", 0); @@ -162,6 +163,8 @@ free_album_data (TAlbum *album) free (album->title); if (album->desc) free (album->desc); + if (album->footnote) + free (album->footnote); if (album->base_dir) free (album->base_dir); if (album->border_style) diff --git a/items.h b/items.h index c6143ca..b3ebf39 100644 --- a/items.h +++ b/items.h @@ -32,6 +32,7 @@ typedef struct { char *ID; char *title; char *desc; + char *footnote; GPtrArray *items; char *base_dir; void *parent_index; // pointer to the parent TAlbum structure diff --git a/sample/src/CIAF_1/index.xml b/sample/src/CIAF_1/index.xml index ed374a0..9fc7d6e 100644 --- a/sample/src/CIAF_1/index.xml +++ b/sample/src/CIAF_1/index.xml @@ -9,6 +9,10 @@

This album sets border style "border_none" for preview images. ]]> + + diff --git a/sample/src/index.xml b/sample/src/index.xml index ba88e57..0e143d2 100644 --- a/sample/src/index.xml +++ b/sample/src/index.xml @@ -11,6 +11,10 @@ Just be aware to be XHTML compliant (at least use lowercase tags). ]]> + + diff --git a/templates/template-album.tmpl b/templates/template-album.tmpl index e8eb115..a367706 100644 --- a/templates/template-album.tmpl +++ b/templates/template-album.tmpl @@ -60,7 +60,12 @@ -
+
+ + +
+
+
diff --git a/templates/template-index.tmpl b/templates/template-index.tmpl index 2f941a2..40a0a5b 100644 --- a/templates/template-index.tmpl +++ b/templates/template-index.tmpl @@ -62,8 +62,10 @@ - -
+ +
+
+
-- cgit v1.2.3