Pinned Posts Download 7.3dev2

5.0
German Michael Zülsdorff 12 months ago

Pinned Posts

An example of step-by-step development

The goal of this component is enabling the admin to pin one or more posts on top of the newsfeed, as requested here:: https://www.opensource-socialnetwork.org/discussion/view/6844


Changelog:
ready to use,
v7.3dev2: fixed wrong merging of extra 'wheres' to get*Posts queries
v7.3dev1: + option to un-/collapse pinned posts contributed by Dominik L.

v7.2dev4: + compatibility fix for Friends-Online component as reported by Dominik L.
v7.2dev3: + 'Pin' menu entries on any wall post
v7.2dev2: + 'Unpin' menu entries on Pinned Post's frontend panel
v7.2dev1: + option to hide/display comments

ready to use, but not recommended
v7.1dev4: + eight selectable background colors + language files

early releases NOT to be used in production environments
v7.1dev3: pinned posts being removed from original location + crash debug
v7.1dev2: pinned posts appear on top of the newsfeed
v7.1dev1: admin backend to save post ids + basic placement on top of newfeed


How to pin one or more posts:
Choose the post you want to pin, open its menu on the right and click 'Pin':


enter image description here


The page reloads and the result will look like this.
(With Greetings and Site Announcement installed, Pinned Posts will care about a meaningful ordering by the way.)


enter image description here


How to unpin one or more pinned posts:
Choose the post you want to unpin, open its menu on the right and click 'Unpin':


enter image description here


Collapsing pinned posts:
Since members may not be too delighted to find the same pinned posts again and again whenever they visit the newsfeed, they may collapse any post they don't want to see anymore...


enter image description here


to just one line ...


enter image description here

Comments
German Dominik L Replied 1 month ago

Hello!

With the newest PinnedPosts, the "FriendsOnline" is doubleenter image description here

German Dominik L Replied 1 month ago

Thanks, works good for me! :)

German Michael Zülsdorff Replied 1 month ago

Now, that the basics are working fine it's time to add some more comfort...

So release 7.2dev2 comes with the feature to unpin a pinned post directly in place. Pinned posts may still be removed via Configure->PinnedPosts on the administrator page, but that's no longer mandantory.


enter image description here

German Michael Zülsdorff Replied 1 month ago

Release 7.2 now handles post pinning in a completely different way:
No more superfluous JavaScript, instead Ossn hooks ensure that the insertion code and database queries are only executed when absolutely necessary.

German Michael Zülsdorff Replied 1 month ago

Thank you for your feedback.
It works - yes, but the current implementation is rather questionable. ;)
Because it unconditionally bloats your page's header - and what's worse - causes unnecessary database queries even on pages where pinning is not expected at all.

bm Helen Trott Replied 2 months ago

Excellent component feature. It works great.

German Dominik L Replied 2 months ago

Idea:

Pin polls

German Dominik L Replied 5 months ago

I found an issue;

Normally comments are collapsed, but when using this component, comments on pinned posts are full length

German Michael Zülsdorff Replied 6 months ago

I'm sorry, but currently I have no time for giving detailed help or larger coding projects.
As a starting point I would clone parts of the Group Invitation component into Pinned Posts in order to get an input field in place, change the 'Invite' button to 'Save' which would call an action to store the post ids. The remaining group 'pin' logic should be adaptable from the already existing code.

Bulgarian Georgi Shindarov Replied 6 months ago

Hello again. I want to ask if it is possible for the Pinned Posts component to be modified to a Group Pinned Posts component so that any user who is a group administrator can change the order of posts in the group. I need this because I want to make a music ranking.. and not only that.. it can also be a ranking of images that can be changed by the administrator depending on the number of likes on clips or images.. Is it possible to help me I will do it.. or you can do it.. if you think it will be faster and easier.. I think such a component would be useful..

enter image description here

Component

Developer: Michael
License GPL v2
Type: Site admin
Requires Ossn Version : 7.1
Latest Version: 7.3dev2
Last Updated 4 weeks ago
Repository Url View Repository

Versions