[insert_php]
$x = get_page_by_title( ‘pemline-data’ )->post_content;
$x = str_replace(“
“, “\n”, $x);
$x = str_replace(“
“, “\n”, $x);
$x = explode(“\n”, $x);
$bgcolors = array(‘lightblue’, ‘pink’, ‘beige’, ‘lightgray’);
$bgi = 0;
$bgyr = array();
for ($y = 2000; $y < 2020; $y++) {
$bgyr[$y] = $bgcolors[$bgi];
$bgi++;
if ($bgi > 3) $bgi = 0;
}
print “
\n”;
$lit = array();
$col = 0;
$bg = 240;
$bg2 = 120;
for ($i = 0; $i < count($x); $i++) {
$line = cleanupline($x[$i]);
if (empty($line)) {
if ((!empty($lit['file'])) && (!empty($lit['title']))) {
$f = $lit['file'];
$th = $lit['thumb'];
$t = $lit['title'];
$c = 'white';
//if (preg_match("/(\d\d\d\d)/", $t, $m))
// $c = $bgyr[$m[1]];
//$c = '#' . dechex($bg*256*256 + $bg*256 + $bg);
$c = '#' . dechex($bg2) . dechex($bg2) . dechex($bg);
if ($th == 'none')
$im = "
“;
else
$im = “
“;
print “
$im $t |
“;
$col++;
if ($col > 6) {
print “
“;
$col = 0;
}
$bg *= 0.98;
$bg2 *= 0.98;
}
$lit = array();
}
if (preg_match(“/file: (.*)$/”, $line, $m)) $lit[‘file’] = $m[1];
if (preg_match(“/thumb: (.*)$/”, $line, $m)) $lit[‘thumb’] = $m[1];
if (preg_match(“/title: (.*)$/”, $line, $m)) $lit[‘title’] = $m[1];
}
print “
\n”;
function cleanupline($line) {
$line = trim($line);
$line = trim($line);
$line = trim($line);
$line = trim($line);
$line = str_replace(“
“, “”, $line);
$line = str_replace(“‘”, “”, $line);
return $line;
}
//$x = get_page_by_title( ‘pemline-data’ );
//print “
" . print_r($x, true) . "
“;
//$x = file_get_contents(“https://stage.pemnet.com/pemline-data/”);
//print “
“;
[/insert_php]