News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Package SDK, anyone?

Started by [Unknown], November 22, 2004, 03:26:37 AM

Previous topic - Next topic

Herman's Mixen

Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

AtariKid

Flag to: AtariKid, nwowatcher

Ha!  Flagged myself and a buddy for future reference.   :P

- noteworthy
Rawk on dude!
SMF 1.1 RC1 | MKP 1.1 Rc1

rudoka

#42
   OK, so I am thinking on writing a package, and I ended up here.
   
   Unfortunately there are very few things on the forum about how to actually write a package or modification. Really, nothing specific.
    While this is a very good start and surely helpful on getting an idea of what a package is, I'm not sure it can help anyone write a complete package (from the scratch).

    Take me, for example. I thought that I did a fairly simple modifications, yet reading this *basic* SDK I can't even start to put my package together.
    Now, maybe I'm being a bit slow, and I the intent behind my criticism is to be constructive.

    So, here are my questions about packaging, with some ideas to include in the SDK. ;)

    First, my veyr first issue was how to modify the database, alter a table in it. I think there are quite  afew mods that add, alter tables in the databes. So it seems it's a quite basic part of a packaging.
    After looking at some already written mods, I found a tag <code> in the package-info.xml.  This is something that is never mentioned in the SDK, and doesn't appears nowhere in the examples. I think it would be a good idea to add it to the SDK, with some explanation on what it does.  (I know that I have to use this to alter the database ;))

    The next issue, would be with the themes, avatars and such. Mainly the themes. My mod is relying mainly on creating a theme. At least half of my modification can be done using a theme, and modifying only one template.
    My question follows. The  <require-file>  just copies the file to the destination or it installs the theme too? Because it seems that simply creating a folder and copying files in the thmees directory doesn't makes the SMF to "see" it as such. It needs to be installed by the SMF, from the admin section.
    So it's not clear to me what is happening there. How can I effecively add (NOT to replace the default!) a theme?


    The third issue, regards the uninstallation. I saw someone mentioning the changings to be reverseable or not. So how can I tell what is "reverseable" and what is not? Knowing a little more on how the uninstallation works, what happens then would be helpful I think.
    Of course following the reveresed logic, I suppsoe that if I search for A and replace with B, then at uninstallation the package system would search for B and replace with A. OK, the same with adding code.
    But let's get back to the database. What if I alter a table in database, with an ALTER query. I guess I should write a "cleanup" code for this.
    So, I think that at least some warnings should be issued about uninstallation already in the basic SDK. And who knows some advanced explanations would not hurt either, maybe in some *advanced* version.


    I refer back to what [Unknown] said in the first post. That this is for package *authors*. Even if I unerstand that "author" is meant as every average joe (making the modding accessible to everyone out there), the a Develompent Kit should be more inclusive.

   As a last thing, before everyone jumps on me. I understand that this is a preliminary version, put together in a hurry(maybe not?), and also understand that it takes time to do such thing.
   So really, I just tried to point out the areas where I'm in difficulty writing the package, and what info could help me (and others) to have an easier job.
   Of course, I do search around and use my head. ;) I wouldn't know what to complain about, if not.  :-\

Respectfully,
Rudolf

Rik©

Well... if you take a good look at the sample package-info.xml and the package-info_advanced.xml you can see a line with the <code> tag.
Quote from: package-info.xml<!-- Installation, the key part of this file. -->
   <install>
      <readme>readme.txt</readme>
      <modification>install.xml</modification>
      <code>add_settings.php</code>
   </install>
And the (example) add_settings.php drops the data into your database....
All can be found in the SDK

Uninstalling the settings/data from the database is not mentioned in the SDK though...

But i know that if you ask for help with your package you will get it asap from [unknown] or SMF (staff-)members


rudoka

oops  :-X
Somehow I missed that one. And the add_setting.php too. Somehow didn't suggested me the name of databases.
I guess I was a little too hasty. My fault.

Still, some explanations on the tags would be handy. Eve if it's a one liner. Just for the folks to know what is what. Maybe a quick-reference in the end?
I still don't know how could I miss that one?  ??? After I saw in one mod I looked carefully the SDK ... and saw nothing.  :'(

Anyway, If things go straight, maybe I can put together my package in the course of this week. Maybe an 0.1 alfa version? haha

Phew, thanks a lot for opening my eyes.  :)

Rudolf

[Unknown]

Packages should also not be used to install themes...

-[Unknown]

rudoka

So, how do I install a theme?
I mean the package it's ready, everything works fine, installs and uninstalls perfectly (on a clean SMF), but it requires that the Display.template.php to be modified for the "thing" to be visible..
  I have two options here. One is to modify the default template file, through the modification.
  The second is to create a new theme, with this file.

  Obviously I like more the second option. I would leave the default as it is, and "install" a new one (as part of my modification, through the package).
  This would makes the things more customizeable, I think. people could still stick with the old "look", if they don't like the new one (won't be forced for all users to use it that way).

So. You can install avatars, smilies, and language files with packages, but you CAN'T install themes??!!  Why is that, what's the problem with the themes?
  Why couldn't the package manager handle themes? It would be possible even to upgrade them.

Rudolf

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

John Slater

QuoteThis tells it what file to edit. Among others, you can use $sourcedir, $themedir, and $languagedir.
<file name="$sourcedir/Subs.php">

   <operation>

      The position attribute should tell the position relative to the code you want to add.
      <search position="before"><![CDATA[
Search for some code to add stuff after.
]]></search>

      The code to add in the described location.
      <add><![CDATA[
This is what to add.
]]></add>

   </operation>

</file>

I have a question about this bit here
Quote<search position="before"><![CDATA[
Search for some code to add stuff after.
]]></search>

Is that a mistake where you have said the search position before, and then said this will search for stuff after?

Just checking because i didnt understand it.

[Unknown]

Search for this code before what I'm about to add:

code

Add:

other code

The search position is *relative to the code being added.*

-[Unknown]

John Slater


Dannii

If the boardmod style is depreciated now, why are the official forum updates in that format?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

codenaught

Well it is a lot easier to read. So I would imagine at least one reason is for someone who may need to install some parts manually that they can read what to do much clearer than the xml format.
Dev Consultant
Former SMF Doc Coordinator

rudoka

Actually, I find the xml format a lot easier to read.  ;)

fragalot

linux works great for gzip files aswell ;)

Elmacik

test_modification.php in this package always returns empty..
i put it to forum directory, any other folders.. doesnt work. returns like this:


results:
1.
Home of Elmacik

JayBachatero

are you sure you are linking to the .xml file that you want to test?  thats what i use when i make mods.  you can try the upload file option.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Elmacik

aha! got it !
i was trying to test packages :P
thanks
Home of Elmacik

nope

At first I was wondering all around: where is this da*n Package SDK?
I ended figuring out that I was browsing the topic as a guest and couldn't see the attachement.
Very confusing...  :o

GC

Do you create this?
url/index.php?package-list&language=blah&ref=their forum

I'm creating a mod site for all my mods and I can't get the thing to connect. How do I make it visible? Can comeonet ell me hte php code or give me an index.php file that reads the XML? I'm a little lazy right now lol.

Advertisement: