⌈⌋ ⎇ branch:  freshcode


Artifact [7fe21eb76d]

Artifact 7fe21eb76dac3d8024b1a9fc690b215767646931:

  • File template/search_entry.php — part of check-in [92d96d21cf] at 2014-07-11 16:00:57 on branch trunk — Introduce search/ function. (user: mario size: 1018)

<?php
/**
 * api: include
 * type: template
 * title: Search results
 * description: Display shortened project description
 *
 *
 */

if (!function_exists("smallify")) {
    function smallify($text, $r="") {
        $text = explode("\n", wordwrap(input::spaces($text), 20));
        foreach ($text as $i=>$line) {
            $q = 100 - $i;
            $h = $q * 0.5;
            $r .= "<span style=\"font: normal $q%/$h% Arial\">"
                . $line . "</span> ";
        }
        return $r;
    }
}


$_ = "trim";

print <<<PROJECT
      <article class="project search">

        <h3>
            <a href="projects/$entry[name]">
               $entry[title]
               <em class=version>$entry[version]</em>
            </a>
        </h3>

        <a href="$entry[homepage]">
           <img class=preview src="$entry[image]" align=left width=60 height=45>
        </a>

        <small class=description style="border:0">{$_(smallify($entry["description"]))}</small>

      </article>
      
PROJECT;


?>