We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Some requirements regarding plugin coding | Forum

dave Leader
dave Apr 22 '16
I am not sure if these are new requirements or not, however since 1.7.5 and now 1.8.2 this is new stuff for me so i wanted to try to help other developers if they get stuck and maybe this might help.  I will try to keep this updated as i discover things :)


So Far:  


It appears that a "classes" folder for listeners is now required. You will need to add a "classes" folder and also add your code into a file inside the classes folder called event_handler.php  and also wrap that code inside the class name of: 


class YOURMODNAME_CLASS_EventHandler


otherwise your listener may not function.  


What i found is that my listener would not function until i added the folder and the file and moved my listener code from my plugin init file to the event_handler file inside my new class name. 



2. It appears that Oxwall is either making some public classes private or simply changing some paths access points.   One part of this i have noticed is with the photo plugin. 


My old call changed in two ways since 1.7.5 to 1.8.2 : 


old code: 


OW::getEventManager()->bind(PHOTO_CLASS_EventHandler::EVENT_BEFORE_PHOTO_DELETE, 'listenForPhoto');


PHOTO_CLASS_EventHandler  is no longer available as public.



New Code: 


OW::getEventManager()->bind('photo.onBeforeDelete', array($this,'listenForPhoto'));


notice that no more is the constant EVENT_BEFORE_PHOTO_DELETE

you will need to refer to the photo event handler file for actual constant values and use those. 

notice they added the $this requirement also


This has been my experience..


So far that is all i have...


 happy coding :)


dave  

dave Leader
dave May 5 '16
When you are doing your updates be sure your calling the OW class and not the Update class in your calls inside your update php file.  It wont find the Update class.  
dave Leader
dave May 10 '16
Speaking of updates when you are doing an update for your plugin you need to think about some of the following. 


Do you have changes to the database, values, fields, tables - add delete or modify?

Do you add anything to the config table for your plugin?

Do you add permissions for your plugin, and do they include guest permissions?

Do you need to add a button to the sidebar for your plugin?

Do you need to add a page for your plugin on the user side, or is it strictly admin panel?


And if you are going to do all or some of these things you need to include them in your update folder.  Here is how the system works for update folders. 


So you have your first version of the plugin version 1.0 Build 1

Inside the update folder of your plugin you should have a folder named 1

The system will look for that folder depending on the build in your plugin xml file. 

BUT WAIT IMPORTANT the folder name cannot be greater than the build number, and it must be greater than the last build. 


If you start off correctly youll be fine. 


Example:  

Build 1    update folder/1 (name of folder inside the update folder)

Build 2    update folder/2 (name of folder inside the update folder)


and so on.... 


But lets say that you have a few updates and you get out of wack. As long as you keep the update folder name inside the update folder

 

greater than the last folder name - and  NOT greater than the build number 


you will be just fine. 


so inside of  pluginname/update you may have folder names 


1

2

5

10


just remember the rule, larger than the last one,  no greater than the current build number. 


Now lets talk about what is inside those folders and why you should leave them there. 


First you should never remove them because if someone is updating from an older version then they will need all those updates to run on their system. 


Now inside those folders there is a update.php file.   Even if you are not going to do anything inside of it just create it anyway  and just put this inside it. 


<?php 


 //nothing 


that way its always there and the system knows you dont want to do anything with it. 


Now also inside that folder is the langs.zip file if you have updates to the plugin language file. 


So what you would do is add this line to your update php file 


$config = OW::getConfig();


OW::getLanguage()->importPluginLangs(OW::getPluginManager()->getPlugin('your plugin name')->getRootDir().'update/the folder name/langs.zip', 'your plugin name');


//nothing further




and then just include the langs.zip in that folder and it will install it during the update. 


We wont cover database updates today but inside your update.php file you also need to include all those things we asked at the start of this post, sql commands and such. 


Hope this helps

The Forum post is edited by dave May 10 '16
dave Leader
dave May 22 '16
I have also realized that when using a upload field you must use the MultiFileField option as for some reason the FileField declaration is not working and i always received a required request on submit. 


So to use the MultiFileField declaration and limit it to 1 file you just do this 


$YourFieldDeclarionName = new MultiFileField('name',1); 


It will then act just like a normal FileField declaration.


Oxwall Germany Club
Oxwall Germany Jul 17 '18
Topic was moved from General Chat.
Anais Merreta
Anais Merreta Mar 30 '21
I just joined the forum so there are so many things I don't know yet, I hope to have the help of the boards, and I really want to get to know you all on the forum.
Getseowebsite
Getseowebsite Feb 5 '22
Thanks for sharing the requirements regarding plugin coding at Oxwall software.
tom curry
tom curry Nov 3 '22

Howdy! I know this is kinda off topic however , I have an amazing website you can check it out and PLEASE ACCEPT MY POST THANKS


<a href=”https://rileyreptiles.org/” rel=”dofollow”>reptiles for sale</a>

<a href=”https://rileyreptiles.org/product-category/alligators-for-sale/” rel=”dofollow”>alligators for sale</a>

<a href=”https://rileyreptiles.org/product-category/pythons-for-sale/” rel=”dofollow”>pythons for sale</a>

<a href=”https://rileyreptiles.org/product-category/turtles-for-sale/” rel=”dofollow”>turtles for sale</a>

<a href=”https://rileyreptiles.org/product-category/tortoise-for-sale/” rel=”dofollow”>tortoise for sale</a>

<a href=”https://rileyreptiles.org/product-category/lizard/” rel=”dofollow”>lizards-for-sale</a>

<a href=”https://rileyreptiles.org/product-category/snakes-for-sale//” rel=”dofollow”>snakes for sale</a>

<a href=”https://rileyreptiles.org/product-category/lizards-for-sale/bearded-dragons-for-sale-near-me/” rel=”dofollow”>bearded dragons for sale near me</a>

<a href=”https://rileyreptiles.org/product-category/lizards-for-sale/iguana-for-sale/” rel=”dofollow”>iguana for sale</a>

<a href=”https://rileyreptiles.org/product-category/lizards-for-sale/uromastyx-for-sale/” rel=”dofollow”>uromastyx for sale</a>

<a href=”https://rileyreptiles.org/product-category/lizards-for-sale/monitor-lizard/” rel=”dofollow”>monitor lizard</a>

<a href=”https://rileyreptiles.org/product/mexican-alligator-lizard/” rel=”dofollow”>Mexican alligator lizard</a>

<a href=”https://rileyreptiles.org/product/american-alligator/” rel=”dofollow”>American alligator</a>

tom curry
tom curry Nov 3 '22

Howdy! I know this is kinda off topic however , I have an amazing website you can check it out and PLEASE ACCEPT MY POST THANKS


<a href=”https://dachshundpuppies.club/” rel=”dofollow”>Dachshund puppies for sale near me</a>

tom curry
tom curry Nov 3 '22

Howdy! I know this is kinda off topic however , I have an amazing website you can check it out and PLEASE ACCEPT MY POST THANKS


<a href=”https://petcoorp.com/” rel=”dofollow”>Dalmatian puppies For Sale</a>

lawofe
lawofe Jan 2
paper roll… keep up your informative writing! At least i have something to look forward too when iam at work!… أهم مباريات اليوم
lawofe
lawofe Jan 7
Gaming desktops are not as problematic as you might assume, and earning your personal gaming personal pc is not as tough as a lot of folks would make you imagine. Given that you by now have a precise software in thoughts when setting up your personal gaming device, there are truly only three most important elements you need to have to be concerned about, and almost everything else is genuinely secondary: the processor, movie card, and RAM. https://roy-rosalyn.com/custom-socks/
lawofe
lawofe Jan 8
You ought to get involved in a contest personally of the finest blogs on-line. I will recommend this page! https://www.sdgicable.com/products-detail/SDGI-100G-QSFP28-Single-Lambda-Optical-Transceive.html
lawofe
lawofe Jan 8
Hello, Neat post. There is an issue along with your website in internet explorer, might test this¡K IE nonetheless is the marketplace chief and a big section of people will pass over your excellent writing due to this problem. PCB board manufacturer in Malaysia
lawofe
lawofe Jan 9
Wow this hit it to the spot we will bookmark on Bebo and also Hub pages thanks Городскую комиссию по землепользованию сменил Мосинвестконтроль | Профессиональные новости | ООО “Белго+” – Двери производства Белоруси. Продажа, установка love it And also my prayers to the people at atomic plant we hope you are OK along with safer too !!! Kudos Financial Advisers led vs hps
lawofe
lawofe Jan 9
Hi there! This is kind of off topic but I need some advice from an established blog. Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about setting up my own but I’m not sure where to start. Do you have any points or suggestions? Thank you https://veymax.com/products/veymax-electric-skateboard-remote-control
lawofe
lawofe Jan 13
Glad to be one of several visitants on this amazing web site : D. UFABETพนันบอลออนไลน์ฟรีถูกกฏหมาย
lawofe
lawofe Jan 14
Hey, you used to write wonderful, but the last few posts have been kinda boring¡K I miss your super writings. Past several posts are just a little bit out of track! come on! Tonic Greens Reviews
lawofe
lawofe Jan 15
Cheap Handbags Wholesale You should think about doing growing this web site to a major authority in this particular market. You clearly contain a grasp handle in the topics so many people are looking for on this website anyways therefore you could indisputably even create a dollar or two off of some advertising. I’d explore following recent topics and raising how many write ups putting up and i guarantee you???d begin seeing some awesome web traffic in the near future. Simply a thought, all the best in whatever you do! FlowForce Max
lawofe
lawofe Jan 15
It’s difficult to get knowledgeable people within this topic, however, you appear to be guess what happens you’re dealing with! Thanks UK FAKE DRIVING LICENCE
Pages: 1 2 3 »