diff options
-rw-r--r-- | include/template_processor.php | 4 | ||||
-rw-r--r-- | mod/poco.php | 4 | ||||
-rw-r--r-- | view/poco_entry_xml.tpl | 4 | ||||
-rw-r--r-- | view/poco_xml.tpl | 12 |
4 files changed, 14 insertions, 10 deletions
diff --git a/include/template_processor.php b/include/template_processor.php index 63d75eaa4..25f7703a2 100644 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -165,17 +165,17 @@ $this->r = $r; $this->search = array(); $this->replace = array(); - + $this->_build_replace($r, ""); #$s = str_replace(array("\n","\r"),array("§n§","§r§"),$s); $s = $this->_build_nodes($s); + $s = preg_replace_callback('/\|\|([0-9]+)\|\|/', array($this, "_replcb_node"), $s); if ($s==Null) $this->_preg_error(); // remove comments block $s = preg_replace('/{#[^#]*#}/', "" , $s); - // replace strings recursively (limit to 10 loops) $os = ""; $count=0; while($os!=$s && $count<10){ diff --git a/mod/poco.php b/mod/poco.php index c354be863..2c2aeb656 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -76,7 +76,7 @@ function poco_init(&$a) { 'id' => false, 'displayName' => false, 'urls' => false, - 'preferredName' => false, + 'preferredUsername' => false, 'photos' => false ); @@ -114,7 +114,7 @@ function poco_init(&$a) { if($format === 'xml') { header('Content-type: text/xml'); - echo replace_macros(get_markup_template('poco_xml.tpl',array_xmlify(array('$response' => $ret)))); + echo replace_macros(get_markup_template('poco_xml.tpl'),array_xmlify(array('$response' => $ret))); http_status_exit(500); } if($format === 'json') { diff --git a/view/poco_entry_xml.tpl b/view/poco_entry_xml.tpl index 71ca2d13e..8d5515152 100644 --- a/view/poco_entry_xml.tpl +++ b/view/poco_entry_xml.tpl @@ -1,7 +1,7 @@ <entry> {{ if $entry.id }}<id>$entry.id</id>{{ endif }} {{ if $entry.displayName }}<displayName>$entry.displayName</displayName>{{ endif }} -{{ if $entry.preferredName }}<preferredName>$entry.preferredName</preferredName>{{ endif }} +{{ if $entry.preferredUsername }}<preferredUsername>$entry.preferredUsername</preferredUsername>{{ endif }} {{ if $entry.urls }}<urls><value>$entry.urls.value</value><type>$entry.urls.type</type></urls>{{ endif }} -{{ if $entry.photos }}<photos><value>$entry.photos.value</value><type><$entry.photos.type></type></photos>{{ endif }} +{{ if $entry.photos }}<photos><value>$entry.photos.value</value><type>$entry.photos.type</type></photos>{{ endif }} </entry> diff --git a/view/poco_xml.tpl b/view/poco_xml.tpl index 218c97c5c..9549b695d 100644 --- a/view/poco_xml.tpl +++ b/view/poco_xml.tpl @@ -3,12 +3,16 @@ {{ if $response.sorted }}<sorted>$response.sorted</sorted>{{ endif }} {{ if $response.filtered }}<filtered>$response.filtered</filtered>{{ endif }} {{ if $response.updatedSince }}<updatedSince>$response.updatedSince</updatedSince>{{ endif }} -{{ if $response.startIndex }}<startIndex>$response.startIndex</startIndex>{{ endif }} -{{ if $response.itemsPerPage }}<itemsPerPage>$response.itemsPerPage</itemsPerPage>{{ endif }} -{{ if $response.totalResults }}<totalResults>$response.totalResults</totalResults>{{ endif }} +<startIndex>$response.startIndex</startIndex> +<itemsPerPage>$response.itemsPerPage</itemsPerPage> +<totalResults>$response.totalResults</totalResults> + +{{ if $response.totalResults }} {{ for $response.entry as $entry }} {{ inc poco_entry_xml.tpl }}{{ endinc }} {{ endfor }} - +{{ else }} +<entry></entry> +{{ endif }} </response> |