diff options
author | Arthur <arthur@hoa.ro> | 2016-05-14 11:11:11 +0200 |
---|---|---|
committer | Arthur <arthur@hoa.ro> | 2016-05-14 11:11:11 +0200 |
commit | 3fdcc7bd47114776a5a8a280783529ee2dd690a1 (patch) | |
tree | d5b9497bd30333e799d93d2fe8b628a4c7fbc1d9 /application/LinkUtils.php | |
parent | 52ccf0d7ee25eb0b6fc405aafcf7211ef07307e1 (diff) | |
parent | 141a86c503af8e314381b3ee39ba4287fdfac63e (diff) | |
download | Shaarli-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.php | 16 |
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 | */ | ||
88 | function 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 | } | ||