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