Advertisement:

Author Topic: [Tutorial]Easy way to make a simple plugin !  (Read 5576 times)

Web-Media

  • Sr. Member
  • ****
  • Posts: 453
  • Web
[Tutorial]Easy way to make a simple plugin !
« on: September 07, 2013, 08:31:12 pm »
Hy everyone . y've tryed to put some things on  this tutorial hope it helps.
Here is some steps to make a  simple plugin to insert some data into database and display on item page.!
Step 1. 
Make a new folder . folder name can be anything , but it is better to keep folder name same as plugin name for   easy acces..
Inside  the folder we need some files.
index.php
is mandatory is the core of the plugin
struct.sql
(if  you wanna insert something into database.. supose we want to create  new table and some fields then        this file is  needed. can have any name
Plugin_1.php
Can have any name.. dont forget  to call the  file by it's name :)
Will have inside a  class to interact with the database,this class will extend  existing DAO class for (Dao class has  his methods and  we can use it as  is already defined).
edit.php
will hold some  input fields needed for  insertind and editing,can have any name.
detail.php
will  be called in item page  to display the  data  saved  before into the database,can have any name
.
Step 2.
inside index.php
Code: [Select]
/*
Plugin Name: Plugin_1
Plugin URI: http://www.yyyyyy.com/
Description: This plugin extends a Item to store some atributes
Version: 1
Author: Web-Media
Author URI: http://www.yyyyyy.com/
Short Name: plugin1

*/
Plugin Name: Plugin_1 (  can be altered .. as your needs... but it is better to keep )
folder name and plugin  name related.
Short Name: plugin1( is important. this is what the script will  look for)

comments inside the each  file  in  plugin (see second post)
« Last Edit: September 07, 2013, 10:28:31 pm by Web-Media »

Web-Media

  • Sr. Member
  • ****
  • Posts: 453
  • Web
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #1 on: September 07, 2013, 08:31:58 pm »
Simple plugin Download here
« Last Edit: September 07, 2013, 08:37:52 pm by Web-Media »

mrdecoder

  • Full Member
  • ***
  • Posts: 124
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #2 on: September 07, 2013, 11:12:16 pm »
thanks ill go study ;D

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #3 on: September 08, 2013, 01:41:24 am »
Thanks Web-Media, very informative tutorial!

lexosc

  • Sr. Member
  • ****
  • Posts: 344
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #4 on: September 08, 2013, 02:10:22 am »
Thank you!

strata

  • Sr. Member
  • ****
  • Posts: 411
  • Always good, always...
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #5 on: September 13, 2013, 04:50:09 am »
Thank for good tuts, I'm learning to make plugin for Osclass community but confused step by step and you make it more easy to learn :)

sajib123

  • Newbie
  • *
  • Posts: 2
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #6 on: October 25, 2013, 03:37:44 am »
Hello ,

I use your plugin it's really good.

itep_post page I need to use Your plugin first then Load custom Filed.

Code: [Select]
if($edit) {
                          ItemForm::plugin_edit_item();
   
                        } else {
                            ItemForm::plugin_post_item();

                        }
                        ?>

Showing me Custom filed first plugin later.
But i want to use - Plugin first than custom field.

I need your help please help me.

Thanks and regards
Shahadat

Web-Media

  • Sr. Member
  • ****
  • Posts: 453
  • Web
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #7 on: October 25, 2013, 04:59:54 pm »
More tutorials to come in 1-2 weeks.glad was helpfull

xxxgoodkillaxxx

  • Newbie
  • *
  • Posts: 44
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #8 on: October 30, 2013, 04:02:22 pm »
Thanks web-media for this tutorial!

Hussard (Madhouse)

  • Full Member
  • ***
  • Posts: 214
  • Outlaw web developer & padawan designer.

anarosa

  • Jr. Member
  • **
  • Posts: 57
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #10 on: January 16, 2014, 05:08:00 pm »
Hi Web-Media,

i was use yout tutorial for my new Plugin. But I cant connect to the database.

http://forums.osclass.org/development/daoproblem-change-from-getconnection()-to-dao-gtdata-from-googleapi/


I don't know, how insert the data, when they comes from outside like API and not from post.  :(

Can you briefly explain it please.

Regards Anarosa

Roberto

  • Newbie
  • *
  • Posts: 46
Re: [Tutorial]Easy way to make a simple plugin !
« Reply #11 on: January 17, 2014, 12:31:05 pm »
Thank U!  :)