Rucna instalacija modova
[/color][/size]
Pa da pocnemo:
-Mod koji cu koristiti u ovom primeru je:
AddPMToHeader1.0Skinete ovaj mod sa zvanicnog sajta Simple Machines
Odzipujete AddPMToHeader1.0.zip
Otvorite fajl Modification.xml( obicno se ovaj fajl zove install.xml, ili ima neko drugo ime u zavisnosti ko je radio mod)
Videcete sledeci kod:
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ATTENTION: If you are trying to install this manually, you should try
the package manager. If it will not work for you, please take a look
at the following for information on this format:
http://mods.simplemachines.org/docs/manual-install.php
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>4fit?:AddPMInfoToHeader</id>
<version>1.0</version>
<!--Defines string to use in PM header-->
<file name="$languagedir/Modifications.english.php">
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
$txt['youhave'] = 'You have ';
]]></add>
</operation>
</file>
<!--Adds PHP code to index.template.php-->
<file name="$themedir/index.template.php">
<operation>
<search position="before"><![CDATA[
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
]]></search>
<add><![CDATA[
if ($context['allow_pm'])
echo $txt['youhave'], '<a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'], '<br />';
]]></add>
</operation>
</file>
</modification>
$txt['youhave'] = 'You have ';
Vi treba da obratite paznju na ovaj deo koda:
<file name="$languagedir/Modifications.english.php">
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
$txt['youhave'] = 'You have ';
]]></add>
</operation>
</file>
<!--Adds PHP code to index.template.php-->
<file name="$themedir/index.template.php">
<operation>
<search position="before"><![CDATA[
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
]]></search>
<add><![CDATA[
if ($context['allow_pm'])
echo $txt['youhave'], '<a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'], '<br />';
]]></add>
</operation>
-U prvoj liniji koda vam pokazuje fajl koji ce editovati, u ovom slucaju je to
Modifications.english.php-Sledece nasta treba obratiti paznju dali se kod dodaje pre,posle ili umesto postojeceg koda.
U ovom slucaju to je posle : <search position="
after"><![CDATA[
?>]]></search>
Znaci dodacemo kod posle :
?>-Znaci u fajlu :
Modifications.english.phpnacicemo kod :
?> i posle njega cemo dodati:
$txt['youhave'] = 'You have ';
U nastavku opet imate da editujete jedan fajl:
<file name="$themedir/index.template.php">
Sada je to
index.template.phpI opet gledamo gde treba da se ovaj kod ubaci u predhodnom slucaju to je bilo posle, a sada je pre:
<search position="[b]before[/b]">
Kod koji sada trazimo je u fajlu
index.template.php je:
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{I pre tog koda cemo dodati:
if ($context['allow_pm'])
echo $txt['youhave'], '<a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'], '<br />';
Ovim ste uspesno zavrsili rucnu instalaciju ako je sve proteklo po planu rezultat bi trebalo da izgleda ovako:
Nadam se da sam uspeo koliko toliko da objasnim : )