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
Hello World! 2.0 #1296
Comments
This ones good idea @Sama34 |
What do you wanna update? It is really simple plugin, maybe just information in header? EDIT: I see, problem with CSS etc. My bad, I am sorry... |
@Cu8eR @Sama34 |
Bulk of comment lines to make it a mini plugin guidebook? Not a bad idea!!! I've seen complains about MyBB plugin guides many times. Atleast we will have something in core to guide people. |
Thats what 'hello world' is for. Not a big example but something to give easy and whats more important - faultless start without reinventing something that is allready defined. |
I have example function chunks written in my sublime snippets. |
Maybe should outline first what 'hello world' will exacly do. |
@DEMONATE - so you will assignee this to you? |
I vote for removing the plugin and instead improve our plugin docs. |
@JN-Jones - yes, even better solution - many admins just deleted this plugin after MyBB is installed. Personally I have never activated it in last 3 years. Better to spend this time to improve plugin docs |
btw, what happened to docs.mybb.com/sourcedocs/ |
I'm not a collaborator ... |
docs should be improved of course, I already reported some problems internally. But I'd leave the example plugin in the package too. Pirata Nervo's looks a lot better than this one so it can replace the current one, not sure if anything should be added to it (setting peekers with the new hook or whatever). |
@PirataNervo woah, brilliant bull's eye could be not bad idea to rename them to example_plugin_simple and example_plugin_advanced Sure, its true that most of people delete it but thats the ones who arent interested in any moding. |
I'll be adding that back in soon. |
@PirataNervo's references was what was in my mind TBH. A complete example plugin showing the right way to use the plugin system without relying on external libraries, etc. The code in the plugin should be used in the docs and the docs should document what is within the plugin file. No sure about a bunch of comment lines in the file, that is what the docs are for. |
Please give feedback (: |
Nice, for sure better than old hello world. |
/* $db->delete_query('settings', 'name IN (\'hello_display1\',\'hello_display2\')'); // just no, why the 4 escapes when " can be used? */
$db->delete_query('settings', "name IN ('hello_display1', 'hello_display2')"); or: /* eval("\$hello = \"".$templates->get('hello_index')."\";"); // just no, why not use ' or the new render() function? */
eval('$hello = "'.$templates->get('hello_index').'";'); // or
$hello = eval($templates->render('hello_index')); |
About 1: I add/remove my settings always in |
i think the same. Thats exacly why there are activate / deactivate. Else would be only install / uninstall |
Agree with @JN-Jones. If you do it in activate/deactivate you are doing it wrong. Ideally something like what PluginLibrary does should be used for handling updates to settings. But there is no core features for it. We may write some for this plugin only or enhance the core. Also, doing it this way avoids the use of "Disable/Enable this plugin whatever" kind of settings. 4 If we added the 'render()' method then I agree to use it.
I don't agree (kind of) but since it is on our standards I shall update that then, I suppose. |
http://community.mybb.com/thread-161297-post-1110751.html#pid1110751 - exemplary |
Yeah, I kind of guessed it from the beginning. I think it was clear in the internal discussion but yet. |
@Sama34 can you get this in time for 1.8.3? |
I have updated the plugin to implement suggestions, settings now got inserted/updated during activation and removed during uninstallation. Using PluginLibrary approach. It also uses the language system as best as possible in the ACP. Templates are a complicated thing nonetheless. We could also store messages in the cache so that people know how to actually use the cache system. Going to implement an Please suggest what could be enhanced without really adding new or complicated features. Remember this is not meant to be a simple plugin but one that actually teach people what is available there and how to make the best use of them. @mybb/developers @Destroy666x @JN-Jones |
I have added a confirmation page to the uninstallation routine. |
I have added PluginLibrary implementation of the tempalte handling. I need this merged before jumping to anything else so please give feedback if you have any. I have also though about adding an ACP side for managing messages (currently there is not anyway to do so) but that would require a new file (proper way) and that would make it too complicated for just an test plugin. @mybb/developers @Destroy666x @JN-Jones |
IMHO this should be a simple plugin to show how MyBB (and the plugin system) work and not how a plugin works. If someone wants to know how one specific thing works he can look into a plugin which does something similar. Also we shouldn't use PluginLibrary IMHO - it's a nice tool I've used too, but I don't see the point in using it in an example plugin.
Why that? I've never seen a plugin doing that (and tbh I'd never use one doing that) |
Does anyone actually know how to add one? Probably that is the reason no one ever uses it. I have seem only advanced plugind using one, I think it is a nice addition. Also, this doesn't use PluginLibrary, it just uses its was to add a template group and handling settings. |
I don't think the example plugin should cover such rare cases. |
Agreed with @JN-Jones and @stefan-st , never seen anyone adding a confirmation page so I don't think we should show that in an example. It'd be better to introduce it to core for every uninstallation link rather than in several single plugins. Also, found some small issues, will post them later. |
This plugin should show all possibilities - we should leave a confirmation dialog... I dont see any problem with this |
First of all, there is no term "all possibilities" in programming.. Showing "everything" would require an infinite number of code and time, not to mention that noone would use it as an example since it would be longer than all the core files merged into one.. Secondly, I can name many many things that are not part of this exemplary plugin while they're used definitely more often than uninstall confirmations, for instance setting peekers, cookies, AJAX, adding stylesheets, group/forum additional settings and so on. |
@Cu8eR An example cannot cover all possible cases. It should show common things (which are used by a lot of plugins). A confirmation dialog is not common. |
I agree, but why to remove it if it has been already added (yes, it is not common function, it should not be there but it has been already added).. just comment it properly in code and leave it. Thats my opinion. |
Anyways, here are the small bugs I wanted to list few days ago:
|
I have used |
I have updated the confirmation page so if anyone can please confirm this ready to be merged please do so. If removing the confirmation page is required to get this merged then so be it, I just need this tested to merge it. Thanks. |
2 more issues:
if(THIS_SCRIPT== 'index.php')
{
$templatelist .= 'hello_index,hello_message';
}
elseif(THIS_SCRIPT== 'showthread.php')
{
$templatelist .= 'hello_post,hello_message';
}
|
I just forgot what I fixed both issues. |
@Destroy666x not sure about now but before, 16* would be interpreted as any 1.6 version. I believe it's still the same for 18*. |
@PirataNervo , but you wrote it without a dot too, that's what I meant, earlier it was |
Ah sorry I couldn't see that in the link anymore :P |
So are you up for merging this? |
Last thing I'd change:
to a more descriptive:
And maybe the weird huge tabbing of the single array: https://github.com/mybb/mybb/pull/1389/files#diff-2dc20e060a386c409ac7f6f95cc0c623R279 Then I think it can be merged. Anything else (like AJAX) can be added in another PR if needed. |
If that is it then I will merge it now. Thanks. |
I think we need to update the example plugin file provided within the pack. It is very outdated.
PR #1389
The text was updated successfully, but these errors were encountered: