Hi,
answers following:
(2020-04-03, 07:29 PM)[ExiTuS] Wrote: So how should anyone be able to decide whether to delete or rename your file!? 
No, the plugins creates it and deletes/renames it at uninstalling.
(2020-04-03, 07:29 PM)[ExiTuS] Wrote: Why using a flat file at all? Is it possible to save this content in the database instead away from filesystem?
Let me explain it a little more, the plugin shows a modal window when you activate it, and to be sure that the modal window doesn't show up more than once, the plugin creates an empty file in activation, and check for it afterwards. If is present, modal window is hidden.
My plugin doesn't create any table in the DB, and create one only to this I thought it was too much work for a simple modal window.
(2020-04-03, 07:29 PM)[ExiTuS] Wrote: In general, a plugin being uninstalled must absolutely recover the original state!
Uninstallation means there is nothing kept at all (neither DB records or files) and the forum and filesystem is in state as of never seen this plugin before.
[ExiTuS]
Yeah, was aware of that, thanks.
(2020-04-04, 05:28 AM).m. Wrote: in practice, uninstalling doesn't remove files. using unlink could be dangerous
users should be informed about the files & their locations (can be through readme.txt
file)
That's the point of my question, to be sure I could use it or not. Any other way I could do it or I should ask the installer of the plugin to manual delete it?
(2020-04-04, 05:53 AM)Darth Apple Wrote: But as said above, using the database is a good idea if you can. You can do it easily in the settings table if you're okay with it being accessible in the admin CP (and it sounds like you're just creating a blank file for some sort of flag). You could also create a new table and add your flag there, although that's somewhat of a tacky solution. 
Also, I'll add real quick, what exactly is this touch file being used for?
As I said to
ExiTuS: "the plugin shows a modal window when you activate it, and to be sure that the modal window doesn't show up more than once, the plugin creates an empty file in activation, and check for it afterwards. If is present, modal window is hidden.
My plugin doesn't create any table in the DB, and create one only to this I thought it was too much work for a simple modal window."
I know maybe it's not the best solution, but this is why I'm asking for advice
global $mybb;
$warnfile = MYBB_ROOT . 'cache/modal_once.txt';
if (!file_exists($warnfile)){
touch(MYBB_ROOT . 'cache/modal_once.txt');
chmod(MYBB_ROOT . 'cache/modal_once.txt', 0444);
echo '<style>/* The Modal (background) */
(...)