示例#1
0
文件: codes.php 项目: rair/yacs
 /**
  * list clicks
  *
  * @param string web address that is monitored
  * @return string the rendered text
  **/
 public static function render_clicks($url)
 {
     global $context;
     $text = '';
     // sanity check
     if (!$url) {
         return $text;
     }
     // if we received only an id, assume file access
     if (preg_match('/^[0-9]+$/', $url)) {
         $url = 'file:' . $url;
     }
     // the list of people who have followed this link
     if ($users = Activities::list_at($url, array('click', 'fetch'), 50, 'comma')) {
         $count = Activities::count_at($url, array('click', 'fetch'));
         $text .= sprintf(i18n::ns('%d named person has followed the link: %s', '%d named persons have followed the link: %s', $count), $count, $url);
     } else {
         $text .= i18n::s('No authenticated person has used this link yet');
     }
     return $text;
 }