diff options
author | Seb Sauvage <sebsauvage@sebsauvage.net> | 2012-01-25 22:26:36 +0100 |
---|---|---|
committer | Emilien Klein <emilien@klein.st> | 2012-01-25 22:26:36 +0100 |
commit | 96bc4efe9ea9ed513d1ec06e0823847d5eebe82f (patch) | |
tree | a5ebeab219ac5a3a308f531416102e817ac29c0b /index.php | |
parent | 8baf884671060db9e166b96f6428aff80f6ca1f5 (diff) | |
download | Shaarli-96bc4efe9ea9ed513d1ec06e0823847d5eebe82f.tar.gz Shaarli-96bc4efe9ea9ed513d1ec06e0823847d5eebe82f.tar.zst Shaarli-96bc4efe9ea9ed513d1ec06e0823847d5eebe82f.zip |
Version 0.0.36 beta:
- Corrected: Improper text color in install form.
- Corrected: Error in QRCode url (missing '?')
- Changed: Display adjustments in “Daily” page.
- Added: Shaarli licence in COPYING
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | <?php | 1 | <?php |
2 | // Shaarli 0.0.35 beta - Shaare your links... | 2 | // Shaarli 0.0.36 beta - Shaare your links... |
3 | // The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net | 3 | // The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net |
4 | // http://sebsauvage.net/wiki/doku.php?id=php:shaarli | 4 | // http://sebsauvage.net/wiki/doku.php?id=php:shaarli |
5 | // Licence: http://www.opensource.org/licenses/zlib-license.php | 5 | // Licence: http://www.opensource.org/licenses/zlib-license.php |
@@ -58,7 +58,7 @@ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); | |||
58 | header("Cache-Control: no-store, no-cache, must-revalidate"); | 58 | header("Cache-Control: no-store, no-cache, must-revalidate"); |
59 | header("Cache-Control: post-check=0, pre-check=0", false); | 59 | header("Cache-Control: post-check=0, pre-check=0", false); |
60 | header("Pragma: no-cache"); | 60 | header("Pragma: no-cache"); |
61 | define('shaarli_version','0.0.35 beta'); | 61 | define('shaarli_version','0.0.36 beta'); |
62 | if (!is_dir($GLOBALS['config']['DATADIR'])) { mkdir($GLOBALS['config']['DATADIR'],0705); chmod($GLOBALS['config']['DATADIR'],0705); } | 62 | if (!is_dir($GLOBALS['config']['DATADIR'])) { mkdir($GLOBALS['config']['DATADIR'],0705); chmod($GLOBALS['config']['DATADIR'],0705); } |
63 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. | 63 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. |
64 | if ($GLOBALS['config']['ENABLE_LOCALCACHE']) | 64 | if ($GLOBALS['config']['ENABLE_LOCALCACHE']) |
@@ -988,9 +988,11 @@ function renderPage() | |||
988 | foreach($linksToDisplay as $key=>$link) | 988 | foreach($linksToDisplay as $key=>$link) |
989 | { | 989 | { |
990 | // Roughly estimate length of entry (by counting characters) | 990 | // Roughly estimate length of entry (by counting characters) |
991 | $length=strlen($link['title'])+strlen($link['description']); | 991 | // Title: 30 chars = 1 line. 1 line is 30 pixels height. |
992 | if ($link['thumbnail']) $length +=100; // 1 thumbnails roughly take as much space as 100 words; | 992 | // Description: 836 characters gives roughly 342 pixel height. |
993 | 993 | // This is not perfect, but it's usually ok. | |
994 | $length=strlen($link['title'])+(342*strlen($link['description']))/836; | ||
995 | if ($link['thumbnail']) $length +=100; // 1 thumbnails roughly takes 100 pixels height. | ||
994 | // Then put in column which is the less filled: | 996 | // Then put in column which is the less filled: |
995 | $smallest=min($fill); // find smallest value in array. | 997 | $smallest=min($fill); // find smallest value in array. |
996 | $index=array_search($smallest,$fill); // find index of this smallest value. | 998 | $index=array_search($smallest,$fill); // find index of this smallest value. |