Forums / Cotonti / Extensions / How hard is it to convert a Joomla Module to Cononti?

fraze
#1 2011-10-05 09:24

Hi

I'm going to be moving my site from Genoa to Siena in the near future, and rather than having to use custom text blocks for some of the data thats shown on the frontpage I want to utilise the plugin framework.

I've found a couple of plugins I want to use, but they are currently Joomla based.  I've checked the PHP of these plugins and it doesn't appear to be massively complicated, however I'm a total PHP newb and am not sure how i'd go about converting them over to work with cotonti's framework.

Would anyone be willing to lend a hand or some in-depth advice?

Thanks

Dyllon
#2 2011-10-05 15:08

Hey there,

It's nice to see someone taking interest in learning how to convert plugins on their own, rather than beg for them to be created. I'll lend all the help I can if your willing to learn. Not too long ago I created a template for plugins (for my own convenience) and I find that it helps getting started.

Blank Plugin - Use this as a basic a guideline

I wish I could provide you with more, but without knowing what your looking to make.. it's kind of hard cheeky Also remember.. as a beginner you will face a lot of trial&error.. dont let it discourage you if you have to try multiple times. Everyone started as a beginner.

We are what we repeatedly do. Excellence then, is not an act, but a habit.
GHengeveld
#3 2011-10-05 21:12

Also, have a look at this: http://www.cotonti.com/news/community/cot_dev_tools_12

I'm not familiar with the Joomla plugin architecture, but if plugins don't have too much Joomla-specific stuff in them it shouldn't be hard.

Can you provide a link to one of the plugins you want to convert?

fraze
#4 2011-10-06 09:59

Hi Guys

Thanks for the responses & offer of help.

I've had a look at the sctructure of the Joomla packages and they are pretty different from the Cotonti structure.  A lot of the info is contained with an XML file, and the php files are pretty basic.

here's the 2 plugins i've been given permission to convert:

http://www.cotonti.com/datas/users/mod_wow_class_search-1.4.5_496.zip

http://www.cotonti.com/datas/users/mod_wowboss_j17_2.1.1_496.zip

Any help would be greatly appreciated.  i'll have a look at the plugin converter as well.

Cheers

Dyllon
#5 2011-10-07 03:02

I'm browsing through the second module you posted, mod_wowboss, and it clearly wont be a simple copy/paste. As you said before, it does seems as though this module is strictly outputting most of the data through an xml file. I can think of several ways that you can accomplish what this plugin is looking for off the top of my head.

  1. Create a new SQL file, and create the following tables
  • wowboss_area
  • wowboss_monster
CREATE TABLE IF NOT EXISTS `cot_wowboss_area` (
	`id` INT(12) NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(24) NOT NULL,
	`type` INT(12) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `cot_wowboss_monster` (
	`id` INT(12) NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(24) NOT NULL,
	`status` INT(12) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Use this as a template. I haven't played WoW in nearly 4 years so I have no idea what columns you will need.

  1. In the same SQL File, insert the data using this:
INSERT INTO `cot_wowboss_area` (`name, type`) VALUES ('BOSS_NAME, 10 or 25');

That should do it for your SQL file. Now you need to create the rest of the plugin. You will need a php file for administrations tools (refer to contact plugin -> contact.tools.php). Then you will need a php file to output the information to your index page (refer to the tags plugin -> tags.index.php).

In your admin tools you will need to set it up so you can modify the values you created through your SQL file, and with your index page you need to set it up to display the values from the SQL file.

As I said before; I'll lend a helping hand, but I would like for you to give an honest attempt at it first. The best way to learn is analyzing another developers code. Eventually you will pick up/understand what is going on.

We are what we repeatedly do. Excellence then, is not an act, but a habit.
fraze
#6 2011-10-10 10:20

thats awesome, i'm going to give the conversion a go this week.

Mynt
#7 2011-10-17 13:28

Fraze,

If you are working on a WoW suite for cotonti I can help you out. I have created 90% of the ports we use for our guild side. Sadly because I work in certain areas I cannot give the URL out.. however I can help you on this project if needed. Just let me know.

 

-M

"I only sleep when I know I won't miss a thing."
fraze
#8 2011-10-18 07:45

Hi Mynt

Any kind of help would be greatly appreciated :)

i'll PM you

thanks