Proper use of plugin_data for entries.

Post plugins and custom CSS snippets here
coplate
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 25 May 2014, 05:32

Proper use of plugin_data for entries.

Postby coplate » 25 May 2014, 05:48

I was looking at using tt-rss for a project I am working on, instead of making my own, and It looks like what I want to do can be done as a plugin.

Basically my plugin would allow users to create shared notes on entries.

This looks possible because the entries are based on GUID, and if all the users fetched from the same URL, then the GUID will match.

Then I want go give my users the ability to mark the notes as read, for their user only.

I have a couple of hopefully basic questions to ask:
1:
I have tt-rss 1.11 right now, which still has a bunch of separate comic plugins, and I notice they all do something like 'if( plugin_data contains "comic_name,user_id:")'
I was wondering if someone had created a guideline on plugin_data interoperability that I could not find. Is it as simple as "don't use colon, so we can split on colon"?

2:
I also noticed a table ttrss_plugin_storage that currently only the nsfw plugin uses ( in what I have installed ).
This table looks like where I can keep the notes that have been read by each user.
There is a function in pluginhost.php that loads, saves, and clears, but the clear function only appears to ever be called from the user interface.
It sounds like I would need to register with the HOOK_HOUSE_KEEPING and either call that cleanup function, or delete from table manually for owners that have not logged in for XX days if I wanted to?

3:
Alternatively , I was considering creating a table for my plugin directly, so I dont have to store everything as serialized objects, and can do queries on the feed_id and such, instead of pulling the 'read' status of all notes. Would anyone say that is 'to be avoided', if I have a House_Keeping hook to cleanup when entries are purged?


Thanks for anyone's time.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Proper use of plugin_data for entries.

Postby fox » 02 Jun 2014, 11:53

>This looks possible because the entries are based on GUID, and if all the users fetched from the same URL, then the GUID will match.

What is stored in the database is specific to the user. Data is not shared.


Return to “Themes and plugins”

Who is online

Users browsing this forum: No registered users and 2 guests