@@ -96,34 +96,34 @@ discard block |
||
| 96 | 96 | $this->_ignore_suffix[$type] = 1; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - function siocURL($type, $id, $page=""){ |
|
| 100 | - $type_part = $this->_url4type .$this->_urlequal . $type ; |
|
| 99 | + function siocURL($type, $id, $page = "") { |
|
| 100 | + $type_part = $this->_url4type.$this->_urlequal.$type; |
|
| 101 | 101 | |
| 102 | 102 | if ($id) { |
| 103 | - if ( isset($this->_type_table[$type]) ) |
|
| 104 | - $myID = $this->_type_table[$type] ; |
|
| 103 | + if (isset($this->_type_table[$type])) |
|
| 104 | + $myID = $this->_type_table[$type]; |
|
| 105 | 105 | else |
| 106 | - $myID = (($this->_url_usetype) ? $type . '_' : '') . $this->_url4id ; |
|
| 106 | + $myID = (($this->_url_usetype) ? $type.'_' : '').$this->_url4id; |
|
| 107 | 107 | |
| 108 | - $id_part = $this->_urlseparator . $myID . $this->_urlequal . $id ; |
|
| 108 | + $id_part = $this->_urlseparator.$myID.$this->_urlequal.$id; |
|
| 109 | 109 | } else { |
| 110 | 110 | $id_part = ''; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - ($page) ? $page_part = $this->_urlseparator . $this->_url4page . $this->_urlequal . $page : $page_part='' ; |
|
| 113 | + ($page) ? $page_part = $this->_urlseparator.$this->_url4page.$this->_urlequal.$page : $page_part = ''; |
|
| 114 | 114 | |
| 115 | - ($this->_url_suffix && !isset($this->_ignore_suffix[$type])) ? $suffix = $this->_urlseparator . $this->_url_suffix : $suffix = ''; |
|
| 115 | + ($this->_url_suffix && !isset($this->_ignore_suffix[$type])) ? $suffix = $this->_urlseparator.$this->_url_suffix : $suffix = ''; |
|
| 116 | 116 | |
| 117 | - $siocURL = $this->_sioc_url . $type_part . $id_part . $page_part . $suffix ; |
|
| 117 | + $siocURL = $this->_sioc_url.$type_part.$id_part.$page_part.$suffix; |
|
| 118 | 118 | return clean($siocURL, true); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - function export( $rdf_content='' ) { |
|
| 121 | + function export($rdf_content = '') { |
|
| 122 | 122 | header('Content-Type: application/rdf+xml; charset='.$this->_encoding, true, 200); |
| 123 | 123 | echo $this->makeRDF($rdf_content); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - function makeRDF( $rdf_content='' ) { |
|
| 126 | + function makeRDF($rdf_content = '') { |
|
| 127 | 127 | $rdf = '<?xml version="1.0" encoding="'.$this->_encoding.'" ?>'."\n"; |
| 128 | 128 | $rdf .= ' |
| 129 | 129 | <rdf:RDF |
@@ -226,53 +226,53 @@ discard block |
||
| 226 | 226 | $this->_next_forums = $next; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - function getContent( &$exp ) { |
|
| 230 | - $rdf = "<sioc:Site rdf:about=\"" . clean($this->_url) ."\">\n"; |
|
| 231 | - $rdf .="\t<dc:title>" . clean($this->_name) . "</dc:title>\n"; |
|
| 232 | - $rdf .= "\t<dc:description>" . clean($this->_description) . "</dc:description>\n"; |
|
| 233 | - $rdf .= "\t<sioc:link rdf:resource=\"" . clean($this->_url) ."\"/>\n"; |
|
| 234 | - if($this->_forums) { |
|
| 229 | + function getContent(&$exp) { |
|
| 230 | + $rdf = "<sioc:Site rdf:about=\"".clean($this->_url)."\">\n"; |
|
| 231 | + $rdf .= "\t<dc:title>".clean($this->_name)."</dc:title>\n"; |
|
| 232 | + $rdf .= "\t<dc:description>".clean($this->_description)."</dc:description>\n"; |
|
| 233 | + $rdf .= "\t<sioc:link rdf:resource=\"".clean($this->_url)."\"/>\n"; |
|
| 234 | + if ($this->_forums) { |
|
| 235 | 235 | foreach ($this->_forums as $id => $url) { |
| 236 | - $rdf .= "\t<sioc:host_of rdf:resource=\"" . clean($url) . "\"/>\n"; |
|
| 236 | + $rdf .= "\t<sioc:host_of rdf:resource=\"".clean($url)."\"/>\n"; |
|
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | - if($this->_next_forums) { |
|
| 240 | - $rdf .= "\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('site', "", $this->_page+1) ."\"/>\n"; |
|
| 239 | + if ($this->_next_forums) { |
|
| 240 | + $rdf .= "\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('site', "", $this->_page + 1)."\"/>\n"; |
|
| 241 | 241 | } |
| 242 | - if($this->_usergroup_uri) { |
|
| 243 | - $rdf .= "\t<sioc:has_Usergroup rdf:resource=\"" . $this->_usergroup_uri . "\"/>\n"; |
|
| 242 | + if ($this->_usergroup_uri) { |
|
| 243 | + $rdf .= "\t<sioc:has_Usergroup rdf:resource=\"".$this->_usergroup_uri."\"/>\n"; |
|
| 244 | 244 | } else { |
| 245 | - $rdf .= "\t<sioc:has_Usergroup rdf:nodeID=\"" . AUTHORS_NODE . "\"/>\n"; |
|
| 245 | + $rdf .= "\t<sioc:has_Usergroup rdf:nodeID=\"".AUTHORS_NODE."\"/>\n"; |
|
| 246 | 246 | } |
| 247 | 247 | $rdf .= "</sioc:Site>\n"; |
| 248 | 248 | // Forums |
| 249 | - if($this->_forums) { |
|
| 249 | + if ($this->_forums) { |
|
| 250 | 250 | $rdf .= "\n"; |
| 251 | 251 | foreach ($this->_forums as $id => $url) { |
| 252 | - $rdf .= '<sioc:Forum rdf:about="' . clean($url) ."\">\n"; |
|
| 253 | - $rdf .= "\t<sioc:link rdf:resource=\"" . clean($url) . "\"/>\n"; |
|
| 254 | - $rdf .= "\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) ."\"/>\n"; |
|
| 252 | + $rdf .= '<sioc:Forum rdf:about="'.clean($url)."\">\n"; |
|
| 253 | + $rdf .= "\t<sioc:link rdf:resource=\"".clean($url)."\"/>\n"; |
|
| 254 | + $rdf .= "\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $id)."\"/>\n"; |
|
| 255 | 255 | $rdf .= "</sioc:Forum>\n"; |
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | // Usergroup |
| 259 | - if($this->_users) { |
|
| 259 | + if ($this->_users) { |
|
| 260 | 260 | $rdf .= "\n"; |
| 261 | - if($this->_usergroup_uri) { |
|
| 262 | - $rdf .= '<sioc:UserAccountgroup rdf:about="' . $this->_usergroup_uri . "\">\n"; |
|
| 261 | + if ($this->_usergroup_uri) { |
|
| 262 | + $rdf .= '<sioc:UserAccountgroup rdf:about="'.$this->_usergroup_uri."\">\n"; |
|
| 263 | 263 | } else { |
| 264 | - $rdf .= '<sioc:UserAccountgroup rdf:nodeID="' . AUTHORS_NODE . "\">\n"; |
|
| 264 | + $rdf .= '<sioc:UserAccountgroup rdf:nodeID="'.AUTHORS_NODE."\">\n"; |
|
| 265 | 265 | } |
| 266 | - $rdf .= "\t<sioc:name>Authors for \"" . clean($this->_name) . "\"</sioc:name>\n"; |
|
| 266 | + $rdf .= "\t<sioc:name>Authors for \"".clean($this->_name)."\"</sioc:name>\n"; |
|
| 267 | 267 | foreach ($this->_users as $id => $url) { |
| 268 | 268 | $rdf .= "\t<sioc:has_member>\n"; |
| 269 | - $rdf .= "\t\t<sioc:UserAccount rdf:about=\"" . clean($url) ."\">\n"; |
|
| 270 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $id). "\"/>\n"; |
|
| 269 | + $rdf .= "\t\t<sioc:UserAccount rdf:about=\"".clean($url)."\">\n"; |
|
| 270 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $id)."\"/>\n"; |
|
| 271 | 271 | $rdf .= "\t\t</sioc:UserAccount>\n"; |
| 272 | 272 | $rdf .= "\t</sioc:has_member>\n"; |
| 273 | 273 | } |
| 274 | - if($this->_next_users) { |
|
| 275 | - $rdf .= "\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('site', "", $this->_page+1) ."\"/>\n"; |
|
| 274 | + if ($this->_next_users) { |
|
| 275 | + $rdf .= "\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('site', "", $this->_page + 1)."\"/>\n"; |
|
| 276 | 276 | } |
| 277 | 277 | $rdf .= "</sioc:UserAccountgroup>\n"; |
| 278 | 278 | } |
@@ -406,18 +406,18 @@ discard block |
||
| 406 | 406 | $this->_parents[$id] = $url; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - function getContent( &$exp) { |
|
| 410 | - $rdf .= '<sioc:Thread rdf:about="' . clean($this->_url) . "\">\n"; |
|
| 411 | - $rdf .= "\t<sioc:link rdf:resource=\"" . clean($this->_url) . "\"/>\n"; |
|
| 412 | - if ($this->_views) $rdf .= "\t<sioc:num_views>" . $this->_views . "</sioc:num_views>\n"; |
|
| 413 | - if ($this->_note) $rdf .= "\t<rdfs:comment>" . $this->_note . "</rdfs:comment>\n"; |
|
| 414 | - if ($this->_subject) { $rdf .= "\t<dc:title>" . $this->_subject . "</dc:title>\n"; } |
|
| 415 | - if ($this->_created) { $rdf .= "\t<dcterms:created>" . $this->_created . "</dcterms:created>\n"; } |
|
| 409 | + function getContent(&$exp) { |
|
| 410 | + $rdf .= '<sioc:Thread rdf:about="'.clean($this->_url)."\">\n"; |
|
| 411 | + $rdf .= "\t<sioc:link rdf:resource=\"".clean($this->_url)."\"/>\n"; |
|
| 412 | + if ($this->_views) $rdf .= "\t<sioc:num_views>".$this->_views."</sioc:num_views>\n"; |
|
| 413 | + if ($this->_note) $rdf .= "\t<rdfs:comment>".$this->_note."</rdfs:comment>\n"; |
|
| 414 | + if ($this->_subject) { $rdf .= "\t<dc:title>".$this->_subject."</dc:title>\n"; } |
|
| 415 | + if ($this->_created) { $rdf .= "\t<dcterms:created>".$this->_created."</dcterms:created>\n"; } |
|
| 416 | 416 | if ($this->_parents) { |
| 417 | - foreach($this->_parents as $id => $uri) { |
|
| 417 | + foreach ($this->_parents as $id => $uri) { |
|
| 418 | 418 | $rdf .= "\t<sioc:has_parent>\n"; |
| 419 | - $rdf .= "\t\t<sioc:Forum rdf:about=\"" .clean($uri) ."\">\n"; |
|
| 420 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n"; |
|
| 419 | + $rdf .= "\t\t<sioc:Forum rdf:about=\"".clean($uri)."\">\n"; |
|
| 420 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $id)."\"/>\n"; |
|
| 421 | 421 | $rdf .= "\t\t</sioc:Forum>\n"; |
| 422 | 422 | $rdf .= "\t</sioc:has_parent>\n"; |
| 423 | 423 | } |
@@ -452,24 +452,24 @@ discard block |
||
| 452 | 452 | if ($this->_related) { |
| 453 | 453 | foreach ($this->_related as $id => $url) { |
| 454 | 454 | $rdf .= "\t<sioc:related_to>\n"; |
| 455 | - $rdf .= "\t\t<sioc:Thread rdf:about=\"" .clean($url) ."\"/>\n"; |
|
| 455 | + $rdf .= "\t\t<sioc:Thread rdf:about=\"".clean($url)."\"/>\n"; |
|
| 456 | 456 | $rdf .= "\t</sioc:related_to>\n"; // todo - each topic needs to have a URI |
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | if ($this->_posts) { |
| 461 | - foreach($this->_posts as $id => $data) { |
|
| 461 | + foreach ($this->_posts as $id => $data) { |
|
| 462 | 462 | $rdf .= "\t<sioc:container_of>\n"; |
| 463 | - $rdf .= "\t\t<sioc:Post rdf:about=\"" .clean($data[url]) ."\">\n"; |
|
| 464 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('post', $id) . "\"/>\n"; |
|
| 465 | - if ($data[prev]) { $rdf .= "\t\t\t<sioc:previous_by_date rdf:resource=\"" . clean($data[prev]) . "\"/>\n"; } |
|
| 466 | - if ($data[next]) { $rdf .= "\t\t\t<sioc:next_by_date rdf:resource=\"" . clean($data[next]) . "\"/>\n"; } |
|
| 463 | + $rdf .= "\t\t<sioc:Post rdf:about=\"".clean($data[url])."\">\n"; |
|
| 464 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('post', $id)."\"/>\n"; |
|
| 465 | + if ($data[prev]) { $rdf .= "\t\t\t<sioc:previous_by_date rdf:resource=\"".clean($data[prev])."\"/>\n"; } |
|
| 466 | + if ($data[next]) { $rdf .= "\t\t\t<sioc:next_by_date rdf:resource=\"".clean($data[next])."\"/>\n"; } |
|
| 467 | 467 | $rdf .= "\t\t</sioc:Post>\n"; |
| 468 | 468 | $rdf .= "\t</sioc:container_of>\n"; |
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | - if($this->_next) { |
|
| 472 | - $rdf .= "\r<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('thread', $this->_id, $this->_page+1) ."\"/>\n"; |
|
| 471 | + if ($this->_next) { |
|
| 472 | + $rdf .= "\r<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('thread', $this->_id, $this->_page + 1)."\"/>\n"; |
|
| 473 | 473 | } |
| 474 | 474 | $rdf .= "</sioc:Thread>\n"; |
| 475 | 475 | return $rdf; |
@@ -534,39 +534,39 @@ discard block |
||
| 534 | 534 | $this->_next = $next; |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | - function getContent( &$exp) { |
|
| 538 | - $rdf .= '<'.$this->_type. ' rdf:about="' . clean($this->_url) . "\">\n"; |
|
| 537 | + function getContent(&$exp) { |
|
| 538 | + $rdf .= '<'.$this->_type.' rdf:about="'.clean($this->_url)."\">\n"; |
|
| 539 | 539 | if ($this->_type != 'sioc:Forum') $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Forum\" />\n"; |
| 540 | - $rdf .= "\t<sioc:link rdf:resource=\"" . clean($this->_url) . "\"/>\n"; |
|
| 541 | - if ($this->_blog_title) $rdf .= "\t<dc:title>" . $this->_blog_title . "</dc:title>\n"; |
|
| 542 | - if ($this->_description) $rdf .= "\t<dc:description>" . $this->_description . "</dc:description>\n"; |
|
| 543 | - if ($this->_note) $rdf .= "\t<rdfs:comment>" . $this->_note . "</rdfs:comment>\n"; |
|
| 540 | + $rdf .= "\t<sioc:link rdf:resource=\"".clean($this->_url)."\"/>\n"; |
|
| 541 | + if ($this->_blog_title) $rdf .= "\t<dc:title>".$this->_blog_title."</dc:title>\n"; |
|
| 542 | + if ($this->_description) $rdf .= "\t<dc:description>".$this->_description."</dc:description>\n"; |
|
| 543 | + if ($this->_note) $rdf .= "\t<rdfs:comment>".$this->_note."</rdfs:comment>\n"; |
|
| 544 | 544 | |
| 545 | 545 | if ($this->_parents) { |
| 546 | - foreach($this->_parents as $id => $uri) { |
|
| 546 | + foreach ($this->_parents as $id => $uri) { |
|
| 547 | 547 | $rdf .= "\t<sioc:has_parent>\n"; |
| 548 | - $rdf .= "\t\t<sioc:Forum rdf:about=\"" .clean($uri) ."\">\n"; |
|
| 549 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n"; |
|
| 548 | + $rdf .= "\t\t<sioc:Forum rdf:about=\"".clean($uri)."\">\n"; |
|
| 549 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $id)."\"/>\n"; |
|
| 550 | 550 | $rdf .= "\t\t</sioc:Forum>\n"; |
| 551 | 551 | $rdf .= "\t</sioc:has_parent>\n"; |
| 552 | 552 | } |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | if ($this->_threads) { |
| 556 | - foreach($this->_threads as $id => $uri) { |
|
| 556 | + foreach ($this->_threads as $id => $uri) { |
|
| 557 | 557 | $rdf .= "\t<sioc:parent_of>\n"; |
| 558 | - $rdf .= "\t\t<sioc:Thread rdf:about=\"" .clean($uri) ."\">\n"; |
|
| 559 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('thread', $id) . "\"/>\n"; |
|
| 558 | + $rdf .= "\t\t<sioc:Thread rdf:about=\"".clean($uri)."\">\n"; |
|
| 559 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('thread', $id)."\"/>\n"; |
|
| 560 | 560 | $rdf .= "\t\t</sioc:Thread>\n"; |
| 561 | 561 | $rdf .= "\t</sioc:parent_of>\n"; |
| 562 | 562 | } |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | - if($this->_posts) { |
|
| 566 | - foreach($this->_posts as $id => $url) { |
|
| 565 | + if ($this->_posts) { |
|
| 566 | + foreach ($this->_posts as $id => $url) { |
|
| 567 | 567 | $rdf .= "\t<sioc:container_of>\n"; |
| 568 | - $rdf .= "\t\t<sioc:Post rdf:about=\"" .clean($url) ."\">\n"; |
|
| 569 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('post', $id) . "\"/>\n"; |
|
| 568 | + $rdf .= "\t\t<sioc:Post rdf:about=\"".clean($url)."\">\n"; |
|
| 569 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('post', $id)."\"/>\n"; |
|
| 570 | 570 | $rdf .= "\t\t</sioc:Post>\n"; |
| 571 | 571 | $rdf .= "\t</sioc:container_of>\n"; |
| 572 | 572 | } |
@@ -600,23 +600,23 @@ discard block |
||
| 600 | 600 | if ($this->_administrator) { |
| 601 | 601 | if ($this->_administrator->_id) { |
| 602 | 602 | $rdf .= "\t<sioc:has_administrator>\n"; |
| 603 | - $rdf .= "\t\t<sioc:UserAccount rdf:about=\"" . clean($this->_administrator->_uri) ."\">\n"; |
|
| 604 | - if($this->_administrator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_administrator->_sioc_url ."\"/>\n"; } |
|
| 605 | - else $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->_administrator->_id). "\"/>\n"; |
|
| 603 | + $rdf .= "\t\t<sioc:UserAccount rdf:about=\"".clean($this->_administrator->_uri)."\">\n"; |
|
| 604 | + if ($this->_administrator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$this->_administrator->_sioc_url."\"/>\n"; } |
|
| 605 | + else $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->_administrator->_id)."\"/>\n"; |
|
| 606 | 606 | $rdf .= "\t\t</sioc:UserAccount>\n"; |
| 607 | 607 | $rdf .= "\t</sioc:has_administrator>\n"; |
| 608 | 608 | } |
| 609 | 609 | } |
| 610 | 610 | if ($this->_links) { |
| 611 | - foreach($this->_links as $url=>$link) { |
|
| 612 | - $rdf .= "\t<sioc:links_to rdfs:label=\"$link\" rdf:resource=\"" . clean($url) ."\"/>\n"; |
|
| 611 | + foreach ($this->_links as $url=>$link) { |
|
| 612 | + $rdf .= "\t<sioc:links_to rdfs:label=\"$link\" rdf:resource=\"".clean($url)."\"/>\n"; |
|
| 613 | 613 | } |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | - if($this->_next) { |
|
| 617 | - $rdf .= "\r<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $this->_id, $this->_page+1) ."\"/>\n"; |
|
| 616 | + if ($this->_next) { |
|
| 617 | + $rdf .= "\r<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $this->_id, $this->_page + 1)."\"/>\n"; |
|
| 618 | 618 | } |
| 619 | - $rdf .= "</".$this->_type.">"; |
|
| 619 | + $rdf .= "</".$this->_type.">"; |
|
| 620 | 620 | |
| 621 | 621 | return $rdf; |
| 622 | 622 | } |
@@ -669,86 +669,86 @@ discard block |
||
| 669 | 669 | $this->_reply_of[$id] = $url; |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | - function getContent( &$exp ) { |
|
| 673 | - $rdf = '<'.$this->_type." rdf:about=\"" . clean($this->_url) . "\">\n"; |
|
| 672 | + function getContent(&$exp) { |
|
| 673 | + $rdf = '<'.$this->_type." rdf:about=\"".clean($this->_url)."\">\n"; |
|
| 674 | 674 | if ($this->_type != 'sioc:Post') $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Post\" />\n"; |
| 675 | - if ($this->_subject) { $rdf .= "\t<dc:title>" . $this->_subject . "</dc:title>\n"; } |
|
| 675 | + if ($this->_subject) { $rdf .= "\t<dc:title>".$this->_subject."</dc:title>\n"; } |
|
| 676 | 676 | if ($this->_creator) { |
| 677 | 677 | if ($this->_creator->_id) { |
| 678 | 678 | $rdf .= "\t<sioc:has_creator>\n"; |
| 679 | - $rdf .= "\t\t<sioc:UserAccount rdf:about=\"" . clean($this->_creator->_uri) ."\">\n"; |
|
| 680 | - if($this->_creator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_creator->_sioc_url ."\"/>\n"; } else { |
|
| 681 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->_creator->_id). "\"/>\n"; |
|
| 679 | + $rdf .= "\t\t<sioc:UserAccount rdf:about=\"".clean($this->_creator->_uri)."\">\n"; |
|
| 680 | + if ($this->_creator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$this->_creator->_sioc_url."\"/>\n"; } else { |
|
| 681 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->_creator->_id)."\"/>\n"; |
|
| 682 | 682 | } |
| 683 | 683 | $rdf .= "\t\t</sioc:UserAccount>\n"; |
| 684 | 684 | $rdf .= "\t</sioc:has_creator>\n"; |
| 685 | 685 | $rdf .= "\t<foaf:maker>\n"; |
| 686 | - $rdf .= "\t\t<foaf:Person rdf:about=\"" . clean($this->_creator->_foaf_uri) ."\">\n"; |
|
| 687 | - if($this->_creator->_foaf_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_creator->_foaf_url ."\"/>\n"; } else { |
|
| 688 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->_creator->_id). "\"/>\n"; |
|
| 686 | + $rdf .= "\t\t<foaf:Person rdf:about=\"".clean($this->_creator->_foaf_uri)."\">\n"; |
|
| 687 | + if ($this->_creator->_foaf_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$this->_creator->_foaf_url."\"/>\n"; } else { |
|
| 688 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->_creator->_id)."\"/>\n"; |
|
| 689 | 689 | } |
| 690 | 690 | $rdf .= "\t\t</foaf:Person>\n"; |
| 691 | 691 | $rdf .= "\t</foaf:maker>\n"; |
| 692 | 692 | } else { |
| 693 | 693 | $rdf .= "\t<foaf:maker>\n"; |
| 694 | 694 | $rdf .= "\t\t<foaf:Person"; |
| 695 | - if($this->_creator->_name) { |
|
| 696 | - $rdf .= " foaf:name=\"" . $this->_creator->_name ."\""; |
|
| 695 | + if ($this->_creator->_name) { |
|
| 696 | + $rdf .= " foaf:name=\"".$this->_creator->_name."\""; |
|
| 697 | 697 | } |
| 698 | - if($this->_creator->_sha1) { |
|
| 699 | - $rdf .= " foaf:mbox_sha1sum=\"" . $this->_creator->_sha1 ."\""; |
|
| 698 | + if ($this->_creator->_sha1) { |
|
| 699 | + $rdf .= " foaf:mbox_sha1sum=\"".$this->_creator->_sha1."\""; |
|
| 700 | 700 | } |
| 701 | - if($this->_creator->_name) { |
|
| 702 | - $rdf .= ">\n\t\t\t<foaf:homepage rdf:resource=\"" . $this->_creator->_homepage ."\"/>\n\t\t</foaf:Person>\n"; |
|
| 701 | + if ($this->_creator->_name) { |
|
| 702 | + $rdf .= ">\n\t\t\t<foaf:homepage rdf:resource=\"".$this->_creator->_homepage."\"/>\n\t\t</foaf:Person>\n"; |
|
| 703 | 703 | } else { |
| 704 | 704 | $rdf .= "/>\n"; |
| 705 | 705 | } |
| 706 | 706 | $rdf .= "\t</foaf:maker>\n"; |
| 707 | 707 | } |
| 708 | 708 | } |
| 709 | - $rdf .= "\t<dcterms:created>" . $this->_created . "</dcterms:created>\n"; |
|
| 710 | - if ($this->_updated AND ($this->_created != $this->_updated) ) $rdf .= "\t<dcterms:modified>" . $this->_updated . "</dcterms:modified>\n"; |
|
| 711 | - $rdf .= "\t<sioc:content>" . pureContent($this->_content) . "</sioc:content>\n"; |
|
| 709 | + $rdf .= "\t<dcterms:created>".$this->_created."</dcterms:created>\n"; |
|
| 710 | + if ($this->_updated AND ($this->_created != $this->_updated)) $rdf .= "\t<dcterms:modified>".$this->_updated."</dcterms:modified>\n"; |
|
| 711 | + $rdf .= "\t<sioc:content>".pureContent($this->_content)."</sioc:content>\n"; |
|
| 712 | 712 | |
| 713 | - $rdf .= "\t<content:encoded><![CDATA[" . $this->_encoded . "]]></content:encoded>\n"; |
|
| 714 | - if($this->_topics) { |
|
| 715 | - foreach($this->_topics as $url=>$topic) { |
|
| 716 | - $rdf .= "\t<sioc:topic rdfs:label=\"$topic\" rdf:resource=\"" . clean($url) ."\"/>\n"; |
|
| 713 | + $rdf .= "\t<content:encoded><![CDATA[".$this->_encoded."]]></content:encoded>\n"; |
|
| 714 | + if ($this->_topics) { |
|
| 715 | + foreach ($this->_topics as $url=>$topic) { |
|
| 716 | + $rdf .= "\t<sioc:topic rdfs:label=\"$topic\" rdf:resource=\"".clean($url)."\"/>\n"; |
|
| 717 | 717 | } |
| 718 | 718 | } |
| 719 | - if($this->_links) { |
|
| 720 | - foreach($this->_links as $url=>$link) { |
|
| 721 | - $rdf .= "\t<sioc:links_to rdfs:label=\"$link\" rdf:resource=\"" . clean($url) ."\"/>\n"; |
|
| 719 | + if ($this->_links) { |
|
| 720 | + foreach ($this->_links as $url=>$link) { |
|
| 721 | + $rdf .= "\t<sioc:links_to rdfs:label=\"$link\" rdf:resource=\"".clean($url)."\"/>\n"; |
|
| 722 | 722 | } |
| 723 | 723 | } |
| 724 | - if($this->_has_part) { |
|
| 725 | - foreach($this->_has_part as $id=>$url) { |
|
| 724 | + if ($this->_has_part) { |
|
| 725 | + foreach ($this->_has_part as $id=>$url) { |
|
| 726 | 726 | $rdf .= "\t<dcterms:hasPart>\n"; |
| 727 | - $rdf .= "\t\t<dcmitype:Image rdf:about=\"" . clean($url) . "\"/>\n"; |
|
| 727 | + $rdf .= "\t\t<dcmitype:Image rdf:about=\"".clean($url)."\"/>\n"; |
|
| 728 | 728 | $rdf .= "\t</dcterms:hasPart>\n"; |
| 729 | 729 | } |
| 730 | 730 | } |
| 731 | - if($this->_reply_of) { |
|
| 732 | - foreach($this->_reply_of as $id => $url) { |
|
| 731 | + if ($this->_reply_of) { |
|
| 732 | + foreach ($this->_reply_of as $id => $url) { |
|
| 733 | 733 | $rdf .= "\t<sioc:reply_of>\n"; |
| 734 | - $rdf .= "\t\t<sioc:Post rdf:about=\"" . clean($url) . "\">\n"; |
|
| 735 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('post', $id) . "\"/>\n"; |
|
| 734 | + $rdf .= "\t\t<sioc:Post rdf:about=\"".clean($url)."\">\n"; |
|
| 735 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('post', $id)."\"/>\n"; |
|
| 736 | 736 | $rdf .= "\t\t</sioc:Post>\n"; |
| 737 | 737 | $rdf .= "\t</sioc:reply_of>\n"; |
| 738 | 738 | } |
| 739 | 739 | } |
| 740 | - if($this->_comments) { |
|
| 741 | - foreach($this->_comments as $id => $url) { |
|
| 740 | + if ($this->_comments) { |
|
| 741 | + foreach ($this->_comments as $id => $url) { |
|
| 742 | 742 | $rdf .= "\t<sioc:has_reply>\n"; |
| 743 | - $rdf .= "\t\t<sioc:Post rdf:about=\"" . clean($url) ."\">\n"; |
|
| 743 | + $rdf .= "\t\t<sioc:Post rdf:about=\"".clean($url)."\">\n"; |
|
| 744 | 744 | // if($comments->f('comment_trackback')) $rdf .= "\t\t\t<sioc:type>" . POST_TRACKBACK . "</sioc:type>\n"; |
| 745 | 745 | // else $rdf .= "\t\t\t<sioc:type>" . POST_COMMENT . "</sioc:type>\n"; |
| 746 | - $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('comment', $id) . "\"/>\n"; |
|
| 746 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('comment', $id)."\"/>\n"; |
|
| 747 | 747 | $rdf .= "\t\t</sioc:Post>\n"; |
| 748 | 748 | $rdf .= "\t</sioc:has_reply>\n"; |
| 749 | 749 | } |
| 750 | 750 | } |
| 751 | - $rdf .= "</".$this->_type.">\n"; |
|
| 751 | + $rdf .= "</".$this->_type.">\n"; |
|
| 752 | 752 | return $rdf; |
| 753 | 753 | } |
| 754 | 754 | } |
@@ -982,13 +982,13 @@ discard block |
||
| 982 | 982 | var $_url; |
| 983 | 983 | var $_type; |
| 984 | 984 | |
| 985 | - function SIOCWiki ($url, $type='sioct:Wiki') { |
|
| 985 | + function SIOCWiki($url, $type = 'sioct:Wiki') { |
|
| 986 | 986 | $this->_url = $url; |
| 987 | 987 | $this->_type = $type; |
| 988 | 988 | } |
| 989 | 989 | |
| 990 | - function getContent( &$exp ) { |
|
| 991 | - $rdf = '<'.$this->_type." rdf:about=\"" . clean($this->_url) . "\"/>\n"; |
|
| 990 | + function getContent(&$exp) { |
|
| 991 | + $rdf = '<'.$this->_type." rdf:about=\"".clean($this->_url)."\"/>\n"; |
|
| 992 | 992 | return $rdf; |
| 993 | 993 | } |
| 994 | 994 | } |
@@ -1003,13 +1003,13 @@ discard block |
||
| 1003 | 1003 | var $_url; |
| 1004 | 1004 | var $_type; |
| 1005 | 1005 | |
| 1006 | - function SIOCCategory ($url, $type='sioct:Category') { |
|
| 1006 | + function SIOCCategory($url, $type = 'sioct:Category') { |
|
| 1007 | 1007 | $this->_url = $url; |
| 1008 | 1008 | $this->_type = $type; |
| 1009 | 1009 | } |
| 1010 | 1010 | |
| 1011 | - function getContent( &$exp ) { |
|
| 1012 | - $rdf = '<'.$this->_type." rdf:about=\"" . clean($this->_url) . "\"/>\n"; |
|
| 1011 | + function getContent(&$exp) { |
|
| 1012 | + $rdf = '<'.$this->_type." rdf:about=\"".clean($this->_url)."\"/>\n"; |
|
| 1013 | 1013 | return $rdf; |
| 1014 | 1014 | } |
| 1015 | 1015 | } |