News:

Wondering if this will always be free?  See why free is better.

Main Menu

Package SDK, anyone?

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

Previous topic - Next topic

DarkCloud14

Quote from: GTSdll on June 30, 2006, 04:50:36 AM
Quote from: DarkCloud14 on March 01, 2006, 07:16:47 PM
Ok if someone wants to know how it works here's the solution that JayBachatero told me:

QuoteUse error="skip" like this
<file name="$languagedir/Modifications.{language}.php" error="skip">

Is there a way to do that on the old modification format (boardmod) too?
If not, does SMF 1.0.x understand the new format?

Jup at least 1.0.5 and up understand the new format for previous version it should work too but I'm not sure

koji

In the example package-info.xml file, there is some <uninstall> tags.

Are we meant to create a reversal of the modification.xml file? If so is the file meant to be called uninstall.xml?

Actually are we meant to create an install.xml file ? It wasn't mentioned anywhere.

<install>
<readme>readme.txt</readme>
<modification>install.xml</modification> // shouldn't be this be: modification.xml ???
</install>


Thanks,

Daniel15

QuoteJup at least 1.0.5 and up understand the new format for previous version it should work too but I'm not sure
Any version from the SMF 1.0 betas, actually... The first version I tested it with was SMF 1.0.1 :).

QuoteActually are we meant to create an install.xml file ? It wasn't mentioned anywhere.
You only need the XML file if you make any changes to the SMF files. You can call the modification XML file whatever you want, it doesn't matter (the only file with a predefined name is package-info.xml). So, you could name it install.xml, or modification.xml. For SMFShop, I have three files: install_SMF1-0.xml (SMF 1.0), install_SMF1-1RC1.xml (SMF 1.1 RC1) and install_SMF1-1RC2.xml (SMF 1.1 RC2 and RC3)
QuoteAre we meant to create a reversal of the modification.xml file?
No, you don't need to. In the uninstall section, have a tag like:

<modification reverse="true">install.xml</modification>


This essentially does the modification in reverse, undoing all the changes :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

koji

Thanks for the swift reply,

Ah I think I get it.  So you are saying that the uninstall file is the same as the install file, and it automatically reverses whatever actions took place during installation.

Cool!

koji

I have a few questions:

If adding to the end of a file, should the content of the search tags be left empty?

<file name="$sourcedir/Subs.php">
<operation>
  <search position="end"></search>
  <add><![CDATA[
Code to add.
]]></add>


If I want to add a folder of images where should I add it and how? I want the images to be available to all themes.

Would this package-info.xml tell the parser to copy all files in the package (except for readme, install and package-info) into a folder called signs in the forum root?

<type>modification</type>

<install>
<readme>readme.txt</readme>
<modification>my_mod.xml</modification>
<require-dir name="signs" destination="$boarddir" />
</install>

Or do I have to specify one file at a time?
Should I have my image files in a folder in the package archive? Or should all the files be loose?
Should images be installed into a theme specific folder or the forum root?

Finally, if a theme must be edited to view my mod, should I leave it to the user? Or should I include operations in the install.xml file to edit the current theme?

Thanks,

Rudolf

You can use this syntax for the "end", which is basically like yours - an empty element:
<search position="end" />
<add><![CDATA[
Code to add.
]]>



<require-dir name="signs" destination="$boarddir" />
will copy directory and all it's content to the specified path.


You should copy the images in the default theme's images folder, and use the $settings['default_images_url'] variable.

Finally the most logical thing would be to modify the default theme, and write a readme for modifying other themes. The default theme, is the only theme you can be sure everyone has.
If you have the time you can create the modified files for other themes and make them available for users, but in separate places, the same with languages. It is antipathetic to download a bunch of things I don't need and want.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Daniel15

QuoteIf adding to the end of a file, should the content of the search tags be left empty?
Well, if you're modifying a Source file, you'd want to put the modification above the ?> tag.

<file name="$sourcedir/Subs.php">
<operation>
  <search position="after"><![CDATA[
?>
]]></search>
  <add><![CDATA[
Code to add.
]]></add>



<require-dir name="signs" destination="$boarddir" />
Will copy a 'signs' directory from the archive into the board directory (so signs/test.png in the archive ends up at {$boarddir}/signs/test.png).
Like Rudolf said, the images should be in the default theme images folder. If you like, put your images in a subdirectory (eg. Themes/default/images/signs). It just keeps things more organised :)

Almost all mods only modify the default theme. Usually, you'd write instructions on how to modify the themes, or the user would have to look in the XML file to see how to do it (or just upload the XML file to http://server.daniel15.com/smf_xml/modification.php?action=file and look for theme stuff :))

Hope this helps you :D
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

JayBachatero

daniel15 the <search position="end" /> will add the data before the ?> ;).
Follow me on Twitter

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

Daniel15

Quotedaniel15 the <search position="end" /> will add the data before the ?>
Oh, OK, I didn't know that... I guess the Package Manager is smarter than I thought :P
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

koji

#89
Thanks,

However I cannot get the Package Manager to copy my images! The images never get extracted anywhere.


<install>
<readme>readme.txt</readme>
<modification>zodiac_starsigns.xml</modification>
<require-dir name="zodiac" destination="$themesdir/images" />
</install>


I've also tried $themesdir/default/images

EDIT:

OK I've got it to work using an absolute path. e.g.

<require-dir name="zodiac" destination="$boarddir/Themes/default/images" />

Is that the correct way to do it?

Oh and when uinstalling, that folder is not deleted.  Is that right?

What is the dynamic path to my images? Or should they be hard-coded to the default theme fodler?

Laibeus Lord

#90
How do you make it so that a package will edit all available themes installed??

Thanks.

UPDATE: nev mind, found it... I still have the package-info named package-info-advanced.php

^^

Daniel15

koji, I believe that it's $themedir, and not $themesdir ;)

QuoteOh and when uinstalling, that folder is not deleted.  Is that right?
I think it should be deleted, but I'm not really sure...
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Gobo

Hi,

Im having a bit of a problem - hopefully someone can help me out.
Instead of storing the images in the theme directory I want to create a folder in the forum root and call all the images from there so that all themes can use them with ease.

Now wold this work?

<readme>readme.txt</readme>
<modification>modification.xml</modification>
<create-dir name="religiontabs" destination="$boarddir" />
<require-file name="Agnostic.png" destination="$boarddir/religiontabs" />
<require-file name="Athiest.png" destination="$boarddir/religiontabs" />


Also now the main problem that arises for me is I dont know how to specify the location for the images which are to be displayed in the profile template....currently my older mod uses this:

echo '
   Way of Life: ', $message['member']['options']['profile_way_of_life'] , ' <img src="', $settings['images_url'], '/', $message['member']['options']['profile_way_of_life'], '.png" /> <br />';


Now can someone please tell me how I will change the

<img src="', $settings['images_url'], '/', $message['member']['options']['profile_way_of_life'], '.png" />

part to pick the images up from the $boarddir/religiontabs

Thanks
Aku

SleePy

the themes have a setting that goes to the default images:
$settings['default_images_url']

Very handy. I use it on my customized themes to save some space on images..
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

Gobo

Quote from: SleePy on November 07, 2006, 08:00:44 PM
the themes have a setting that goes to the default images:
$settings['default_images_url']

Very handy. I use it on my customized themes to save some space on images..

nice :D that should work perfectly - ill just store the images in the default and use the method u gave :D

Thanks

ch3ster

check ; http:www.battlefieldpirate.nl the best news website ever..
BF2, BF2142, ARMA ; Make an account and support the forum to !

Rasyr

Question

What could cause a Package to install zero byte files? The files in the zip are not zero byte, but it creates zero byte files for the two files involved.

Any help would be appreciated. If you are interested in checking out the Package I am having problems with, you can download it from here --> http://www.wizlair.net/index.php?action=tpmod;dl=item32  (Thantos gave me permission to update/improve it, and distribute it - just have to solve the Package problems....)



Daniel15

QuoteWhat could cause a Package to install zero byte files? The files in the zip are not zero byte, but it creates zero byte files for the two files involved.

Any help would be appreciated. If you are interested in checking out the Package I am having problems with, you can download it from here --> http://www.wizlair.net/index.php?action=tpmod;dl=item32  (Thantos gave me permission to update/improve it, and distribute it - just have to solve the Package problems....)
If you're using SMF 1.1 RC1, it's a known bug (upgrade to SMF 1.1 RC3)
Otherwise, is the directory it's trying to write to CHMODded to 0777?
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Rasyr

I am using 1.1 RC3.

This happened on both my local machine and on one of my websites (a website that installed new pages for other mods without problems).

B Patterson

In the test_modification.php file, when dealing with template type stuff, it can cause the <pre> code to break the HTML.  In an effort to keep it right, here's a fix for it.

Around line 90 you change this:

	
	
	
	
	
<
pre style="width: 98%; overflow: auto; border: 1px solid red;">', $action['search'], '</pre></li>';


To:

	
	
	
	
	
<
pre style="width: 98%; overflow: auto; border: 1px solid red;">', str_replace('<', '&lt;', stripslashes($action['search'])), '</pre></li>';


It also takes away the slashes that make it not look like what you're searching for.

Advertisement: