Files, Bookmarks : be sure to not duplicate files or bookmarks

Hello everybody,

I would like to check, when someone wants to add a file or a bookmark, that this one is not already registered.

If this one already exists, is it possible to get the ID to associate this to the user ID ?

Regards,

CV

  • This is not a default functionality. You need to consider access level - an bookmark might exist for a given URL, but it might not be accessible by another user adding it.
    This can be done however. You will need to write event handlers and check bookmark's address metadata, and files can be compared by md5 checksum, you would probably need to add checksum as metadata when files are saved.

  • Hello Ismayil,

    Thank you for your answer.
    I thought I would have to use elgg_get_entities_from_metadata().
    In fact, I would not be able to do that.
    Shame !

    Regards,

    CV

     

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking