OSDN Git Service

* Changed Mode=WP action for iPhone/Android.
authorAtsushi Konno <konn@users.sourceforge.jp>
Sat, 23 Apr 2011 18:21:22 +0000 (03:21 +0900)
committerAtsushi Konno <konn@users.sourceforge.jp>
Sat, 23 Apr 2011 18:21:22 +0000 (03:21 +0900)
  * utmdt need UTF-8 and url_encode

28 files changed:
etc/device_data.xml
include/chxj_android.h
include/chxj_chtml10.h
include/chxj_chtml20.h
include/chxj_chtml30.h
include/chxj_chtml40.h
include/chxj_chtml50.h
include/chxj_cookie.h
include/chxj_google.h
include/chxj_iphone.h
include/chxj_ixhtml10.h
include/chxj_jhtml.h
include/chxj_jxhtml.h
include/chxj_xhtml_mobile_1_0.h
src/chxj_android.c
src/chxj_chtml10.c
src/chxj_chtml20.c
src/chxj_chtml30.c
src/chxj_chtml40.c
src/chxj_chtml50.c
src/chxj_cookie.c
src/chxj_google.c
src/chxj_img_conv_format.c
src/chxj_iphone.c
src/chxj_ixhtml10.c
src/chxj_jhtml.c
src/chxj_jxhtml.c
src/chxj_xhtml_mobile_1_0.c

index 95e8df1..48fbe67 100644 (file)
@@ -21499,7 +21499,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>320</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21520,7 +21520,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>320</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21547,7 +21547,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>320</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21568,7 +21568,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>320</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21589,7 +21589,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>640</wp_width>
       <wp_heigh>960</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21624,7 +21624,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>960</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21649,7 +21649,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>960</wp_width>
       <wp_heigh>640</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21674,7 +21674,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>854</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21699,7 +21699,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>960</wp_width>
       <wp_heigh>854</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21724,7 +21724,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>800</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21756,7 +21756,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>320</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21785,7 +21785,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>480</wp_width>
       <wp_heigh>854</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21810,7 +21810,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>960</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21835,7 +21835,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>480</wp_width>
       <wp_heigh>800</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21860,7 +21860,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>600</wp_width>
       <wp_heigh>1024</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21885,7 +21885,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>480</wp_width>
       <wp_heigh>800</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21910,7 +21910,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>480</wp_width>
       <wp_heigh>854</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21935,7 +21935,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>320</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21961,7 +21961,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>480</wp_width>
       <wp_heigh>854</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -21986,7 +21986,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>480</wp_width>
       <wp_heigh>854</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -22011,7 +22011,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>1280</wp_width>
       <wp_heigh>768</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -22044,7 +22044,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>800</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -22072,7 +22072,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>800</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -22100,7 +22100,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>800</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -22128,7 +22128,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>800</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -22156,7 +22156,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>800</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -22181,7 +22181,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>800</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
@@ -22202,7 +22202,7 @@ Mozilla/4.0 (compatible; MSIE 6.0; KYOCERA/AH-K3001V/1.4.1.67.000000/0.1) Opera
 
       <wp_width>800</wp_width>
       <wp_heigh>480</wp_heigh>
-      <cache>300000</cache>
+      <cache>30000000</cache>
       <dpi_width>96</dpi_width>
       <dpi_heigh>96</dpi_heigh>
       <output_encoding>UTF-8</output_encoding>
index 7db0de5..cde4a27 100644 (file)
@@ -56,6 +56,8 @@ struct android_t {
   int head_tag_out; /* 1 if <head> out */
   int charset_out; /* 1 if <meta charset> out */
   int blink_keyframe_out; 
+
+  char                *pagetitle;
 };
 
 typedef struct _android_flags_t android_flags_t;
index 97f2e62..8b879dd 100644 (file)
@@ -41,6 +41,8 @@ struct ctml10_t {
   cookie_t            *cookie;
   css_stylesheet_t    *style;
   css_prop_list_stack_t *css_prop_stack;
+
+  char                *pagetitle;
 };
 
 typedef struct _chtml10_flags_t chtml10_flags_t;
index 3b9e2ec..97dbbf2 100644 (file)
@@ -42,6 +42,8 @@ struct ctml20_t {
   cookie_t            *cookie;
   css_stylesheet_t    *style;
   css_prop_list_stack_t *css_prop_stack;
+
+  char                *pagetitle;
 };
 
 typedef struct _chtml20_flags_t chtml20_flags_t;
index be8baa5..80456d9 100644 (file)
@@ -42,6 +42,8 @@ struct chtml30_t {
   cookie_t            *cookie;
   css_stylesheet_t    *style;
   css_prop_list_stack_t *css_prop_stack;
+
+  char                *pagetitle;
 };
 
 typedef struct _chtml30_flags_t chtml30_flags_t;
index c71fd1d..077b4d1 100644 (file)
@@ -42,6 +42,8 @@ struct chtml40_t {
   cookie_t            *cookie;
   css_stylesheet_t    *style;
   css_prop_list_stack_t *css_prop_stack;
+
+  char                *pagetitle;
 };
 
 typedef struct _chtml40_flags_t chtml40_flags_t;
index 6e20901..e16b696 100644 (file)
@@ -42,6 +42,8 @@ struct chtml50_t {
   cookie_t            *cookie;
   css_stylesheet_t    *style;
   css_prop_list_stack_t *css_prop_stack;
+
+  char                *pagetitle;
 };
 
 typedef struct _chtml50_flags_t chtml50_flags_t;
index 182ea67..26149ae 100644 (file)
@@ -127,7 +127,7 @@ extern apr_time_t chxj_parse_cookie_expires(const char *s);
 extern cookie_lock_t *__chxj_cookie_lock(request_rec *r, const char *filename, int line);
 extern int __chxj_cookie_unlock(request_rec *r, cookie_lock_t *lock, const char *filename, int line);
 
-extern char *chxj_add_cookie_no_update_parameter(request_rec *r, char *value);
+extern char *chxj_add_cookie_no_update_parameter(request_rec *r, char *value, int xmlflag);
 extern char *chxj_cookie_only_mode(request_rec *r, const char *src, apr_size_t *len, cookie_t *cookie);
 char * chxj_uniq_id(request_rec *r);
 
index 5da39b2..34eb2b8 100644 (file)
@@ -23,7 +23,7 @@
 /*----------------------------------------------------------------------------*/
 /* Prototype                                                                  */
 /*----------------------------------------------------------------------------*/
-extern char *chxj_google_analytics_get_image_url(request_rec *r);
+extern char *chxj_google_analytics_get_image_url(request_rec *r, const char *pagetitle);
 extern int chxj_google_analytics_handler(request_rec *r);
 
 
index 8a90576..8277a69 100644 (file)
@@ -55,6 +55,8 @@ struct iphone_t {
 
   int head_tag_out; /* 1 if <head> out */
   int blink_keyframe_out; 
+
+  char                *pagetitle;
 };
 
 typedef struct _iphone_flags_t iphone_flags_t;
index 6973c50..f8a4484 100644 (file)
@@ -53,6 +53,8 @@ struct ixhtml10_t {
   css_stylesheet_t    *style;
   css_prop_list_stack_t *css_prop_stack;
   int                 start_html_flag;
+
+  char                *pagetitle;
 };
 
 typedef struct _ixhtml10_flags_t ixhtml10_flags_t;
index 008d5f8..ea33195 100644 (file)
@@ -48,6 +48,8 @@ struct jhtml_t {
   cookie_t            *cookie;
   css_stylesheet_t    *style;
   css_prop_list_stack_t *css_prop_stack;
+
+  char                *pagetitle;
 };
 
 typedef struct _jhtml_flags_t jhtml_flags_t;
index 3bcc544..877fc4f 100644 (file)
@@ -50,6 +50,8 @@ struct jxhtml_t {
   cookie_t            *cookie;
   css_stylesheet_t    *style;
   css_prop_list_stack_t *css_prop_stack;
+
+  char                *pagetitle;
 };
 
 typedef struct _jxhtml_flags_t jxhtml_flags_t;
index 8f1ecda..f12e0a2 100644 (file)
@@ -42,6 +42,8 @@ struct xhtml_t {
   css_prop_list_stack_t *css_prop_stack;
 
   int                 start_html_flag;
+
+  char                *pagetitle;
 };
 
 typedef struct _xhtml_flags_t xhtml_flags_t;
index ec25806..57def6c 100644 (file)
@@ -1418,7 +1418,7 @@ s_android_end_head_tag(void *pdoc, Node *UNUSED(child))
  * @return The conversion result is returned.
  */
 static char *
-s_android_start_title_tag(void *pdoc, Node *UNUSED(node)) 
+s_android_start_title_tag(void *pdoc, Node *node)
 {
   android_t      *android;
   Doc          *doc;
@@ -1429,6 +1429,17 @@ s_android_start_title_tag(void *pdoc, Node *UNUSED(node))
   r     = doc->r;
 
   W_L("<title>");
+  if (android->conf->use_google_analytics) {
+    android->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      android->pagetitle = apr_pstrcat(doc->r->pool, android->pagetitle, textval, NULL);
+    }
+  }
+
   return android->out;
 }
 
@@ -1715,7 +1726,7 @@ s_android_end_body_tag(void *pdoc, Node *UNUSED(child))
   r     = doc->r;
 
   if (android->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(r);
+    char *src = chxj_google_analytics_get_image_url(r, android->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -4032,14 +4043,14 @@ s_android_start_img_tag(void *pdoc, Node *node)
 #ifdef IMG_NOT_CONVERT_FILENAME
       value = chxj_encoding_parameter(r, value, 1);
       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, android->entryp, 1);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 1);
       value = chxj_img_rewrite_parameter(r,android->conf,value);
       attr_src = value;
 #else
       value = chxj_img_conv(r, spec, value);
       value = chxj_encoding_parameter(r, value, 1);
       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, android->entryp, 1);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 1);
       value = chxj_img_rewrite_parameter(r,android->conf,value);
       attr_src = value;
 #endif
index 0ba54ba..518ed8e 100644 (file)
@@ -1595,7 +1595,7 @@ s_chtml10_end_h6_tag(void *pdoc, Node *UNUSED(child))
  * @return The conversion result is returned.
  */
 static char *
-s_chtml10_start_title_tag(void *pdoc, Node *UNUSED(node)
+s_chtml10_start_title_tag(void *pdoc, Node *node
 {
   Doc          *doc;
   chtml10_t    *chtml10;
@@ -1605,6 +1605,17 @@ s_chtml10_start_title_tag(void *pdoc, Node *UNUSED(node))
 
   W_L("<title>");
 
+  if (chtml10->conf->use_google_analytics) {
+    chtml10->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      chtml10->pagetitle = apr_pstrcat(doc->r->pool, chtml10->pagetitle, textval, NULL);
+    }
+  }
+
   return chtml10->out;
 }
 
@@ -1807,7 +1818,7 @@ s_chtml10_end_body_tag(void *pdoc, Node *UNUSED(child))
   doc     = chtml10->doc;
 
   if (chtml10->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(doc->r);
+    char *src = chxj_google_analytics_get_image_url(doc->r, chtml10->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -2705,7 +2716,7 @@ s_chtml10_start_img_tag(void *pdoc, Node *node)
 #ifdef IMG_NOT_CONVERT_FILENAME
         value = chxj_encoding_parameter(r, value, 0);
         value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
-        value = chxj_add_cookie_no_update_parameter(r, value);
+        value = chxj_add_cookie_no_update_parameter(r, value, 0);
         value = chxj_img_rewrite_parameter(r,chtml10->conf,value);
         attr_src = value;
 #else
index 6cd86b2..e960706 100644 (file)
@@ -984,7 +984,7 @@ s_chtml20_end_head_tag(void *pdoc, Node *UNUSED(child))
  * @return The conversion result is returned.
  */
 static char *
-s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node)
+s_chtml20_start_title_tag(void *pdoc, Node *node
 {
   chtml20_t   *chtml20;
   Doc         *doc;
@@ -996,6 +996,17 @@ s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
 
   W_L("<title>");
 
+  if (chtml20->conf->use_google_analytics) {
+    chtml20->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      chtml20->pagetitle = apr_pstrcat(doc->r->pool, chtml20->pagetitle, textval, NULL);
+    }
+  }
+
   return chtml20->out;
 }
 
@@ -1260,7 +1271,7 @@ s_chtml20_end_body_tag(void *pdoc, Node *UNUSED(child))
   r       = doc->r;
 
   if (chtml20->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(r);
+    char *src = chxj_google_analytics_get_image_url(r, chtml20->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -2673,7 +2684,7 @@ s_chtml20_start_img_tag(void *pdoc, Node *node)
 #ifdef IMG_NOT_CONVERT_FILENAME
         value = chxj_encoding_parameter(r, value, 0);
         value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
-        value = chxj_add_cookie_no_update_parameter(r, value);
+        value = chxj_add_cookie_no_update_parameter(r, value, 0);
         value = chxj_img_rewrite_parameter(r,chtml20->conf,value);
         attr_src = value;
 #else
index 467dbff..639ac19 100644 (file)
@@ -975,13 +975,24 @@ s_chtml30_end_head_tag(void *pdoc, Node *UNUSED(node))
  * @return The conversion result is returned.
  */
 static char *
-s_chtml30_start_title_tag(void *pdoc, Node *UNUSED(node)
+s_chtml30_start_title_tag(void *pdoc, Node *node
 {
   chtml30_t     *chtml30 = GET_CHTML30(pdoc);
   Doc           *doc     = chtml30->doc;
 
   W_L("<title>");
 
+  if (chtml30->conf->use_google_analytics) {
+    chtml30->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      chtml30->pagetitle = apr_pstrcat(doc->r->pool, chtml30->pagetitle, textval, NULL);
+    }
+  }
+
   return chtml30->out;
 }
 
@@ -1232,7 +1243,7 @@ s_chtml30_end_body_tag(void *pdoc, Node *UNUSED(child))
   doc     = chtml30->doc;
 
   if (chtml30->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(doc->r);
+    char *src = chxj_google_analytics_get_image_url(doc->r, chtml30->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -2297,14 +2308,14 @@ s_chtml30_start_img_tag(void *pdoc, Node *node)
 #ifdef IMG_NOT_CONVERT_FILENAME
       value = chxj_encoding_parameter(r, value, 0);
       value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 0);
       value = chxj_img_rewrite_parameter(r,chtml30->conf,value);
       attr_src = value;
 #else
       value = chxj_img_conv(r,spec,value);
       value = chxj_encoding_parameter(r, value, 0);
       value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 0);
       value = chxj_img_rewrite_parameter(r,chtml30->conf,value);
       attr_src = value;
 #endif
index 81b5615..9e9a2a3 100644 (file)
@@ -914,13 +914,24 @@ s_chtml40_end_head_tag(void *pdoc, Node *UNUSED(node))
  * @return The conversion result is returned.
  */
 static char *
-s_chtml40_start_title_tag(void *pdoc, Node *UNUSED(node)) 
+s_chtml40_start_title_tag(void *pdoc, Node *node)
 {
   chtml40_t     *chtml40 = GET_CHTML40(pdoc);
   Doc           *doc     = chtml40->doc;
 
   W_L("<title>");
 
+  if (chtml40->conf->use_google_analytics) {
+    chtml40->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      chtml40->pagetitle = apr_pstrcat(doc->r->pool, chtml40->pagetitle, textval, NULL);
+    }
+  }
+
   return chtml40->out;
 }
 
@@ -1177,7 +1188,7 @@ s_chtml40_end_body_tag(void *pdoc, Node *UNUSED(child))
   doc     = chtml40->doc;
 
   if (chtml40->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(doc->r);
+    char *src = chxj_google_analytics_get_image_url(doc->r, chtml40->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -2243,14 +2254,14 @@ s_chtml40_start_img_tag(void *pdoc, Node *node)
 #ifdef IMG_NOT_CONVERT_FILENAME
       value = chxj_encoding_parameter(r, value, 0);
       value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 0);
       value = chxj_img_rewrite_parameter(r,chtml40->conf,value);
       attr_src = value;
 #else
       value = chxj_img_conv(r,spec,value);
       value = chxj_encoding_parameter(r, value, 0);
       value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 0);
       value = chxj_img_rewrite_parameter(r,chtml40->conf,value);
       attr_src = value;
 #endif
index e69fa29..81517fc 100644 (file)
@@ -896,13 +896,24 @@ s_chtml50_end_head_tag(void *pdoc, Node *UNUSED(node))
  * @return The conversion result is returned.
  */
 static char *
-s_chtml50_start_title_tag(void *pdoc, Node *UNUSED(node)) 
+s_chtml50_start_title_tag(void *pdoc, Node *node)
 {
   chtml50_t     *chtml50 = GET_CHTML50(pdoc);
   Doc           *doc     = chtml50->doc;
 
   W_L("<title>");
 
+  if (chtml50->conf->use_google_analytics) {
+    chtml50->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      chtml50->pagetitle = apr_pstrcat(doc->r->pool, chtml50->pagetitle, textval, NULL);
+    }
+  }
+
   return chtml50->out;
 }
 
@@ -1158,7 +1169,7 @@ s_chtml50_end_body_tag(void *pdoc, Node *UNUSED(child))
   doc     = chtml50->doc;
 
   if (chtml50->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(doc->r);
+    char *src = chxj_google_analytics_get_image_url(doc->r, chtml50->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -2327,14 +2338,14 @@ s_chtml50_start_img_tag(void *pdoc, Node *node)
 #ifdef IMG_NOT_CONVERT_FILENAME
       value = chxj_encoding_parameter(r, value, 0);
       value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 0);
       value = chxj_img_rewrite_parameter(r,chtml50->conf,value);
       attr_src = value;
 #else
       value = chxj_img_conv(r,spec,value);
       value = chxj_encoding_parameter(r, value, 0);
       value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 0);
       value = chxj_img_rewrite_parameter(r,chtml50->conf,value);
       attr_src = value;
 #endif
index 948741b..c4ecada 100644 (file)
@@ -929,7 +929,7 @@ on_error:
 
 
 char *
-chxj_add_cookie_no_update_parameter(request_rec *r, char *value)
+chxj_add_cookie_no_update_parameter(request_rec *r, char *value, int xmlflag)
 {
   char *qs;
   char *dst;
@@ -956,7 +956,11 @@ chxj_add_cookie_no_update_parameter(request_rec *r, char *value)
     name = apr_pstrdup(r->pool, qs);
     *qs = 0;
   }
-  dst = apr_psprintf(r->pool, "%s%c%s=true%s", dst, (strchr(dst,'?')) ? '&' : '?',CHXJ_COOKIE_NOUPDATE_PARAM, name);
+  char *amp = "&";
+  if (xmlflag) {
+    amp = "&amp;";
+  }
+  dst = apr_psprintf(r->pool, "%s%s%s=true%s", dst, (strchr(dst,'?')) ? amp : "?",CHXJ_COOKIE_NOUPDATE_PARAM, name);
   DBG(r,"REQ[%X] dst=[%s]", TO_ADDR(r), dst);
   DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
   return dst;
index afa2ebc..44f33ee 100644 (file)
 #include "chxj_preg_replace.h"
 #include "chxj_serf.h"
 #include "chxj_url_encode.h"
+#include "chxj_encoding.h"
 
 #include "apr_uuid.h"
 #include "apr_md5.h"
 
 
 char *
-chxj_google_analytics_get_image_url(request_rec *r)
+chxj_google_analytics_get_image_url(request_rec *r, const char *pagetitle)
 {
   char *url;
   char *referer;
   char *query;
   char *path;
+  char *ptitle;
   mod_chxj_config *conf;
   int rdm;
   apr_pool_t *pool;
+  apr_size_t plen;
 
   
   DBG(r, "REQ[%X] start %s()", TO_ADDR(r),__func__);
@@ -49,10 +52,22 @@ chxj_google_analytics_get_image_url(request_rec *r)
   rdm = rand();
   apr_pool_create(&pool, r->pool);
 
+  
+
+  plen = 0;
+  ptitle = "";
+  if (pagetitle) {
+    plen = strlen(pagetitle);
+    ptitle = chxj_iconv(r,pool,apr_pstrdup(pool, pagetitle),&plen,"CP932","UTF-8");
+  }
+  else {
+    ptitle = "(no name)";
+  }
   url = apr_pstrdup(pool, conf->google_analytics_target);
   url = apr_pstrcat(pool, url, "?", NULL);
   url = apr_pstrcat(pool, url, "utmac=", conf->google_analytics_account, NULL);
   url = apr_pstrcat(pool, url, "&utmn=", apr_psprintf(pool, "%d",rdm), NULL);
+  url = apr_pstrcat(pool, url, "&utmdt=", chxj_url_encode(pool, ptitle), NULL);
 
   referer = (char *)apr_table_get(r->headers_in, "Referer");
   DBG(r, "REQ[%X] referer:[%s]", TO_ADDR(r), referer);
index 77d2fc4..8d6da51 100644 (file)
@@ -1837,28 +1837,68 @@ s_send_cache_file(
     }
     char *nowFormat = MagickGetImageFormat(magick_wand);
     DestroyMagickWand(magick_wand);
+    char *fname = apr_pstrdup(r->pool, r->filename);
+    char *ext = strrchr(fname, '.');
     if (nowFormat) {
       if (STRCASEEQ('j','J',"jpeg",nowFormat) || STRCASEEQ('j','J',"jpg",nowFormat)) {
         DBG(r,"REQ[%X] detect cache file => jpg.",TO_ADDR(r));
         ap_set_content_type(r, "image/jpeg");
+
+        if (!ext) {
+          fname = apr_pstrcat(r->pool, fname, ".jpg");
+        }
+        else if (ext && strcasecmp(".jpeg", ext) != 0 && strcasecmp(".jpg", ext) != 0) {
+          *ext = 0;
+          fname = apr_pstrcat(r->pool, fname, ".jpg");
+        }
       }
       else if (STRCASEEQ('p','P',"png", nowFormat)) {
         DBG(r,"REQ[%X] detect cache file => png.",TO_ADDR(r));
         ap_set_content_type(r, "image/png");
+
+        if (!ext) {
+          fname = apr_pstrcat(r->pool, fname, ".png");
+        }
+        else if (ext && strcasecmp(".png", ext) != 0) {
+          *ext = 0;
+          fname = apr_pstrcat(r->pool, fname, ".png");
+        }
+
       }
       else if (STRCASEEQ('g','G',"gif", nowFormat)) {
         DBG(r,"REQ[%X] detect cache file => gif.",TO_ADDR(r));
         ap_set_content_type(r, "image/gif");
+
+        if (!ext) {
+          fname = apr_pstrcat(r->pool, fname, ".gif");
+        }
+        else if (ext && strcasecmp(".gif", ext) != 0) {
+          *ext = 0;
+          fname = apr_pstrcat(r->pool, fname, ".gif");
+        }
       }
       else if (STRCASEEQ('b','B',"bmp", nowFormat)) {
         DBG(r,"REQ[%X] detect cache file => bmp.",TO_ADDR(r));
         ap_set_content_type(r, "image/bmp");
+
+        if (!ext) {
+          fname = apr_pstrcat(r->pool, fname, ".bmp");
+        }
+        else if (ext && strcasecmp(".bmp", ext) != 0) {
+          *ext = 0;
+          fname = apr_pstrcat(r->pool, fname, ".bmp");
+        }
       }
       else {
         ERR(r,"REQ[%X] detect unknown file",TO_ADDR(r));
         return HTTP_NOT_FOUND;
       }
     }
+    if (query_string->mode == IMG_CONV_MODE_WALLPAPER && (IS_IPHONE(spec)||IS_ANDROID(spec))) {
+      ap_set_content_type(r, "application/octet-stream");
+      apr_table_setn(r->headers_out, "Content-Disposition", apr_psprintf(r->pool, "attachment; filename=%s", fname));
+      DBG(r,"REQ[%X] detect cache file => iphone/android",TO_ADDR(r));
+    }
     if (conf->image_copyright) {
       DBG(r,"REQ[%X] Add COPYRIGHT Header for SoftBank [%s]", TO_ADDR(r), conf->image_copyright);
       if (spec->html_spec_type == CHXJ_SPEC_Jhtml ||  spec->html_spec_type == CHXJ_SPEC_Jxhtml) {
index 337eba7..a09690e 100644 (file)
@@ -1062,7 +1062,7 @@ s_iphone_end_head_tag(void *pdoc, Node *UNUSED(child))
  * @return The conversion result is returned.
  */
 static char *
-s_iphone_start_title_tag(void *pdoc, Node *UNUSED(node)) 
+s_iphone_start_title_tag(void *pdoc, Node *node)
 {
   iphone_t      *iphone;
   Doc          *doc;
@@ -1073,6 +1073,16 @@ s_iphone_start_title_tag(void *pdoc, Node *UNUSED(node))
   r     = doc->r;
 
   W_L("<title>");
+  if (iphone->conf->use_google_analytics) {
+    iphone->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      iphone->pagetitle = apr_pstrcat(doc->r->pool, iphone->pagetitle, textval, NULL);
+    }
+  }
   return iphone->out;
 }
 
@@ -1359,7 +1369,7 @@ s_iphone_end_body_tag(void *pdoc, Node *UNUSED(child))
   r     = doc->r;
 
   if (iphone->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(r);
+    char *src = chxj_google_analytics_get_image_url(r, iphone->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -3677,14 +3687,14 @@ s_iphone_start_img_tag(void *pdoc, Node *node)
 #ifdef IMG_NOT_CONVERT_FILENAME
       value = chxj_encoding_parameter(r, value, 1);
       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, iphone->entryp, 1);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 1);
       value = chxj_img_rewrite_parameter(r,iphone->conf,value);
       attr_src = value;
 #else
       value = chxj_img_conv(r, spec, value);
       value = chxj_encoding_parameter(r, value, 1);
       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, iphone->entryp, 1);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 1);
       value = chxj_img_rewrite_parameter(r,iphone->conf,value);
       attr_src = value;
 #endif
index 0f772fa..a08a6e4 100644 (file)
@@ -904,7 +904,7 @@ s_ixhtml10_end_head_tag(void *pdoc, Node *UNUSED(child))
  * @return The conversion result is returned.
  */
 static char *
-s_ixhtml10_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_ixhtml10_start_title_tag(void *pdoc, Node *node)
 {
   ixhtml10_t      *ixhtml10;
   Doc          *doc;
@@ -915,6 +915,18 @@ s_ixhtml10_start_title_tag(void *pdoc, Node *UNUSED(node))
   r     = doc->r;
 
   W_L("<title>");
+
+  if (ixhtml10->conf->use_google_analytics) {
+    ixhtml10->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      ixhtml10->pagetitle = apr_pstrcat(doc->r->pool, ixhtml10->pagetitle, textval, NULL);
+    }
+  }
+
   return ixhtml10->out;
 }
 
@@ -1205,7 +1217,7 @@ s_ixhtml10_end_body_tag(void *pdoc, Node *UNUSED(child))
   r     = doc->r;
 
   if (ixhtml10->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(r);
+    char *src = chxj_google_analytics_get_image_url(r, ixhtml10->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -3654,14 +3666,14 @@ s_ixhtml10_start_img_tag(void *pdoc, Node *node)
 #ifdef IMG_NOT_CONVERT_FILENAME
       value = chxj_encoding_parameter(r, value, 1);
       value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 1);
       value = chxj_img_rewrite_parameter(r,ixhtml10->conf,value);
       attr_src = value;
 #else
       value = chxj_img_conv(r, spec, value);
       value = chxj_encoding_parameter(r, value, 1);
       value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 1);
       value = chxj_img_rewrite_parameter(r,ixhtml10->conf,value);
       attr_src = value;
 #endif
index efe730d..47c6de5 100644 (file)
@@ -947,7 +947,7 @@ s_jhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
  * @return The conversion result is returned.
  */
 static char *
-s_jhtml_start_title_tag(void *pdoc, Node *UNUSED(node)) 
+s_jhtml_start_title_tag(void *pdoc, Node *node)
 {
   jhtml_t      *jhtml;
   Doc          *doc;
@@ -958,6 +958,17 @@ s_jhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
   r     = doc->r;
 
   W_L("<title>");
+
+  if (jhtml->conf->use_google_analytics) {
+    jhtml->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      jhtml->pagetitle = apr_pstrcat(doc->r->pool, jhtml->pagetitle, textval, NULL);
+    }
+  }
   return jhtml->out;
 }
 
@@ -1205,7 +1216,7 @@ s_jhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
   r     = doc->r;
 
   if (jhtml->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(r);
+    char *src = chxj_google_analytics_get_image_url(r, jhtml->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -2731,7 +2742,7 @@ s_jhtml_start_img_tag(void *pdoc, Node *node)
       value = chxj_encoding_parameter(r, value, 0);
       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp, 0);
       value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 0);
       value = chxj_img_rewrite_parameter(r,jhtml->conf,value);
       value = s_add_copyright_parameter(r, value);
       attr_src = value;
@@ -2740,7 +2751,7 @@ s_jhtml_start_img_tag(void *pdoc, Node *node)
       value = chxj_encoding_parameter(r, value, 0);
       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp, 0);
       value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 0);
       value = chxj_img_rewrite_parameter(r,jhtml->conf,value);
       value = s_add_copyright_parameter(r, value);
       attr_src = value;
index 2373326..c4c9d41 100644 (file)
@@ -974,7 +974,7 @@ s_jxhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
  * @return The conversion result is returned.
  */
 static char *
-s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node)
+s_jxhtml_start_title_tag(void *pdoc, Node *node
 {
   jxhtml_t      *jxhtml;
   Doc          *doc;
@@ -985,6 +985,17 @@ s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
   r     = doc->r;
 
   W_L("<title>");
+
+  if (jxhtml->conf->use_google_analytics) {
+    jxhtml->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      jxhtml->pagetitle = apr_pstrcat(doc->r->pool, jxhtml->pagetitle, textval, NULL);
+    }
+  }
   return jxhtml->out;
 }
 
@@ -1258,7 +1269,7 @@ s_jxhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
   r     = doc->r;
 
   if (jxhtml->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(r);
+    char *src = chxj_google_analytics_get_image_url(r, jxhtml->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -3706,14 +3717,14 @@ s_jxhtml_start_img_tag(void *pdoc, Node *node)
 #ifdef IMG_NOT_CONVERT_FILENAME
       value = chxj_encoding_parameter(r, value, 1);
       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 1);
       value = chxj_img_rewrite_parameter(r,jxhtml->conf,value);
       attr_src = value;
 #else
       value = chxj_img_conv(r, spec, value);
       value = chxj_encoding_parameter(r, value, 1);
       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 1);
       value = chxj_img_rewrite_parameter(r,jxhtml->conf,value);
       attr_src = value;
 #endif
index 997fd8f..fd403f9 100644 (file)
@@ -1091,12 +1091,22 @@ s_xhtml_1_0_end_head_tag(void *pdoc, Node *UNUSED(child))
  * @return The conversion result is returned.
  */
 static char *
-s_xhtml_1_0_start_title_tag(void *pdoc, Node *UNUSED(node)) 
+s_xhtml_1_0_start_title_tag(void *pdoc, Node *node)
 {
   xhtml_t      *xhtml = GET_XHTML(pdoc);
   Doc          *doc   = xhtml->doc;
 
   W_L("<title>");
+  if (xhtml->conf->use_google_analytics) {
+    xhtml->pagetitle = "";
+    Node         *child;
+    for (child = qs_get_child_node(doc,node);
+         child;
+         child = qs_get_next_node(doc,child)) {
+      char *textval = qs_get_node_value(doc,child);
+      xhtml->pagetitle = apr_pstrcat(doc->r->pool, xhtml->pagetitle, textval, NULL);
+    }
+  }
   return xhtml->out;
 }
 
@@ -1337,7 +1347,7 @@ s_xhtml_1_0_end_body_tag(void *pdoc, Node *UNUSED(child))
 
 
   if (xhtml->conf->use_google_analytics) {
-    char *src = chxj_google_analytics_get_image_url(xhtml->doc->r);
+    char *src = chxj_google_analytics_get_image_url(xhtml->doc->r, xhtml->pagetitle);
     W_L("<img src=\"");
     W_V(src);
     W_L("\" />");
@@ -4219,7 +4229,7 @@ s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
     if (STRCASEEQ('s','S',"src",name)) {
       value = chxj_encoding_parameter(r, value, 1);
       value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
-      value = chxj_add_cookie_no_update_parameter(r, value);
+      value = chxj_add_cookie_no_update_parameter(r, value, 1);
       value = chxj_img_rewrite_parameter(r,xhtml->conf,value);
 #ifdef IMG_NOT_CONVERT_FILENAME
       attr_src = value;