News:

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

Main Menu

[TIP] Customising the mod installation messages

Started by Dannii, June 22, 2009, 12:52:44 PM

Previous topic - Next topic

Dannii

When you install a mod the package manager finishes by saying:
QuoteThe package was installed successfully. You should now be able to use whatever functionality it adds or changes; or not be able to use functionality it removes.

Which is all nice and informative, and boring.

But luckily, it's not hard to change!

In your install.php script (loaded with <code> or <database> in package-info.php) you can easily change this. The simplest way is to just change that language entry, like this:

<?php

$txt
['package_installed_done'] = 'MY-AWESOME-MOD has now been installed! :D';

?>


But you can do a lot more than that. Using SMF's template system you can actually change the entire page's display. My Pretty URLs mod does this. From "Output a success message" to the end of the file is some code that loads the new template and language file, and replaces the existing package manager subtemplate with a new one. In addition, it adds a basic html template for when the install.php file is run stand alone rather than in the package manager. Feel free to copy and adjust this code for your own mods.

Why would you do this? Firstly, so you can make your mod special and unique right from the installation. Secondly, you could offer them some further documentation or suggestions. But probably the most important is to be able to do all of that, while also adding a link to your mod's control panel. Show them where it is as soon as they've installed the mod!
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

[Core]


Advertisement: