Package SDK, anyone?

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

Previous topic - Next topic

eattheword

Quote from: Arantor on April 20, 2010, 01:28:27 PM
Quote from: eattheword on April 20, 2010, 06:21:55 AM
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.

Quote from: Arantor on April 21, 2010, 06:17:21 AM

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.

Arantor

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.

vinsci

Quote from: Once Upon A Star on April 20, 2010, 01:28:27 PM
Quote from: eattheword on April 20, 2010, 06:21:55 AM
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.

Joshua Dickerson

A lot of it should be added to the wiki and I have added a category for this.
Come work with me at Promenade Group



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?

Zaine

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

SoLoGHoST

#225
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.

Zaine

Thanks.  I could do it with that...   I'll have a go!

Adren

nice help for me, thank you!

antoncbr

Hi! I have lost a bit.... Is it possible to upload my mod to http://www.simplemachines.org/ ?

Elmacik

@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

antoncbr


AlexGt

Hi In this morning I make a avatars package but I do not know how to put on the smf customize
Please help me

NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

AlexGt

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

NanoSector

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 / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: