Advertisement:

Author Topic: Package SDK, anyone?  (Read 406702 times)

Offline DarkCloud14

  • Jr. Member
  • **
  • Posts: 172
Re: Package SDK, anyone?
« Reply #80 on: October 19, 2006, 10:53:38 AM »
Ok if someone wants to know how it works here's the solution that JayBachatero told me:

Quote
Use 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

Offline koji

  • Semi-Newbie
  • *
  • Posts: 44
  • Gender: Male
Re: Package SDK, anyone?
« Reply #81 on: October 27, 2006, 11:41:57 AM »
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.
Code: [Select]
<install>
<readme>readme.txt</readme>
<modification>install.xml</modification> // shouldn't be this be: modification.xml ???
</install>

Thanks,

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Package SDK, anyone?
« Reply #82 on: October 27, 2006, 11:49:14 AM »
Quote
Jup 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 :).

Quote
Actually 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)
Quote
Are 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:
Code: [Select]
<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!

Offline koji

  • Semi-Newbie
  • *
  • Posts: 44
  • Gender: Male
Re: Package SDK, anyone?
« Reply #83 on: October 27, 2006, 11:57:04 AM »
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!

Offline koji

  • Semi-Newbie
  • *
  • Posts: 44
  • Gender: Male
Re: Package SDK, anyone?
« Reply #84 on: October 28, 2006, 01:21:02 PM »
I have a few questions:

If adding to the end of a file, should the content of the search tags be left empty?
Code: [Select]
<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?
Code: [Select]
<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,

Offline Rudolf

  • SMF Hero
  • ******
  • Posts: 1,934
  • Gender: Male
  • iamanoompaloompa
Re: Package SDK, anyone?
« Reply #85 on: October 28, 2006, 02:47:26 PM »
You can use this syntax for the "end", which is basically like yours - an empty element:
Code: [Select]
<search position="end" />
<add><![CDATA[
Code to add.
]]>

Code: [Select]
<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)

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Package SDK, anyone?
« Reply #86 on: October 28, 2006, 10:17:07 PM »
Quote
If 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.
Code: [Select]
<file name="$sourcedir/Subs.php">
 <operation>
  <search position="after"><![CDATA[
?>
]]></search>
  <add><![CDATA[
Code to add.
]]></add>

 
Code: [Select]
<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!

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,561
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Package SDK, anyone?
« Reply #87 on: October 28, 2006, 10:20:57 PM »
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

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Package SDK, anyone?
« Reply #88 on: October 28, 2006, 11:32:49 PM »
Quote
daniel15 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!

Offline koji

  • Semi-Newbie
  • *
  • Posts: 44
  • Gender: Male
Re: Package SDK, anyone?
« Reply #89 on: October 31, 2006, 06:07:13 AM »
Thanks,

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

Code: [Select]
<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?
« Last Edit: October 31, 2006, 06:30:10 AM by koji »

Offline Laibeus Lord

  • Semi-Newbie
  • *
  • Posts: 88
  • Gender: Male
Re: Package SDK, anyone?
« Reply #90 on: November 01, 2006, 08:30:45 AM »
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

^^
« Last Edit: November 01, 2006, 09:19:13 AM by Laibcoms »

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Package SDK, anyone?
« Reply #91 on: November 03, 2006, 03:51:56 AM »
koji, I believe that it's $themedir, and not $themesdir ;)

Quote
Oh 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!

Offline Gobo

  • Sr. Member
  • ****
  • Posts: 912
  • Gender: Male
  • Peace Be Upon You
    • Path To Peace
Re: Package SDK, anyone?
« Reply #92 on: November 07, 2006, 07:54:14 PM »
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?
Code: [Select]
<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:
Code: [Select]
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
Code: [Select]
<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

Offline SleePy

  • Site Team
  • SMF Master
  • *
  • Posts: 28,943
  • Gender: Male
  • Thats his happy face.
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: Package SDK, anyone?
« Reply #93 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..
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub
G+

Offline Gobo

  • Sr. Member
  • ****
  • Posts: 912
  • Gender: Male
  • Peace Be Upon You
    • Path To Peace
Re: Package SDK, anyone?
« Reply #94 on: November 07, 2006, 08:02:12 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

Offline ch3ster

  • Semi-Newbie
  • *
  • Posts: 29
  • Gender: Male
    • Battlefieldpirate The MultiGaming Community! BF2,BF2142,ARNA
Re: Package SDK, anyone?
« Reply #95 on: November 16, 2006, 09:02:29 AM »
thankssss thats better....
check ; http:www.battlefieldpirate.nl the best news website ever..
BF2, BF2142, ARMA ; Make an account and support the forum to !

Offline Rasyr

  • Jr. Member
  • **
  • Posts: 170
Re: Package SDK, anyone?
« Reply #96 on: November 18, 2006, 01:23:53 PM »
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....)



Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Package SDK, anyone?
« Reply #97 on: November 18, 2006, 10:51:06 PM »
Quote
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....)
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!

Offline Rasyr

  • Jr. Member
  • **
  • Posts: 170
Re: Package SDK, anyone?
« Reply #98 on: November 19, 2006, 07:21:29 AM »
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).

Offline B Patterson

  • Full Member
  • ***
  • Posts: 512
  • Gender: Male
  • Never Miss an Opportunity to be Great
Re: Package SDK, anyone?
« Reply #99 on: November 20, 2006, 05:47:00 PM »
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.