News:

Join the Facebook Fan Page.

Main Menu

Help me with mods

Started by nightware, December 07, 2004, 06:12:56 AM

Previous topic - Next topic

nightware

Hi, I wanna write a mod to add a new feature. I have searched the fora, but found no help.

I have downloaded a few of the mods but I am a bit lost.

Ill use OnLineUsersToday as an example; it has a .mod, a .xml and a .php file. What do they do, and what tags can I use?

Other mods dont have the .mod or .xml .... please help.

Trekkie101

The execute changes to your files and i think the php one is a new file, depends what you want to write though, and how skilled you are in php, it wont harm you to open them and look.

Grudge

.xml - A file telling SMF what to do with the mod (i.e what to apply, copy, move, execute)
.php - Sometimes an additional file on big mods - on most mods the PHP file is used for executing SQL changes to the database
.mod - The actual mod file.

They are all fairly self explanatry once you open them ;)
I'm only a half geek really...

nightware

Trekkie101:

I did, of course :)

From my own simple analysis:

.php: in the mod mentioned above, this file just adds a new field to the database if its not already there.

.mod: this file seems to have some fixed format. It contains info on modifications that need to be made to the existing files.

.xml: this one seems to contain info on the package, presented in a standard format, I guess this is what the package manager displays.

Understanding the files isn't that hard, thats not what I am looking for. I am wondering if the .xml and .mod are autogenerated, and if they are, then how it is done. If not, there might be more tags available than the ones used.... I wonder what they are.

nightware

One more question....

When a mod is applied, changes are made to the code.
Mods can be removed.

Two mods might add code at the same point. Is there some rules when you replace code, or do you just hope for the best?

...One mod might remove some of the code the next one is looking for or insert code at the same point, making it hard to remove the first mod...

Trekkie101

that actually happens with one of the mods as i experienced but the package manager can make backups which call your page that it edit index.php~ and then you have your backup, plus most files can be updated with clean versions.

Grudge

I tend to try and use add before/add after instead of replace where I can so that it doesn't affect other mods. There is another mod syntax which is xml based which is better - but I haven't done any of my mods using it as there were issues about uninstalling it. The xml format allows things like regex, and "end of file" commands. .mod files just have before, after and replace
I'm only a half geek really...

nightware

Quote from: Grudge on December 07, 2004, 07:26:21 AM
<snip> I haven't done any of my mods using it as there were issues about uninstalling it. The xml format allows things like regex, and "end of file" commands. .mod files just have before, after and replace

The Integrated Chat Mod at http://mods.simplemachines.org/index.php?mod=60 is using this method. What is the status on the uninstall issue?

[Unknown]

Package SDK, anyone?

It's already fixed in 1.0 and 1.0 (preview), if I remember correctly.

Obviously, installation order could cause conflicts.  This is true for any system - even plugins.  It's almost impossible to avoid :/.

There are a few different files, actually:

*.php: yes...
package-info.xml: a description of the package.
*.xml: xml style modification files.
*.mod: BoardMod style modification files.

-[Unknown]

Advertisement: