Customizing SMF > SMF Coding Discussion

Package SDK, anyone?

<< < (46/48) > >>

SoLoGHoST:
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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version