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

Creating Form in Custom Plugin [ Plugin development needed] | Forum

Ryan P
Ryan P Jun 20 '16
Hey everyone,
I created a custom plugin following Alia's guide from a previous post on this forum.
I have little coding skills, & Dave has done a wonderful job walking me through the steps to customize it. I have now created user roles for the plugin/page. He also gave me a rundown on rules & protocols for files and language, as well as introducing me to the skeleton plugin.

I don't want to bug him & wanted to post this public to help others in similar situations, but Dave you are more than welcome to chime in.
I am looking to simply make an editable field with a table for content that will be updated daily. I will then grant access to specific users to have the ability to edit the table. Can anyone provide the necessary steps to create this in my custom plugin? Thanks in advance
The Forum post is edited by Aliya Nov 25 '16
dave Leader
dave Jun 20 '16
You said before that you had my gif plugin as a guide, it has a form on it. If you look in the gifaction file in controllers you will see the form setup,  also in the views controllers is the html part of that form.  


controllers folder is for site pages and admin pages, components folder is for widgets and component features. 


you will also need to set up your database and put the sql db code  in your install folder

the bol folder is for the db stuff. 


There should be a php file for every table of your plugin and also a dao file.  The php file has a list of the fields in the table and the dao file is where you do all your queries. Then you need a service.php file as the go between. The path for data is like this. 


page php file call a function in the service file, the service file calls the function in whichever dao file (if you have multiple tables) and then its passed back to the page in reverse. 


look at the bol folder in the slideshow plugin, its a perfect example.  they have one table and so they have a slide php file, slide dao file and service file.  thats how you need to set it up. 



The Forum post is edited by dave Jun 20 '16
Ryan P
Ryan P Jun 20 '16
Dave, if you drink then I owe ya a beer! If not, then hopefully a good ol thank you will work. Man, you are doing a great job at breaking things down for me and I truly appreciate it. I'll give this a shot & continue to use your plugins as my point of reference. Thanks again!
dave Leader
dave Jun 20 '16
Your welcome,  :)  


no i dont drink but thanks 

just dont use my free language cleaner for refererence, cause at that time i was new and really didnt know about the dao file and stuff so i didnt make the other files just the service file.  but its on my list to fix it next time i update the plugin.  

ross Team
ross Jun 20 '16
Topic was moved from General Questions.
Ryan P
Ryan P Jun 21 '16
Hello Dave & friends,

My frustration continues lol. Being new to this & eager to learn as much as I can about development, I have bitten off much more than I can chew. Dave has been very helpful & I greatly appreciate it, but the language & vernacular is as foreign to me as any other language outside of my native tongue.

Besides creating a custom plugin to accomplish having an editable field for content with user roles/permissions to edit said field, is there any alternative to this?
-  Can I use this instead (Anon's Pages Extened), but can the content be edited on the user side? https://developers.oxwall.com/store/item/278#
-Is it possible to create a 2nd blog, then simply assign these users to edit?
-Is it possible to take any other unused plugin or form and make it an editable dialog box with user submitted content?

I'll continue to dive into the code & I'm sure eventually I will figure this out. Thanks to everyone for the help
 
dave Leader
dave Jun 21 '16
So you are basically doing a mini blog or what?  Im not sure i understand the full scope of your plugin exactly.  Why would users edit a field every day.  Is it like a message of the day or something. 
The Forum post is edited by dave Jun 21 '16
Ryan P
Ryan P Jun 21 '16
I am creating a page where 5 or 6 assigned users will recommend their top fantasy baseball (or football) picks for that day. This content will change,with new players being added to their list each day. It is to benefit the other users who visit for fantasy sports advice, but not intended for them to edit.

*Edit: The format will be similar to a table, where user A is in the first column and his players are ranked 1-9 . User B is in the 2nd column and does the same. So each user can have the opportunity to login throughout the day and edit their column
The Forum post is edited by Ryan P Jun 21 '16
dave Leader
dave Jun 21 '16
I dont want you to stop trying to learn ok,  we need more good plugins and devs that will take care of their customers.  So here is what ill do if you want.  Send me what you have and ill finish it up for you free as long as its not a large job.  It sounds like your almost there so it should not take me that long.  


You can have all the rights, im not holding anything that way.  I just want you to look at it and say 'oh thats how you do that'.  And then learn some more.  I dont normally do this kind of thing because im very busy but this is the one freebee ill give ya and ill do it so you can learn if you want. :)

Ryan P
Ryan P Jun 21 '16
Thanks Dave!
I appreciate that, and you are spot on with your assessment, as I do want to continue to learn & be able to develop on my own. I feel like I've already made significant progress through our conversations.
You do not have to complete this for me. I've already had many "oh that's how you did that" moments just looking over your plugins. My issue is not identifying what I did correctly, but where I possibly went wrong. Rome wasn't built in a day, neither should my plugin with me learning to do it.
dave Leader
dave Jun 21 '16
turn your debug on and leave it on, then use the free extreme cache plugin to clear your cache when you need to. It makes it better than having to change between dev mode and debug all the time.  Just leave debug on and when you want to clear the cache use the plugin. 


is the search utility helping you ?


Ryan P
Ryan P Jun 21 '16
Yes, debug is off and I constantly clear the cache. The search utility works well, much better than what I was doing before going through each file. When using the skeleton plugin & using the notes you have provided me, my issues range from the input of data to knowing what communicates with what. Because this is so new to me, I don't understand the protocol and logic within the language and algorithm. I'm zigging instead of zagging, so bear with me guys!

*Edit: I'd also like to add that Alia's step-by-step process to create a custom plugin with designated user roles was perfect for the level that I am at. I am able to do this process now without looking at the post. Are there any other step-by-step guides like this that I can find regarding plugin customizations?
The Forum post is edited by Ryan P Jun 21 '16
dave Leader
dave Jun 21 '16
Not that i know of, but you said debug was off, turn it on and leave it on while you develope.  Also clear and check your ow_log folder often. keep it clean that way you know if there is a new error it will have stuff in it.  Just sel all and del and save 


its the same as any other php process, you have a userside html, a server side php, and then the db process.  


do you have a specific question and i will thy to help you grasp it 

Ryan P
Ryan P Jun 21 '16
Sorry, meant dev mode off and debug on. I will go through my process and see if I can figure this whole thing out. Thanks again
The Forum post is edited by Ryan P Jun 21 '16
dave Leader
dave Nov 21 '16
Ryan are you still seeking a custom form