本文整理汇总了PHP中ArtefactTypeFileBase::count_user_files方法的典型用法代码示例。如果您正苦于以下问题:PHP ArtefactTypeFileBase::count_user_files方法的具体用法?PHP ArtefactTypeFileBase::count_user_files怎么用?PHP ArtefactTypeFileBase::count_user_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArtefactTypeFileBase
的用法示例。
在下文中一共展示了ArtefactTypeFileBase::count_user_files方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: group_get_groupinfo_data
function group_get_groupinfo_data($group)
{
safe_require('artefact', 'file');
safe_require('interaction', 'forum');
$group->admins = group_get_admins(array($group->id));
$group->settingsdescription = group_display_settings($group);
if (get_config('allowgroupcategories')) {
$group->categorytitle = $group->category ? get_field('group_category', 'title', 'id', $group->category) : '';
}
if (group_can_list_members($group, group_user_access($group->id))) {
$group->membercount = count_records('group_member', 'group', $group->id);
}
$group->viewcount = count_records('view', 'group', $group->id);
$group->filecounts = ArtefactTypeFileBase::count_user_files(null, $group->id, null);
$group->forumcounts = PluginInteractionForum::count_group_forums($group->id);
$group->topiccounts = PluginInteractionForum::count_group_topics($group->id);
$group->postcounts = PluginInteractionForum::count_group_posts($group->id);
return $group;
}
示例2: get_data
protected static function get_data($groupid)
{
global $USER;
if (!defined('GROUP')) {
define('GROUP', $groupid);
}
// get the currently requested group
$group = group_current_group();
$group->ctime = strftime(get_string('strftimedate'), $group->ctime);
// if the user isn't logged in an the group isn't public don't show anything
if (!is_logged_in() && !$group->public) {
throw new AccessDeniedException();
}
// find the group administrators
$group->admins = get_column_sql("SELECT \"member\"\n FROM {group_member}\n WHERE \"group\" = ?\n AND \"role\" = 'admin'", array($group->id));
$role = group_user_access($group->id);
$group->role = $role;
// logged in user can do stuff
if (is_logged_in()) {
$afterjoin = param_variable('next', 'view');
if ($role) {
if ($role == 'admin') {
$group->membershiptype = 'admin';
$group->requests = count_records('group_member_request', 'group', $group->id);
} else {
$group->membershiptype = 'member';
}
$group->canleave = group_user_can_leave($group->id);
} else {
if ($group->jointype == 'invite' and $invite = get_record('group_member_invite', 'group', $group->id, 'member', $USER->get('id'))) {
$group->membershiptype = 'invite';
$group->invite = group_get_accept_form('invite', $group->id, $afterjoin);
} else {
if ($group->jointype == 'request' and $request = get_record('group_member_request', 'group', $group->id, 'member', $USER->get('id'))) {
$group->membershiptype = 'request';
} else {
if ($group->jointype == 'open') {
$group->groupjoin = group_get_join_form('joingroup', $group->id, $afterjoin);
}
}
}
}
}
$group->settingsdescription = group_display_settings($group);
if (get_config('allowgroupcategories')) {
$group->categorytitle = $group->category ? get_field('group_category', 'title', 'id', $group->category) : '';
}
$filecounts = ArtefactTypeFileBase::count_user_files(null, $group->id, null);
return array('group' => $group, 'filecounts' => $filecounts);
}
示例3: group_get_accept_form
} else {
if ($group->jointype == 'invite' and $invite = get_record('group_member_invite', 'group', $group->id, 'member', $USER->get('id'))) {
$group->membershiptype = 'invite';
$group->invite = group_get_accept_form('invite', $group->id, $afterjoin);
} else {
if ($group->jointype == 'request' and $request = get_record('group_member_request', 'group', $group->id, 'member', $USER->get('id'))) {
$group->membershiptype = 'request';
} else {
if ($group->jointype == 'open') {
$group->groupjoin = group_get_join_form('joingroup', $group->id, $afterjoin);
}
}
}
}
}
$filecounts = ArtefactTypeFileBase::count_user_files(null, $group->id, null);
// Latest forums posts
// NOTE: it would be nicer if there was some generic way to get information
// from any installed interaction. But the only interaction plugin is forum,
// and group info pages might be replaced with views anyway...
$foruminfo = null;
if ($role || $group->public) {
$foruminfo = get_records_sql_array('
SELECT
p.id, p.subject, p.body, p.poster, p.topic, t.forum, pt.subject AS topicname
FROM
{interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t ON (t.id = p.topic)
INNER JOIN {interaction_instance} i ON (i.id = t.forum)
INNER JOIN {interaction_forum_post} pt ON (pt.topic = p.topic AND pt.parent IS NULL)
WHERE