aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/LinkUtils.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-05-14 11:11:11 +0200
committerArthur <arthur@hoa.ro>2016-05-14 11:11:11 +0200
commit3fdcc7bd47114776a5a8a280783529ee2dd690a1 (patch)
treed5b9497bd30333e799d93d2fe8b628a4c7fbc1d9 /application/LinkUtils.php
parent52ccf0d7ee25eb0b6fc405aafcf7211ef07307e1 (diff)
parent141a86c503af8e314381b3ee39ba4287fdfac63e (diff)
downloadShaarli-3fdcc7bd47114776a5a8a280783529ee2dd690a1.tar.gz
Shaarli-3fdcc7bd47114776a5a8a280783529ee2dd690a1.tar.zst
Shaarli-3fdcc7bd47114776a5a8a280783529ee2dd690a1.zip
Merge pull request #560 from ArthurHoaro/nb-private-shaare
Private links counter in the header
Diffstat (limited to 'application/LinkUtils.php')
-rw-r--r--application/LinkUtils.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/application/LinkUtils.php b/application/LinkUtils.php
index 2df76ba8..da04ca97 100644
--- a/application/LinkUtils.php
+++ b/application/LinkUtils.php
@@ -77,3 +77,19 @@ function html_extract_charset($html)
77 77
78 return false; 78 return false;
79} 79}
80
81/**
82 * Count private links in given linklist.
83 *
84 * @param array $links Linklist.
85 *
86 * @return int Number of private links.
87 */
88function count_private($links)
89{
90 $cpt = 0;
91 foreach ($links as $link) {
92 $cpt = $link['private'] == true ? $cpt + 1 : $cpt;
93 }
94 return $cpt;
95}