本文整理汇总了PHP中cmsUser::getUserWall方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsUser::getUserWall方法的具体用法?PHP cmsUser::getUserWall怎么用?PHP cmsUser::getUserWall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsUser
的用法示例。
在下文中一共展示了cmsUser::getUserWall方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clubs
//.........这里部分代码省略.........
// Инициализируем участников клуба
$model->initClubMembers($club['id']);
// права доступа
$is_admin = $inUser->is_admin || ($inUser->id == $club['admin_id']);
$is_moder = $model->checkUserRightsInClub('moderator');
$is_member = $model->checkUserRightsInClub('member');
// Приватный или публичный клуб
$is_access = true;
if ($club['clubtype']=='private' && (!$is_admin && !$is_moder && !$is_member)){
$is_access = false;
}
// Общее количество участников
$club['members'] = $model->club_total_members;
// Общее количество участников
$club['moderators'] = $model->club_total_moderators;
// Массив членов клуба
if($club['members']){
$inDB->limit($model->config['club_perpage']);
$club['members_list'] = $model->getClubMembers($club['id'], 'member');
} else { $club['members_list'] = array(); }
// Массив модераторов клуба
if($club['moderators']){
$club['moderators_list'] = $model->getClubMembers($club['id'], 'moderator');
}
// Стена клуба
// количество записей на стене берем из настроек
$inDB->limitPage(1, $model->config['wall_perpage']);
$club['wall_html'] = cmsUser::getUserWall($club['id'], 'clubs', ($is_moder || $is_admin), ($is_moder || $is_admin));
/////////////////////////////////////////////
//////////// ПОСТЫ БЛОГА КЛУБА //////////////
/////////////////////////////////////////////
if ($club['enabled_blogs']){
$inBlog = $model->initBlog();
$inBlog->whereBlogUserIs($club['id']);
$club['total_posts'] = $inBlog->getPostsCount($is_admin || $is_moder);
$inDB->addSelect('b.user_id as bloglink');
$inDB->orderBy('p.pubdate', 'DESC');
$inDB->limit($model->config['club_posts_perpage']);
$club['blog_posts'] = $inBlog->getPosts(($is_admin || $is_moder), $model, true);
}
/////////////////////////////////////////////
//////////// ФОТОАЛЬБОМЫ КЛУБА //////////////
/////////////////////////////////////////////
if ($club['enabled_photos']){
// Общее количество альбомов
$club['all_albums'] = $inDB->rows_count('cms_photo_albums', "NSDiffer = 'club{$club['id']}' AND user_id = '{$club['id']}' AND parent_id > 0");
// получаем альбомы
if($club['all_albums']){
示例2: users
//.........这里部分代码省略.........
$usr = $model->getUser($login);
if (!$usr) {
cmsCore::error404();
}
$myprofile = $inUser->id == $usr['id'];
$inPage->setTitle($usr['nickname']);
$inPage->addPathway($usr['nickname']);
// просмотр профиля запрещен
if (!cmsUser::checkUserContentAccess($usr['allow_who'], $usr['id'])) {
cmsPage::initTemplate('components', 'com_users_not_allow')->assign('is_auth', $inUser->id)->assign('usr', $usr)->display('com_users_not_allow.tpl');
return;
}
// Профиль удален
if ($usr['is_deleted']) {
cmsPage::initTemplate('components', 'com_users_deleted.tpl')->assign('usr', $usr)->assign('is_admin', $inUser->is_admin)->assign('others_active', $inDB->rows_count('cms_users', "login='{$usr['login']}' AND is_deleted=0", 1))->display('com_users_deleted.tpl');
return;
}
// Данные о друзьях
$usr['friends_total'] = cmsUser::getFriendsCount($usr['id']);
$usr['friends'] = cmsUser::getFriends($usr['id']);
// очищать сессию друзей если в своем профиле и количество друзей из базы не совпадает с количеством друзей в сессии
if ($myprofile && sizeof($usr['friends']) != $usr['friends_total']) {
cmsUser::clearSessionFriends();
}
// обрезаем список
$usr['friends'] = array_slice($usr['friends'], 0, 6);
// выясняем друзья ли мы с текущим пользователем
$usr['isfriend'] = !$myprofile ? cmsUser::isFriend($usr['id']) : false;
// награды пользователя
$usr['awards'] = $model->config['sw_awards'] ? $model->getUserAwards($usr['id']) : false;
// стена
if ($model->config['sw_wall']) {
$inDB->limitPage(1, $model->config['wall_perpage']);
$usr['wall_html'] = cmsUser::getUserWall($usr['id'], 'users', $myprofile, $inUser->is_admin);
}
// можно ли пользователю изменять карму
$usr['can_change_karma'] = $model->isUserCanChangeKarma($usr['id']) && $inUser->id;
// Фотоальбомы пользователя
if ($model->config['sw_photo']) {
$usr['albums'] = $model->getPhotoAlbums($usr['id'], $usr['isfriend'], !$inCore->isComponentEnable('photos'));
$usr['albums_total'] = sizeof($usr['albums']);
$usr['albums_show'] = 6;
if ($usr['albums_total'] > $usr['albums_show']) {
array_splice($usr['albums'], $usr['albums_show']);
}
}
$usr['board_count'] = $model->config['sw_board'] ? $inDB->rows_count('cms_board_items', "user_id='{$usr['id']}' AND published=1") : 0;
$usr['comments_count'] = $model->config['sw_comm'] ? $inDB->rows_count('cms_comments', "user_id='{$usr['id']}' AND published=1") : 0;
$usr['forum_count'] = $model->config['sw_forum'] ? $inDB->rows_count('cms_forum_posts', "user_id = '{$usr['id']}'") : 0;
$usr['files_count'] = $model->config['sw_files'] ? $inDB->rows_count('cms_user_files', "user_id = '{$usr['id']}'") : 0;
$cfg_reg = $inCore->loadComponentConfig('registration');
$usr['invites_count'] = $inUser->id && $myprofile && $cfg_reg['reg_type'] == 'invite' ? $model->getUserInvitesCount($inUser->id) : 0;
$usr['blog'] = $model->config['sw_blogs'] ? $inDB->get_fields('cms_blogs', "user_id = '{$usr['id']}' AND owner = 'user'", 'title, seolink') : false;
$usr['form_fields'] = array();
if (is_array($model->config['privforms'])) {
foreach ($model->config['privforms'] as $form_id) {
$usr['form_fields'] = array_merge($usr['form_fields'], cmsForm::getFieldsValues($form_id, $usr['formsdata']));
}
}
if ($usr['city']) {
cmsCore::loadModel('geo');
$geo = new cms_model_geo();
$city_parents = $geo->getCityParents($usr['city']);
if ($city_parents) {
$usr['country'] = $city_parents['country_name'];
}
示例3: assign
if (method_exists($model, 'forWallIsAdmin')){
$is_admin = $model->forWallIsAdmin($target_id);
}
// проверяем наличие места для добавления записи
if (!method_exists($model, 'addWall')){ cmsCore::halt(); }
cmsCore::loadLanguage('components/users');
/* ==================================================================================================== */
/* ==================================================================================================== */
if($do == 'view'){
$inDB->limitPage($page, $cfg['wall_perpage']);
echo cmsUser::getUserWall($target_id, $component, $my_profile, $is_admin);
}
/* ==================================================================================================== */
/* ==================================================================================================== */
if($do == 'add'){
if (!$inUser->id) { cmsCore::jsonOutput(array('error' => true, 'text' => $_LANG['ONLY_REG_USER_CAN_WALL'])); }
if (!cmsCore::inRequest('submit')){
ob_start();
cmsPage::initTemplate('components', 'com_users_addwall')->
assign('target_id', $target_id)->
assign('component', $component)->