logo

Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
making plugins

i am trying to make a plugin and i have been folowing the Plugins instructions but every time i do it i dont know what code to change or what to put in the admin links and all of that but i am trying to make the draft post any help on how this all works because i have neva made a plugin b4:(
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: making plugins

Admin link is if your plugin requires an admin backend which can be accessed through the Admin area. If it does, inside your plugin folder eg Plugins/pluginname create a folder named Layouts, then add a layout which is the Admin area for the plugin, then state the name of that file in the plugin-info

Please do not PM me requesting support or anything, use the forums, thats what they are here for
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 909
Re: making plugins

this is good, as the theme/mod (any addon) is going through some changes right now, to try and help with things like this, in the meantime, you will want something like the following:
Code:
eocms/Plugins/PM-draft/plugin-info.php:
<?php
$pluginfo_name = 'PM Save Draft';
$pluginfo_version = '0.1';
$pluginfo_layout = '';
$pluginfo_admin = '0';
$pluginfo_admin_layout = '';
$pluginfo_author = 'James';
$pluginfo_author_site = 'http://j4mes1.110mb.com.com';
$tables = false;
$pluginfo_every_page = 0;
$pluginfo_every_page_layout = '';

?>

then you need to work out where the plugin is to be inserted. For PM-draft, this would be a "save draft" button next to "send".

The tricky part (with mod) is that it needs to modify the action of the form, so that the insetad of "sendpm.php" it uses say "savedraftpm.php"

the above can be done a couple of ways, and I'll let you have a play to find out how, just know there are better and worse ways.

"savedraftpm.php" is basically a modified version of "sendpm.php", so start there. You can just drop the code that INSERT that is for the recipient (To: ) . you will also need a "senddraftpm.php" that is the opposite, it makes the PM "not draft" and "sends" it to the correct recipent.

the eoCMS code base is relatively well layed out, the above mentioned pages are in the "functions" folder, your new ones need to be in your plugin folder, in their "functions" dir

you will need to "hack" the eoCMS to get the plugin to work, by that time the new "info" layouts will be finalized and a system of "patching" standard eoCMS "functions" will need to be implemented (but thats after you get it to work)

Umnfortunately you are "ground breaking here", so apart from confuser, and to a lesser degree, myself and say banancanard, their is little or no help, you basically have to persist until you get it to work..

eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 242
banancanardbanancanard@live.com
Re: making plugins

Well, to start you need to figure out what your plugin is going to do.  From there you can move into building it.  If you do not know php/html/etc that well, I suggest building it standalone without using the cms to start with and then integrating it in (which usually does not take that much time).   That is how I make most of my plugins at least.  Once you get a grasp on the language it is just as easy to implement it into the cms first.  If you need another example other then looking at the navpanel plugin code that comes default with eocms I will post the source to some other smaller plugins ive made for own personal things.

"Control yourself. Take only what you need from it"
http://mrrsm.com
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

i have copyed the code over and all that but i still dont know what to change in the coding also if it was a draft message it wouldnt need a admin side would it ?
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 909
Re: making plugins

no, you have to think logically about it.
1) where do you "create a pm" (you need to ad a buuton here)
2) where does the code "sendpm", so you can insert the correct "savedraftpm"

Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

so would that meen that i would have to place the send pm in the same folder as the savedraft pm ?

or would it be in diffrent folders like it is now ?

and i dont think it would need a admin side unless the admins had to conferm the saving of the draft so then i wouldnt have to worry about that

edit:
also what i dont get is what do i change on
Code:
$pluginfo_name = 'Navigation Panel';
$pluginfo_version = '0.1';
$pluginfo_layout = '';
$pluginfo_admin = '1';
$pluginfo_admin_layout = 'Admin.php';
$pluginfo_author = 'confuser';
$pluginfo_author_site = 'http://eocms.com';
$tables = true;
$tables_alter = 0;
$tables_create = 1;
$tables_delete = 0;
$tables_insert = 0;
$uninstall = 1;
$table_create_[1] = "CREATE TABLE navigation_menu (
id int(225) NOT NULL auto_increment,
name varchar(225) NOT NULL,
link varchar(225) NOT NULL,
item_order varchar(225) NOT NULL,
rank varchar(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
$uninstall_[1] = " DROP TABLE navigation_menu";


obv the name and all that but how would i make that in to a save draft along with

Code:
$pluginfo_name : [string] //The name of your plugin!
$pluginfo_version : [version] //The version (0.5.6*)
$pluginfo_layout : [path] //This is the layout file for your function, the file that contains all the display info
$pluginfo_admin : [1/0] //This states whether your plugin has a admin side
$pluginfo_admin_layout : [path] //path to admin layout. Requred if $pluginfo_admin is true
$pluginfo_author : [string] //Your name !
$pluginfo_author_site : [url] //Want free traffic? Put your site here ;)

//As of v0.8.1, you may now tell the CMS to include a layout on everypage by setting

$pluginfo_every_page : 1/0;
$pluginfo_every_page_layout = [path] //Layout file name including file extension


because if it doesnt need a admin file then can u just deleat were it says admin :S

and also it wouldnt need to have a
Code:
$table_create_[1] and $table_create_[2]
would it ?
Last Edit: 5th June, 2009, 03:01:33 AM by James
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 909
Re: making plugins

ummm, see my first post... (it does not show the use of table info, cos in this case you do not need it, its already part of eoCMS default db setup..)

Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

ahh ok it got me confused because it says that is what i have to do on the plugin help guide thing so if i dont need tables will i only need the
Code:

eocms/Plugins/PM-draft/plugin-info.php:
<?php
$pluginfo_name = 'PM Save Draft';
$pluginfo_version = '0.1';
$pluginfo_layout = '';
$pluginfo_admin = '0';
$pluginfo_admin_layout = '';
$pluginfo_author = 'James';
$pluginfo_author_site = 'http://j4mes1.110mb.com';
$tables = false;
$pluginfo_every_page = 0;
$pluginfo_every_page_layout = '';

?>
Last Edit: 5th June, 2009, 03:09:10 AM by James
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

because i dont know if that is the only thing i need or is there more needed to go on it that ?
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: making plugins

Thats all you need in there, to get the drafts you need to do as Paul suggested, think about how you are going to do it and what core files to modify

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

so then would i then need to get the sendpm php thing and then added it to that plugin folder but name make it as a layout using a normal pm message than change it to add another button in so that it allowes it to be saved ?

and would the code be -
Code:

$pluginfo_every_page_layout = [path] //Layout file name including file extension
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: making plugins

No you dont need to have a layout, just modify the sendpm.php function

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

what to then link that with the plugin and make a new image for it so people can save it and then what would it then need in the coding for it allowed to be saved for another time of acsess
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: making plugins

Well you dont need to link it to anything, think about how it can be done. If i was you i would add a new column into pm called draft and then modify the SendPM layout, add a button named save draft, then modify the send pm to set the draft column to 1

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

hhaa sorry for all about me not knowing it all haha i am sure i will get the hang of it after i made afew Smile so by adding a column i then have to get the saved message to get to the column 1


edit also what is the pm file name?
Last Edit: 5th June, 2009, 07:00:24 AM by James
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: making plugins

Layout name is Pm.php, actually instead of modifying sendpm function, add a new function to save draft, name the save draft submit button draft and do a check for $_POST['draft'], if thats posted then do the save draft function

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

so in the save draft folder i should make a new function or do i add it in to the file containing
Code:

<html dir="ltr">
    <head>
    </head>
    <body spellcheck="false">
        <p>/Plugins/PM-draft/plugin-info.php:</p>
        <?php
$pluginfo_name = 'PM Save Draft';
$pluginfo_version = '0.1';
$pluginfo_layout = '';
$pluginfo_admin = '0';
$pluginfo_admin_layout = '';
$pluginfo_author = 'James Patten';
$pluginfo_author_site = 'http://j4mes1.110mb.com';
$tables = false;
$pluginfo_every_page = 0;
$pluginfo_every_page_layout = '';

?>
    </body>
</html>
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: making plugins

inside the folder where that plugin-info file is, create a folder named functions and add the function in there. Remove all the <html> tags from the plugin-info.php

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

removed the html tags and made the folder but what do i put in the coding to go in the functions folder

Jump to:


0.11 seconds Queries: 13