@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | public function addLinks($links) { |
60 | - if(is_array($links) && count($links) > 0) { |
|
60 | + if (is_array($links) && count($links) > 0) { |
|
61 | 61 | $this->links = $links; |
62 | 62 | } |
63 | 63 | } |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | public function getContent(&$exp): string { |
95 | - $rdf = '<' . $this->type . " rdf:about=\"" . clean($this->url, true) . "\">\n"; |
|
96 | - if($this->subject) { |
|
97 | - $rdf .= " <dc:title>" . clean($this->subject) . "</dc:title>\n"; |
|
95 | + $rdf = '<'.$this->type." rdf:about=\"".clean($this->url, true)."\">\n"; |
|
96 | + if ($this->subject) { |
|
97 | + $rdf .= " <dc:title>".clean($this->subject)."</dc:title>\n"; |
|
98 | 98 | // if(strcmp($this->has_container, 'http://en.wikipedia.org')===0) |
99 | 99 | // $rdf .= " <foaf:primaryTopic rdf:resource=\"".clean('http://dbpedia.org/resource/' |
100 | 100 | // .$this->subject)."\"/>\n"; |
@@ -102,59 +102,59 @@ discard block |
||
102 | 102 | |
103 | 103 | $creator_name = null; |
104 | 104 | |
105 | - if(count($this->contributors) > 0) { |
|
106 | - foreach($this->contributors as $cont_id => $cont_name) { |
|
107 | - if(!isset($this->creator['sioc:modifier']) || ($this->creator['sioc:modifier'] != $cont_id)) { |
|
108 | - $rdf .= " <sioc:has_modifier rdf:resource=\"" . normalizeUri($exp->siocURL('user', $cont_id)) |
|
109 | - . "\" rdfs:label=\"" . clean($cont_name) . "\"/>\n"; |
|
105 | + if (count($this->contributors) > 0) { |
|
106 | + foreach ($this->contributors as $cont_id => $cont_name) { |
|
107 | + if (!isset($this->creator['sioc:modifier']) || ($this->creator['sioc:modifier'] != $cont_id)) { |
|
108 | + $rdf .= " <sioc:has_modifier rdf:resource=\"".normalizeUri($exp->siocURL('user', $cont_id)) |
|
109 | + . "\" rdfs:label=\"".clean($cont_name)."\"/>\n"; |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | - if(isset($this->contributors[$this->creator['sioc:modifier']])) { |
|
114 | - $creator_name = 'rdfs:label="' . clean($this->contributors[$this->creator['sioc:modifier']]) . '"'; |
|
113 | + if (isset($this->contributors[$this->creator['sioc:modifier']])) { |
|
114 | + $creator_name = 'rdfs:label="'.clean($this->contributors[$this->creator['sioc:modifier']]).'"'; |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | - if(is_array($this->creator)) { |
|
118 | + if (is_array($this->creator)) { |
|
119 | 119 | // if ($this->creator['foaf:maker']) |
120 | 120 | // $rdf .= " <foaf:maker rdf:resource=\"".clean($this->creator['foaf:maker'])."\"/>\n"; |
121 | - if($this->creator['sioc:modifier']) { |
|
122 | - if($this->is_creator === false) { |
|
121 | + if ($this->creator['sioc:modifier']) { |
|
122 | + if ($this->is_creator === false) { |
|
123 | 123 | $rdf .= " <sioc:has_modifier rdf:resource=\"" |
124 | - . normalizeUri($exp->siocURL('user', $this->creator['sioc:modifier'])) . "\" $creator_name/>\n"; |
|
124 | + . normalizeUri($exp->siocURL('user', $this->creator['sioc:modifier']))."\" $creator_name/>\n"; |
|
125 | 125 | } |
126 | - if($this->is_creator === true) { |
|
126 | + if ($this->is_creator === true) { |
|
127 | 127 | $rdf .= " <sioc:has_creator rdf:resource=\"" |
128 | - . normalizeUri($exp->siocURL('user', $this->creator['sioc:modifier'])) . "\" $creator_name/>\n"; |
|
128 | + . normalizeUri($exp->siocURL('user', $this->creator['sioc:modifier']))."\" $creator_name/>\n"; |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
133 | - if($this->created) { |
|
134 | - $rdf .= " <dcterms:created>" . $this->created . "</dcterms:created>\n"; |
|
133 | + if ($this->created) { |
|
134 | + $rdf .= " <dcterms:created>".$this->created."</dcterms:created>\n"; |
|
135 | 135 | } |
136 | 136 | |
137 | - if($this->modified) { |
|
138 | - $rdf .= " <dcterms:modified>" . $this->modified . "</dcterms:modified>\n"; |
|
137 | + if ($this->modified) { |
|
138 | + $rdf .= " <dcterms:modified>".$this->modified."</dcterms:modified>\n"; |
|
139 | 139 | } |
140 | 140 | |
141 | - if($this->has_space) { |
|
142 | - $rdf .= " <sioc:has_space rdf:resource=\"" . clean($this->has_space, true) . "\" />\n"; |
|
141 | + if ($this->has_space) { |
|
142 | + $rdf .= " <sioc:has_space rdf:resource=\"".clean($this->has_space, true)."\" />\n"; |
|
143 | 143 | // TODO: rdfs:label |
144 | 144 | } |
145 | 145 | |
146 | - if($this->has_container) { |
|
146 | + if ($this->has_container) { |
|
147 | 147 | $rdf .= " <sioc:has_container rdf:resource=\"" |
148 | - . normalizeUri($exp->siocURL('container', $this->has_container)) . "\" />\n"; |
|
148 | + . normalizeUri($exp->siocURL('container', $this->has_container))."\" />\n"; |
|
149 | 149 | // TODO: rdfs:label |
150 | 150 | } |
151 | 151 | |
152 | - if($this->content) { |
|
153 | - $rdf .= " <sioc:content><![CDATA[" . pureContent($this->content) . "]]></sioc:content>\n"; |
|
152 | + if ($this->content) { |
|
153 | + $rdf .= " <sioc:content><![CDATA[".pureContent($this->content)."]]></sioc:content>\n"; |
|
154 | 154 | } |
155 | 155 | |
156 | - if($this->content_encoded) { |
|
157 | - $rdf .= " <content:encoded><![CDATA[" . $this->content_encoded . "]]></content:encoded>\n"; |
|
156 | + if ($this->content_encoded) { |
|
157 | + $rdf .= " <content:encoded><![CDATA[".$this->content_encoded."]]></content:encoded>\n"; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /* |
@@ -172,21 +172,21 @@ discard block |
||
172 | 172 | } |
173 | 173 | */ |
174 | 174 | |
175 | - if(is_array($this->links) && count($this->links) > 0) { |
|
176 | - foreach($this->links as $link_id => $link_exists) { |
|
177 | - if($link_exists && !isHiddenPage($link_id)) { |
|
175 | + if (is_array($this->links) && count($this->links) > 0) { |
|
176 | + foreach ($this->links as $link_id => $link_exists) { |
|
177 | + if ($link_exists && !isHiddenPage($link_id)) { |
|
178 | 178 | $rdf .= " <sioc:links_to rdf:resource=\"" |
179 | - . normalizeUri($exp->siocURL('post', $link_id)) . "\"/>\n"; |
|
179 | + . normalizeUri($exp->siocURL('post', $link_id))."\"/>\n"; |
|
180 | 180 | // TODO: rdfs:label |
181 | 181 | } |
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
185 | - if(count($this->backlinks) > 0) { |
|
186 | - foreach($this->backlinks as $link_id) { |
|
187 | - if(!isHiddenPage($link_id)) { |
|
185 | + if (count($this->backlinks) > 0) { |
|
186 | + foreach ($this->backlinks as $link_id) { |
|
187 | + if (!isHiddenPage($link_id)) { |
|
188 | 188 | $rdf .= " <dcterms:isReferencedBy rdf:resource=\"" |
189 | - . normalizeUri($exp->siocURL('post', $link_id)) . "\"/>\n"; |
|
189 | + . normalizeUri($exp->siocURL('post', $link_id))."\"/>\n"; |
|
190 | 190 | // TODO: rdfs:label |
191 | 191 | } |
192 | 192 | } |
@@ -200,52 +200,52 @@ discard block |
||
200 | 200 | } |
201 | 201 | */ |
202 | 202 | |
203 | - if($this->previous_version) { |
|
203 | + if ($this->previous_version) { |
|
204 | 204 | $rdf .= " <sioc:previous_version rdf:resource=\"" |
205 | 205 | . normalizeUri( |
206 | 206 | $exp->siocURL( |
207 | - 'post', $this->id . $exp->_urlseparator . 'rev' . $exp->_urlequal |
|
207 | + 'post', $this->id.$exp->_urlseparator.'rev'.$exp->_urlequal |
|
208 | 208 | . $this->previous_version |
209 | 209 | ) |
210 | - ) . "\"/>\n"; |
|
210 | + )."\"/>\n"; |
|
211 | 211 | // TODO: rdfs:label |
212 | 212 | |
213 | 213 | /* If there is support for inference and transitivity the following is not needed */ |
214 | 214 | $rdf .= " <sioc:earlier_version rdf:resource=\"" |
215 | 215 | . normalizeUri( |
216 | 216 | $exp->siocURL( |
217 | - 'post', $this->id . $exp->_urlseparator . 'rev' . $exp->_urlequal |
|
217 | + 'post', $this->id.$exp->_urlseparator.'rev'.$exp->_urlequal |
|
218 | 218 | . $this->previous_version |
219 | 219 | ) |
220 | - ) . "\"/>\n"; |
|
220 | + )."\"/>\n"; |
|
221 | 221 | // TODO: rdfs:label |
222 | 222 | |
223 | 223 | } |
224 | 224 | |
225 | - if($this->next_version) { |
|
225 | + if ($this->next_version) { |
|
226 | 226 | $rdf .= " <sioc:next_version rdf:resource=\"" |
227 | 227 | . normalizeUri( |
228 | 228 | $exp->siocURL( |
229 | - 'post', $this->id . $exp->_urlseparator . 'rev' . $exp->_urlequal |
|
229 | + 'post', $this->id.$exp->_urlseparator.'rev'.$exp->_urlequal |
|
230 | 230 | . $this->next_version |
231 | 231 | ) |
232 | - ) . "\"/>\n"; |
|
232 | + )."\"/>\n"; |
|
233 | 233 | // TODO: rdfs:label |
234 | 234 | |
235 | 235 | /* If there is support for inference and transitivity the following is not needed */ |
236 | 236 | $rdf .= " <sioc:later_version rdf:resource=\"" |
237 | 237 | . normalizeUri( |
238 | 238 | $exp->siocURL( |
239 | - 'post', $this->id . $exp->_urlseparator . 'rev' . $exp->_urlequal |
|
239 | + 'post', $this->id.$exp->_urlseparator.'rev'.$exp->_urlequal |
|
240 | 240 | . $this->next_version |
241 | 241 | ) |
242 | - ) . "\"/>\n"; |
|
242 | + )."\"/>\n"; |
|
243 | 243 | // TODO: rdfs:label |
244 | 244 | } |
245 | 245 | |
246 | - if($this->latest_version) { |
|
246 | + if ($this->latest_version) { |
|
247 | 247 | $rdf .= " <sioc:latest_version rdf:resource=\"" |
248 | - . normalizeUri($exp->siocURL('post', $this->id)) . "\"/>\n"; |
|
248 | + . normalizeUri($exp->siocURL('post', $this->id))."\"/>\n"; |
|
249 | 249 | // TODO: rdfs:label |
250 | 250 | } |
251 | 251 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | } |
274 | 274 | */ |
275 | 275 | |
276 | - $rdf .= "</" . $this->type . ">\n"; |
|
276 | + $rdf .= "</".$this->type.">\n"; |
|
277 | 277 | return $rdf; |
278 | 278 | } |
279 | 279 | } |
@@ -306,45 +306,45 @@ discard block |
||
306 | 306 | //$this->email = $email; |
307 | 307 | $this->url = $url; |
308 | 308 | |
309 | - if(preg_match_all('/^.+@.+\..+$/Ui', $email, $check, PREG_SET_ORDER)) { |
|
310 | - if(preg_match_all('/^mailto:(.+@.+\..+$)/Ui', $email, $matches, PREG_SET_ORDER)) { |
|
309 | + if (preg_match_all('/^.+@.+\..+$/Ui', $email, $check, PREG_SET_ORDER)) { |
|
310 | + if (preg_match_all('/^mailto:(.+@.+\..+$)/Ui', $email, $matches, PREG_SET_ORDER)) { |
|
311 | 311 | $this->email = $email; |
312 | 312 | $this->sha1 = sha1($email); |
313 | 313 | } else { |
314 | - $this->email = "mailto:" . $email; |
|
315 | - $this->sha1 = sha1("mailto:" . $email); |
|
314 | + $this->email = "mailto:".$email; |
|
315 | + $this->sha1 = sha1("mailto:".$email); |
|
316 | 316 | } |
317 | 317 | } |
318 | 318 | } |
319 | 319 | |
320 | 320 | public function getContent(&$exp): string { |
321 | - $rdf = "<sioc:UserAccount rdf:about=\"" . clean($this->url, true) . "\">\n"; |
|
322 | - if($this->nick) { |
|
323 | - $rdf .= " <sioc:name>" . clean($this->nick) . "</sioc:name>\n"; |
|
321 | + $rdf = "<sioc:UserAccount rdf:about=\"".clean($this->url, true)."\">\n"; |
|
322 | + if ($this->nick) { |
|
323 | + $rdf .= " <sioc:name>".clean($this->nick)."</sioc:name>\n"; |
|
324 | 324 | } |
325 | - if($this->email) { |
|
326 | - if($exp->_export_email) { |
|
327 | - $rdf .= " <sioc:email rdf:resource=\"" . $this->email . "\"/>\n"; |
|
325 | + if ($this->email) { |
|
326 | + if ($exp->_export_email) { |
|
327 | + $rdf .= " <sioc:email rdf:resource=\"".$this->email."\"/>\n"; |
|
328 | 328 | } |
329 | - $rdf .= " <sioc:email_sha1>" . $this->sha1 . "</sioc:email_sha1>\n"; |
|
329 | + $rdf .= " <sioc:email_sha1>".$this->sha1."</sioc:email_sha1>\n"; |
|
330 | 330 | } |
331 | - if($this->role) { |
|
331 | + if ($this->role) { |
|
332 | 332 | $rdf .= " <sioc:has_function>\n"; |
333 | 333 | $rdf .= " <sioc:Role>\n"; |
334 | - $rdf .= " <sioc:name>" . $this->role . "</sioc:name>\n"; |
|
334 | + $rdf .= " <sioc:name>".$this->role."</sioc:name>\n"; |
|
335 | 335 | $rdf .= " </sioc:Role>\n"; |
336 | 336 | $rdf .= " </sioc:has_function>\n"; |
337 | 337 | } |
338 | 338 | $rdf .= " <sioc:account_of>\n"; |
339 | 339 | $rdf .= " <foaf:Person>\n"; |
340 | - if($this->name) { |
|
341 | - $rdf .= " <foaf:name>" . clean($this->name) . "</foaf:name>\n"; |
|
340 | + if ($this->name) { |
|
341 | + $rdf .= " <foaf:name>".clean($this->name)."</foaf:name>\n"; |
|
342 | 342 | } |
343 | - if($this->email) { |
|
344 | - $rdf .= " <foaf:mbox_sha1sum>" . $this->sha1 . "</foaf:mbox_sha1sum>\n"; |
|
343 | + if ($this->email) { |
|
344 | + $rdf .= " <foaf:mbox_sha1sum>".$this->sha1."</foaf:mbox_sha1sum>\n"; |
|
345 | 345 | } |
346 | - if($this->foaf_url) { |
|
347 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $this->foaf_url . "\"/>\n"; |
|
346 | + if ($this->foaf_url) { |
|
347 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$this->foaf_url."\"/>\n"; |
|
348 | 348 | } |
349 | 349 | $rdf .= " </foaf:Person>\n"; |
350 | 350 | $rdf .= " </sioc:account_of>\n"; |
@@ -397,32 +397,32 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | public function getContent(&$exp): string { |
400 | - $rdf = '<' . $this->type . " rdf:about=\"" . normalizeUri(clean($this->url, true)) . "\" >\n"; |
|
400 | + $rdf = '<'.$this->type." rdf:about=\"".normalizeUri(clean($this->url, true))."\" >\n"; |
|
401 | 401 | |
402 | - if($this->title) { |
|
403 | - $rdf .= " <sioc:name>" . clean($this->title) . "</sioc:name>\n"; |
|
402 | + if ($this->title) { |
|
403 | + $rdf .= " <sioc:name>".clean($this->title)."</sioc:name>\n"; |
|
404 | 404 | } |
405 | 405 | |
406 | - if($this->_has_parent) { |
|
406 | + if ($this->_has_parent) { |
|
407 | 407 | $rdf .= " <sioc:has_parent rdf:resource=\"" |
408 | - . normalizeUri($exp->siocURL('container', $this->_has_parent)) . "\" />\n"; |
|
408 | + . normalizeUri($exp->siocURL('container', $this->_has_parent))."\" />\n"; |
|
409 | 409 | // TODO: rdfs:label |
410 | 410 | } |
411 | 411 | |
412 | - foreach($this->posts as $article) { |
|
412 | + foreach ($this->posts as $article) { |
|
413 | 413 | // TODO: test permission before? |
414 | 414 | $rdf .= " <sioc:container_of rdf:resource=\"" |
415 | - . normalizeUri($exp->siocURL('post', $article['id'])) . "\"/>\n"; |
|
415 | + . normalizeUri($exp->siocURL('post', $article['id']))."\"/>\n"; |
|
416 | 416 | // TODO: inluding title/name |
417 | 417 | } |
418 | 418 | |
419 | - foreach($this->subcontainers as $container) { |
|
419 | + foreach ($this->subcontainers as $container) { |
|
420 | 420 | $rdf .= " <sioc:parent_of rdf:resource=\"" |
421 | - . normalizeUri($exp->siocURL('container', $container['id'])) . "\"/>\n"; |
|
421 | + . normalizeUri($exp->siocURL('container', $container['id']))."\"/>\n"; |
|
422 | 422 | // TODO: inluding title/name |
423 | 423 | } |
424 | 424 | |
425 | - $rdf .= "</" . $this->type . ">\n"; |
|
425 | + $rdf .= "</".$this->type.">\n"; |
|
426 | 426 | return $rdf; |
427 | 427 | } |
428 | 428 |
@@ -105,35 +105,35 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | public function siocURL($type, $id, $page = "") { |
108 | - $type_part = $this->url4type . $this->urlequal . $type; |
|
108 | + $type_part = $this->url4type.$this->urlequal.$type; |
|
109 | 109 | |
110 | - if($id) { |
|
111 | - if(isset($this->type_table[$type])) |
|
110 | + if ($id) { |
|
111 | + if (isset($this->type_table[$type])) |
|
112 | 112 | $myID = $this->type_table[$type]; |
113 | 113 | else |
114 | - $myID = (($this->url_usetype) ? $type . '_' : '') . $this->url4id; |
|
114 | + $myID = (($this->url_usetype) ? $type.'_' : '').$this->url4id; |
|
115 | 115 | |
116 | - $id_part = $this->urlseparator . $myID . $this->urlequal . $id; |
|
116 | + $id_part = $this->urlseparator.$myID.$this->urlequal.$id; |
|
117 | 117 | } else { |
118 | 118 | $id_part = ''; |
119 | 119 | } |
120 | 120 | |
121 | - ($page) ? $page_part = $this->urlseparator . $this->url4page . $this->urlequal . $page : $page_part = ''; |
|
121 | + ($page) ? $page_part = $this->urlseparator.$this->url4page.$this->urlequal.$page : $page_part = ''; |
|
122 | 122 | |
123 | 123 | ($this->url_suffix && !isset($this->ignore_suffix[$type])) ? $suffix = $this->urlseparator |
124 | 124 | . $this->url_suffix : $suffix = ''; |
125 | 125 | |
126 | - $siocURL = $this->sioc_url . $type_part . $id_part . $page_part . $suffix; |
|
126 | + $siocURL = $this->sioc_url.$type_part.$id_part.$page_part.$suffix; |
|
127 | 127 | return clean($siocURL, true); |
128 | 128 | } |
129 | 129 | |
130 | 130 | public function export($rdf_content = '') { |
131 | - header('Content-Type: application/rdf+xml; charset=' . $this->encoding, true, 200); |
|
131 | + header('Content-Type: application/rdf+xml; charset='.$this->encoding, true, 200); |
|
132 | 132 | echo $this->makeRDF($rdf_content); |
133 | 133 | } |
134 | 134 | |
135 | 135 | public function makeRDF($rdf_content = '') { |
136 | - $rdf = '<?xml version="1.0" encoding="' . $this->encoding . '" ?>' . "\n"; |
|
136 | + $rdf = '<?xml version="1.0" encoding="'.$this->encoding.'" ?>'."\n"; |
|
137 | 137 | $rdf .= ' |
138 | 138 | <rdf:RDF |
139 | 139 | xmlns="http://xmlns.com/foaf/0.1/" |
@@ -148,18 +148,18 @@ discard block |
||
148 | 148 | xmlns:sioc="http://rdfs.org/sioc/ns#" |
149 | 149 | xmlns:sioct="http://rdfs.org/sioc/types#" |
150 | 150 | xmlns:owl="http://www.w3.org/2002/07/owl"> |
151 | -<foaf:Document rdf:about="' . clean($this->profile_url, true) . '"> |
|
152 | - <dc:title>"' . clean($this->title) . '" (SIOC profile)</dc:title> |
|
153 | - <foaf:primaryTopic rdf:resource="' . clean($this->objects[0]->_url, true) . '"/> |
|
154 | - <admin:generatorAgent rdf:resource="' . clean($this->generator, true) . '"/> |
|
155 | - <admin:generatorAgent rdf:resource="' . clean(EXPORTER_URL, true) . '?version=' . EXPORTER_VERSION . '"/> |
|
151 | +<foaf:Document rdf:about="' . clean($this->profile_url, true).'"> |
|
152 | + <dc:title>"' . clean($this->title).'" (SIOC profile)</dc:title> |
|
153 | + <foaf:primaryTopic rdf:resource="' . clean($this->objects[0]->_url, true).'"/> |
|
154 | + <admin:generatorAgent rdf:resource="' . clean($this->generator, true).'"/> |
|
155 | + <admin:generatorAgent rdf:resource="' . clean(EXPORTER_URL, true).'?version='.EXPORTER_VERSION.'"/> |
|
156 | 156 | </foaf:Document>' . "\n"; |
157 | - if($rdf_content) { |
|
157 | + if ($rdf_content) { |
|
158 | 158 | $rdf .= $rdf_content; |
159 | 159 | } |
160 | - if(count($this->objects)) { |
|
161 | - foreach($this->objects as $object) { |
|
162 | - if($object) { |
|
160 | + if (count($this->objects)) { |
|
161 | + foreach ($this->objects as $object) { |
|
162 | + if ($object) { |
|
163 | 163 | $rdf .= $object->getContent($this); |
164 | 164 | } |
165 | 165 | } |
@@ -240,52 +240,52 @@ discard block |
||
240 | 240 | } |
241 | 241 | |
242 | 242 | public function getContent(&$exp): string { |
243 | - $rdf = "<sioc:Site rdf:about=\"" . clean($this->url) . "\">\n"; |
|
244 | - $rdf .= " <dc:title>" . clean($this->name) . "</dc:title>\n"; |
|
245 | - $rdf .= " <dc:description>" . clean($this->description) . "</dc:description>\n"; |
|
246 | - $rdf .= " <sioc:link rdf:resource=\"" . clean($this->url) . "\"/>\n"; |
|
247 | - if($this->forums) { |
|
248 | - foreach($this->forums as $id => $url) { |
|
249 | - $rdf .= " <sioc:host_of rdf:resource=\"" . clean($url) . "\"/>\n"; |
|
243 | + $rdf = "<sioc:Site rdf:about=\"".clean($this->url)."\">\n"; |
|
244 | + $rdf .= " <dc:title>".clean($this->name)."</dc:title>\n"; |
|
245 | + $rdf .= " <dc:description>".clean($this->description)."</dc:description>\n"; |
|
246 | + $rdf .= " <sioc:link rdf:resource=\"".clean($this->url)."\"/>\n"; |
|
247 | + if ($this->forums) { |
|
248 | + foreach ($this->forums as $id => $url) { |
|
249 | + $rdf .= " <sioc:host_of rdf:resource=\"".clean($url)."\"/>\n"; |
|
250 | 250 | } |
251 | 251 | } |
252 | - if($this->next_forums) { |
|
253 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('site', "", $this->page + 1) . "\"/>\n"; |
|
252 | + if ($this->next_forums) { |
|
253 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('site', "", $this->page + 1)."\"/>\n"; |
|
254 | 254 | } |
255 | - if($this->usergroup_uri) { |
|
256 | - $rdf .= " <sioc:has_Usergroup rdf:resource=\"" . $this->usergroup_uri . "\"/>\n"; |
|
255 | + if ($this->usergroup_uri) { |
|
256 | + $rdf .= " <sioc:has_Usergroup rdf:resource=\"".$this->usergroup_uri."\"/>\n"; |
|
257 | 257 | } else { |
258 | - $rdf .= " <sioc:has_Usergroup rdf:nodeID=\"" . AUTHORS_NODE . "\"/>\n"; |
|
258 | + $rdf .= " <sioc:has_Usergroup rdf:nodeID=\"".AUTHORS_NODE."\"/>\n"; |
|
259 | 259 | } |
260 | 260 | $rdf .= "</sioc:Site>\n"; |
261 | 261 | // Forums |
262 | - if($this->forums) { |
|
262 | + if ($this->forums) { |
|
263 | 263 | $rdf .= "\n"; |
264 | - foreach($this->forums as $id => $url) { |
|
265 | - $rdf .= '<sioc:Forum rdf:about="' . clean($url) . "\">\n"; |
|
266 | - $rdf .= " <sioc:link rdf:resource=\"" . clean($url) . "\"/>\n"; |
|
267 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n"; |
|
264 | + foreach ($this->forums as $id => $url) { |
|
265 | + $rdf .= '<sioc:Forum rdf:about="'.clean($url)."\">\n"; |
|
266 | + $rdf .= " <sioc:link rdf:resource=\"".clean($url)."\"/>\n"; |
|
267 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $id)."\"/>\n"; |
|
268 | 268 | $rdf .= "</sioc:Forum>\n"; |
269 | 269 | } |
270 | 270 | } |
271 | 271 | // Usergroup |
272 | - if($this->users) { |
|
272 | + if ($this->users) { |
|
273 | 273 | $rdf .= "\n"; |
274 | - if($this->usergroup_uri) { |
|
275 | - $rdf .= '<sioc:UserAccountgroup rdf:about="' . $this->usergroup_uri . "\">\n"; |
|
274 | + if ($this->usergroup_uri) { |
|
275 | + $rdf .= '<sioc:UserAccountgroup rdf:about="'.$this->usergroup_uri."\">\n"; |
|
276 | 276 | } else { |
277 | - $rdf .= '<sioc:UserAccountgroup rdf:nodeID="' . AUTHORS_NODE . "\">\n"; |
|
277 | + $rdf .= '<sioc:UserAccountgroup rdf:nodeID="'.AUTHORS_NODE."\">\n"; |
|
278 | 278 | } |
279 | - $rdf .= " <sioc:name>Authors for \"" . clean($this->name) . "\"</sioc:name>\n"; |
|
280 | - foreach($this->users as $id => $url) { |
|
279 | + $rdf .= " <sioc:name>Authors for \"".clean($this->name)."\"</sioc:name>\n"; |
|
280 | + foreach ($this->users as $id => $url) { |
|
281 | 281 | $rdf .= " <sioc:has_member>\n"; |
282 | - $rdf .= " <sioc:UserAccount rdf:about=\"" . clean($url) . "\">\n"; |
|
283 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $id) . "\"/>\n"; |
|
282 | + $rdf .= " <sioc:UserAccount rdf:about=\"".clean($url)."\">\n"; |
|
283 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $id)."\"/>\n"; |
|
284 | 284 | $rdf .= " </sioc:UserAccount>\n"; |
285 | 285 | $rdf .= " </sioc:has_member>\n"; |
286 | 286 | } |
287 | - if($this->next_users) { |
|
288 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('site', "", $this->page + 1) . "\"/>\n"; |
|
287 | + if ($this->next_users) { |
|
288 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('site', "", $this->page + 1)."\"/>\n"; |
|
289 | 289 | } |
290 | 290 | $rdf .= "</sioc:UserAccountgroup>\n"; |
291 | 291 | } |
@@ -333,13 +333,13 @@ discard block |
||
333 | 333 | $this->uri = $uri; |
334 | 334 | $this->name = $name; |
335 | 335 | |
336 | - if(preg_match_all('/^.+@.+\..+$/Ui', $email, $check, PREG_SET_ORDER)) { |
|
337 | - if(preg_match_all('/^mailto:(.+@.+\..+$)/Ui', $email, $matches, PREG_SET_ORDER)) { |
|
336 | + if (preg_match_all('/^.+@.+\..+$/Ui', $email, $check, PREG_SET_ORDER)) { |
|
337 | + if (preg_match_all('/^mailto:(.+@.+\..+$)/Ui', $email, $matches, PREG_SET_ORDER)) { |
|
338 | 338 | $this->email = $email; |
339 | 339 | $this->sha1 = sha1($email); |
340 | 340 | } else { |
341 | - $this->email = "mailto:" . $email; |
|
342 | - $this->sha1 = sha1("mailto:" . $email); |
|
341 | + $this->email = "mailto:".$email; |
|
342 | + $this->sha1 = sha1("mailto:".$email); |
|
343 | 343 | } |
344 | 344 | } |
345 | 345 | $this->homepage = $homepage; |
@@ -352,36 +352,36 @@ discard block |
||
352 | 352 | } |
353 | 353 | |
354 | 354 | public function getContent(&$exp): string { |
355 | - $rdf = "<foaf:Person rdf:about=\"" . clean($this->foaf_uri) . "\">\n"; |
|
356 | - if($this->name) { |
|
357 | - $rdf .= " <foaf:name>" . $this->name . "</foaf:name>\n"; |
|
355 | + $rdf = "<foaf:Person rdf:about=\"".clean($this->foaf_uri)."\">\n"; |
|
356 | + if ($this->name) { |
|
357 | + $rdf .= " <foaf:name>".$this->name."</foaf:name>\n"; |
|
358 | 358 | } |
359 | - if($this->email) { |
|
360 | - $rdf .= " <foaf:mbox_sha1sum>" . $this->sha1 . "</foaf:mbox_sha1sum>\n"; |
|
359 | + if ($this->email) { |
|
360 | + $rdf .= " <foaf:mbox_sha1sum>".$this->sha1."</foaf:mbox_sha1sum>\n"; |
|
361 | 361 | } |
362 | - if($this->foaf_url) { |
|
363 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $this->foaf_url . "\"/>\n"; |
|
362 | + if ($this->foaf_url) { |
|
363 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$this->foaf_url."\"/>\n"; |
|
364 | 364 | } |
365 | 365 | $rdf .= " <foaf:holdsAccount>\n"; |
366 | - $rdf .= " <sioc:UserAccount rdf:about=\"" . clean($this->uri) . "\">\n"; |
|
367 | - if($this->nick) { |
|
368 | - $rdf .= " <sioc:name>" . $this->nick . "</sioc:name>\n"; |
|
366 | + $rdf .= " <sioc:UserAccount rdf:about=\"".clean($this->uri)."\">\n"; |
|
367 | + if ($this->nick) { |
|
368 | + $rdf .= " <sioc:name>".$this->nick."</sioc:name>\n"; |
|
369 | 369 | } |
370 | - if($this->email) { |
|
371 | - if($exp->_export_email) { |
|
372 | - $rdf .= " <sioc:email rdf:resource=\"" . $this->email . "\"/>\n"; |
|
370 | + if ($this->email) { |
|
371 | + if ($exp->_export_email) { |
|
372 | + $rdf .= " <sioc:email rdf:resource=\"".$this->email."\"/>\n"; |
|
373 | 373 | } |
374 | - $rdf .= " <sioc:email_sha1>" . $this->sha1 . "</sioc:email_sha1>\n"; |
|
374 | + $rdf .= " <sioc:email_sha1>".$this->sha1."</sioc:email_sha1>\n"; |
|
375 | 375 | } |
376 | - if($this->role) { |
|
376 | + if ($this->role) { |
|
377 | 377 | $rdf .= " <sioc:has_function>\n"; |
378 | 378 | $rdf .= " <sioc:Role>\n"; |
379 | - $rdf .= " <sioc:name>" . $this->role . "</sioc:name>\n"; |
|
379 | + $rdf .= " <sioc:name>".$this->role."</sioc:name>\n"; |
|
380 | 380 | $rdf .= " </sioc:Role>\n"; |
381 | 381 | $rdf .= " </sioc:has_function>\n"; |
382 | 382 | } |
383 | - if($this->sioc_url) { |
|
384 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $this->sioc_url . "\"/>\n"; |
|
383 | + if ($this->sioc_url) { |
|
384 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$this->sioc_url."\"/>\n"; |
|
385 | 385 | } |
386 | 386 | $rdf .= " </sioc:UserAccount>\n"; |
387 | 387 | $rdf .= " </foaf:holdsAccount>\n"; |
@@ -448,29 +448,29 @@ discard block |
||
448 | 448 | } |
449 | 449 | |
450 | 450 | public function getContent(&$exp): string { |
451 | - $rdf = '<sioc:Thread rdf:about="' . clean($this->url) . "\">\n"; |
|
452 | - $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"; |
|
455 | - if($this->subject) { |
|
456 | - $rdf .= " <dc:title>" . $this->subject . "</dc:title>\n"; |
|
451 | + $rdf = '<sioc:Thread rdf:about="'.clean($this->url)."\">\n"; |
|
452 | + $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"; |
|
455 | + if ($this->subject) { |
|
456 | + $rdf .= " <dc:title>".$this->subject."</dc:title>\n"; |
|
457 | 457 | } |
458 | - if($this->created) { |
|
459 | - $rdf .= " <dcterms:created>" . $this->created . "</dcterms:created>\n"; |
|
458 | + if ($this->created) { |
|
459 | + $rdf .= " <dcterms:created>".$this->created."</dcterms:created>\n"; |
|
460 | 460 | } |
461 | - if($this->parents) { |
|
462 | - foreach($this->parents as $id => $uri) { |
|
461 | + if ($this->parents) { |
|
462 | + foreach ($this->parents as $id => $uri) { |
|
463 | 463 | $rdf .= " <sioc:has_parent>\n"; |
464 | - $rdf .= " <sioc:Forum rdf:about=\"" . clean($uri) . "\">\n"; |
|
465 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n"; |
|
464 | + $rdf .= " <sioc:Forum rdf:about=\"".clean($uri)."\">\n"; |
|
465 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $id)."\"/>\n"; |
|
466 | 466 | $rdf .= " </sioc:Forum>\n"; |
467 | 467 | $rdf .= " </sioc:has_parent>\n"; |
468 | 468 | } |
469 | 469 | } |
470 | 470 | // here the tags are just used as keywords for dc:subject |
471 | - if($this->tags) { |
|
472 | - foreach($this->tags as $id => $tag) { |
|
473 | - $rdf .= " <dc:subject>" . $tag . "</dc:subject>\n"; |
|
471 | + if ($this->tags) { |
|
472 | + foreach ($this->tags as $id => $tag) { |
|
473 | + $rdf .= " <dc:subject>".$tag."</dc:subject>\n"; |
|
474 | 474 | } |
475 | 475 | } |
476 | 476 | // here the tags are used by creating a tag object with a blank node, with the keyword as moat:name - if you |
@@ -496,31 +496,31 @@ discard block |
||
496 | 496 | } |
497 | 497 | } |
498 | 498 | */ |
499 | - if($this->related) { |
|
500 | - foreach($this->related as $id => $url) { |
|
499 | + if ($this->related) { |
|
500 | + foreach ($this->related as $id => $url) { |
|
501 | 501 | $rdf .= " <sioc:related_to>\n"; |
502 | - $rdf .= " <sioc:Thread rdf:about=\"" . clean($url) . "\"/>\n"; |
|
502 | + $rdf .= " <sioc:Thread rdf:about=\"".clean($url)."\"/>\n"; |
|
503 | 503 | $rdf .= " </sioc:related_to>\n"; // todo - each topic needs to have a URI |
504 | 504 | } |
505 | 505 | } |
506 | 506 | |
507 | - if($this->posts) { |
|
508 | - foreach($this->posts as $id => $data) { |
|
507 | + if ($this->posts) { |
|
508 | + foreach ($this->posts as $id => $data) { |
|
509 | 509 | $rdf .= " <sioc:container_of>\n"; |
510 | - $rdf .= " <sioc:Post rdf:about=\"" . clean($data[url]) . "\">\n"; |
|
511 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('post', $id) . "\"/>\n"; |
|
512 | - if($data[prev]) { |
|
513 | - $rdf .= " <sioc:previous_by_date rdf:resource=\"" . clean($data[prev]) . "\"/>\n"; |
|
510 | + $rdf .= " <sioc:Post rdf:about=\"".clean($data[url])."\">\n"; |
|
511 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('post', $id)."\"/>\n"; |
|
512 | + if ($data[prev]) { |
|
513 | + $rdf .= " <sioc:previous_by_date rdf:resource=\"".clean($data[prev])."\"/>\n"; |
|
514 | 514 | } |
515 | - if($data[next]) { |
|
516 | - $rdf .= " <sioc:next_by_date rdf:resource=\"" . clean($data[next]) . "\"/>\n"; |
|
515 | + if ($data[next]) { |
|
516 | + $rdf .= " <sioc:next_by_date rdf:resource=\"".clean($data[next])."\"/>\n"; |
|
517 | 517 | } |
518 | 518 | $rdf .= " </sioc:Post>\n"; |
519 | 519 | $rdf .= " </sioc:container_of>\n"; |
520 | 520 | } |
521 | 521 | } |
522 | - if($this->next) { |
|
523 | - $rdf .= "\r<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('thread', $this->id, $this->page + 1) |
|
522 | + if ($this->next) { |
|
523 | + $rdf .= "\r<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('thread', $this->id, $this->page + 1) |
|
524 | 524 | . "\"/>\n"; |
525 | 525 | } |
526 | 526 | $rdf .= "</sioc:Thread>\n"; |
@@ -600,61 +600,61 @@ discard block |
||
600 | 600 | } |
601 | 601 | |
602 | 602 | public function getContent(&$exp): string { |
603 | - $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"; |
|
605 | - $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"; |
|
609 | - |
|
610 | - if($this->parents) { |
|
611 | - foreach($this->parents as $id => $uri) { |
|
603 | + $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"; |
|
605 | + $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"; |
|
609 | + |
|
610 | + if ($this->parents) { |
|
611 | + foreach ($this->parents as $id => $uri) { |
|
612 | 612 | $rdf .= " <sioc:has_parent>\n"; |
613 | - $rdf .= " <sioc:Forum rdf:about=\"" . clean($uri) . "\">\n"; |
|
614 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n"; |
|
613 | + $rdf .= " <sioc:Forum rdf:about=\"".clean($uri)."\">\n"; |
|
614 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $id)."\"/>\n"; |
|
615 | 615 | $rdf .= " </sioc:Forum>\n"; |
616 | 616 | $rdf .= " </sioc:has_parent>\n"; |
617 | 617 | } |
618 | 618 | } |
619 | 619 | |
620 | - if($this->threads) { |
|
621 | - foreach($this->threads as $id => $uri) { |
|
620 | + if ($this->threads) { |
|
621 | + foreach ($this->threads as $id => $uri) { |
|
622 | 622 | $rdf .= " <sioc:parent_of>\n"; |
623 | - $rdf .= " <sioc:Thread rdf:about=\"" . clean($uri) . "\">\n"; |
|
624 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('thread', $id) . "\"/>\n"; |
|
623 | + $rdf .= " <sioc:Thread rdf:about=\"".clean($uri)."\">\n"; |
|
624 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('thread', $id)."\"/>\n"; |
|
625 | 625 | $rdf .= " </sioc:Thread>\n"; |
626 | 626 | $rdf .= " </sioc:parent_of>\n"; |
627 | 627 | } |
628 | 628 | } |
629 | 629 | |
630 | - if($this->posts) { |
|
631 | - foreach($this->posts as $id => $url) { |
|
630 | + if ($this->posts) { |
|
631 | + foreach ($this->posts as $id => $url) { |
|
632 | 632 | $rdf .= " <sioc:container_of>\n"; |
633 | - $rdf .= " <sioc:Post rdf:about=\"" . clean($url) . "\">\n"; |
|
634 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('post', $id) . "\"/>\n"; |
|
633 | + $rdf .= " <sioc:Post rdf:about=\"".clean($url)."\">\n"; |
|
634 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('post', $id)."\"/>\n"; |
|
635 | 635 | $rdf .= " </sioc:Post>\n"; |
636 | 636 | $rdf .= " </sioc:container_of>\n"; |
637 | 637 | } |
638 | 638 | } |
639 | 639 | |
640 | - if($this->creator) { |
|
641 | - if($this->creator->_id) { |
|
640 | + if ($this->creator) { |
|
641 | + if ($this->creator->_id) { |
|
642 | 642 | $rdf .= " <sioc:has_creator>\n"; |
643 | - $rdf .= " <sioc:UserAccount rdf:about=\"" . clean($this->creator->_uri) . "\">\n"; |
|
644 | - if($this->creator->_sioc_url) { |
|
645 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $this->creator->_sioc_url . "\"/>\n"; |
|
643 | + $rdf .= " <sioc:UserAccount rdf:about=\"".clean($this->creator->_uri)."\">\n"; |
|
644 | + if ($this->creator->_sioc_url) { |
|
645 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$this->creator->_sioc_url."\"/>\n"; |
|
646 | 646 | } else { |
647 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->creator->_id) |
|
647 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->creator->_id) |
|
648 | 648 | . "\"/>\n"; |
649 | 649 | } |
650 | 650 | $rdf .= " </sioc:UserAccount>\n"; |
651 | 651 | $rdf .= " </sioc:has_creator>\n"; |
652 | 652 | $rdf .= " <foaf:maker>\n"; |
653 | - $rdf .= " <foaf:Person rdf:about=\"" . clean($this->creator->_foaf_uri) . "\">\n"; |
|
654 | - if($this->creator->_foaf_url) { |
|
655 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $this->creator->_foaf_url . "\"/>\n"; |
|
653 | + $rdf .= " <foaf:Person rdf:about=\"".clean($this->creator->_foaf_uri)."\">\n"; |
|
654 | + if ($this->creator->_foaf_url) { |
|
655 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$this->creator->_foaf_url."\"/>\n"; |
|
656 | 656 | } else { |
657 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->creator->_id) |
|
657 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->creator->_id) |
|
658 | 658 | . "\"/>\n"; |
659 | 659 | } |
660 | 660 | $rdf .= " </foaf:Person>\n"; |
@@ -662,14 +662,14 @@ discard block |
||
662 | 662 | } else { |
663 | 663 | $rdf .= " <foaf:maker>\n"; |
664 | 664 | $rdf .= " <foaf:Person"; |
665 | - if($this->creator->_name) { |
|
666 | - $rdf .= " foaf:name=\"" . $this->creator->_name . "\""; |
|
665 | + if ($this->creator->_name) { |
|
666 | + $rdf .= " foaf:name=\"".$this->creator->_name."\""; |
|
667 | 667 | } |
668 | - if($this->creator->_sha1) { |
|
669 | - $rdf .= " foaf:mbox_sha1sum=\"" . $this->creator->_sha1 . "\""; |
|
668 | + if ($this->creator->_sha1) { |
|
669 | + $rdf .= " foaf:mbox_sha1sum=\"".$this->creator->_sha1."\""; |
|
670 | 670 | } |
671 | - if($this->creator->_name) { |
|
672 | - $rdf .= ">\n <foaf:homepage rdf:resource=\"" . $this->creator->_homepage |
|
671 | + if ($this->creator->_name) { |
|
672 | + $rdf .= ">\n <foaf:homepage rdf:resource=\"".$this->creator->_homepage |
|
673 | 673 | . "\"/>\n </foaf:Person>\n"; |
674 | 674 | } else { |
675 | 675 | $rdf .= "/>\n"; |
@@ -678,28 +678,28 @@ discard block |
||
678 | 678 | } |
679 | 679 | } |
680 | 680 | |
681 | - if($this->administrator) { |
|
682 | - if($this->administrator->_id) { |
|
681 | + if ($this->administrator) { |
|
682 | + if ($this->administrator->_id) { |
|
683 | 683 | $rdf .= " <sioc:has_administrator>\n"; |
684 | - $rdf .= " <sioc:UserAccount rdf:about=\"" . clean($this->administrator->_uri) . "\">\n"; |
|
685 | - if($this->administrator->_sioc_url) { |
|
686 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $this->administrator->_sioc_url . "\"/>\n"; |
|
684 | + $rdf .= " <sioc:UserAccount rdf:about=\"".clean($this->administrator->_uri)."\">\n"; |
|
685 | + if ($this->administrator->_sioc_url) { |
|
686 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$this->administrator->_sioc_url."\"/>\n"; |
|
687 | 687 | } else $rdf .= " <rdfs:seeAlso rdf:resource=\"" |
688 | - . $exp->siocURL('user', $this->administrator->_id) . "\"/>\n"; |
|
688 | + . $exp->siocURL('user', $this->administrator->_id)."\"/>\n"; |
|
689 | 689 | $rdf .= " </sioc:UserAccount>\n"; |
690 | 690 | $rdf .= " </sioc:has_administrator>\n"; |
691 | 691 | } |
692 | 692 | } |
693 | - if($this->links) { |
|
694 | - foreach($this->links as $url => $link) { |
|
695 | - $rdf .= " <sioc:links_to rdfs:label=\"$link\" rdf:resource=\"" . clean($url) . "\"/>\n"; |
|
693 | + if ($this->links) { |
|
694 | + foreach ($this->links as $url => $link) { |
|
695 | + $rdf .= " <sioc:links_to rdfs:label=\"$link\" rdf:resource=\"".clean($url)."\"/>\n"; |
|
696 | 696 | } |
697 | 697 | } |
698 | 698 | |
699 | - if($this->next) { |
|
700 | - $rdf .= "\r<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $this->id, $this->page + 1) . "\"/>\n"; |
|
699 | + if ($this->next) { |
|
700 | + $rdf .= "\r<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $this->id, $this->page + 1)."\"/>\n"; |
|
701 | 701 | } |
702 | - $rdf .= "</" . $this->_type . ">"; |
|
702 | + $rdf .= "</".$this->_type.">"; |
|
703 | 703 | |
704 | 704 | return $rdf; |
705 | 705 | } |
@@ -764,29 +764,29 @@ discard block |
||
764 | 764 | } |
765 | 765 | |
766 | 766 | public function getContent(&$exp): string { |
767 | - $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"; |
|
769 | - if($this->subject) { |
|
770 | - $rdf .= " <dc:title>" . $this->subject . "</dc:title>\n"; |
|
767 | + $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"; |
|
769 | + if ($this->subject) { |
|
770 | + $rdf .= " <dc:title>".$this->subject."</dc:title>\n"; |
|
771 | 771 | } |
772 | - if($this->creator) { |
|
773 | - if($this->creator->_id) { |
|
772 | + if ($this->creator) { |
|
773 | + if ($this->creator->_id) { |
|
774 | 774 | $rdf .= " <sioc:has_creator>\n"; |
775 | - $rdf .= " <sioc:UserAccount rdf:about=\"" . clean($this->creator->_uri) . "\">\n"; |
|
776 | - if($this->creator->_sioc_url) { |
|
777 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $this->creator->_sioc_url . "\"/>\n"; |
|
775 | + $rdf .= " <sioc:UserAccount rdf:about=\"".clean($this->creator->_uri)."\">\n"; |
|
776 | + if ($this->creator->_sioc_url) { |
|
777 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$this->creator->_sioc_url."\"/>\n"; |
|
778 | 778 | } else { |
779 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->creator->_id) |
|
779 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->creator->_id) |
|
780 | 780 | . "\"/>\n"; |
781 | 781 | } |
782 | 782 | $rdf .= " </sioc:UserAccount>\n"; |
783 | 783 | $rdf .= " </sioc:has_creator>\n"; |
784 | 784 | $rdf .= " <foaf:maker>\n"; |
785 | - $rdf .= " <foaf:Person rdf:about=\"" . clean($this->creator->_foaf_uri) . "\">\n"; |
|
786 | - if($this->creator->_foaf_url) { |
|
787 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $this->creator->_foaf_url . "\"/>\n"; |
|
785 | + $rdf .= " <foaf:Person rdf:about=\"".clean($this->creator->_foaf_uri)."\">\n"; |
|
786 | + if ($this->creator->_foaf_url) { |
|
787 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$this->creator->_foaf_url."\"/>\n"; |
|
788 | 788 | } else { |
789 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->creator->_id) |
|
789 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->creator->_id) |
|
790 | 790 | . "\"/>\n"; |
791 | 791 | } |
792 | 792 | $rdf .= " </foaf:Person>\n"; |
@@ -794,14 +794,14 @@ discard block |
||
794 | 794 | } else { |
795 | 795 | $rdf .= " <foaf:maker>\n"; |
796 | 796 | $rdf .= " <foaf:Person"; |
797 | - if($this->creator->_name) { |
|
798 | - $rdf .= " foaf:name=\"" . $this->creator->_name . "\""; |
|
797 | + if ($this->creator->_name) { |
|
798 | + $rdf .= " foaf:name=\"".$this->creator->_name."\""; |
|
799 | 799 | } |
800 | - if($this->creator->_sha1) { |
|
801 | - $rdf .= " foaf:mbox_sha1sum=\"" . $this->creator->_sha1 . "\""; |
|
800 | + if ($this->creator->_sha1) { |
|
801 | + $rdf .= " foaf:mbox_sha1sum=\"".$this->creator->_sha1."\""; |
|
802 | 802 | } |
803 | - if($this->creator->_name) { |
|
804 | - $rdf .= ">\n <foaf:homepage rdf:resource=\"" . $this->creator->_homepage |
|
803 | + if ($this->creator->_name) { |
|
804 | + $rdf .= ">\n <foaf:homepage rdf:resource=\"".$this->creator->_homepage |
|
805 | 805 | . "\"/>\n </foaf:Person>\n"; |
806 | 806 | } else { |
807 | 807 | $rdf .= "/>\n"; |
@@ -809,51 +809,51 @@ discard block |
||
809 | 809 | $rdf .= " </foaf:maker>\n"; |
810 | 810 | } |
811 | 811 | } |
812 | - $rdf .= " <dcterms:created>" . $this->created . "</dcterms:created>\n"; |
|
813 | - if($this->updated and ($this->created != $this->updated)) $rdf .= " <dcterms:modified>" |
|
814 | - . $this->updated . "</dcterms:modified>\n"; |
|
815 | - $rdf .= " <sioc:content>" . pureContent($this->content) . "</sioc:content>\n"; |
|
816 | - |
|
817 | - $rdf .= " <content:encoded><![CDATA[" . $this->encoded . "]]></content:encoded>\n"; |
|
818 | - if($this->topics) { |
|
819 | - foreach($this->topics as $url => $topic) { |
|
820 | - $rdf .= " <sioc:topic rdfs:label=\"$topic\" rdf:resource=\"" . clean($url) . "\"/>\n"; |
|
812 | + $rdf .= " <dcterms:created>".$this->created."</dcterms:created>\n"; |
|
813 | + if ($this->updated and ($this->created != $this->updated)) $rdf .= " <dcterms:modified>" |
|
814 | + . $this->updated."</dcterms:modified>\n"; |
|
815 | + $rdf .= " <sioc:content>".pureContent($this->content)."</sioc:content>\n"; |
|
816 | + |
|
817 | + $rdf .= " <content:encoded><![CDATA[".$this->encoded."]]></content:encoded>\n"; |
|
818 | + if ($this->topics) { |
|
819 | + foreach ($this->topics as $url => $topic) { |
|
820 | + $rdf .= " <sioc:topic rdfs:label=\"$topic\" rdf:resource=\"".clean($url)."\"/>\n"; |
|
821 | 821 | } |
822 | 822 | } |
823 | - if($this->links) { |
|
824 | - foreach($this->links as $url => $link) { |
|
825 | - $rdf .= " <sioc:links_to rdfs:label=\"$link\" rdf:resource=\"" . clean($url) . "\"/>\n"; |
|
823 | + if ($this->links) { |
|
824 | + foreach ($this->links as $url => $link) { |
|
825 | + $rdf .= " <sioc:links_to rdfs:label=\"$link\" rdf:resource=\"".clean($url)."\"/>\n"; |
|
826 | 826 | } |
827 | 827 | } |
828 | - if($this->has_part) { |
|
829 | - foreach($this->has_part as $id => $url) { |
|
828 | + if ($this->has_part) { |
|
829 | + foreach ($this->has_part as $id => $url) { |
|
830 | 830 | $rdf .= " <dcterms:hasPart>\n"; |
831 | - $rdf .= " <dcmitype:Image rdf:about=\"" . clean($url) . "\"/>\n"; |
|
831 | + $rdf .= " <dcmitype:Image rdf:about=\"".clean($url)."\"/>\n"; |
|
832 | 832 | $rdf .= " </dcterms:hasPart>\n"; |
833 | 833 | } |
834 | 834 | } |
835 | - if($this->reply_of) { |
|
836 | - foreach($this->reply_of as $id => $url) { |
|
835 | + if ($this->reply_of) { |
|
836 | + foreach ($this->reply_of as $id => $url) { |
|
837 | 837 | $rdf .= " <sioc:reply_of>\n"; |
838 | - $rdf .= " <sioc:Post rdf:about=\"" . clean($url) . "\">\n"; |
|
839 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('post', $id) . "\"/>\n"; |
|
838 | + $rdf .= " <sioc:Post rdf:about=\"".clean($url)."\">\n"; |
|
839 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('post', $id)."\"/>\n"; |
|
840 | 840 | $rdf .= " </sioc:Post>\n"; |
841 | 841 | $rdf .= " </sioc:reply_of>\n"; |
842 | 842 | } |
843 | 843 | } |
844 | - if($this->comments) { |
|
845 | - foreach($this->comments as $id => $url) { |
|
844 | + if ($this->comments) { |
|
845 | + foreach ($this->comments as $id => $url) { |
|
846 | 846 | $rdf .= " <sioc:has_reply>\n"; |
847 | - $rdf .= " <sioc:Post rdf:about=\"" . clean($url) . "\">\n"; |
|
847 | + $rdf .= " <sioc:Post rdf:about=\"".clean($url)."\">\n"; |
|
848 | 848 | // if($comments->f('comment_trackback')) $rdf .= " <sioc:type>" |
849 | 849 | // . POST_TRACKBACK . "</sioc:type>\n"; |
850 | 850 | // else $rdf .= " <sioc:type>" . POST_COMMENT . "</sioc:type>\n"; |
851 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('comment', $id) . "\"/>\n"; |
|
851 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('comment', $id)."\"/>\n"; |
|
852 | 852 | $rdf .= " </sioc:Post>\n"; |
853 | 853 | $rdf .= " </sioc:has_reply>\n"; |
854 | 854 | } |
855 | 855 | } |
856 | - $rdf .= "</" . $this->_type . ">\n"; |
|
856 | + $rdf .= "</".$this->_type.">\n"; |
|
857 | 857 | return $rdf; |
858 | 858 | } |
859 | 859 | } |
@@ -917,17 +917,17 @@ discard block |
||
917 | 917 | } |
918 | 918 | |
919 | 919 | public function getContent(&$exp): string { |
920 | - $rdf = '<' . $this->_type . " rdf:about=\"" . clean($this->url) . "\">\n"; |
|
921 | - if($this->subject) { |
|
922 | - $rdf .= " <dc:title>" . clean($this->subject) . "</dc:title>\n"; |
|
923 | - if(strcmp($this->has_container, 'http://en.wikipedia.org') === 0) { |
|
924 | - $rdf .= " <foaf:primaryTopic rdf:resource=\"" . clean( |
|
920 | + $rdf = '<'.$this->_type." rdf:about=\"".clean($this->url)."\">\n"; |
|
921 | + if ($this->subject) { |
|
922 | + $rdf .= " <dc:title>".clean($this->subject)."</dc:title>\n"; |
|
923 | + if (strcmp($this->has_container, 'http://en.wikipedia.org') === 0) { |
|
924 | + $rdf .= " <foaf:primaryTopic rdf:resource=\"".clean( |
|
925 | 925 | 'http://dbpedia.org/resource/' |
926 | 926 | . $this->subject |
927 | - ) . "\"/>\n"; |
|
927 | + )."\"/>\n"; |
|
928 | 928 | } |
929 | 929 | } |
930 | - if($this->creator->_nick) { |
|
930 | + if ($this->creator->_nick) { |
|
931 | 931 | /*if ($this->creator->id) { |
932 | 932 | $rdf .= " <sioc:has_creator>\n"; |
933 | 933 | $rdf .= " <sioc:UserAccount rdf:about=\"" . clean($this->creator->uri) ."\">\n"; |
@@ -947,16 +947,16 @@ discard block |
||
947 | 947 | $rdf .= " </foaf:maker>\n"; |
948 | 948 | } else {*/ |
949 | 949 | $rdf .= " <sioc:has_creator>\n"; |
950 | - $rdf .= " <sioc:UserAccount rdf:about=\"" . clean($this->creator->_uri) . "\">\n"; |
|
951 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . |
|
952 | - clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->creator->_uri); |
|
953 | - if($this->api) { |
|
954 | - $rdf .= clean("&api=" . $this->api); |
|
950 | + $rdf .= " <sioc:UserAccount rdf:about=\"".clean($this->creator->_uri)."\">\n"; |
|
951 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"". |
|
952 | + clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->creator->_uri); |
|
953 | + if ($this->api) { |
|
954 | + $rdf .= clean("&api=".$this->api); |
|
955 | 955 | } |
956 | 956 | $rdf .= "\"/>\n"; |
957 | 957 | $rdf .= " </sioc:UserAccount>\n"; |
958 | 958 | $rdf .= " </sioc:has_creator>\n"; |
959 | - $rdf .= " <dc:contributor>" . clean($this->creator->_nick) . "</dc:contributor>\n"; |
|
959 | + $rdf .= " <dc:contributor>".clean($this->creator->_nick)."</dc:contributor>\n"; |
|
960 | 960 | /*$rdf .= " <foaf:maker>\n"; |
961 | 961 | $rdf .= " <foaf:Person"; |
962 | 962 | if($this->creator->name) $rdf .= " foaf:name=\"" . $this->creator->name ."\""; |
@@ -967,69 +967,69 @@ discard block |
||
967 | 967 | $rdf .= " </foaf:maker>\n"; |
968 | 968 | }*/ |
969 | 969 | } else { |
970 | - if($this->creator !== 'void') { |
|
970 | + if ($this->creator !== 'void') { |
|
971 | 971 | $rdf .= " <sioc:has_creator>\n"; |
972 | 972 | $rdf .= " <sioc:UserAccount>\n"; |
973 | 973 | $rdf .= " </sioc:UserAccount>\n"; |
974 | 974 | $rdf .= " </sioc:has_creator>\n"; |
975 | 975 | } |
976 | 976 | } |
977 | - if($this->created) { |
|
978 | - $rdf .= " <dcterms:created>" . $this->created . "</dcterms:created>\n"; |
|
977 | + if ($this->created) { |
|
978 | + $rdf .= " <dcterms:created>".$this->created."</dcterms:created>\n"; |
|
979 | 979 | } |
980 | - if(is_array($this->topics)) { |
|
981 | - foreach($this->topics as $topic => $url) { |
|
980 | + if (is_array($this->topics)) { |
|
981 | + foreach ($this->topics as $topic => $url) { |
|
982 | 982 | $rdf .= " <sioc:topic>\n"; |
983 | - $rdf .= " <sioct:Category rdf:about=\"" . clean($url) . "\">\n"; |
|
984 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . |
|
985 | - clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $url); |
|
986 | - if($this->api) { |
|
987 | - $rdf .= clean("&api=" . $this->api); |
|
983 | + $rdf .= " <sioct:Category rdf:about=\"".clean($url)."\">\n"; |
|
984 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"". |
|
985 | + clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$url); |
|
986 | + if ($this->api) { |
|
987 | + $rdf .= clean("&api=".$this->api); |
|
988 | 988 | } |
989 | 989 | $rdf .= "\"/>\n"; |
990 | 990 | $rdf .= " </sioct:Category>\n"; |
991 | 991 | $rdf .= " </sioc:topic>\n"; |
992 | 992 | } |
993 | 993 | } |
994 | - if(is_array($this->links)) { |
|
995 | - foreach($this->links as $label => $url) { |
|
994 | + if (is_array($this->links)) { |
|
995 | + foreach ($this->links as $label => $url) { |
|
996 | 996 | $rdf .= " <sioc:links_to>\n"; |
997 | - $rdf .= " <sioct:WikiArticle rdf:about=\"" . clean($url) . "\">\n"; |
|
998 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . |
|
999 | - clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $url); |
|
1000 | - if($this->api) { |
|
1001 | - $rdf .= clean("&api=" . $this->api); |
|
997 | + $rdf .= " <sioct:WikiArticle rdf:about=\"".clean($url)."\">\n"; |
|
998 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"". |
|
999 | + clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$url); |
|
1000 | + if ($this->api) { |
|
1001 | + $rdf .= clean("&api=".$this->api); |
|
1002 | 1002 | } |
1003 | 1003 | $rdf .= "\"/>\n"; |
1004 | 1004 | $rdf .= " </sioct:WikiArticle>\n"; |
1005 | 1005 | $rdf .= " </sioc:links_to>\n"; |
1006 | 1006 | } |
1007 | 1007 | } else { |
1008 | - if($this->links) { |
|
1008 | + if ($this->links) { |
|
1009 | 1009 | $rdf .= " <sioc:links_to>\n"; |
1010 | - $rdf .= " <sioct:WikiArticle rdf:about=\"" . clean($this->links) . "\">\n"; |
|
1011 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . |
|
1012 | - clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->links); |
|
1013 | - if($this->api) { |
|
1014 | - $rdf .= clean("&api=" . $this->api); |
|
1010 | + $rdf .= " <sioct:WikiArticle rdf:about=\"".clean($this->links)."\">\n"; |
|
1011 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"". |
|
1012 | + clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->links); |
|
1013 | + if ($this->api) { |
|
1014 | + $rdf .= clean("&api=".$this->api); |
|
1015 | 1015 | } |
1016 | 1016 | $rdf .= "\"/>\n"; |
1017 | 1017 | $rdf .= " </sioct:WikiArticle>\n"; |
1018 | 1018 | $rdf .= " </sioc:links_to>\n"; |
1019 | 1019 | } |
1020 | 1020 | } |
1021 | - if(is_array($this->ext_links)) { |
|
1022 | - foreach($this->ext_links as $label => $url) { |
|
1023 | - $rdf .= " <sioc:links_to rdf:resource=\"" . clean($url) . "\"/>\n"; |
|
1021 | + if (is_array($this->ext_links)) { |
|
1022 | + foreach ($this->ext_links as $label => $url) { |
|
1023 | + $rdf .= " <sioc:links_to rdf:resource=\"".clean($url)."\"/>\n"; |
|
1024 | 1024 | } |
1025 | 1025 | } |
1026 | - if($this->previous_version) { |
|
1026 | + if ($this->previous_version) { |
|
1027 | 1027 | $rdf .= " <sioc:previous_version>\n"; |
1028 | - $rdf .= " <sioct:WikiArticle rdf:about=\"" . clean($this->previous_version) . "\">\n"; |
|
1029 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . |
|
1030 | - clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->previous_version); |
|
1031 | - if($this->api) { |
|
1032 | - $rdf .= clean("&api=" . $this->api); |
|
1028 | + $rdf .= " <sioct:WikiArticle rdf:about=\"".clean($this->previous_version)."\">\n"; |
|
1029 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"". |
|
1030 | + clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->previous_version); |
|
1031 | + if ($this->api) { |
|
1032 | + $rdf .= clean("&api=".$this->api); |
|
1033 | 1033 | } |
1034 | 1034 | $rdf .= "\"/>\n"; |
1035 | 1035 | $rdf .= " </sioct:WikiArticle>\n"; |
@@ -1047,13 +1047,13 @@ discard block |
||
1047 | 1047 | $rdf .= " </sioc:earlier_version>\n"; |
1048 | 1048 | */ |
1049 | 1049 | } |
1050 | - if($this->next_version) { |
|
1050 | + if ($this->next_version) { |
|
1051 | 1051 | $rdf .= " <sioc:next_version>\n"; |
1052 | - $rdf .= " <sioct:WikiArticle rdf:about=\"" . clean($this->next_version) . "\">\n"; |
|
1053 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . |
|
1054 | - clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->next_version); |
|
1055 | - if($this->api) { |
|
1056 | - $rdf .= clean("&api=" . $this->api); |
|
1052 | + $rdf .= " <sioct:WikiArticle rdf:about=\"".clean($this->next_version)."\">\n"; |
|
1053 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"". |
|
1054 | + clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->next_version); |
|
1055 | + if ($this->api) { |
|
1056 | + $rdf .= clean("&api=".$this->api); |
|
1057 | 1057 | } |
1058 | 1058 | $rdf .= "\"/>\n"; |
1059 | 1059 | $rdf .= " </sioct:WikiArticle>\n"; |
@@ -1071,46 +1071,46 @@ discard block |
||
1071 | 1071 | $rdf .= " </sioc:later_version>\n"; |
1072 | 1072 | */ |
1073 | 1073 | } |
1074 | - if($this->latest_version) { |
|
1074 | + if ($this->latest_version) { |
|
1075 | 1075 | $rdf .= " <sioc:latest_version>\n"; |
1076 | - $rdf .= " <sioct:WikiArticle rdf:about=\"" . clean($this->latest_version) . "\">\n"; |
|
1077 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . |
|
1078 | - clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->latest_version); |
|
1079 | - if($this->api) { |
|
1080 | - $rdf .= clean("&api=" . $this->api); |
|
1076 | + $rdf .= " <sioct:WikiArticle rdf:about=\"".clean($this->latest_version)."\">\n"; |
|
1077 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"". |
|
1078 | + clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->latest_version); |
|
1079 | + if ($this->api) { |
|
1080 | + $rdf .= clean("&api=".$this->api); |
|
1081 | 1081 | } |
1082 | 1082 | $rdf .= "\"/>\n"; |
1083 | 1083 | $rdf .= " </sioct:WikiArticle>\n"; |
1084 | 1084 | $rdf .= " </sioc:latest_version>\n"; |
1085 | 1085 | } |
1086 | - if($this->has_discussion && (strpos($this->has_discussion, 'Talk:Talk:') == false)) { |
|
1086 | + if ($this->has_discussion && (strpos($this->has_discussion, 'Talk:Talk:') == false)) { |
|
1087 | 1087 | $rdf .= " <sioc:has_discussion>\n"; |
1088 | - $rdf .= " <sioct:WikiArticle rdf:about=\"" . clean($this->has_discussion) . "\">\n"; |
|
1089 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . |
|
1090 | - clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->has_discussion); |
|
1091 | - if($this->api) { |
|
1092 | - $rdf .= clean("&api=" . $this->api); |
|
1088 | + $rdf .= " <sioct:WikiArticle rdf:about=\"".clean($this->has_discussion)."\">\n"; |
|
1089 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"". |
|
1090 | + clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->has_discussion); |
|
1091 | + if ($this->api) { |
|
1092 | + $rdf .= clean("&api=".$this->api); |
|
1093 | 1093 | } |
1094 | 1094 | $rdf .= "\"/>\n"; |
1095 | 1095 | $rdf .= " </sioct:WikiArticle>\n"; |
1096 | 1096 | $rdf .= " </sioc:has_discussion>\n"; |
1097 | 1097 | } |
1098 | - if($this->has_container) { |
|
1098 | + if ($this->has_container) { |
|
1099 | 1099 | $rdf .= " <sioc:has_container>\n"; |
1100 | - $rdf .= " <sioct:Wiki rdf:about=\"" . clean($this->has_container) . "\"/>\n"; |
|
1100 | + $rdf .= " <sioct:Wiki rdf:about=\"".clean($this->has_container)."\"/>\n"; |
|
1101 | 1101 | $rdf .= " </sioc:has_container>\n"; |
1102 | 1102 | } |
1103 | - if($this->redirpage) { |
|
1104 | - $rdf .= " <owl:sameAs rdf:resource=\"" . clean($this->redirpage) . "\"/>\n"; |
|
1105 | - $rdf .= " <rdfs:seeAlso rdf:resource=\"" . |
|
1106 | - clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->redirpage); |
|
1107 | - if($this->api) { |
|
1108 | - $rdf .= clean("&api=" . $this->api); |
|
1103 | + if ($this->redirpage) { |
|
1104 | + $rdf .= " <owl:sameAs rdf:resource=\"".clean($this->redirpage)."\"/>\n"; |
|
1105 | + $rdf .= " <rdfs:seeAlso rdf:resource=\"". |
|
1106 | + clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->redirpage); |
|
1107 | + if ($this->api) { |
|
1108 | + $rdf .= clean("&api=".$this->api); |
|
1109 | 1109 | } |
1110 | 1110 | $rdf .= "\"/>\n"; |
1111 | 1111 | } |
1112 | 1112 | |
1113 | - $rdf .= "</" . $this->_type . ">\n"; |
|
1113 | + $rdf .= "</".$this->_type.">\n"; |
|
1114 | 1114 | return $rdf; |
1115 | 1115 | } |
1116 | 1116 | } |
@@ -1131,7 +1131,7 @@ discard block |
||
1131 | 1131 | } |
1132 | 1132 | |
1133 | 1133 | public function getContent(&$exp): string { |
1134 | - $rdf = '<' . $this->type . " rdf:about=\"" . clean($this->url) . "\"/>\n"; |
|
1134 | + $rdf = '<'.$this->type." rdf:about=\"".clean($this->url)."\"/>\n"; |
|
1135 | 1135 | return $rdf; |
1136 | 1136 | } |
1137 | 1137 | } |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | } |
1153 | 1153 | |
1154 | 1154 | public function getContent(&$exp): string { |
1155 | - $rdf = '<' . $this->type . " rdf:about=\"" . clean($this->url) . "\"/>\n"; |
|
1155 | + $rdf = '<'.$this->type." rdf:about=\"".clean($this->url)."\"/>\n"; |
|
1156 | 1156 | return $rdf; |
1157 | 1157 | } |
1158 | 1158 | } |
@@ -1162,13 +1162,13 @@ discard block |
||
1162 | 1162 | * |
1163 | 1163 | * Transforms text so that it can be safely put into XML markup |
1164 | 1164 | */ |
1165 | -if(!function_exists('clean')) { |
|
1165 | +if (!function_exists('clean')) { |
|
1166 | 1166 | function clean($text, $url = false) { |
1167 | 1167 | # return htmlentities( $text ); |
1168 | 1168 | # return htmlentities2( $text ); |
1169 | 1169 | // double encoding is preventable now |
1170 | 1170 | // $text = htmlspecialchars_decode($text, ENT_COMPAT); |
1171 | - if($url) { |
|
1171 | + if ($url) { |
|
1172 | 1172 | $text = str_replace('&', '&', $text); |
1173 | 1173 | } |
1174 | 1174 | return htmlspecialchars($text, ENT_COMPAT, 'UTF-8'); |
@@ -1180,7 +1180,7 @@ discard block |
||
1180 | 1180 | * |
1181 | 1181 | * Same a HTMLEntities, but avoids double-encoding of entities |
1182 | 1182 | */ |
1183 | -if(!function_exists('htmlentities2')) { |
|
1183 | +if (!function_exists('htmlentities2')) { |
|
1184 | 1184 | function htmlentities2($myHTML) { |
1185 | 1185 | $translation_table = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES); |
1186 | 1186 | $translation_table[chr(38)] = '&'; |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | * |
1198 | 1198 | * Prepares text-only representation of HTML content |
1199 | 1199 | */ |
1200 | -if(!function_exists('pureContent')) { |
|
1200 | +if (!function_exists('pureContent')) { |
|
1201 | 1201 | function pureContent($content) { |
1202 | 1202 | // Remove HTML tags |
1203 | 1203 | // May add more cleanup code later, if validation errors are found |
@@ -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"; |