cosmetic fix linkification, 'written in' subtitles
This commit is contained in:
parent
a4262f8f8f
commit
092f8f0950
16
rebuild.php
16
rebuild.php
@ -94,10 +94,10 @@ function hesc($sz) {
|
||||
}
|
||||
|
||||
function text2html($sz) {
|
||||
$base = nl2br(hesc($sz));
|
||||
$base = hesc($sz);
|
||||
$base = preg_replace('~(https?://[^ \\r\\n\\t]+)~i', '<a href="\\1">\\1</a>', $base);
|
||||
|
||||
preg_replace('~(https?://.+\b)~i', '<a href="\1">\1</a>', $base);
|
||||
return $base;
|
||||
return nl2br($base);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -108,6 +108,7 @@ class CProject {
|
||||
private $dir;
|
||||
public $projname;
|
||||
public $shortdesc = '(no description)';
|
||||
public $subtag = '';
|
||||
private $longdesc = '';
|
||||
private $images = array();
|
||||
private $downloads = array();
|
||||
@ -126,6 +127,11 @@ class CProject {
|
||||
|
||||
if ($file == 'README.txt') {
|
||||
$this->longdesc = file_get_contents($this->dir.'README.txt');
|
||||
$matches = array();
|
||||
if (preg_match('~Written in ([^\\r\\n]+)~', $this->longdesc, $matches)) {
|
||||
$this->subtag = rtrim($matches[1], ' .');
|
||||
}
|
||||
|
||||
$this->shortdesc = array_shift(explode("\n", $this->longdesc));
|
||||
$this->shortdesc[0] = strtolower($this->shortdesc[0]); // cosmetic lowercase
|
||||
continue;
|
||||
@ -328,6 +334,10 @@ function buildall() {
|
||||
<strong><?=hesc($pr->projname)?></strong>,
|
||||
<?=hesc($pr->shortdesc)?>
|
||||
<a href="<?=hesc(urlencode($pr->projname))?>.html">more...</a>
|
||||
<?php if (strlen($pr->subtag)) { ?>
|
||||
<br>
|
||||
<small><?=hesc($pr->subtag)?></small>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
@ -56,6 +56,10 @@ html, body {
|
||||
.projtable td {
|
||||
padding: 4px;
|
||||
}
|
||||
.projtable small {
|
||||
color:grey;
|
||||
font-style:italic;
|
||||
}
|
||||
|
||||
.projinfo {
|
||||
position:relative;
|
||||
@ -74,7 +78,7 @@ html, body {
|
||||
position:absolute;
|
||||
right:0;
|
||||
|
||||
width:60px;
|
||||
width:62px; /* 60px + 2px border */
|
||||
}
|
||||
|
||||
/* */
|
||||
@ -94,6 +98,7 @@ html, body {
|
||||
height:60px;
|
||||
opacity: 0.8;
|
||||
transition:0.2s opacity;
|
||||
border:1px solid lightgrey;
|
||||
}
|
||||
.thumbimage:hover {
|
||||
opacity:1.0;
|
||||
|
Reference in New Issue
Block a user