aboutsummaryrefslogtreecommitdiff
path: root/lib/tidypics.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-10-05 23:45:29 +0000
committerCash Costello <cash.costello@gmail.com>2009-10-05 23:45:29 +0000
commit8fdbddca3d0f4712036675d5e32d5db9a8a7931b (patch)
tree57b59b4e6755c3bf416f3a48211405c943977619 /lib/tidypics.php
parent1a7154ad17d69107cafd1f80e71e7cd5406f811c (diff)
downloadelgg-8fdbddca3d0f4712036675d5e32d5db9a8a7931b.tar.gz
elgg-8fdbddca3d0f4712036675d5e32d5db9a8a7931b.tar.bz2
only counting human viewers now
Diffstat (limited to 'lib/tidypics.php')
-rw-r--r--lib/tidypics.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/tidypics.php b/lib/tidypics.php
index 6bed421ed..38afc27f2 100644
--- a/lib/tidypics.php
+++ b/lib/tidypics.php
@@ -56,7 +56,7 @@
/*********************************************************************
* the functions below replace broken core functions or add functions
- * that should exist in the core
+ * that could/should exist in the core
*/
/**
@@ -173,6 +173,11 @@
}
+ /**
+ * Is page owner a group - convenience function
+ *
+ * @return true/false
+ */
function tp_is_group_page() {
if ($group = page_owner_entity()) {
@@ -183,4 +188,25 @@
return false;
}
+
+ /**
+ * Is the request from a known browser
+ *
+ * @return true/false
+ */
+ function tp_is_person()
+ {
+ $known = array('msie', 'mozilla', 'firefox', 'safari', 'webkit', 'opera', 'netscape', 'konqueror', 'gecko');
+
+ $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
+
+ foreach ($known as $browser)
+ {
+ if (strpos($agent, $browser) !== false) {
+ return true;
+ }
+ }
+
+ return false;
+ }
?> \ No newline at end of file