Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enh: add "Posted links" section #51

Open
marc-farre opened this issue Sep 6, 2022 · 2 comments
Open

Enh: add "Posted links" section #51

marc-farre opened this issue Sep 6, 2022 · 2 comments

Comments

@marc-farre
Copy link
Contributor

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
Copy link
Contributor Author

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-
Copy link
Contributor

luke- commented Sep 13, 2022

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...

marc-farre added a commit to marc-farre/linklist that referenced this issue Sep 19, 2022
marc-farre added a commit to marc-farre/linklist that referenced this issue Sep 19, 2022
marc-farre added a commit to marc-farre/linklist that referenced this issue Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants