>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
include_once('head.php');
include_once('db.php');
include_once('rpc.php');
$thing=explode('@',$path[2]);
$thingobj=rpc_get($thing[1], 'thing/'.$thing[0]);
if(isset($thingobj['error']))
{
print('
'.$thingobj['error'].'
');
include_once('foot.php');
exit();
}
$name=htmlentities($thingobj['name']);
$by=htmlentities($thingobj['by']['name']);
$by=''.htmlentities($thingobj['by']['displayname']).'';
$license=$thingobj['license']['name'];
if($license=='other')
{
$license='Other, see description';
}else{
$simple=(isset($thingobj['license']['simple'])?' title="'.htmlentities($thingobj['license']['simple']).'"':'');
$license=''.htmlentities($license).'';
}
include_once('parsedown/Parsedown.php');
$md=new Parsedown();
$description=$md->text(htmlentities($thingobj['description']));
if(isset($_SESSION['name']))
{
if($thing[1]==DOMAIN && $thingobj['by']['name']==$_SESSION['name'])
{
$description.=''._('Edit').'';
}else{
$description.=''._('Report').'';
}
}
$files='';
foreach($thingobj['files'] as $file)
{
$type=(isset($file['type'])?$file['type']:'unknown');
$files.='';
}
$tags='';
foreach($thingobj['tags'] as $tag)
{
$tag=htmlentities($tag);
$tags.=' '.$tag.'';
}
?>
=$name?>
=sprintf(_('Published on %s under the license %s'), ''.htmlentities($thingobj['date']).'', $license)?>
=$description?>
Tags: =$tags?>
=$files?>