all: build
-build: core banana wiki jquery
+build: core banana wiki medals jquery
q:
@echo -e "Code statistics\n"
include/banana/banana.inc.php:
cd $(@D) && find $(BANANA)/banana/ -name '*.php' -exec ln -snf {} . ";"
+##
+## Medal thumbnails
+##
+MEDAL_PICTURES=$(wildcard htdocs/images/medals/*.jpg)
+MEDAL_THUMBNAILS=$(subst /medals/,/medals/thumb/,$(MEDAL_PICTURES))
+
+medals: $(MEDAL_THUMBNAILS)
+$(MEDAL_THUMBNAILS): $(subst /medals/thumb/,/medals/,$(@F))
+ convert -resize x50 $(subst /medals/thumb/,/medals/,$@) $@
##
## jquery
function handler_medal(&$page, $mid)
{
+ $thumb = ($mid == 'thumb');
+ $mid = $thumb ? @func_get_arg(2) : $mid;
+
$res = XDB::query("SELECT img
FROM profile_medals
WHERE id = {?}",
$mid);
- $img = dirname(__FILE__).'/../htdocs/images/medals/' . $res->fetchOneCell();
+ $img = $thumb ?
+ dirname(__FILE__).'/../htdocs/images/medals/thumb/' . $res->fetchOneCell() :
+ dirname(__FILE__).'/../htdocs/images/medals/' . $res->fetchOneCell();
$type = mime_content_type($img);
header("Content-Type: $type");
echo file_get_contents($img);
<div id="medal_{$id}" style="clear: both; margin-top: 1em; height: 50px; vertical-align: middle">
<div style="float: left; margin-right: 0.3em">
- <img src="profile/medal/{$id}" height="50" />
+ <img src="profile/medal/thumb/{$id}" height="50px" />
</div>
<div style="float: left; width: 70%">
<div><b id="medal_name_{$id}"></b>
<h2>Distinctions : </h2>
{foreach from=$x.medals item=m}
<div class="medal_frame">
- <img src="profile/medal/{$m.id}" width="24" alt="{$m.medal}" title="{$m.medal}" style='float: left;' />
+ <img src="profile/medal/thumb/{$m.id}" height="50px" alt="{$m.medal}" title="{$m.medal}" style='float: left;' />
<div class="medal_text">
{$m.medal}<br />{$m.grade}
</div>