![]() |
|
new akismet plugin with php5 classes - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Plugins (https://forum.zenphoto.org/forum-6.html) +--- Thread: new akismet plugin with php5 classes (/thread-9096.html) |
new akismet plugin with php5 classes - vincent3569 - 02-12-2011 hi It seems to work with [8548] : Thanks ! I have another question : I wish to verify the akismet key when the options of the plugin are saved. There is a method of akismet to do that. could you help me ? new akismet plugin with php5 classes - acrylian - 02-12-2011 You would actually need a filter that is called on saving plugin options. Not sure we have one at the moment, but sbillard will know it for sure. Edit: Is probably possible without a filter. Use the OPTION_TYPE_CUSTOM and create a check with in handleOption(). It would then work like 1. Save the key 2. on page reload this function gets that value and checks it. Then you can put out a warning right with the text field. new akismet plugin with php5 classes - sbillard - 02-12-2011 You do not actually have to change the option type. Just add code in the getSupportedOptions() method to check the validity of the key. If it is not valid (and probably also not empty) add the message to the option description. new akismet plugin with php5 classes - acrylian - 02-12-2011 True, why easy if possible complicated...;-) new akismet plugin with php5 classes - vincent3569 - 03-12-2011 thanks sbillard, but could you give me an example how to add code in getSupportedOptions() ? fyi, I have a new methoe of SpamFilter :
` new akismet plugin with php5 classes - acrylian - 03-12-2011 Within getSupportedOptions() call your method and add the text about failure if it fails to the option text itself for example. new akismet plugin with php5 classes - sbillard - 03-12-2011
new akismet plugin with php5 classes - acrylian - 03-12-2011 I guess a wrong key is actually an error. We have serveral predefined class for styling you can use: new akismet plugin with php5 classes - vincent3569 - 03-12-2011 thanks ! the new release of the plugin is ready.
I have to do some testing and I will give it to the community when the 1.4.2 release of Zenphoto will be published. new akismet plugin with php5 classes - acrylian - 04-12-2011 Great. You also could release it as a beta so people interessted could try it before 1.4.2 so possible bugs are sorted out. |