From 3fac0a52577ac0d1ac0a78fde5f5dba154a70e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20SAUVAGE?= Date: Tue, 24 Sep 2013 11:17:22 +0200 Subject: Added tags+private in shaarli URL Manually merged pull request https://github.com/sebsauvage/Shaarli/pull/99 --- index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 9446c660..327109f0 100644 --- a/index.php +++ b/index.php @@ -1541,7 +1541,8 @@ function renderPage() $linkdate = strval(date('Ymd_His')); $title = (empty($_GET['title']) ? '' : $_GET['title'] ); // Get title if it was provided in URL (by the bookmarklet). $description = (empty($_GET['description']) ? '' : $_GET['description'] )."\n"; // Get description if it was provided in URL (by the bookmarklet). [Bronco added that] - $tags=''; $private=0; + $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); // Get tags if it was provided in URL + $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); // Get private if it was provided in URL if (($url!='') && parse_url($url,PHP_URL_SCHEME)=='') $url = 'http://'.$url; // If this is an HTTP link, we try go get the page to extact the title (otherwise we will to straight to the edit form.) if (empty($title) && parse_url($url,PHP_URL_SCHEME)=='http') @@ -1573,7 +1574,7 @@ function renderPage() } } if ($url=='') $url='?'.smallHash($linkdate); // In case of empty URL, this is just a text (with a link that point to itself) - $link = array('linkdate'=>$linkdate,'title'=>$title,'url'=>$url,'description'=>$description,'tags'=>$tags,'private'=>0); + $link = array('linkdate'=>$linkdate,'title'=>$title,'url'=>$url,'description'=>$description,'tags'=>$tags,'private'=>$private); } $PAGE = new pageBuilder; -- cgit v1.2.3