Manual installation of mods: Difference between revisions From Online Manual

Jump to: navigation, search
({{Cleanup html}})
(Originally written by A.M.A)
Line 1: Line 1:
{{Cleanup html}}
{{Cleanup html}}
Originally Written by A.M.A.
Mods are installed on the default theme's template files. It is hard for a Mod's author as well as a [[Theme] creater to make Mods work with other themes especially if they have several of their own template files. When a template file is not found in a custom non-default [[Theme] the [[Theme] will rollback and use the default theme's template file. But for the template files that the custom [[Theme] does use, you will need to manually install the mod on to your custom themes template files if the mod edited the same template file in the default theme. To apply a Mod to any [[Theme] manually use the following steps.
Mods are installed on the default theme's template files. It is hard for a Mod's author as well as a [[Theme] creater to make Mods work with other themes especially if they have several of their own template files. When a template file is not found in a custom non-default [[Theme] the [[Theme] will rollback and use the default theme's template file. But for the template files that the custom [[Theme] does use, you will need to manually install the mod on to your custom themes template files if the mod edited the same template file in the default theme. To apply a Mod to any [[Theme] manually use the following steps.


Line 13: Line 11:


For example:
For example:
 
{{code|<edit file>
<div class="codeheader">: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation"></a></div><code>&lt;edit file&gt;
Themes/default/Display.template.php
Themes/default/Display.template.php
&lt;/edit file&gt;
&lt;/edit file&gt;}}


&lt;search&gt;
&lt;search&gt;
Line 26: Line 23:


  // Show the anchor for the top and for the first message.&nbsp; If the first message is new, say so.
  // Show the anchor for the top and for the first message.&nbsp; If the first message is new, say so.
&lt;/replace&gt;</code>
&lt;/replace&gt;}}
And that means, we need to open Display.template.php and look for:
And that means, we need to open Display.template.php and look for:


<div class="codeheader">: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation"></a></div><code>// Show the anchor for the top and for the first message.&nbsp; If the first message is new, say so.</code>
{{code|// Show the anchor for the top and for the first message.&nbsp; If the first message is new, say so.</code>}}
and replace it with:
and replace it with:


<div class="codeheader">: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation"></a></div><code>global $bar_exps, $bar_posts;
{{code|global $bar_exps, $bar_posts;


// Show the anchor for the top and for the first message.&nbsp; If the first message is new, say so.</code>
// Show the anchor for the top and for the first message.&nbsp; If the first message is new, say so.}}


[[Category:Customizing SMF]]
[[Category:Customizing SMF]]

Revision as of 19:50, 14 February 2011

Mods are installed on the default theme's template files. It is hard for a Mod's author as well as a [[Theme] creater to make Mods work with other themes especially if they have several of their own template files. When a template file is not found in a custom non-default [[Theme] the [[Theme] will rollback and use the default theme's template file. But for the template files that the custom [[Theme] does use, you will need to manually install the mod on to your custom themes template files if the mod edited the same template file in the default theme. To apply a Mod to any [[Theme] manually use the following steps.

1. unzip the Mod package, and look for a file ending with .mod or .xml

2. open the .mod file with any text editor and search for <edit file>...</edit file> , you will find a file name after the tag. What we need here is looking for a template file i.e. index.template.php, BoardIndex.template.php ..etc.

3. If you locate any template after the <edit file> tag, you will find the <search for>...</search for>tag below it. It will contain a block of code that must be located in the specified template.

4. After the <search for> tag, you will find one of these: <add after>...</add after> , which add a block of code after the code found. <add before>...</add before> , which add a block of code before the code found. <replace>...</replace> , which replace a block of code with the code found.

For example:

<edit file>
Themes/default/Display.template.php
</edit file>

<search> // Show the anchor for the top and for the first message.  If the first message is new, say so. </search>

<replace>

global $bar_exps, $bar_posts;
// Show the anchor for the top and for the first message.  If the first message is new, say so.

</replace>}} And that means, we need to open Display.template.php and look for:

// Show the anchor for the top and for the first message.  If the first message is new, say so.

and replace it with:

global $bar_exps, $bar_posts;

// Show the anchor for the top and for the first message.  If the first message is new, say so.


Advertisement: