Check-in [f5ea6d4058]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Added "Project Spotlight" to page footer, and a cron-job for rotating 3 random projects in there. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
f5ea6d40583a7267577a400f8a6ee670 |
User & Date: | mario 2014-08-02 20:51:33 |
Context
2014-08-02
| ||
20:52 | Make ->list not forgo absent keys, but substitute values with NULL. check-in: 041f5c22f2 user: mario tags: trunk | |
20:51 | Added "Project Spotlight" to page footer, and a cron-job for rotating 3 random projects in there. check-in: f5ea6d4058 user: mario tags: trunk | |
20:50 | Moved defaults into static ::$defaults to also override UserAgent check-in: 7d2a749ebc user: mario tags: trunk | |
Changes
Added cron.daily/spotlight.php.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | <?php /** * api: cron * title: Create random picks for project spotlight * description: Randomly picks out a few projects for the footer * version: 0.1 * * */ chdir(dirname(__DIR__)); include("config.php"); /** * Scan each project, * pick random three. * */ $r = db(" SELECT name, title, SUBSTR(description, 0, 150) AS description, MAX(t_changed) AS t FROM release GROUP BY name ORDER BY random() LIMIT 3; "); // combine into HTML blob $html = ""; foreach ($r as $entry) { $entry = array_map("input::_html", $entry); # $entry["description"] = preg_replace("/\.[^.]*$|[,;][^,;]*$|\S*$/", "", $entry["description"]); $html .= <<<EOF <a class=project-spotlight href="projects/$entry[name]"> <img src="img/screenshot/$entry[name].jpeg" width=120 height=90 alt=$entry[name]> <b> $entry[title] </b> <small class=description>$entry[description]</small> </a> EOF; } // store as template file_put_contents("./template/spotlight.htm", $html); |
Changes to freshcode.css.
1 2 3 4 5 | /** * api: css * type: stylesheet * title: freshcode.club layout+style * description: Simulates the late freecode.com layout and looks; well mostly. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 | /** * api: css * type: stylesheet * title: freshcode.club layout+style * description: Simulates the late freecode.com layout and looks; well mostly. * version: 0.6.2.2 * * Centered two-pane layout. The #main section is usually 33% of the screen width, * while the #sidebar floats at the right. They're repositioned only using padding: * to the outer html,body{}. * */ |
︙ | ︙ | |||
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | } /** * Project listing on frontpage and /projects/xyz * */ #main .project h3 a { color: #000; } #main .project h3 a:hover, #main .project h3 a:hover .version { color: #237; } #main .project .version { font-style: normal; font-weight: 200; | > > > > > > > | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | } /** * Project listing on frontpage and /projects/xyz * */ #main .project h3 { white-space: nowrap; } #main .project h3 a { color: #000; display: inline-block; max-width: 400pt; overflow: hidden; text-overflow: ellipsis; } #main .project h3 a:hover, #main .project h3 a:hover .version { color: #237; } #main .project .version { font-style: normal; font-weight: 200; |
︙ | ︙ | |||
547 548 549 550 551 552 553 | */ #spotlight { margin-top: 50pt; border-top: 3pt solid #B7C0BB; background: #E7E7D0; padding: 10pt 150pt; color: #111; | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | */ #spotlight { margin-top: 50pt; border-top: 3pt solid #B7C0BB; background: #E7E7D0; padding: 10pt 150pt; color: #111; height: 120pt; } #spotlight a { display: inline-block; float: left; margin: 10pt; padding: 7pt; width: 200pt; height: 85pt; overflow: hidden; text-overflow: ellipsis; border-radius: 10pt; background: linear-gradient(to bottom, #F3F3DF, #E7E7D0 70%); } #spotlight a b { color: #111; font-weight: 700; display: inline-block; max-width: 120px; max-height: 15pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } #spotlight a img { float: left; margin-right: 5pt; border-radius: 5pt; } #spotlight a small { color: #444; } #bottom { border-top: 3pt solid #5F677F; background: #444477; padding: 10pt 150pt; color: #fff; height: 50pt; } #bottom a { color: #fc9; } |
Changes to template/bottom.php.
1 2 3 | </section> <footer id=spotlight> | | | 1 2 3 4 5 6 7 8 9 10 11 | </section> <footer id=spotlight> <?php include("template/spotlight.htm"); ?> </footer> <footer id=bottom> <a href="http://fossil.include-once.org/freshcode/wiki/About">About</a> | <a href="http://fossil.include-once.org/freshcode/wiki/Privacy">Privacy / Policy</a> | <a href="http://fossil.include-once.org/freshcode/wiki/Contribute">Contribute</a> | <small> |
︙ | ︙ |