示例#1
0
文件: view.php 项目: rair/yacs
 //				.'	}'."\n"
 //				."\n"
 //			.'	// use a definition list to enable customization of the download box'."\n"
 //				.'	document.write(\'<dl class="download">\');'."\n"
 //				.'	document.write(\'<dt><a onclick="edit_in_word()" title="'.addcslashes($title, "'").'">'.addcslashes($label, "'").'</a></dt>\');'."\n"
 //				.'	document.write(\'<dd>'.addcslashes($description, "'").'</dd></dl>\');'."\n"
 //			.'}'."\n"
 //			.JS_SUFFIX."\n";
 //	}
 //
 // link to download the file
 //
 // download description
 $description = '';
 // the list of people who have fetched this file, for owners and associates
 if (Files::allow_modification($item, $anchor) && ($users = Activities::list_users_at('file:' . $item['id'], 'fetch', 30, 'comma'))) {
     $count = Activities::count_users_at('file:' . $item['id'], 'fetch');
     if ($count > 30) {
         $more = ' ...';
     } else {
         $more = '';
     }
     $description .= '<p>' . Skin::build_number($item['hits'], i18n::ns('download', 'downloads', $item['hits'])) . sprintf(i18n::ns(', including %d authenticated person: %s', ', including %d authenticated persons: %s', $count), $count, $users) . "</p>\n";
 }
 // add some help depending on the file type
 $extension = strtolower(@array_pop(@explode('.', @basename($item['file_name']))));
 switch ($extension) {
     case '3gp':
         // video/3gpp
         $description .= '<p>' . sprintf(i18n::s('You are about to download a small video. To take the most of it we recommend you to use %s (open source).'), Skin::build_link(i18n::s('http://www.videolan.org/vlc/'), i18n::s('VLC media player'), 'external')) . '</p>';
         break;