humhub-contrib / linklist

Link List Space / User Module
5 stars 20 forks source link

Enh: add "Posted links" section #51

Open marc-farre opened 2 years ago

marc-farre commented 2 years ago

The Files module has a "Files from the stream" section and the Gallery module has a "Posted Media Files" section.

It would be great if this module had a "Posted links" section that fetches all links contained in posts.

marc-farre commented 2 years ago

Maybe I could have a try.

For the Files and Gallery module, we can query the file table, join with the content and comments tables and filter by content container: https://github.com/humhub/cfiles/blob/master/models/File.php#L409 But for links in text, this is not possible.

Maybe we could, after Post saving (with an event), collect the links in the message, and save them in a new table (or in the existing linklist_category adding a type column and in the linklist_link adding a content_id column)?

On module activation in the space, a job could search links in all posts of the space to populate the table.

luke- commented 2 years ago

Hmm, this is a tricky one. An AfterSave Event and an ActiveJob would probably be the best solution. Unfortunately it only works for Post content type.

Unfortunately I can't see any other solution...