Advertisement:

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

Offline eattheword

  • Semi-Newbie
  • *
  • Posts: 11
Re: Package SDK, anyone?
« Reply #220 on: April 30, 2010, 02:22:56 PM »
Can someone tell me where this 'test_modification.php' script can be found please?

In the only attachment in the first post of this thread?

Umm, thanks. I've only been a member of a couple of SMF forums before and neither of those had attachments activated so it never crossed my mind that such a thing was available. Of course, now I know what to look for I see the OP does, indeed, have an attachment which I have now downloaded.


FFS

Seriously you like this thread but you didn't bother to actually LOOK AT THE ATTACHMENT IN THE FIRST POST?


Charmed, I'm sure, but perhaps this other user, like me, was simply not aware that you could have attachments on posts. We all learn and we all have to start somewhere.

Offline Arantor

  • SMF Friend
  • SMF Legend
  • *
  • Posts: 58,417
Re: Package SDK, anyone?
« Reply #221 on: April 30, 2010, 02:27:31 PM »
I got annoyed because RIGHT AFTER I said where to look, the other person asked where to look. Had they actually read the post immediately before their own they'd have seen the answer.

Offline vinsci

  • Newbie
  • *
  • Posts: 1
Re: Package SDK, anyone?
« Reply #222 on: June 26, 2011, 10:35:33 PM »
Can someone tell me where this 'test_modification.php' script can be found please?

In the only attachment in the first post of this thread?

Note that the attachment is only visible if you are logged in to the forum.  IMHO, though, the package-sdk file is important enough to make it available in the downloads area as well, where it would be a lot easier to find to begin with.

Offline Joshua Dickerson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,663
  • Gender: Male
    • joshuaadickerson on LinkedIn
Re: Package SDK, anyone?
« Reply #223 on: June 26, 2011, 11:56:39 PM »
A lot of it should be added to the wiki and I have added a category for this.
Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Offline Zaine

  • Semi-Newbie
  • *
  • Posts: 27
    • Tales of Freeloading
Re: Package SDK, anyone?
« Reply #224 on: August 22, 2011, 06:14:22 PM »
Feel like I'm getting my head around this now.  2 Questions though. 

1) In an <operation><add></add></operation> CDATA section are you able to add variables in there?

I'm modifying an ini file that comes with a 3rd party library and I want to write out the SMF connection details into it so the application uses the SMF database, rather than having to set up another DB by hand.   I'm assuming you can't just put $db_name or {db_name} in the middle of a CDATA section though.  (It tried using $db_name and it does weird things!

2) The above ini file I'm wanting to modify is being added by a <require-dir> earlier on.  The tests performed on the package however fail because they are executed before the directory is unfolded into the target directory.  Is there any way around this?

I hope I'm not doing something really dumb here, but help would be appreciated :D

Offline SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,697
  • Gender: Male
  • I had a dream & it was Dream Portal! :)
    • Dream Portal
Re: Package SDK, anyone?
« Reply #225 on: September 16, 2011, 12:01:58 PM »
Ok, correct me if I'm wrong here, but you are requiring a directory within your package and than you want to edit a file that is in the directory after the directory is added to their server??  If yes to both of these, than you don't want to use any <operation> tags for this.

Within the package-info.xml file, create a <code>your php filepath that gets executed</code> tag.  Within this file...

Use file_get_contents to open up the file.

Than use file_put_contents to write whatever you want to the file.  You can get the prefix by using the $db_prefix from Settings.php.  Or you can use {db_prefix} to be written to that file as well.

Atleast, this is the method that I would try first, and not sure if the order matters, but you can place the <code> tag at the bottom within the <install> tag.  You can do a test to see if the file exists before you try to read from it, using file_exists(path to the ini file), within your php file that gets executed within the <code></code> tag of package-info.xml.

Well, that would be my first approach to trying to do this atleast.  Haven't tested it, but seems likely to work if the ini file is included with your package...

Good Luck.

P.S. - Ofcourse, you can create an entirely separate package altogether and than do it your way.  But the user would need to install 2 packages to get it functioning properly.

EDIT:  Opps, didn't realize how old this post actually was....  Well, hope it helps anyways.
« Last Edit: September 16, 2011, 02:37:26 PM by SoLoGHoST »

Offline Zaine

  • Semi-Newbie
  • *
  • Posts: 27
    • Tales of Freeloading
Re: Package SDK, anyone?
« Reply #226 on: September 25, 2011, 10:36:58 AM »
Thanks.  I could do it with that...   I'll have a go!

Offline Adren

  • Semi-Newbie
  • *
  • Posts: 44
  • Gender: Male
Re: Package SDK, anyone?
« Reply #227 on: February 25, 2012, 04:30:47 PM »
nice help for me, thank you!

Offline antoncbr

  • Newbie
  • *
  • Posts: 2
Re: Package SDK, anyone?
« Reply #228 on: May 30, 2012, 12:55:53 AM »
Hi! I have lost a bit.... Is it possible to upload my mod to http://www.simplemachines.org/ ?

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,247
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Package SDK, anyone?
« Reply #229 on: May 30, 2012, 01:50:25 AM »
@antoncbr, welcome to SMF!

See the Modifications Page to upload your mods for SMF and browse the others' mods. After your modification is inspected against Customization Approval Guidelines and is accepted to be approved, then it will be available for anyone to download from simplemachines.org. So you'd better check the guideliness before you submit your work.
Home of Elmacik

Offline antoncbr

  • Newbie
  • *
  • Posts: 2
Re: Package SDK, anyone?
« Reply #230 on: May 30, 2012, 10:44:40 AM »
Thanks a lot !

Offline AlexGt

  • Newbie
  • *
  • Posts: 2
Re: Package SDK, anyone?
« Reply #231 on: September 23, 2012, 04:18:21 AM »
Hi In this morning I make a avatars package but I do not know how to put on the smf customize
Please help me

Offline Yoshi

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,429
  • Gender: Male
Re: Package SDK, anyone?
« Reply #232 on: September 23, 2012, 06:30:09 AM »
Hi In this morning I make a avatars package but I do not know how to put on the smf customize
Please help me

http://custom.simplemachines.org/mods/index.php?action=postmod;sa=new :)
My Mods / Mod Builder - A tool to easily create mods

Offline AlexGt

  • Newbie
  • *
  • Posts: 2
Re: Package SDK, anyone?
« Reply #233 on: September 23, 2012, 09:54:14 AM »
Thanks but say : Warning: this mod is currently not approved!
Please do not use this mod unless you are completely sure of the consequences!

What can i do ? and to people say Sorry but no mod was found
Sorry for bad english... http://custom.simplemachines.org/mods/index.php?mod=3475

Offline Yoshi

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,429
  • Gender: Male
Re: Package SDK, anyone?
« Reply #234 on: September 23, 2012, 10:41:58 AM »
People like me (Customizers) will need to check over your mod and approve it before it gets visible - I can see and interact with it, and send you PMs about it. You will receive one soon.
My Mods / Mod Builder - A tool to easily create mods