Pinned Posts Download 7.1dev4

5.0
German Michael Zülsdorff 6 months ago

Pinned Posts

An example of step-by-step development
release 7.1dev4: ready to use + 8 selectable background colors + language files

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

The idea of this component is to pin one or more selected posts on top of the newsfeeds as requested here:
https://www.opensource-socialnetwork.org/discussion/view/6844


How to pin one or more posts:
1 - Click the date of the post you want to pin:


enter image description here


This will open a new page with the ID of that post (346 in this example)

enter image description here


2 - Keep that ID in mind (write it down ... whatever ...)
3 - Proceed to your administrator page -> Configure -> PinnedPosts


enter image description here


4 - Enter the ID and save it


enter image description here


The first release of this component (7.1dev1) is implementing the basic placement of pinned posts and was derived from the Site Announcement component. No wonder that the result will look very much the same:


enter image description here


Now, that we have the post ID of interest already in place, the next task is to make use of it, fetch that post and display it.


Release 7.1dev2 comes implemented with the code to pin the actual post(s) now - using the ids which were saved via Configure -> PinnedPosts

See posts.php for more details...

So here's pinned post 346 again that I picked as an example:
enter image description here

Comments
German Michael Zülsdorff Replied 5 months ago

I'd rather call this a problem - at least not a problem of my component - if you got only a handful of posts on your site and both the fixed and original appear twice on the same page. :)) It's just another feature request.

Anyway: Arsalan posted some the code to accomplish things like that 2 weeks ago in your thread already. That is: Use these hooks, and change the accompanying function to exclude the saved post ids.

Bulgarian Georgi Shindarov Replied 5 months ago

Thank you very much for starting to develop this component.. And is it possible to make it so that the original post that appears in the top position disappears from its previous position in the list of posts.. because at the moment we get very close repetition of posts and it seems a bit overloaded and unnecessary.. Will you be able to fix this problem in the next version of this component. Thank you again!

Indonesian Arsalan Shah Replied 5 months ago

@Georgi , waiting response from you? did you read the description?

German Michael Zülsdorff Replied 5 months ago

You did not read the description, did you?
Actually, there's yet no code in release 7.1dev1 to make use of the post ID you saved at your admin backend.

Thus, the next step is trying to find out which way the OssnWall component is able to display a standalone post. Any idea?

Bulgarian Georgi Shindarov Replied 5 months ago

I have installed the same component.. and only the post series numbers are showing.. not showing the posts themselves enter image description here

Component

Developer: Michael
License GPL v2
Type: Site admin
Requires Ossn Version : 7.1
Latest Version: 7.1dev4
Last Updated 5 months ago
Repository Url View Repository

Versions