@@ -109,10 +109,11 @@ discard block |
||
| 109 | 109 | $type_part = $this->url4type . $this->urlequal . $type; |
| 110 | 110 | |
| 111 | 111 | if($id) { |
| 112 | - if(isset($this->type_table[$type])) |
|
| 113 | - $myID = $this->type_table[$type]; |
|
| 114 | - else |
|
| 115 | - $myID = (($this->url_usetype) ? $type . '_' : '') . $this->url4id; |
|
| 112 | + if(isset($this->type_table[$type])) { |
|
| 113 | + $myID = $this->type_table[$type]; |
|
| 114 | + } else { |
|
| 115 | + $myID = (($this->url_usetype) ? $type . '_' : '') . $this->url4id; |
|
| 116 | + } |
|
| 116 | 117 | |
| 117 | 118 | $id_part = $this->urlseparator . $myID . $this->urlequal . $id; |
| 118 | 119 | } else { |
@@ -451,8 +452,12 @@ discard block |
||
| 451 | 452 | public function getContent(&$exp): string { |
| 452 | 453 | $rdf = '<sioc:Thread rdf:about="' . clean($this->url) . "\">\n"; |
| 453 | 454 | $rdf .= "\t<sioc:link rdf:resource=\"" . clean($this->url) . "\"/>\n"; |
| 454 | - if($this->views) $rdf .= "\t<sioc:num_views>" . $this->views . "</sioc:num_views>\n"; |
|
| 455 | - if($this->note) $rdf .= "\t<rdfs:comment>" . $this->note . "</rdfs:comment>\n"; |
|
| 455 | + if($this->views) { |
|
| 456 | + $rdf .= "\t<sioc:num_views>" . $this->views . "</sioc:num_views>\n"; |
|
| 457 | + } |
|
| 458 | + if($this->note) { |
|
| 459 | + $rdf .= "\t<rdfs:comment>" . $this->note . "</rdfs:comment>\n"; |
|
| 460 | + } |
|
| 456 | 461 | if($this->subject) { |
| 457 | 462 | $rdf .= "\t<dc:title>" . $this->subject . "</dc:title>\n"; |
| 458 | 463 | } |
@@ -602,11 +607,19 @@ discard block |
||
| 602 | 607 | |
| 603 | 608 | public function getContent(&$exp): string { |
| 604 | 609 | $rdf = '<' . $this->_type . ' rdf:about="' . clean($this->url) . "\">\n"; |
| 605 | - if($this->_type != 'sioc:Forum') $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Forum\" />\n"; |
|
| 610 | + if($this->_type != 'sioc:Forum') { |
|
| 611 | + $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Forum\" />\n"; |
|
| 612 | + } |
|
| 606 | 613 | $rdf .= "\t<sioc:link rdf:resource=\"" . clean($this->url) . "\"/>\n"; |
| 607 | - if($this->blog_title) $rdf .= "\t<dc:title>" . $this->blog_title . "</dc:title>\n"; |
|
| 608 | - if($this->description) $rdf .= "\t<dc:description>" . $this->description . "</dc:description>\n"; |
|
| 609 | - if($this->note) $rdf .= "\t<rdfs:comment>" . $this->note . "</rdfs:comment>\n"; |
|
| 614 | + if($this->blog_title) { |
|
| 615 | + $rdf .= "\t<dc:title>" . $this->blog_title . "</dc:title>\n"; |
|
| 616 | + } |
|
| 617 | + if($this->description) { |
|
| 618 | + $rdf .= "\t<dc:description>" . $this->description . "</dc:description>\n"; |
|
| 619 | + } |
|
| 620 | + if($this->note) { |
|
| 621 | + $rdf .= "\t<rdfs:comment>" . $this->note . "</rdfs:comment>\n"; |
|
| 622 | + } |
|
| 610 | 623 | |
| 611 | 624 | if($this->parents) { |
| 612 | 625 | foreach($this->parents as $id => $uri) { |
@@ -685,8 +698,10 @@ discard block |
||
| 685 | 698 | $rdf .= "\t\t<sioc:UserAccount rdf:about=\"" . clean($this->administrator->_uri) . "\">\n"; |
| 686 | 699 | if($this->administrator->_sioc_url) { |
| 687 | 700 | $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $this->administrator->_sioc_url . "\"/>\n"; |
| 688 | - } else $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->administrator->_id) |
|
| 701 | + } else { |
|
| 702 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->administrator->_id) |
|
| 689 | 703 | . "\"/>\n"; |
| 704 | + } |
|
| 690 | 705 | $rdf .= "\t\t</sioc:UserAccount>\n"; |
| 691 | 706 | $rdf .= "\t</sioc:has_administrator>\n"; |
| 692 | 707 | } |
@@ -766,7 +781,9 @@ discard block |
||
| 766 | 781 | |
| 767 | 782 | public function getContent(&$exp): string { |
| 768 | 783 | $rdf = '<' . $this->_type . " rdf:about=\"" . clean($this->url) . "\">\n"; |
| 769 | - if($this->_type != 'sioc:Post') $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Post\" />\n"; |
|
| 784 | + if($this->_type != 'sioc:Post') { |
|
| 785 | + $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Post\" />\n"; |
|
| 786 | + } |
|
| 770 | 787 | if($this->subject) { |
| 771 | 788 | $rdf .= "\t<dc:title>" . $this->subject . "</dc:title>\n"; |
| 772 | 789 | } |
@@ -811,8 +828,10 @@ discard block |
||
| 811 | 828 | } |
| 812 | 829 | } |
| 813 | 830 | $rdf .= "\t<dcterms:created>" . $this->created . "</dcterms:created>\n"; |
| 814 | - if($this->updated and ($this->created != $this->updated)) $rdf .= "\t<dcterms:modified>" |
|
| 831 | + if($this->updated and ($this->created != $this->updated)) { |
|
| 832 | + $rdf .= "\t<dcterms:modified>" |
|
| 815 | 833 | . $this->updated . "</dcterms:modified>\n"; |
| 834 | + } |
|
| 816 | 835 | $rdf .= "\t<sioc:content>" . pureContent($this->content) . "</sioc:content>\n"; |
| 817 | 836 | |
| 818 | 837 | $rdf .= "\t<content:encoded><![CDATA[" . $this->encoded . "]]></content:encoded>\n"; |