diff options
author | Seb Sauvage <sebsauvage@sebsauvage.net> | 2011-11-24 16:10:00 +0100 |
---|---|---|
committer | Emilien Klein <emilien@klein.st> | 2011-11-24 16:10:00 +0100 |
commit | 5112a433897d4d6507982b64bb07333b774ddb3a (patch) | |
tree | fe5e7c8a94fa32eff60a8de4f2b999246576bec7 | |
parent | c4c9c4140d16e7e88ddc64c5c3b8fd6e17b74a05 (diff) | |
download | Shaarli-5112a433897d4d6507982b64bb07333b774ddb3a.tar.gz Shaarli-5112a433897d4d6507982b64bb07333b774ddb3a.tar.zst Shaarli-5112a433897d4d6507982b64bb07333b774ddb3a.zip |
Version 0.0.31 beta:
- Added: Support for TED Talks (ted.com/talks) thumbnails (patch by Emilien K.) [r26]
- Corrected: Better error handling in thumbnail generation (patch by Emilien K.) [r27]
- Added: partial patch by Idleman: Better design consistency, icon on private links. In-page popup was not included because it causes problem on some websites.
- Corrected: The top menu is no longer displayed in bookmarklet popup.
- Corrected: Bookmark which have the exact same date/time are now correctly imported. Most remaining import problem should be solved now.
- Added: Support for bookmark files without ADD_DATE attributes.
- Corrected: Comment in Shaarli export moved to beginning of file to prevent clash with last link description.
- Added: Logo is clickable.
- Added: user.css can be added to overload Shaarli base CSS.(patch by Jerrywham) Just put user.css in the same directory as shaarli.css. Example:
#pageheader { background: blue; }
Please note that Shaarli CSS are not stable and may completely change on each version.
- Changed: Edit and Delete buttons in link list were replaced with icons. (patch by Jerrywham)
-rw-r--r-- | images/delete_icon.png | bin | 0 -> 150 bytes | |||
-rw-r--r-- | images/edit_icon.png | bin | 0 -> 394 bytes | |||
-rw-r--r-- | images/private.png | bin | 0 -> 650 bytes | |||
-rw-r--r-- | index.php | 123 | ||||
-rw-r--r-- | shaarli.css | 97 |
5 files changed, 135 insertions, 85 deletions
diff --git a/images/delete_icon.png b/images/delete_icon.png new file mode 100644 index 00000000..55e388b4 --- /dev/null +++ b/images/delete_icon.png | |||
Binary files differ | |||
diff --git a/images/edit_icon.png b/images/edit_icon.png new file mode 100644 index 00000000..5cff5743 --- /dev/null +++ b/images/edit_icon.png | |||
Binary files differ | |||
diff --git a/images/private.png b/images/private.png new file mode 100644 index 00000000..5cea272a --- /dev/null +++ b/images/private.png | |||
Binary files differ | |||
@@ -1,5 +1,5 @@ | |||
1 | <?php | 1 | <?php |
2 | // Shaarli 0.0.30 beta - Shaare your links... | 2 | // Shaarli 0.0.31 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 |
@@ -54,7 +54,7 @@ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); | |||
54 | header("Cache-Control: no-store, no-cache, must-revalidate"); | 54 | header("Cache-Control: no-store, no-cache, must-revalidate"); |
55 | header("Cache-Control: post-check=0, pre-check=0", false); | 55 | header("Cache-Control: post-check=0, pre-check=0", false); |
56 | header("Pragma: no-cache"); | 56 | header("Pragma: no-cache"); |
57 | define('shaarli_version','0.0.30 beta'); | 57 | define('shaarli_version','0.0.31 beta'); |
58 | if (!is_dir($GLOBALS['config']['DATADIR'])) { mkdir($GLOBALS['config']['DATADIR'],0705); chmod($GLOBALS['config']['DATADIR'],0705); } | 58 | if (!is_dir($GLOBALS['config']['DATADIR'])) { mkdir($GLOBALS['config']['DATADIR'],0705); chmod($GLOBALS['config']['DATADIR'],0705); } |
59 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. | 59 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. |
60 | if ($GLOBALS['config']['ENABLE_LOCALCACHE']) | 60 | if ($GLOBALS['config']['ENABLE_LOCALCACHE']) |
@@ -798,7 +798,7 @@ function renderPage() | |||
798 | 798 | ||
799 | foreach($linksToDisplay as $link) | 799 | foreach($linksToDisplay as $link) |
800 | { | 800 | { |
801 | $href='?'.htmlspecialchars(smallhash($link['linkdate']),ENT_QUOTES); | 801 | $href='?'.htmlspecialchars(smallhash($link['linkdate']),ENT_QUOTES); |
802 | $thumb=thumbnail($link['url'],$href); | 802 | $thumb=thumbnail($link['url'],$href); |
803 | if ($thumb!='') | 803 | if ($thumb!='') |
804 | { | 804 | { |
@@ -903,16 +903,17 @@ HTML; | |||
903 | { | 903 | { |
904 | $pageabsaddr=serverUrl().$_SERVER["SCRIPT_NAME"]; // Why doesn't php have a built-in function for that ? | 904 | $pageabsaddr=serverUrl().$_SERVER["SCRIPT_NAME"]; // Why doesn't php have a built-in function for that ? |
905 | // The javascript code for the bookmarklet: | 905 | // The javascript code for the bookmarklet: |
906 | $changepwd = ($GLOBALS['config']['OPEN_SHAARLI'] ? '' : '<a href="?do=changepasswd"><b>Change password</b></a> - Change your password.<br><br>' ); | 906 | $changepwd = ($GLOBALS['config']['OPEN_SHAARLI'] ? '' : '<a href="?do=changepasswd"><b>Change password</b> <span>: Change your password.</span></a><br><br>' ); |
907 | $toolbar= <<<HTML | 907 | $toolbar= <<<HTML |
908 | <div id="toolsdiv"><br> | 908 | <div id="toolsdiv"> |
909 | {$changepwd} | 909 | {$changepwd} |
910 | <a href="?do=configure"><b>Configure your Shaarli</b></a> - Change Title, timezone...<br><br> | 910 | <a href="?do=configure"><b>Configure your Shaarli</b> <span>: Change Title, timezone...</span></a><br><br> |
911 | <a href="?do=changetag"><b>Rename/delete tags</b></a> - Rename or delete a tag in all links.<br><br> | 911 | <a href="?do=changetag"><b>Rename/delete tags</b> <span>: Rename or delete a tag in all links</span></a><br><br> |
912 | <a href="?do=import"><b>Import</b></a> - Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)<br><br> | 912 | <a href="?do=import"><b>Import</b> <span>: Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)</span></a> <br><br> |
913 | <a href="?do=export"><b>Export</b></a> - Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)<br><br> | 913 | <a href="?do=export"><b>Export</b> <span>: Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)</span></a><br><br> |
914 | <a class="smallbutton" onclick="alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');return false;" href="javascript:javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+'&title='%20+%20encodeURIComponent(title)+'&source=bookmarklet','_blank','menubar=no,height=400,width=608,toolbar=no,scrollbars=no,status=no');})();">Shaare link</a> - Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....). Then click "Shaare link" button in any page you want to share.<br><br> | 914 | <a class="smallbutton" onclick="alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');return false;" href="javascript:javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+'&title='%20+%20encodeURIComponent(title)+'&source=bookmarklet','_blank','menubar=no,height=390,width=600,toolbar=no,scrollbars=no,status=no');})();"><b>Shaare link</b></a> <a href="#" style="clear:none;"><span>⇐ Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....). Then click "Shaare link" button in any page you want to share.</span></a><br><br> |
915 | </div> | 915 | <div class="clear"></div> |
916 | </div> | ||
916 | HTML; | 917 | HTML; |
917 | $data = array('pageheader'=>$toolbar,'body'=>'','onload'=>''); | 918 | $data = array('pageheader'=>$toolbar,'body'=>'','onload'=>''); |
918 | templatePage($data); | 919 | templatePage($data); |
@@ -1161,9 +1162,9 @@ HTML; | |||
1161 | { | 1162 | { |
1162 | $toolbar= <<<HTML | 1163 | $toolbar= <<<HTML |
1163 | <div id="toolsdiv"> | 1164 | <div id="toolsdiv"> |
1164 | <a href="?do=export&what=all"><b>Export all</b></a> - Export all links<br><br> | 1165 | <a href="?do=export&what=all"><b>Export all</b> <span>: Export all links</span></a><br><br> |
1165 | <a href="?do=export&what=public"><b>Export public</b></a> - Export public links only<br><br> | 1166 | <a href="?do=export&what=public"><b>Export public</b> <span>: Export public links only</a><br><br> |
1166 | <a href="?do=export&what=private"><b>Export private</b></a> - Export private links only<br><br> | 1167 | <a href="?do=export&what=private"><b>Export private</b> <span>: Export private links only</a><br><br style="clear:both;"> |
1167 | </div> | 1168 | </div> |
1168 | HTML; | 1169 | HTML; |
1169 | $data = array('pageheader'=>$toolbar,'body'=>'','onload'=>''); | 1170 | $data = array('pageheader'=>$toolbar,'body'=>'','onload'=>''); |
@@ -1175,11 +1176,13 @@ HTML; | |||
1175 | 1176 | ||
1176 | header('Content-Type: text/html; charset=utf-8'); | 1177 | header('Content-Type: text/html; charset=utf-8'); |
1177 | header('Content-disposition: attachment; filename=bookmarks_'.$exportWhat.'_'.strval(date('Ymd_His')).'.html'); | 1178 | header('Content-disposition: attachment; filename=bookmarks_'.$exportWhat.'_'.strval(date('Ymd_His')).'.html'); |
1179 | $currentdate=date('Y/m/d H:i:s'); | ||
1178 | echo <<<HTML | 1180 | echo <<<HTML |
1179 | <!DOCTYPE NETSCAPE-Bookmark-file-1> | 1181 | <!DOCTYPE NETSCAPE-Bookmark-file-1> |
1180 | <!-- This is an automatically generated file. | 1182 | <!-- This is an automatically generated file. |
1181 | It will be read and overwritten. | 1183 | It will be read and overwritten. |
1182 | DO NOT EDIT! --> | 1184 | DO NOT EDIT! --> |
1185 | <!-- Shaarli {$exportWhat} bookmarks export on {$currentdate} --> | ||
1183 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | 1186 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> |
1184 | <TITLE>Bookmarks</TITLE> | 1187 | <TITLE>Bookmarks</TITLE> |
1185 | <H1>Bookmarks</H1> | 1188 | <H1>Bookmarks</H1> |
@@ -1196,8 +1199,7 @@ HTML; | |||
1196 | if ($link['description']!='') echo '<DD>'.htmlspecialchars($link['description'])."\n"; | 1199 | if ($link['description']!='') echo '<DD>'.htmlspecialchars($link['description'])."\n"; |
1197 | } | 1200 | } |
1198 | } | 1201 | } |
1199 | echo '<!-- Shaarli '.$exportWhat.' bookmarks export on '.date('Y/m/d H:i:s')."-->\n"; | 1202 | exit; |
1200 | exit; | ||
1201 | } | 1203 | } |
1202 | 1204 | ||
1203 | // -------- User is uploading a file for import | 1205 | // -------- User is uploading a file for import |
@@ -1272,7 +1274,6 @@ function importFile() | |||
1272 | { | 1274 | { |
1273 | // This is a standard Netscape-style bookmark file. | 1275 | // This is a standard Netscape-style bookmark file. |
1274 | // This format is supported by all browsers (except IE, of course), also delicious, diigo and others. | 1276 | // This format is supported by all browsers (except IE, of course), also delicious, diigo and others. |
1275 | // I didn't want to use DOM... anyway, this is FAST (less than 1 second to import 7200 links (2.1 Mb html file)). | ||
1276 | foreach(explode('<DT>',$data) as $html) // explode is very fast | 1277 | foreach(explode('<DT>',$data) as $html) // explode is very fast |
1277 | { | 1278 | { |
1278 | $link = array('linkdate'=>'','title'=>'','url'=>'','description'=>'','tags'=>'','private'=>0); | 1279 | $link = array('linkdate'=>'','title'=>'','url'=>'','description'=>'','tags'=>'','private'=>0); |
@@ -1283,19 +1284,42 @@ function importFile() | |||
1283 | preg_match('!<A .*?>(.*?)</A>!i',$d[0],$matches); $link['title'] = (isset($matches[1]) ? trim($matches[1]) : ''); // Get title | 1284 | preg_match('!<A .*?>(.*?)</A>!i',$d[0],$matches); $link['title'] = (isset($matches[1]) ? trim($matches[1]) : ''); // Get title |
1284 | $link['title'] = html_entity_decode($link['title'],ENT_QUOTES,'UTF-8'); | 1285 | $link['title'] = html_entity_decode($link['title'],ENT_QUOTES,'UTF-8'); |
1285 | preg_match_all('! ([A-Z_]+)=\"(.*?)"!i',$html,$matches,PREG_SET_ORDER); // Get all other attributes | 1286 | preg_match_all('! ([A-Z_]+)=\"(.*?)"!i',$html,$matches,PREG_SET_ORDER); // Get all other attributes |
1287 | $raw_add_date=0; | ||
1286 | foreach($matches as $m) | 1288 | foreach($matches as $m) |
1287 | { | 1289 | { |
1288 | $attr=$m[1]; $value=$m[2]; | 1290 | $attr=$m[1]; $value=$m[2]; |
1289 | if ($attr=='HREF') $link['url']=html_entity_decode($value,ENT_QUOTES,'UTF-8'); | 1291 | if ($attr=='HREF') $link['url']=html_entity_decode($value,ENT_QUOTES,'UTF-8'); |
1290 | elseif ($attr=='ADD_DATE') $link['linkdate']=date('Ymd_His',intval($value)); | 1292 | elseif ($attr=='ADD_DATE') $raw_add_date=intval($value); |
1291 | elseif ($attr=='PRIVATE') $link['private']=($value=='0'?0:1); | 1293 | elseif ($attr=='PRIVATE') $link['private']=($value=='0'?0:1); |
1292 | elseif ($attr=='TAGS') $link['tags']=html_entity_decode(str_replace(',',' ',$value),ENT_QUOTES,'UTF-8'); | 1294 | elseif ($attr=='TAGS') $link['tags']=html_entity_decode(str_replace(',',' ',$value),ENT_QUOTES,'UTF-8'); |
1293 | } | 1295 | } |
1294 | if ($link['linkdate']!='' && $link['url']!='' && ($overwrite || empty($LINKSDB[$link['linkdate']]))) | 1296 | if ($link['url']!='') |
1295 | { | 1297 | { |
1296 | if ($private==1) $link['private']=1; | 1298 | if ($private==1) $link['private']=1; |
1297 | $LINKSDB[$link['linkdate']] = $link; | 1299 | $dblink = $LINKSDB->getLinkFromUrl($link['url']); // See if the link is already in database. |
1298 | $import_count++; | 1300 | if ($dblink==false) |
1301 | { // Link not in database, let's import it... | ||
1302 | if (empty($raw_add_date)) $raw_add_date=time(); // In case of shitty bookmark file with no ADD_DATE | ||
1303 | |||
1304 | // Make sure date/time is not already used by another link. | ||
1305 | // (Some bookmark files have several different links with the same ADD_DATE) | ||
1306 | // We increment date by 1 second until we find a date which is not used in db. | ||
1307 | // (so that links that have the same date/time are more or less kept grouped by date, but do not conflict.) | ||
1308 | while (!empty($LINKSDB[date('Ymd_His',$raw_add_date)])) { $raw_add_date++; }// Yes, I know it's ugly. | ||
1309 | $link['linkdate']=date('Ymd_His',$raw_add_date); | ||
1310 | $LINKSDB[$link['linkdate']] = $link; | ||
1311 | $import_count++; | ||
1312 | } | ||
1313 | else // link already present in database. | ||
1314 | { | ||
1315 | if ($overwrite) | ||
1316 | { // If overwrite is required, we import link data, except date/time. | ||
1317 | $link['linkdate']=$dblink['linkdate']; | ||
1318 | $LINKSDB[$link['linkdate']] = $link; | ||
1319 | $import_count++; | ||
1320 | } | ||
1321 | } | ||
1322 | |||
1299 | } | 1323 | } |
1300 | } | 1324 | } |
1301 | } | 1325 | } |
@@ -1417,9 +1441,9 @@ function templateLinkList() | |||
1417 | $classprivate = ($link['private']==0 ? $classLi : 'class="private"'); | 1441 | $classprivate = ($link['private']==0 ? $classLi : 'class="private"'); |
1418 | if (isLoggedIn()) | 1442 | if (isLoggedIn()) |
1419 | { | 1443 | { |
1420 | $actions=' <form method="GET" class="buttoneditform"><input type="hidden" name="edit_link" value="'.$link['linkdate'].'"><input type="submit" value="Edit" class="smallbutton"></form>'; | 1444 | $actions=' <form method="GET" class="buttoneditform"><input type="hidden" name="edit_link" value="'.$link['linkdate'].'"><input type="image" alt="Edit" src="images/edit_icon.png" title="Edit" class="button_edit"></form>'; |
1421 | $actions.=' <form method="POST" class="buttoneditform"><input type="hidden" name="lf_linkdate" value="'.$link['linkdate'].'">'; | 1445 | $actions.=' <form method="POST" class="buttoneditform"><input type="hidden" name="lf_linkdate" value="'.$link['linkdate'].'">'; |
1422 | $actions.='<input type="hidden" name="token" value="'.$token.'"><input type="submit" value="Delete" name="delete_link" class="smallbutton" onClick="return confirmDeleteLink();"></form>'; | 1446 | $actions.='<input type="hidden" name="token" value="'.$token.'"><input type="hidden" name="delete_link"><input type="image" alt="Delete" src="images/delete_icon.png" title="Delete" class="button_delete" onClick="return confirmDeleteLink();"></form>'; |
1423 | } | 1447 | } |
1424 | $tags=''; | 1448 | $tags=''; |
1425 | if ($link['tags']!='') | 1449 | if ($link['tags']!='') |
@@ -1520,16 +1544,16 @@ function thumbnail($url,$href=false) | |||
1520 | || $domain=='ted.com' || endsWith($domain,'.ted.com') | 1544 | || $domain=='ted.com' || endsWith($domain,'.ted.com') |
1521 | ) | 1545 | ) |
1522 | { | 1546 | { |
1523 | if ($domain=='vimeo.com') | 1547 | if ($domain=='vimeo.com') |
1524 | { // Make sure this vimeo url points to a video (/xxx... where xxx is numeric) | 1548 | { // Make sure this vimeo url points to a video (/xxx... where xxx is numeric) |
1525 | $path = parse_url($url,PHP_URL_PATH); | 1549 | $path = parse_url($url,PHP_URL_PATH); |
1526 | if (!preg_match('!/\d+.+?!',$path)) return ''; // This is not a single video URL. | 1550 | if (!preg_match('!/\d+.+?!',$path)) return ''; // This is not a single video URL. |
1527 | } | 1551 | } |
1528 | if ($domain=='ted.com' || endsWith($domain,'.ted.com')) | 1552 | if ($domain=='ted.com' || endsWith($domain,'.ted.com')) |
1529 | { // Make sure this TED url points to a video (/talks/...) | 1553 | { // Make sure this TED url points to a video (/talks/...) |
1530 | $path = parse_url($url,PHP_URL_PATH); | 1554 | $path = parse_url($url,PHP_URL_PATH); |
1531 | if ("/talks/" !== substr($path,0,7)) return ''; // This is not a single video URL. | 1555 | if ("/talks/" !== substr($path,0,7)) return ''; // This is not a single video URL. |
1532 | } | 1556 | } |
1533 | $sign = hash_hmac('sha256', $url, $GLOBALS['salt']); // We use the salt to sign data (it's random, secret, and specific to each installation) | 1557 | $sign = hash_hmac('sha256', $url, $GLOBALS['salt']); // We use the salt to sign data (it's random, secret, and specific to each installation) |
1534 | return '<a href="'.htmlspecialchars($href).'"><img src="?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url).'" width="120" style="height:auto;"></a>'; | 1558 | return '<a href="'.htmlspecialchars($href).'"><img src="?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url).'" width="120" style="height:auto;"></a>'; |
1535 | } | 1559 | } |
@@ -1563,15 +1587,25 @@ function templatePage($data) | |||
1563 | $newversion=checkUpdate(); | 1587 | $newversion=checkUpdate(); |
1564 | if ($newversion!='') $newversion='<div id="newversion"><span style="text-decoration:blink;">●</span> Shaarli '.htmlspecialchars($newversion).' is <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli#download">available</a>.</div>'; | 1588 | if ($newversion!='') $newversion='<div id="newversion"><span style="text-decoration:blink;">●</span> Shaarli '.htmlspecialchars($newversion).' is <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli#download">available</a>.</div>'; |
1565 | $linkcount = count($LINKSDB); | 1589 | $linkcount = count($LINKSDB); |
1590 | |||
1591 | $feedurl=htmlspecialchars(serverUrl().$_SERVER['SCRIPT_NAME']); | ||
1592 | $searchcrits=''; // Search criteria | ||
1593 | if (!empty($_GET['searchtags'])) $searchcrits.='&searchtags='.$_GET['searchtags']; | ||
1594 | elseif (!empty($_GET['searchterm'])) $searchcrits.='&searchterm='.$_GET['searchterm']; | ||
1595 | $filtered_feed= ($searchcrits=='' ? '' : 'Filtered '); | ||
1596 | |||
1566 | $open=''; | 1597 | $open=''; |
1567 | if ($GLOBALS['config']['OPEN_SHAARLI']) | 1598 | if ($GLOBALS['config']['OPEN_SHAARLI']) |
1568 | { | 1599 | { |
1569 | $menu=' <a href="?do=tools">Tools</a> <a href="?do=addlink"><b>Add link</b></a>'; | 1600 | $menu='<a href="?do=tools">Tools</a><a href="?do=addlink"><b>Add link</b></a>'; |
1570 | $open='Open '; | 1601 | $open='Open '; |
1571 | } | 1602 | } |
1572 | else | 1603 | else |
1573 | $menu=(isLoggedIn() ? ' <a href="?do=logout">Logout</a> <a href="?do=tools">Tools</a> <a href="?do=addlink"><b>Add link</b></a>' : ' <a href="?do=login">Login</a>'); | 1604 | $menu=(isLoggedIn() ? '<a href="?do=logout">Logout</a><a href="?do=tools">Tools</a><a href="?do=addlink"><b>Add link</b></a>' : ' <a href="?do=login">Login</a>'); |
1574 | 1605 | $menu='<a href="?">Home</a>'.$menu.'<a href="'.$feedurl.'?do=rss'.$searchcrits.'">RSS Feed</a><a href="'.$feedurl.'?do=atom'.$searchcrits.'" style="padding-left:10px;">ATOM Feed</a><a href="?do=tagcloud">Tag cloud</a><a href="?do=picwall'.$searchcrits.'">Picture wall</a>'; | |
1606 | # If we are in the bookmarklet popup, do not display menu. | ||
1607 | if (!empty($_GET['source']) && $_GET['source']=='bookmarklet') $menu=''; | ||
1608 | |||
1575 | foreach(array('pageheader','body','onload') as $k) // make sure all required fields exist (put an empty string if not). | 1609 | foreach(array('pageheader','body','onload') as $k) // make sure all required fields exist (put an empty string if not). |
1576 | { | 1610 | { |
1577 | if (!array_key_exists($k,$data)) $data[$k]=''; | 1611 | if (!array_key_exists($k,$data)) $data[$k]=''; |
@@ -1592,15 +1626,12 @@ $(document).ready(function() | |||
1592 | </script> | 1626 | </script> |
1593 | JS; | 1627 | JS; |
1594 | } | 1628 | } |
1595 | $feedurl=htmlspecialchars(serverUrl().$_SERVER['SCRIPT_NAME']); | 1629 | |
1596 | $searchcrits=''; // Search criteria | ||
1597 | if (!empty($_GET['searchtags'])) $searchcrits.='&searchtags='.$_GET['searchtags']; | ||
1598 | elseif (!empty($_GET['searchterm'])) $searchcrits.='&searchterm='.$_GET['searchterm']; | ||
1599 | $filtered_feed= ($searchcrits=='' ? '' : 'Filtered '); | ||
1600 | $version=shaarli_version; | 1630 | $version=shaarli_version; |
1601 | 1631 | ||
1602 | $title = htmlspecialchars( $GLOBALS['title'] ); | 1632 | $title = htmlspecialchars( $GLOBALS['title'] ); |
1603 | $pagetitle = htmlspecialchars( empty($GLOBALS['pagetitle']) ? $title : $GLOBALS['pagetitle'] ); | 1633 | $pagetitle = htmlspecialchars( empty($GLOBALS['pagetitle']) ? $title : $GLOBALS['pagetitle'] ); |
1634 | |||
1604 | echo <<<HTML | 1635 | echo <<<HTML |
1605 | <html> | 1636 | <html> |
1606 | <head> | 1637 | <head> |
@@ -1609,19 +1640,19 @@ JS; | |||
1609 | <link rel="alternate" type="application/atom+xml" href="{$feedurl}?do=atom{$searchcrits}" title="{$filtered_feed}ATOM Feed" /> | 1640 | <link rel="alternate" type="application/atom+xml" href="{$feedurl}?do=atom{$searchcrits}" title="{$filtered_feed}ATOM Feed" /> |
1610 | <link href="./images/favicon.ico" rel="shortcut icon" type="image/x-icon" /> | 1641 | <link href="./images/favicon.ico" rel="shortcut icon" type="image/x-icon" /> |
1611 | <link type="text/css" rel="stylesheet" href="shaarli.css?version={$version}" /> | 1642 | <link type="text/css" rel="stylesheet" href="shaarli.css?version={$version}" /> |
1643 | <link type="text/css" rel="stylesheet" href="user.css?version={$version}" /> | ||
1612 | {$jsincludes} | 1644 | {$jsincludes} |
1613 | </head> | 1645 | </head> |
1614 | <body {$data['onload']}>{$newversion} | 1646 | <body {$data['onload']}>{$newversion} |
1615 | <div id="pageheader"><div id="logo" title="Share your links !"></div><div style="float:right; font-style:italic; color:#bbb; text-align:right; padding:0 5 0 0;">Shaare your links...<br>{$linkcount} links</div> | 1647 | <div id="pageheader"><div id="logo" title="Share your links !" onclick="document.location='?';"></div><div style="float:right; font-style:italic; color:#bbb; text-align:right; padding:0 5 0 0;">Shaare your links...<br>{$linkcount} links</div> |
1616 | <span id="shaarli_title"><a href="?">{$title}</a></span> - <a href="?">Home</a> {$menu} <a href="{$feedurl}?do=rss{$searchcrits}">RSS Feed</a> <a href="{$feedurl}?do=atom{$searchcrits}" style="padding-left:10px;">ATOM Feed</a> | 1648 | <span id="shaarli_title"><a href="?">{$title}</a></span>{$menu}<div class="clear"></div> |
1617 | <a href="?do=tagcloud">Tag cloud</a> <a href="?do=picwall{$searchcrits}">Picture wall</a> | ||
1618 | {$data['pageheader']} | 1649 | {$data['pageheader']} |
1619 | </div> | 1650 | </div> |
1620 | {$data['body']} | 1651 | {$data['body']} |
1621 | 1652 | ||
1622 | HTML; | 1653 | HTML; |
1623 | $exectime = round(microtime(true)-$STARTTIME,4); | 1654 | $exectime = round(microtime(true)-$STARTTIME,4); |
1624 | echo '<div id="footer"><b><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">Shaarli '.shaarli_version.'</a></b> - The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net. Theme by idleman.fr.<br>Who gives a shit that this page was generated in '.$exectime.' seconds ?</div>'; | 1655 | echo '<div id="footer"><b><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">Shaarli '.shaarli_version.'</a></b> - The personal, minimalist, super-fast, no-database delicious clone. By <a href="http://sebsauvage.net" target="_blank">sebsauvage.net</a>. Theme by <a href="http://blog.idleman.fr" target="_blank">idleman.fr</a>.<br>Who gives a shit that this page was generated in '.$exectime.' seconds ?</div>'; |
1625 | if (isLoggedIn()) echo '<script language="JavaScript">function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>'; | 1656 | if (isLoggedIn()) echo '<script language="JavaScript">function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>'; |
1626 | echo $jsincludes_bottom.'</body></html>'; | 1657 | echo $jsincludes_bottom.'</body></html>'; |
1627 | } | 1658 | } |
@@ -1990,4 +2021,4 @@ if (!isset($_SESSION['LINKS_PER_PAGE'])) $_SESSION['LINKS_PER_PAGE']=$GLOBALS['c | |||
1990 | if (startswith($_SERVER["QUERY_STRING"],'do=rss')) { showRSS(); exit; } | 2021 | if (startswith($_SERVER["QUERY_STRING"],'do=rss')) { showRSS(); exit; } |
1991 | if (startswith($_SERVER["QUERY_STRING"],'do=atom')) { showATOM(); exit; } | 2022 | if (startswith($_SERVER["QUERY_STRING"],'do=atom')) { showATOM(); exit; } |
1992 | renderPage(); | 2023 | renderPage(); |
1993 | ?> | 2024 | ?> \ No newline at end of file |
diff --git a/shaarli.css b/shaarli.css index 4fc40e5f..aba488a7 100644 --- a/shaarli.css +++ b/shaarli.css | |||
@@ -30,45 +30,47 @@ h1 { font-size:20pt; font-weight:bold; font-style:italic; margin-bottom:20px; } | |||
30 | 30 | ||
31 | /* Buttons */ | 31 | /* Buttons */ |
32 | .bigbutton { | 32 | .bigbutton { |
33 | background-color: #a0a0a0; | 33 | background: -moz-linear-gradient(#c0c0c0, #ffffff) repeat scroll 0 0 transparent; |
34 | background: -webkit-gradient(linear, 0 0, 0 bottom, from(#a0a0a0), to(#d4d4d4)); | 34 | background: -webkit-gradient(linear, 0 0, 0 bottom, from(#c0c0c0), to(#ffffff)); |
35 | background: -webkit-linear-gradient(#a0a0a0, #d4d4d4); | 35 | background: -webkit-linear-gradient(#c0c0c0, #ffffff); |
36 | background: -moz-linear-gradient(#a0a0a0, #d4d4d4); | 36 | background: -ms-linear-gradient(#c0c0c0, #ffffff); |
37 | background: -ms-linear-gradient(#a0a0a0, #d4d4d4); | 37 | background: -o-linear-gradient(#c0c0c0, #ffffff); |
38 | background: -o-linear-gradient(#a0a0a0, #d4d4d4); | 38 | background: linear-gradient(#c0c0c0, #ffffff); |
39 | background: linear-gradient(#a0a0a0, #d4d4d4); | 39 | border-radius: 3px 3px 3px 3px; |
40 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); | 40 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); |
41 | padding:0 5px 0 5px; | 41 | cursor: pointer; |
42 | margin:5px 0 5px 0; | 42 | height: 24px; |
43 | height:25px; | 43 | margin-left: 5px; |
44 | 44 | padding: 0 5px; | |
45 | border-radius: 5px 5px 5px 5px; | 45 | color: #606060; |
46 | -moz-border-radius:5px 5px 5px 5px; | ||
47 | cursor:pointer; | ||
48 | border:none; | ||
49 | border-style:outset; | 46 | border-style:outset; |
50 | border-width:2px; | 47 | border-width:1px; |
48 | |||
51 | } | 49 | } |
52 | .smallbutton { | 50 | .smallbutton { |
53 | background-color: #a0a0a0; | 51 | background: -moz-linear-gradient(#c0c0c0, #ffffff) repeat scroll 0 0 transparent; |
54 | background: -webkit-gradient(linear, 0 0, 0 bottom, from(#a0a0a0), to(#d4d4d4)); | 52 | background: -webkit-gradient(linear, 0 0, 0 bottom, from(#c0c0c0), to(#ffffff)); |
55 | background: -webkit-linear-gradient(#a0a0a0, #d4d4d4); | 53 | background: -webkit-linear-gradient(#c0c0c0, #ffffff); |
56 | background: -moz-linear-gradient(#a0a0a0, #d4d4d4); | 54 | background: -ms-linear-gradient(#c0c0c0, #ffffff); |
57 | background: -ms-linear-gradient(#a0a0a0, #d4d4d4); | 55 | background: -o-linear-gradient(#c0c0c0, #ffffff); |
58 | background: -o-linear-gradient(#a0a0a0, #d4d4d4); | 56 | background: linear-gradient(#c0c0c0, #ffffff); |
59 | background: linear-gradient(#a0a0a0, #d4d4d4); | 57 | border-radius: 3px 3px 3px 3px; |
60 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); | 58 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); |
61 | padding:0; | 59 | cursor: pointer; |
62 | margin:5px 0 5px 0; | 60 | height: 20px; |
63 | border-radius: 5px 5px 5px 5px; | 61 | margin-left: 5px; |
64 | -moz-border-radius:5px 5px 5px 5px; | 62 | padding: 0 5px; |
65 | cursor:pointer; | 63 | color: #606060; |
66 | padding:0 3px 0 3px; | ||
67 | border-style:outset; | 64 | border-style:outset; |
68 | border-width:2px; | 65 | border-width:1px; |
69 | font-size:8pt; | 66 | |
70 | } | 67 | } |
71 | 68 | ||
69 | /* Edit/Delete buttons on links */ | ||
70 | .button_edit, .button_delete { border-radius:0; box-shadow:none; border-style:none; border-width:0; padding:0; background:none; } | ||
71 | .button_edit { margin-left:10px; } | ||
72 | |||
73 | |||
72 | #pageheader #logo{ | 74 | #pageheader #logo{ |
73 | background-image: url('./images/logo.png'); | 75 | background-image: url('./images/logo.png'); |
74 | background-repeat: no-repeat; | 76 | background-repeat: no-repeat; |
@@ -76,7 +78,9 @@ float:left; | |||
76 | margin:0 10px 0 10px; | 78 | margin:0 10px 0 10px; |
77 | width:105px; | 79 | width:105px; |
78 | height:55px; | 80 | height:55px; |
81 | cursor:pointer; | ||
79 | } | 82 | } |
83 | |||
80 | #pageheader | 84 | #pageheader |
81 | { | 85 | { |
82 | 86 | ||
@@ -101,15 +105,21 @@ height:55px; | |||
101 | background: -ms-linear-gradient(#333333, #000000); | 105 | background: -ms-linear-gradient(#333333, #000000); |
102 | background: -o-linear-gradient(#333333, #000000); | 106 | background: -o-linear-gradient(#333333, #000000); |
103 | background: linear-gradient(#333333, #000000); | 107 | background: linear-gradient(#333333, #000000); |
104 | |||
105 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); | 108 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); |
106 | padding:5px; | 109 | padding:5px; |
107 | border-radius: 5px 5px 5px 5px; | 110 | border-radius: 5px 5px 5px 5px; |
108 | margin:10px 3px 3px 3px; | 111 | margin:10px 3px 3px 3px; |
109 | color:#A2DD42; | 112 | color:#A2DD42; |
113 | float:left; | ||
110 | text-decoration:none; | 114 | text-decoration:none; |
111 | } | 115 | } |
112 | 116 | ||
117 | #toolsdiv a{ | ||
118 | clear:both; | ||
119 | } | ||
120 | #toolsdiv a span{ | ||
121 | color:#ffffff; | ||
122 | } | ||
113 | .linksperpage,.tagfilter,.searchform,.addform { | 123 | .linksperpage,.tagfilter,.searchform,.addform { |
114 | background-color: #dedede; | 124 | background-color: #dedede; |
115 | background: -webkit-gradient(linear, 0 0, 0 bottom, from(#dedede), to(#ffffff)); | 125 | background: -webkit-gradient(linear, 0 0, 0 bottom, from(#dedede), to(#ffffff)); |
@@ -160,10 +170,10 @@ height:55px; | |||
160 | cursor:pointer; | 170 | cursor:pointer; |
161 | } | 171 | } |
162 | 172 | ||
163 | #shaarli_title { font-weight:bold; font-style:italic; } | 173 | #shaarli_title { font-weight:bold; font-style:italic; margin-top:0;} |
164 | #shaarli_title a { color: #fff !important; } | 174 | #shaarli_title a { color: #fff !important; } |
165 | 175 | ||
166 | #pageheader a:visited { color:#bbb; text-decoration:none;} | 176 | #pageheader a:visited { color:#98C943; text-decoration:none;} |
167 | #pageheader a:hover { color:#FFFFC9; text-decoration:none;} | 177 | #pageheader a:hover { color:#FFFFC9; text-decoration:none;} |
168 | #pageheader a:active { color:#bbb; text-decoration:none;} | 178 | #pageheader a:active { color:#bbb; text-decoration:none;} |
169 | #searchcriteria { padding: 4 0 5 5; font-weight:bold;} | 179 | #searchcriteria { padding: 4 0 5 5; font-weight:bold;} |
@@ -172,10 +182,10 @@ height:55px; | |||
172 | .paging a:visited { color:#ccc; } | 182 | .paging a:visited { color:#ccc; } |
173 | .paging a:hover { color:#FFFFC9; } | 183 | .paging a:hover { color:#FFFFC9; } |
174 | .paging a:active { color:#fff; } | 184 | .paging a:active { color:#fff; } |
175 | #headerform { color:#ffffff; padding:5 5 5 5; } | 185 | #headerform { color:#ffffff; padding:5 5 5 5; clear: both;} |
176 | #toolsdiv { color:#ffffff; padding:5 5 5 5; clear:left; } | 186 | #toolsdiv { color:#ffffff; padding:5 5 5 5; clear:left; } |
177 | #uploaddiv { color:#ffffff; padding:5 5 5 5; clear:left; } | 187 | #uploaddiv { color:#ffffff; padding:5 5 5 5; clear:left; } |
178 | #editlinkform { color:#ffffff; padding:5 5 5 15px; width:80%; clear:left; } | 188 | #editlinkform { height:100%;color:#ffffff; padding:5 5 5 15px; width:80%; clear:left; } |
179 | #linklist li { | 189 | #linklist li { |
180 | padding:4 10 15 20; border-top: 1px solid #bbb; clear:both; | 190 | padding:4 10 15 20; border-top: 1px solid #bbb; clear:both; |
181 | background: -webkit-gradient(linear, 0 0, 0 bottom, from(#F2F2F2), to(#ffffff)); | 191 | background: -webkit-gradient(linear, 0 0, 0 bottom, from(#F2F2F2), to(#ffffff)); |
@@ -190,7 +200,8 @@ height:55px; | |||
190 | #linklist li.publicLinkHightLight:hover,#linklist li:hover{ | 200 | #linklist li.publicLinkHightLight:hover,#linklist li:hover{ |
191 | background: #E9FFCE; | 201 | background: #E9FFCE; |
192 | } | 202 | } |
193 | #linklist li.private { background-color: #ccc; border-left:8px solid #888; } | 203 | #linklist li.private { background: url('./images/private.png') no-repeat 10px center; padding-left:60px; } |
204 | .private .linktitle a {color:#969696;} | ||
194 | .linktitle { font-size:14pt; font-weight:bold; } | 205 | .linktitle { font-size:14pt; font-weight:bold; } |
195 | .linktitle a { text-decoration: none; color:#80AD48; } | 206 | .linktitle a { text-decoration: none; color:#80AD48; } |
196 | .linktitle a:hover { color:#F57900; } | 207 | .linktitle a:hover { color:#F57900; } |
@@ -230,6 +241,8 @@ font-size:9pt; | |||
230 | .linkshort a:hover { text-decoration: underline; } | 241 | .linkshort a:hover { text-decoration: underline; } |
231 | .buttoneditform { display:inline; } | 242 | .buttoneditform { display:inline; } |
232 | #footer { font-size:8pt; text-align:center; border-top:1px solid #ddd; color: #888; clear:both; } | 243 | #footer { font-size:8pt; text-align:center; border-top:1px solid #ddd; color: #888; clear:both; } |
244 | #footer a{ color:#486D08;} | ||
245 | #footer a:hover{ color:#000000;} | ||
233 | #newversion { background-color: #FFFFA0; color:#000; position:absolute; top:0;right:0; padding:2 7 2 7; font-size:9pt;} | 246 | #newversion { background-color: #FFFFA0; color:#000; position:absolute; top:0;right:0; padding:2 7 2 7; font-size:9pt;} |
234 | #cloudtag { padding-left:10%; padding-right:10%; } | 247 | #cloudtag { padding-left:10%; padding-right:10%; } |
235 | #cloudtag a { color:black; text-decoration:none; } | 248 | #cloudtag a { color:black; text-decoration:none; } |
@@ -277,6 +290,12 @@ text-shadow:2px 2px 1px #000000; | |||
277 | background: #ffffff; | 290 | background: #ffffff; |
278 | } | 291 | } |
279 | 292 | ||
293 | /* Common css screwdriver */ | ||
294 | |||
295 | .clear{ | ||
296 | clear:both; | ||
297 | } | ||
298 | |||
280 | @media print { | 299 | @media print { |
281 | html {border:none;background:#fff!important;color:#000!important;} | 300 | html {border:none;background:#fff!important;color:#000!important;} |
282 | body {font-size:12pt;width:auto!important;margin:auto!important;} | 301 | body {font-size:12pt;width:auto!important;margin:auto!important;} |