first commit

This commit is contained in:
2018-09-02 09:39:01 +02:00
commit 90ff97c51a
172 changed files with 5686 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
<div class="container-fluid bg-grey">
<div class="row">
<div class="col-sm-8">
<h2>A digital currency</h2>
<p>
Use cryptography.<br>
No "central bank".<br>
P2P network.<br>
</p>
</div>
<div class="col-sm-4 align-middle">
<img src="images/bitcoin.jpg" width="100%; height: auto"></img>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4 align-middle">
<img src="images/wallet.png" height="300px"></img>
</div>
<div class="col-sm-8">
<h2>WALLET</h2>
<p>
Use cryptography.<br>
No "central bank".<br>
P2P network.<br>
</p>
</div>
</div>
</div>
<div class="container-fluid bg-grey">
<div class="row">
<div class="col-sm-8">
<h2>Transaction</h2>
<p>
When Bob is sending 42 <span class="glyphicon glyphicon-bitcoin"></span> to Alice, the bitcoin protocol is creating a transaction.<br>
A transaction is the balance between his Inputs and his Outputs.
<ul>
<li>First the network needs to be sure that Bob has got enough <span class="glyphicon glyphicon-bitcoin"></span> in his wallet.<br>So Bob will include a list of transactions that he has received before.<br>This is the inputs of the transactions.<br>For example, previous transaction's amount are 10, 25 and another 10, so total inputs are 45 <span class="glyphicon glyphicon-bitcoin"></span></li>
<li>As the input's sum is superior to the amount of the transaction, an ouput is added.<br>This output is the change to Bob.<br>In the example, this 3 <span class="glyphicon glyphicon-bitcoin"></span></li>
<li>Fees are took by the network to process the transaction.<br>Let say it will take 0.5<span class="glyphicon glyphicon-bitcoin"></span>.<br>This is another ouput</li>
<li>So Alice will get only a part of the transaction's amount.<br>this the last output, 41.5<span class="glyphicon glyphicon-bitcoin"></span></li>
</ul>
So the transaction is a made with :
<ul>
<li>Inputs : a list of previous transactions that bob has received</li>
<li>Outputs : a list of amounts to send to Alice, Bob, and fees</li>
<li>A timestamp</li>
</ul>
Then the wallet will broadcast the transaction on the network.<br>
It will be sent to the area called "mempool".<br>
Nodes of the network will validate the transaction by verfying the Inputs and the Ouputs.<br>
A hash of the transaction is computed.<br>
So the transaction is sealed.
</p>
</div>
<div class="col-sm-4 align-middle">
<img src="images/bob_to_alice.gif" width="100%; height: auto"></img>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4">
<img src="images/tx2block.gif" width="100%; height: auto"></img>
</div>
<div class="col-sm-8">
<h2>Block</h2>
<p>
Then the bitcoin protocol is grouping validated transactions in blocks.<br>
So a block is an array of transactions.<br>
A block is made with :
<ul>
<li>An array of transactions.<br>
That's what my script is drawing.<br>
Running the transactions array, it is computing the sum of each outputs of each transaction.<br>
Then, it draws a rectangle for each sum.<br>
</li>
<li>A "proof of work".<br>The miner is computing a special hash that depends on the array of transaction and that will answer to a constraint.<br>This hash is very difficult to compute. In fact it is not really computed, the miner must test every value until he find the solution.<br></li>
<li>That why the network will give him a reward.<br>This is a special transaction that has no inputs.</li>
</ul>
</p>
</div>
</div>
</div>
<div class="container-fluid bg-grey">
<div class="row">
<div class="col-sm-8">
<h2>Blockchain</h2>
<p>
Each block has a hash and a reference to the ihash of the previous block.<br>
So blocks are chained together.<br>
</p>
</div>
<div class="col-sm-4">
<img src="/images/loading.gif" width="100%; height: auto"></img>
</div>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

View File

@@ -0,0 +1,21 @@
<?php
$type='spline';
if (isset($_REQUEST['type'])) $type=$_REQUEST['type'];
$files = glob('/opt/TOPISTO/data/'.$type.'/*.png');
usort($files, function($a, $b) {
return filemtime($a) > filemtime($b);
});
$block_image = @imagecreatefrompng($files[0]);
// ---
// --- envoyer l'image au navigateur
// ---
header("Content-Type: image/png");
imagepng($block_image);
imagedestroy($block_image);
?>

BIN
images/bandeau.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
images/bitcoin.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 KiB

231
images/block_image.php Normal file
View File

@@ -0,0 +1,231 @@
<?php
function tri_filemtime( $a, $b ) { return filemtime($a) - filemtime($b); }
// ---
// --- La config globale
// ---
chdir('/opt/TOPISTO/apps');
require_once '/opt/TOPISTO/apps/global/inc/config.php';
// ---
// --- External dependances
// ---
require TOPISTO_PATH.'/ressources/vendor/autoload.php';
// ---
// --- Internal dependances
// ---
require_once APP_PATH.'/blockchain/inc/block.php';
// ---
// --- Par défaut on cherche le dernier block
// ---
$block_hash = '*';
$methode='hasard';
$mode=9999;
// ---
// --- Le cas échéant, on cherche block passé en argument
// ---
if (isset($_REQUEST['hash'])) $block_hash = $_REQUEST['hash'];
if (isset($_REQUEST['methode'])) $methode = $_REQUEST['methode'];
if (isset($_REQUEST['mode'])) $mode = intval($_REQUEST['mode']);
$img = null;
// ---
// --- Le cas général : on trouve le fichier image demandé
// ---
$imagefilename = DATA_PATH.'/'.$methode.'/'.$block_hash;
if ($mode != 9999) $imagefilename .= '-'.$mode;
$imagefilename .= '.png';
if (file_exists($imagefilename)) $img = imagecreatefrompng($imagefilename);
// ---
// --- "strict" est un flag qui indique que l'on veut précisément
// --- ce que les paramètres demandent
// ---
if (($img==null)&&(!isset($_REQUEST['strict'])))
{
//
// On n'a pas passé de HASH
//
if (($img==null)&&(!isset($_REQUEST['hash'])))
{
//
// On prend le dernier connu pour la méthode et le mode
//
$myarray = glob(DATA_PATH.'/'.$methode.'/*-'.$mode.'.png');
if (isset($myarray[0]))
{
usort( $myarray, tri_filemtime );
$img = imagecreatefrompng($myarray[0]);
}
//
// On prend le dernier connu pour la méthode tout mode confondu
//
if ($img==null)
{
$myarray = glob(DATA_PATH.'/'.$methode.'/*.png');
if (isset($myarray[0]))
{
usort( $myarray, tri_filemtime );
$img = imagecreatefrompng($myarray[0]);
}
}
}
//
// On a passé un HASH
//
if (($img==null)&&(isset($_REQUEST['hash'])))
{
//
// On cherche le bon HASH et la bonne méthode
//
$imagefilename = DATA_PATH.'/'.$methode.'/'.$block_hash.'.png';
if (($img==null)&&(file_exists($imagefilename)))
{
$img = imagecreatefrompng($imagefilename);
}
//
// En fait on s'en fiche de la méthode tant qu'on a le bon HASH
//
$imagefilename = DATA_PATH.'/hasard/'.$block_hash.'.png';
if (($img==null)&&(file_exists($imagefilename)))
{
$img = imagecreatefrompng($imagefilename);
}
}
}
//
// On n'a rien trouvé, donc on dessine ce qui est demandé
//
if ($img==null)
{
if ($mode == 9999) $mode = 0;
if ($block_hash == '*') $block_hash = blockchain::getLastCacheBlockHash();
if ($methode == 'hasard') $methode = 'treemap';
$imagefilename = DATA_PATH.'/'.$methode.'/'.$block_hash.'.png';
$the_block = blockchain::getBlockWithHash($block_hash);
if ($the_block === FALSE) die();
$the_name = blockchain::hash2SpecialName($the_block->hash);
if ($the_name == $the_block->hash) $the_name ='';
$bandeau = 50;
$marge = 25;
$text_border = 20;
$width = GRAPH_WIDTH;
$height = GRAPH_HEIGHT;
// Pour que l'image simple ait les proportions que l'image full
$width = $marge + ($width*2) + (2*$text_border);
$height = $marge + ($height*2);
$img_w = $width;
$img_h = $height+(2*$bandeau);
$type=2;
if (count($the_block->tx)==1) $type=4;
// création d'une image plus haute pour inclure bandeaux haut et bas
$img = imagecreatetruecolor($img_w, $img_h);
$param0 = blockchain::DrawBlockHeaderFooter($the_block, $img, $bandeau);
$parametres = [];
$parametres['x'] = 0;
$parametres['y'] = $bandeau;
$parametres['width'] = $width;
$parametres['height'] = $height;
$parametres['methode'] = $mode;
$parametres['type'] = $type;
$parametres['transparent_color'] = $param0[0];
$parametres['background_color'] = $param0[1];
$parametres['font_color'] = $param0[2];
$parametres['fontname'] = $param0[3];
$parametres['font_RGB'] = $param0[4];
$parametres['background_RGB'] = $param0[5];
switch($methode)
{
case 'veraMolnar':
require_once APP_PATH.'/methode/veraMolnar/inc/treemap.php';
topisto_veraMolnar::DrawBlock($the_block, $img, $parametres);
break;
case 'treemapV2':
require_once APP_PATH.'/methode/treemapV2/inc/treemap.php';
topisto_treemap::DrawBlock($the_block, $img, $parametres);
break;
case 'treemap_fuzzy':
require_once APP_PATH.'/methode/treemap_fuzzy/inc/treemap.php';
topisto_treemap_fuzzy::DrawBlock($the_block, $img, 0, $bandeau, $width, $height, $mode, $type);
break;
case 'spline':
require_once APP_PATH.'/methode/spline/inc/splines.php';
topisto_spline::DefaultDrawBlock($the_block, $img, 0, $bandeau, $width, $height, $mode, $type);
break;
case 'spline_2':
require_once APP_PATH.'/methode/spline/inc/splines.php';
topisto_spline::DrawBlock($the_block, $img, 0, $bandeau, $width, $height, $mode, 200, $type);
break;
case 'treemap' :
default:
require_once APP_PATH.'/methode/treemap/inc/treemap.php';
topisto_treemap::DrawBlock($the_block, $img, 0, $bandeau, $width, $height, $mode, $type);
break;
}
// Les textes
/*
* INUTILE depuis que blockchain::DrawBlockHeaderFooter ajoute elle-même les textes
*
putenv('GDFONTPATH='.RESS_PATH.'/fonts/');
$font = 'DS-DIGIB.TTF';
$fontColor = imagecolorallocate($img, 227,227,153);
$the_texte = "Height : ".$the_block->height;
imagettftext($img,18, 0, 5, $bandeau-5, $fontColor, $font, $the_texte);
$the_texte = "Inputs : ".$the_block->topisto_inputs;
if ($type == 4) $the_texte = "Reward : ".$the_block->topisto_reward;
imagettftext($img,15, 0, 5, $bandeau+$height+18, $fontColor, $font, $the_texte);
if ($the_name == '') $the_name = date('Ymd H:m:s', $the_block->time);
$bbox = imagettfbbox(14, 0, $font, $the_name);
imagettftext($img, 14, 0, ($img_w-3)-($bbox[2]-$bbox[0]), ($bandeau-5), $fontColor, $font, $the_name);
*/
// Sauvegarder l'image et ajouter
// - un lien sur le mode
// - un lien dans le dossier "hasard"
$imagefilename2 = str_replace(".png","-$mode.png", $imagefilename);
imagepng($img,$imagefilename2);
if (!file_exists($imagefilename)) link($imagefilename2, $imagefilename);
$imagefilename2 = str_replace("methode/$methode/","methode/hasard/", $imagefilename);
if (!file_exists($imagefilename2)) link($imagefilename, $imagefilename2);
}
$seconds_to_cache = 7200;
$ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
header("Expires: $ts");
header("Pragma: cache");
header("Cache-Control: max-age=$seconds_to_cache");
header('Content-Type: image/png');
imagepng($img);
imagedestroy($img);
?>

BIN
images/blockchain.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

BIN
images/bob_to_alice.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

BIN
images/bob_to_alice.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

BIN
images/btcfond.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@@ -0,0 +1,53 @@
<?php
// ---
// --- La config globale
// ---
chdir('/opt/TOPISTO/apps');
require_once '/opt/TOPISTO/apps/global/inc/config.php';
// ---
// --- External dependances
// ---
require TOPISTO_PATH.'/ressources/vendor/autoload.php';
// ---
// --- Internal dependances
// ---
require_once APP_PATH.'/blockchain/inc/block.php';
// ---
// --- Par défaut on cherche le dernier block
// ---
$block_hash = '*';
// ---
// --- Le cas échéant, on cherche block passé en argument
// ---
if (isset($_REQUEST['hash'])) $block_hash = $_REQUEST['hash'];
$img = null;
$myarray = glob(DATA_PATH.'/hasard/'.$block_hash.'.png');
if (isset($myarray[0]))
{
usort( $myarray, function( $a, $b ) { return filemtime($a) - filemtime($b); } );
$img = imagecreatefrompng($myarray[0]);
$seconds_to_cache = 7200;
$ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
header("Expires: $ts");
header("Pragma: cache");
header("Cache-Control: max-age=$seconds_to_cache");
header('Content-Type: image/png');
imagepng($img);
imagedestroy($img);
exit(0);
}
require_once('block_image.php');
?>

View File

@@ -0,0 +1,109 @@
<?php
// ---
// --- La config globale
// ---
chdir('/opt/TOPISTO/apps');
require_once '/opt/TOPISTO/apps/global/inc/config.php';
// ---
// --- External dependances
// ---
require TOPISTO_PATH.'/ressources/vendor/autoload.php';
// ---
// --- Internal dependances
// ---
require_once APP_PATH.'/blockchain/inc/block.php';
// ---
// --- Par défaut on cherche le dernier block
// ---
$block_hash = '*';
$methode='hasard';
$mode=9999;
// ---
// --- Le cas échéant, on cherche block passé en argument
// ---
if (isset($_REQUEST['hash'])) $block_hash = $_REQUEST['hash'];
if (isset($_REQUEST['methode'])) $methode = $_REQUEST['methode'];
if (isset($_REQUEST['mode'])) $mode = intval($_REQUEST['mode']);
//$methode = str_replace('full_', '', $methode);
$img = null;
$imagefilename = DATA_PATH.'/'.$methode.'/'.$block_hash.'-'.$mode.'.png';
echo $imagefilename;
if (file_exists($imagefilename)) echo ' <font color="green">OK</font><br>'.PHP_EOL;
else echo ' <font color="red">KO</font><br>'.PHP_EOL;
//
// "strict" est un flag qui indique que l'on veut précisément
// ce que les paramètres demandent
//
if (($img==null)&&(!isset($_REQUEST['strict'])))
{
//
// On n'a pas passé de HASH
//
if (($img==null)&&(!isset($_REQUEST['hash'])))
{
//
// On prend le dernier connu pour la méthode et le mode
//
$myarray = glob(DATA_PATH.'/'.$methode.'/*-'.$mode.'.png');
if (isset($myarray[0]))
{
usort( $myarray, function( $a, $b ) { return filemtime($a) - filemtime($b); } );
echo $myarray[0].' <font color="green">OK</font><br>'.PHP_EOL;
$img=true;
}
//
// On prend le dernier connu pour la méthode tout mode confondu
//
if ($img==null)
{
$myarray = glob(DATA_PATH.'/'.$methode.'/*.png');
if (isset($myarray[0]))
{
usort( $myarray, function( $a, $b ) { return filemtime($a) - filemtime($b); } );
echo $myarray[0].' <font color="green">OK</font><br>'.PHP_EOL;
$img=true;
}
}
}
//
// On a passé un HASH
//
if (($img==null)&&(isset($_REQUEST['hash'])))
{
//
// On cherche le bon HASH et la bonne méthode
//
$imagefilename = DATA_PATH.'/'.$methode.'/'.$block_hash.'.png';
if (($img==null)&&(file_exists($imagefilename)))
{
echo $imagefilename.' <font color="green">OK</font><br>'.PHP_EOL;
$img=true;
}
//
// En fait on s'en fiche de la méthode tant qu'on a le bon HASH
//
$imagefilename = DATA_PATH.'/hasard/'.$block_hash.'.png';
if (($img==null)&&(file_exists($imagefilename)))
{
echo $imagefilename.' <font color="green">OK</font><br>'.PHP_EOL;
$img=true;
}
}
}
//
// On n'a rien trouvé, donc on dessine ce qui est demandé
//
if ($img==null) echo '<font color="red">KO</font><br>';
?>

237
images/full_block_image.php Normal file
View File

@@ -0,0 +1,237 @@
<?php
// ---
// --- La config globale
// ---
chdir('/opt/TOPISTO/apps');
require_once '/opt/TOPISTO/apps/global/inc/config.php';
// ---
// --- External dependances
// ---
require TOPISTO_PATH.'/ressources/vendor/autoload.php';
// ---
// --- Internal dependances
// ---
require_once APP_PATH.'/blockchain/inc/block.php';
// ---
// --- Par défaut on cherche le dernier block
// ---
$block_hash = '*';
$methode='hasard';
$mode=9999;
// ---
// --- Le cas échéant, on cherche block passé en argument
// ---
if (isset($_REQUEST['hash'])) $block_hash = $_REQUEST['hash'];
if (isset($_REQUEST['methode'])) $methode = $_REQUEST['methode'];
if (isset($_REQUEST['mode'])) $mode = intval($_REQUEST['mode']);
//$methode = str_replace('full_', '', $methode);
$img = null;
$imagefilename = DATA_PATH.'/'.$methode.'/'.$block_hash.'-'.$mode.'.png';
if (file_exists($imagefilename))
{
$img = imagecreatefrompng($imagefilename);
}
//
// "strict" est un flag qui indique que l'on veut précisément
// ce que les paramètres demandent
//
if (($img==null)&&(!isset($_REQUEST['strict'])))
{
//
// On n'a pas passé de HASH
//
if (($img==null)&&(!isset($_REQUEST['hash'])))
{
//
// On prend le dernier connu pour la méthode et le mode
//
$myarray = glob(DATA_PATH.'/'.$methode.'/*-'.$mode.'.png');
if (isset($myarray[0]))
{
usort( $myarray, function( $a, $b ) { return filemtime($a) - filemtime($b); } );
$img = imagecreatefrompng($myarray[0]);
}
//
// On prend le dernier connu pour la méthode tout mode confondu
//
if ($img==null)
{
$myarray = glob(DATA_PATH.'/'.$methode.'/*.png');
if (isset($myarray[0]))
{
usort( $myarray, function( $a, $b ) { return filemtime($a) - filemtime($b); } );
$img = imagecreatefrompng($myarray[0]);
}
}
}
//
// On a passé un HASH
//
if (($img==null)&&(isset($_REQUEST['hash'])))
{
//
// On cherche le bon HASH et la bonne méthode
//
$imagefilename = DATA_PATH.'/'.$methode.'/'.$block_hash.'.png';
if (($img==null)&&(file_exists($imagefilename)))
{
$img = imagecreatefrompng($imagefilename);
}
//
// En fait on s'en fiche de la méthode tant qu'on a le bon HASH
//
$imagefilename = DATA_PATH.'/hasard/'.$block_hash.'.png';
if (($img==null)&&(file_exists($imagefilename)))
{
$img = imagecreatefrompng($imagefilename);
}
}
}
//
// On n'a rien trouvé, donc on dessine ce qui est demandé
//
if ($img==null)
{
if ($mode == 9999) $mode = 0;
if ($block_hash == '*') $block_hash = blockchain::getLastCacheBlockHash();
$imagefilename = DATA_PATH.'/'.$methode.'/'.$block_hash.'.png';
switch($methode)
{
case 'full_treemap_fuzzy':
require_once APP_PATH.'/methode/treemap_fuzzy/inc/treemap.php';
$imagefilename = DATA_PATH.'/full_treemap_fuzzy/'.$block_hash.'.png';
break;
case 'full_spline':
require_once APP_PATH.'/methode/spline/inc/splines.php';
$imagefilename = DATA_PATH.'/full_spline/'.$block_hash.'.png';
break;
case 'full_treemap' :
default:
require_once APP_PATH.'/methode/treemap/inc/treemap.php';
$imagefilename = DATA_PATH.'/full_treemap/'.$block_hash.'-'.$mode.'.png';
}
$the_block = blockchain::getBlockWithHash($block_hash);
if ($the_block === FALSE) die();
$the_name = blockchain::hash2SpecialName($the_block->hash);
if ($the_name == $the_block->hash) $the_name ='';
$bandeau = 50;
$marge = 25;
$text_border = 20;
$width = GRAPH_WIDTH;
$height = GRAPH_HEIGHT;
$img_w = $marge + ($width*2) + (2*$text_border);
$img_h = $marge + ($height*2) + (2*$bandeau);
// création d'une image plus haute pour inclure bandeaux haut et bas
$img = imagecreatetruecolor( $img_w, $img_h);
// Les parties du block : inputs, outputs, fees, reward
switch($methode)
{
case 'full_treemap_fuzzy':
topisto_treemap_fuzzy::DrawBlock($the_block, $img, $text_border + 0, $bandeau, $width, $height, $mode, 2);
topisto_treemap_fuzzy::DrawBlock($the_block, $img, $text_border+$marge+$width, $bandeau, $width, $height, $mode, 1);
topisto_treemap_fuzzy::DrawBlock($the_block, $img, $text_border+0, $marge+$height + $bandeau, $width, $height, $mode, 3);
topisto_treemap_fuzzy::DrawBlock($the_block, $img, $text_border+$marge+$width, $marge+$height + $bandeau, $width, $height, $mode, 4);
break;
case 'full_spline':
$type=2;
$x0 = $text_border; $y0 = $bandeau;
topisto_spline::DefaultDrawBlock($the_block, $img, $x0, $y0, $width, $height, $type);
$type=1;
$x0 = $text_border+$marge+$width; $y0 = $bandeau;
topisto_spline::DefaultDrawBlock($the_block, $img, $x0, $y0, $width, $height, $type);
$type=3;
$x0 = $text_border; $y0 = $marge+$height+$bandeau;
topisto_spline::DefaultDrawBlock($the_block, $img, $x0, $y0, $width, $height, $type);
$type=4;
$x0 = $text_border+$marge+$width; $y0 = $marge+$height+$bandeau;
topisto_spline::DefaultDrawBlock($the_block, $img, $x0, $y0, $width, $height, $type);
break;
case 'full_treemap':
default:
topisto_treemap::DrawBlock($the_block, $img, $text_border + 0, $bandeau, $width, $height, $mode, 2);
topisto_treemap::DrawBlock($the_block, $img, $text_border+$marge+$width, $bandeau, $width, $height, $mode, 1);
topisto_treemap::DrawBlock($the_block, $img, $text_border+0, $marge+$height + $bandeau, $width, $height, $mode, 3);
topisto_treemap::DrawBlock($the_block, $img, $text_border+$marge+$width, $marge+$height + $bandeau, $width, $height, $mode, 4);
break;
}
blockchain::DrawBlockHeaderFooter($the_block, $img, $bandeau);
$fond = imagecolorallocate($img, 40, 40, 40);
imagefilledrectangle($img, 0, $bandeau, $text_border, $img_h-$bandeau, $fond);
imagefilledrectangle($img, $img_w-$text_border, $bandeau, $img_w, $img_h-$bandeau, $fond);
imagefilledrectangle($img, $text_border+$width, $bandeau, $text_border+$marge+$width, $img_h-$bandeau, $fond);
imagefilledrectangle($img, 0, $bandeau+$height, $img_w - $text_border, $bandeau+$marge+$height, $fond);
// Les textes
putenv('GDFONTPATH='.RESS_PATH.'/fonts/');
$font = 'DS-DIGIB.TTF';
$fontColor = imagecolorallocate($img, 158,227,253);
$fontColor = imagecolorallocate($img, 227,253,158);
$fontColor = imagecolorallocate($img, 227,227,153);
$the_texte = "Height : ".$the_block->height;
imagettftext($img,18, 0, 5, $bandeau-5, $fontColor, $font, $the_texte);
$the_texte = "Inputs : ".$the_block->topisto_inputs;
imagettftext($img,15, 90, $text_border-3, $bandeau+$height, $fontColor, $font, $the_texte);
$the_texte = "Outputs : ".$the_block->topisto_outputs;
imagettftext($img,15, 90, $text_border+$width+$marge-3, $bandeau+$height, $fontColor, $font, $the_texte);
$the_texte = "Fees : ".$the_block->topisto_fees;
imagettftext($img,15, 90, $text_border-3, $bandeau+(2*$height)+$marge-3, $fontColor, $font, $the_texte);
$the_texte = "Reward : ".$the_block->topisto_reward;
imagettftext($img,15, 90, $text_border+$width+$marge-3, $bandeau+(2*$height)+$marge-3, $fontColor, $font, $the_texte);
if ($the_name == '') $the_name = date('Ymd H:m:s', $the_block->time);
$bbox = imagettfbbox(14, 0, $font, $the_name);
imagettftext($img, 14, 0, ($img_w-3)-($bbox[2]-$bbox[0]), ($bandeau-5), $fontColor, $font, $the_name);
// Sauvegarder l'image et ajouter
// - un lien sur le mode
// - un lien dans le dossier "hasard"
$imagefilename2 = str_replace(".png","-$mode.png", $imagefilename);
imagepng($img,$imagefilename2);
if (!file_exists($imagefilename)) link($imagefilename2, $imagefilename);
$imagefilename2 = str_replace("methode/$methode/","methode/hasard/", $imagefilename);
if (!file_exists($imagefilename2)) link($imagefilename, $imagefilename2);
}
$seconds_to_cache = 7200;
$ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
header("Expires: $ts");
header("Pragma: cache");
header("Cache-Control: max-age=$seconds_to_cache");
header('Content-Type: image/png');
imagepng($img);
imagedestroy($img);
?>

BIN
images/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

29
images/logo.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
$alea=rand(0,100);
$logo='topisto_vert.png';
if ($alea > 30)
{
$files = glob('logo/medium/*/topisto_vert.png');
usort($files, function($a, $b) {
return filemtime($a) > filemtime($b);
});
shuffle($files);
$logo = $files[0];
}
$block_image = @imagecreatefrompng($logo);
// ---
// --- envoyer l'image au navigateur
// ---
header("Content-Type: image/png");
imagepng($block_image);
imagedestroy($block_image);
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 883 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

4
images/logo/gmic.sh Executable file
View File

@@ -0,0 +1,4 @@
for toto in rouge vert
do
gmic ../topisto_$toto.png $@ -output topisto_$toto.png
done

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 KiB

Some files were not shown because too many files have changed in this diff Show More