Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
207
Issues
207
List
Boards
Labels
Service Desk
Milestones
Merge Requests
29
Merge Requests
29
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
f62228be
Commit
f62228be
authored
39 minutes ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): Pro users to have up to 12 pinned posts
parent
b8d55a17
epic/minds-pro
1 merge request
!292
WIP: (feat): Minds Pro (development branch) - Release 2
Pipeline
#76238942
passed with stages
in 12 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
User.php
Entities/User.php
+8
-8
No files found.
Entities/User.php
View file @
f62228be
...
...
@@ -390,16 +390,16 @@ class User extends \ElggUser
public
function
addPinned
(
$guid
)
{
$pinned
=
$this
->
getPinnedPosts
();
if
(
!
$pinned
)
{
$pinned
=
[];
}
else
if
(
count
(
$pinned
)
>
2
)
{
array_shift
(
$pinned
);
}
if
(
array_search
(
$guid
,
$pinned
)
===
false
)
{
$pinned
[]
=
(
string
)
$guid
;
$this
->
setPinnedPosts
(
$pinned
);
$pinned
[]
=
(
string
)
$guid
;
}
$this
->
setPinnedPosts
(
$pinned
);
}
/**
...
...
@@ -425,10 +425,10 @@ class User extends \ElggUser
* @return $this
*/
public
function
setPinnedPosts
(
$pinned
)
{
if
(
count
(
$pinned
)
>
3
)
{
$pinned
=
array_slice
(
$pinned
,
0
,
3
);
}
$this
->
pinned_posts
=
$pinned
;
$maxPinnedPosts
=
$this
->
isPro
()
?
12
:
3
;
$this
->
pinned_posts
=
array_slice
(
$pinned
,
-
$maxPinnedPosts
,
null
,
false
);
return
$this
;
}
...
...
This diff is collapsed.
Click to expand it.
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