Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
30438e42
Commit
30438e42
authored
Mar 10, 2009
by
Nigel McNie
Browse files
Don't show people's profile views on their listing of views on the myfriends page.
parent
7c174b7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
30438e42
...
...
@@ -1471,10 +1471,11 @@ function get_view_from_token($token) {
* @param array $users users to fetch views owned by
* @param int $userlooking (optional, defaults to logged in user)
* @param int $limit grab this many views. (setting this null means get all)
* @param string $type the type of views to return
*
* @return array Associative array keyed by userid, of arrays of view ids
*/
function
get_views
(
$users
,
$userlooking
=
null
,
$limit
=
5
)
{
function
get_views
(
$users
,
$userlooking
=
null
,
$limit
=
5
,
$type
=
'portfolio'
)
{
$userlooking
=
optional_userid
(
$userlooking
);
if
(
is_int
(
$users
))
{
$users
=
array
(
$users
);
...
...
@@ -1507,6 +1508,11 @@ function get_views($users, $userlooking=null, $limit=5) {
}
}
$typesql
=
''
;
if
(
$type
!=
null
)
{
$typesql
=
'AND v.type = '
.
db_quote
(
$type
);
}
// public, logged in, or friends' views
if
(
$results
=
get_records_sql_array
(
'SELECT
...
...
@@ -1534,7 +1540,7 @@ function get_views($users, $userlooking=null, $limit=5) {
v.owner IN ('
.
join
(
','
,
array_map
(
'db_quote'
,
array_keys
(
$users
)))
.
')
AND ( v.startdate IS NULL OR v.startdate < ? )
AND ( v.stopdate IS NULL OR v.stopdate > ? )
'
,
'
.
$typesql
,
array
(
$dbnow
,
$dbnow
)
)
)
{
...
...
@@ -1562,7 +1568,7 @@ function get_views($users, $userlooking=null, $limit=5) {
v.owner IN ('
.
join
(
','
,
array_map
(
'db_quote'
,
array_keys
(
$users
)))
.
')
AND ( v.startdate IS NULL OR v.startdate < ? )
AND ( v.stopdate IS NULL OR v.stopdate > ? )
'
,
'
.
$typesql
,
array
(
$userlooking
,
$dbnow
,
$dbnow
)
)
)
{
...
...
@@ -1592,7 +1598,7 @@ function get_views($users, $userlooking=null, $limit=5) {
v.owner IN ('
.
join
(
','
,
array_map
(
'db_quote'
,
array_keys
(
$users
)))
.
')
AND ( v.startdate IS NULL OR v.startdate < ? )
AND ( v.stopdate IS NULL OR v.stopdate > ? )
'
,
'
.
$typesql
,
array
(
$userlooking
,
0
,
$dbnow
,
$dbnow
)
)
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment