本文整理汇总了PHP中elgg_list_river函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_list_river函数的具体用法?PHP elgg_list_river怎么用?PHP elgg_list_river使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elgg_list_river函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activity_view_page
/**
* Main activity stream list page
*/
function activity_view_page()
{
$options = array();
$page_type = preg_replace('[\\W]', '', get_input('page_type', 'all'));
$type = preg_replace('[\\W]', '', get_input('type', 'all'));
$subtype = preg_replace('[\\W]', '', get_input('subtype', ''));
if ($subtype) {
$selector = "type={$type}&subtype={$subtype}";
} else {
$selector = "type={$type}";
}
if ($type != 'all') {
$options['type'] = $type;
if ($subtype) {
$options['subtype'] = $subtype;
}
}
switch ($page_type) {
case 'mine':
$title = elgg_echo('river:mine');
$page_filter = 'mine';
$options['subject_guid'] = elgg_get_logged_in_user_guid();
break;
case 'friends':
$title = elgg_echo('river:friends');
$page_filter = 'friends';
$options['relationship_guid'] = elgg_get_logged_in_user_guid();
$options['relationship'] = 'friend';
break;
default:
$title = elgg_echo('river:all');
$page_filter = 'all';
break;
}
$create_content = '';
if (elgg_is_logged_in()) {
$create_content = elgg_view('activity/create');
}
$activity = elgg_list_river($options);
if (!$activity) {
$activity = elgg_echo('river:none');
}
$content = elgg_view('core/river/filter', array('selector' => $selector));
$sidebar = elgg_view('core/river/sidebar');
$sidebar .= elgg_view('activity/module/mentions');
$sidebar .= elgg_view('activity/module/comments');
$sidebar_alt = elgg_view('activity/module/weekly_likes');
$sidebar_alt .= elgg_view('page/elements/tagcloud_block', array('limit' => 30));
$params = array('content' => $create_content . $content . $activity, 'sidebar' => $sidebar, 'sidebar_alt' => $sidebar_alt, 'filter_context' => $page_filter, 'class' => 'elgg-river-layout');
$body = elgg_view_layout('two_sidebar', $params);
return elgg_view_page($title, $body);
}
示例2: personal_activity_page_handler
/**
* Handle requests to activity/owner/<username>
*
* @param string $hook Hook name
* @param string $type Hook type
* @param array $return Array of url segments
* @param array $params
* @return boolean False if the request was handled
*/
function personal_activity_page_handler($hook, $type, $return, $params)
{
$segments = $return['segments'];
if (isset($segments[0]) && $segments[0] == 'owner') {
$user = get_user_by_username($segments[1]);
// Use default page handler if no user or user is looking at own activity
if (!$user || $user->guid == elgg_get_logged_in_user_guid()) {
return $return;
}
$params['title'] = elgg_echo('personal_activity:owner', array($user->name));
$params['filter_context'] = '';
$params['content'] = elgg_list_river(array('subject_guids' => $user->guid));
if (!$params['content']) {
$params['content'] = elgg_echo('river:none');
}
$body = elgg_view_layout('content', $params);
echo elgg_view_page($params['title'], $body);
return false;
}
return $return;
}
示例3: get_input
<?php
$options = get_input('options');
$count = (int) get_input('count');
$options['count'] = true;
$newcount = elgg_get_river($options);
$options['count'] = false;
$returnData['count'] = $newcount;
$limit = $newcount - $count;
if ($limit > 0) {
$options['pagination'] = false;
$options['offset'] = 0;
$options['limit'] = 1;
$returnData['content'] = elgg_list_river($options);
$returnData['valid'] = 1;
} else {
$returnData['valid'] = 0;
}
echo json_encode($returnData);
exit;
示例4: elgg_list_river
if (!empty($field_result)) {
$details_result .= $cat_title;
$details_result .= "<table class='haarlem-extranet-profile-details'>" . $field_result . "</table>";
}
}
}
if (!empty($details_result)) {
echo "";
echo $details_result;
echo "";
/*echo "<div id='custom_fields_userdetails'>" . $details_result . "</div>";
if (elgg_get_plugin_setting("display_categories", "profile_manager") == "accordion") {
?>
<script type="text/javascript">
$('#custom_fields_userdetails').accordion({
header: 'h3',
autoHeight: false
});
</script>
<?php
}*/
}
if ($description_position != "top") {
echo $about;
}
$activity = elgg_list_river(array('subject_guid' => $user->guid, 'limit' => 10, 'pagination' => false));
if (!$activity) {
$activity = elgg_echo('river:none');
}
echo elgg_view_module('info', 'Recente activiteit', $activity);
echo '</div>';
示例5: aga_handle_activity_page
function aga_handle_activity_page($group, $page, $options, $titlepart)
{
//checking for filter
$type = preg_replace('[\\W]', '', get_input('type', 'all'));
$subtype = preg_replace('[\\W]', '', get_input('subtype', ''));
if ($type != 'all') {
$options['type'] = $type;
if ($subtype) {
$options['subtype'] = $subtype;
}
}
if ($subtype) {
$selector = "type={$type}&subtype={$subtype}";
} else {
$selector = "type={$type}";
}
// now start building the page
$content = "";
$content .= elgg_view_module('info', elgg_echo('aga:note'), elgg_echo('aga:activitycaution'));
elgg_set_page_owner_guid($group->guid);
$title = $titlepart;
elgg_push_breadcrumb($group->name, $group->getURL());
elgg_push_breadcrumb($title);
// this is where we actually build the list of content
$content .= elgg_view('core/river/filter', array('selector' => $selector));
$options['pagination'] = true;
$results = elgg_list_river($options);
if ($results) {
$content .= $results;
} else {
$content .= '<p>' . elgg_echo('groups:activity:none') . '</p>';
}
$params = array('filter_context' => 'aga', 'content' => $content, 'title' => $title, 'class' => 'elgg-river-layout');
$body = elgg_view_layout('content', $params);
echo elgg_view_page($title, $body);
return true;
}
示例6: groups_handle_activity_page
/**
* Group activity page
*
* @param int $guid Group entity GUID
*/
function groups_handle_activity_page($guid)
{
elgg_entity_gatekeeper($guid, 'group');
elgg_set_page_owner_guid($guid);
elgg_group_gatekeeper();
$group = get_entity($guid);
$title = elgg_echo('groups:activity');
elgg_push_breadcrumb($group->name, $group->getURL());
elgg_push_breadcrumb($title);
$db_prefix = elgg_get_config('dbprefix');
$content = elgg_list_river(array('joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid", "LEFT JOIN {$db_prefix}entities e2 ON e2.guid = rv.target_guid"), 'wheres' => array("(e1.container_guid = {$group->guid} OR e2.container_guid = {$group->guid})"), 'no_results' => elgg_echo('groups:activity:none')));
$params = array('content' => $content, 'title' => $title, 'filter' => '');
$body = elgg_view_layout('content', $params);
echo elgg_view_page($title, $body);
}
示例7: get_entity
<?php
$group = get_entity(get_input('group_guid'));
$user = elgg_get_logged_in_user_entity();
$offset = get_input('offset');
$options['offset'] = $offset;
$base_url = get_input('base_url');
if (!$group || !elgg_instanceof($group, 'group')) {
register_error(elgg_echo('groups:notfound'));
exit;
}
//elgg_load_library('elgg:groups');
if (group_gatekeeper(false)) {
if (!$group instanceof ElggGroup) {
exit;
}
//put test in if user not part of group don't show composer otherwise goes in lalaland
$db_prefix = elgg_get_config('dbprefix');
$options = array('joins' => array("JOIN {$db_prefix}entities e ON e.guid = rv.object_guid"), 'wheres' => array("(e.container_guid = {$group->guid} OR rv.object_guid = {$group->guid}) AND rv.action_type != 'vote' AND rv.action_type != 'join'"));
$options['body_class'] = 'new-feed';
$options['base_url'] = $base_url;
$activity = elgg_list_river($options);
if (!$activity) {
$activity = elgg_view('output/longtext', array('value' => elgg_echo('groups:activity:none')));
}
echo $activity;
}
示例8: filter_tags
$bookmark->tags = $wall_post->tags;
} else {
$bookmark->title = filter_tags($document->meta->title);
$bookmark->description = filter_tags($document->meta->description);
$bookmark->tags = string_to_tag_array(filter_tags($document->meta->keywords));
}
$bookmark->save();
}
if ($wall_post->save()) {
$message = format_wall_message($wall_post);
$params = array('entity' => $wall_post, 'user' => $poster, 'message' => $message, 'url' => $wall_post->getURL(), 'origin' => 'wall');
elgg_trigger_plugin_hook('status', 'user', $params);
// Trigger a publish event, so that we can send out notifications
elgg_trigger_event('publish', 'object', $wall_post);
if (get_input('widget')) {
elgg_push_context('widgets');
}
if (elgg_is_xhr()) {
if (get_input('river') && get_input('river') != 'false') {
echo elgg_list_river(array('object_guids' => $wall_post->guid));
} else {
elgg_set_page_owner_guid($wall_owner->guid);
echo elgg_view_entity($wall_post, array('full_view' => false));
}
}
system_message(elgg_echo('wall:create:success'));
forward($wall_post->getURL());
}
}
register_error(elgg_echo('wall:create:error'));
forward(REFERER);
示例9: group_activity
/**
* Web service to get activity feed for a group
*
* @param int $guid - the guid of the group
* @param int $limit default 10
* @param int $offset default 0
*
* @return bool
*/
function group_activity($guid, $limit = 10, $offset = 0)
{
$group = get_entity($guid);
if (!$guid) {
$msg = elgg_echo('groups:notfound');
throw new InvalidParameterException($msg);
}
$db_prefix = elgg_get_config('dbprefix');
global $jsonexport;
$content = elgg_list_river(array('limit' => $limit, 'pagination' => false, 'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"), 'wheres' => array("(e1.container_guid = {$group->guid})")));
return $jsonexport['activity'];
}
示例10: elgg_list_river
$content .= elgg_list_river($river_options);
$content .= '<div class="elgg-widget-more">';
$content .= elgg_view('output/url', array('text' => elgg_echo('river:mine'), 'href' => "activity/owner/{$owner->username}", 'is_trusted' => true));
$content .= '</div>';
$content .= '</div>';
unset($river_options['subject_guid']);
$first = false;
// all activity
$tabs[] = array('text' => elgg_echo('river:all'), 'href' => '#', 'selected' => $first, 'rel' => 'all');
$first = false;
$class = array('theme-haarlem-intranet-dashboard-river', 'theme-haarlem-intranet-dashboard-river-all');
if (!$first) {
$class[] = 'hidden';
}
$content .= '<div class="' . implode(' ', $class) . '">';
$content .= elgg_list_river($river_options);
$content .= '<div class="elgg-widget-more">';
$content .= elgg_view('output/url', array('text' => elgg_echo('river:all'), 'href' => 'activity', 'is_trusted' => true));
$content .= '</div>';
$content .= '</div>';
// content
echo elgg_view('navigation/tabs', array('tabs' => $tabs, 'class' => 'theme-haarlem-intranet-dashboard-activity-tabs'));
echo $content;
?>
<script>
$('#elgg-widget-<?php
echo $widget->getGUID();
?>
.elgg-tabs a').live('click', function() {
var $widget = $('#elgg-widget-<?php
示例11: ajaxmodule_page_handler
/**
* Ajaxmodule page handler
*
* @param array $page From the page_handler function
* @return true|false Depending on success
*
*/
function ajaxmodule_page_handler($page)
{
switch ($page[0]) {
case 'load_activity_ping':
// check for last checked time
if (!($seconds_passed = get_input('seconds_passed', 0))) {
echo '';
exit;
}
$last_reload = time() - $seconds_passed;
// Get current count of entries
$current_count = elgg_get_river(array('count' => TRUE));
// Get the count at the last reload
$last_count = elgg_get_river(array('count' => TRUE, 'posted_time_upper' => $last_reload));
if ($current_count > $last_count) {
$count = $current_count - $last_count;
$s = $count == 1 ? '' : 's';
$link = "<a id='refresh-river-module' href='#' class='update_link'>{$count} update{$s}!</a>";
$page_title = "[{$count} update{$s}] ";
echo json_encode(array('count' => $count, 'link' => $link));
exit;
}
break;
case 'loadriver':
// River options
$options['ids'] = get_input('ids');
$options['subject_guids'] = json_decode(get_input('subject_guids'));
$options['object_guids'] = json_decode(get_input('object_guids'));
$options['annotation_ids'] = json_decode(get_input('annotation_ids'));
$options['action_types'] = json_decode(get_input('action_types'));
$options['posted_time_lower'] = get_input('posted_time_lower');
$options['posted_time_upper'] = get_input('posted_time_upper');
$options['types'] = get_input('types');
$options['subtypes'] = get_input('subtypes');
$options['type_subtype_pairs'] = json_decode(get_input('type_subtype_pairs'));
$options['relationship'] = get_input('relationship');
$options['relationship_guid'] = get_input('relationship_guid');
$options['inverse_relationship'] = get_input('inverse_relationship');
$options['limit'] = get_input('limit', 15);
$options['offset'] = get_input('offset', 0);
$options['count'] = get_input('count');
$options['order_by'] = get_input('order_by');
$options['group_by'] = get_input('group_by');
// Remove empty options
foreach ($options as $key => $option) {
if ($option === NULL || empty($options)) {
unset($options[$key]);
}
}
$options = elgg_trigger_plugin_hook('get_options', 'river', '', $options);
// Display river
$river = elgg_list_river($options);
if (!$river) {
echo "<div style='font-weight: bold; margin-top: 10px; margin-bottom: 10px; border-top: 1px solid #aaa; width: 100%; text-align: center;'>" . elgg_echo('river:none') . "</div>";
} else {
//echo $river;
echo elgg_trigger_plugin_hook('output', 'page', array(), $river);
}
break;
case 'loadentities':
// Entity options
$options['container_guid'] = get_input('container_guid');
$options['tag'] = get_input('tag', false);
$options['tags'] = json_decode(get_input('tags', false));
$options['types'] = json_decode(get_input('types'));
$options['subtypes'] = json_decode(get_input('subtypes'));
$options['limit'] = get_input('limit', 10);
$options['offset'] = get_input('offset', 0);
$options['owner_guids'] = json_decode(get_input('owner_guids'));
$options['created_time_upper'] = get_input('created_time_upper');
$options['created_time_lower'] = get_input('created_time_lower');
$options['count'] = get_input('count', FALSE);
// Store access status
$access_status = access_get_show_hidden_status();
// Check if bypassing hidden entities
if (get_input('access_show_hidden_entities')) {
// Override
access_show_hidden_entities(true);
}
// Set 'listing type' for new simple listing if supplied
if ($listing_type = get_input('listing_type', FALSE)) {
set_input('ajaxmodule_listing_type', $listing_type);
}
// Make sure container guid isn't empty
$options['container_guid'] = !empty($options['container_guid']) ? $options['container_guid'] : ELGG_ENTITIES_ANY_VALUE;
if (get_input('restrict_tag')) {
// Grab content with supplied tags ONLY
elgg_set_context('search');
$options['type'] = 'object';
$options['full_view'] = FALSE;
// Multiple tags
if ($options['tags']) {
foreach ($options['tags'] as $tag) {
//.........这里部分代码省略.........
示例12: get_input
<?php
$id = (int) get_input('id');
if ($id) {
echo elgg_list_river(array('id' => $id, 'limit' => 0, 'list_class' => "", 'item_class' => ""));
}
?>
示例13: elgg_extract
<?php
/**
* Group activity widget
*/
$widget = elgg_extract('entity', $vars);
$num = (int) $widget->num_display;
$guid = (int) $widget->group_guid;
if (empty($guid)) {
// no group selected yet
echo '<p>' . elgg_echo('groups:widget:group_activity:content:noselect') . '</p>';
return;
}
$db_prefix = elgg_get_config('dbprefix');
echo elgg_list_river(['limit' => $num, 'pagination' => false, 'joins' => ["JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"], 'wheres' => ["(e1.container_guid = {$guid})"], 'no_results' => elgg_echo('groups:widget:group_activity:content:noactivity')]);
示例14: elgg_get_page_owner_entity
<?php
$group = elgg_get_page_owner_entity();
if (!$group || !elgg_instanceof($group, 'group')) {
register_error(elgg_echo('groups:notfound'));
forward();
}
elgg_load_library('elgg:groups');
groups_register_profile_buttons($group);
$title = $group->name;
$composer = '';
if (elgg_is_logged_in()) {
$composer = elgg_view('page/elements/composer', array('entity' => $group));
}
$db_prefix = elgg_get_config('dbprefix');
$activity = elgg_list_river(array('joins' => array("JOIN {$db_prefix}entities e ON e.guid = rv.object_guid"), 'wheres' => array("e.container_guid = {$group->guid} OR rv.object_guid = {$group->guid}")));
if (!$activity) {
$activity = elgg_view('output/longtext', array('value' => elgg_echo('group:activity:none')));
}
$body = elgg_view_layout('two_sidebar', array('title' => $title, 'content' => $composer . $activity));
echo elgg_view_page($title, $body);
示例15: elgg_get_logged_in_user_guid
<?php
/**
*
* return all river items related to a users friends
*/
$userGuid = elgg_get_logged_in_user_guid();
$river_options_friends = array("pagination" => false, "limit" => 10, "type_subtype_pairs" => array(), "relationship_guid" => $userGuid, "relationship" => 'friend');
$friend_activity = elgg_list_river($river_options_friends);
return $friend_activity;