Posted on Wtorek, 24th marzec 2009 by admin

Modyfikację Profile z poprzedniego wpisu już wgrałem do gry Santic. Potrzebne było kika poprawek, a oto instrukcja:

1. Kopiujemy wszystkie pliki .js do katalogu js/profile/.
2. Następnie edytujemy plik account.php. Jako że w Santic Engine profile zostały przeniesione do osobnej tabeli, kod odrobinę od tej modyfikacji się różni. Wstawiamy poniższe linie:

if (isset($_GET[‘view’]) && $_GET[‘view’] == "profile")
{
        $ADODB_CACHE_DIR = ‘tmp’;
        $db -> cacheFlush("SELECT profile FROM profile WHERE id=?", array($player -> id));

        $objprofil = $db -> SelectLimit("SELECT * FROM profile WHERE id=".$player -> id, 1);
        if (!isset($objprofil -> fields[‘id’])) $db -> Execute("INSERT INTO `profile` (`id`, `profile`) VALUES(".$player -> id.", ”)");
        $profil = $objprofil -> fields[‘profile’];
        $objprofil -> Close();

        require_once(‘includes/bbcodeprof.php’);
        $profil = htmltobbcode($profil);
        $smarty -> assign(array("Profileinfo" => PROFILE_INFO,
        "Newprofile" => NEW_PROFILE,
        "Profile" => $profil,
        "Change" => CHANGE));
        if (isset($_GET[’step’]) && $_GET[’step’] == "profile")
        {
                if ($player -> rank == ‘Tester’) error(‘Załóż konto aby mieć peĹ‚ny dostÄ™p do gry!’);
                if (empty ($_POST[‘profile’]))  error (EMPTY_FIELDS);
                require_once(‘includes/bbcodeprof.php’);
                $_POST[‘profile’] = bbcodetohtml($_POST[‘profile’]);
                if (isset($_POST[‘podglad’]))
                {
                        $strProfil = "PodglÄ…d profilu:".$_POST[‘profile’]."";
                        $_POST[‘profile’] = htmltobbcode($_POST[‘profile’]);
                        $smarty -> assign(array("Podglad" => $strProfil, "Profile" => $_POST[‘profile’]));
                }
        if (isset($_POST[‘zapisz’]))
        {
                $strProfile = $db -> qstr($_POST[‘profile’], get_magic_quotes_gpc());
                $db -> Execute("UPDATE profile SET profile = ".$strProfile." WHERE id = ‘".$player -> id."’");
                $_POST[‘profile’] = htmltobbcode($_POST[‘profile’]);
                $smarty -> assign (array("Profile" => $_POST[‘profile’],
                "Profileview" => bbcodetohtml($_POST[‘profile’]),
                "Newprofile2" => NEW_PROFILE2));
        }
}
}


w miejsce starej edycji profilu: if (isset($_GET['view']) && $_GET['view'] == “profile”). Zdaję się na wasz spryt :)

3. Wstawiamy nowy kod do pliku templates/account.tpl:

{if $View == "profile"}
<script src="js/profile/domel.js" type="text/javascript"></script> <script src="js/profile/script.js" type="text/javascript"></script>
<script src="js/profile/color-picker.js" type="text/javascript"></script> <script src="js/profile/bbcode.js"></script></code>

{if $Step == "profile"}
{$Podglad}
{$Message}
{/if}

<form id="generator" action="account.php?view=profile&amp;step=profile" method="post">
<table border="0" cellspacing="0" cellpadding="2" width="400" align="center">
<tbody>
<tr>
<td align="left"><span class="genmed">
<input class="button" style="font-weight: bold; width: 100%;" onclick="bbstyle(2)" onmouseover="helpline(’b')" name="addbbcode2" type="button" value=" B " accesskey="b" />
</span></td>
<td><span class="genmed">
<input class="button" style="font-style: italic; width: 100%;" onclick="bbstyle(4)" onmouseover="helpline(’i')" name="addbbcode4" type="button" value=" i " accesskey="i" />
</span></td>
<td><span class="genmed">
<input class="button" style="text-decoration: underline; width: 100%;" onclick="bbstyle(6)" onmouseover="helpline(’u')" name="addbbcode6" type="button" value=" u " accesskey="u" />
</span></td>
<td><span class="genmed">
<input class="button" style="width: 100%;" onclick="bbstyle(8)" onmouseover="helpline(’q')" name="addbbcode8" type="button" value=" Cytat " accesskey="q" />
</span></td>
<td><span class="genmed">
<input class="button" style="width: 100%;" onclick="bbstyle(16)" onmouseover="helpline(’p')" name="addbbcode16" type="button" value=" Img " accesskey="p" />

</span></td>
<td><span class="genmed">
<input class="button" style="width: 100%;" onclick="bbstyle(0)" onmouseover="helpline(’f')" name="addbbcode0" type="button" value=" Center " accesskey="f" />
</span></td>
<td><span class="genmed">
<input class="button" style="text-decoration: underline; width: 100%;" onclick="bbstyle(18)" onmouseover="helpline(’w')" name="addbbcode18" type="button" value=" Right " accesskey="w" />
</span></td>
</tr>
<tr>
<td colspan="9">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><span class="genmed">Kolor:

<select onmouseover="helpline(’s’)" name="addbbcode20"> <option class="genmed" style="color:black;" value="#FFFFFF">DomyĹ›lny</option> <option class="genmed" style="color:darkred;" value="darkred">Ciemnoczerwony</option> <option class="genmed" style="color:red;" value="red">Czerwony</option> <option class="genmed" style="color:orange;" value="orange">PomaraĹ„czowy</option> <option class="genmed" style="color:brown;" value="brown">BrÄ…zowy</option> <option class="genmed" style="color:yellow;" value="yellow">Żółty</option> <option class="genmed" style="color:green;" value="green">Zielony</option> <option class="genmed" style="color:olive;" value="olive">Oliwkowy</option> <option class="genmed" style="color:cyan;" value="cyan">Błękitny</option> <option class="genmed" style="color:blue;" value="blue">Niebieski</option> <option class="genmed" style="color:darkblue;" value="darkblue">Ciemnoniebieski</option> <option class="genmed" style="color:indigo;" value="indigo">Purpurowy</option> <option class="genmed" style="color:violet;" value="violet">Fioletowy</option> <option class="genmed" style="color:white;" value="white">BiaĹ‚y</option> <option class="genmed" style="color:black;" value="black">Czarny</option> </select>

</span></td>
<td><label id="type" class="sort" for="color1">Kolor własny:</label>
<span>#</span>
<input id="color1" class="color" style="width: 70px; font-size: 12px;" onmouseover="helpline(’x')" name="color1" type="text" value="000000" /></td>
<td align="right"><span class="gensmall"><a class="genmed" onmouseover="helpline(’a')" href="javascript:bbstyle(-1)">Zamknij Tagi</a></span></td>
</tr>
</tbody></table>
</td>   
</tr>
<tr>
<td colspan="9"><span class="gensmall">
<input class="helpline" style="width: 400px; font-size: 10px;" maxlength="100" name="helpbox" readonly="readonly" size="45" type="text" value="Rada: Style mogą być stosowane szybko do zaznaczonego tekstu" />
</span></td>
</tr>
<tr>
<td colspan="9"><span class="gen">
<textarea class="post" style="width: 400px;" onclick="storeCaret(this);" onkeyup="storeCaret(this);" cols="30" rows="20" name="profile">{$Profile}</textarea>
<input style="width: 200px; font-size: 12px;" name="podglad" type="submit" value="PodglÄ…d" /><input style="width: 200px; font-size: 12px;" name="zapisz" type="submit" value="{$Change}" />

Przed zapisaniem profilu, możesz zrobić jego podgląd widoczny tylko dla Ciebie i sprawdzić co trzeba ewentualnie jeszcze dodać/poprawić

* - oznacza iĹĽ uĹĽyty tag jest otwarty

</span></td>
</tr>
</tbody></table>
<table border="0">{/if}

Z Khulmar-owego pliku wyrzuciłem zbędne opisy a także zmieniłem szerokości tabel tak aby mieściła się w mojej grze.

4. Wrzucami pliki obrazków z katalogu images do images.

Tags:
Posted in Santic Engine | Comments (16)

16 Responses to “Mniej lub bardziej szczegółowa instrukcja instalacji modyfikacji Profile”

  1. Szczurek Says:

    if (isset($_GET[’step’]) && $_GET[’step’] == “profile”)

    Co to jest && ? xD
    Chyba && miało być :) ?

  2. Szczurek Says:

    Podwójny koment, ale nie wiedziałem, że CI interpretuje html :)
    W kodzie jest && zapisane w htmlu - amp amp, a powinno być normalnie - &&

  3. admin Says:

    dzieki, poprawilem ;)

  4. Szczurek Says:

    {/if}

    Kolejny błąd - zbędne :)

  5. Szczurek Says:

    Dobija ta interpretacja powiem Ci :D

    Miało być, że w pliku .tpl nie potrzebnie jest otwarta nowa tabela - psuje konstrukcje strony ;)

  6. Arianaquax Says:

    That was nice. Thank you for sharing this one.

  7. SannyMusy Says:

    well.. it’s like I said!

  8. Sherager Says:

    any news coming ?

  9. JaneRadriges Says:

    Original post by Dmitri Gromov

  10. KattyBlackyard Says:

    The best information i have found exactly here. Keep going Thank you

  11. GarykPatton Says:

    Hi! I like your srticle and I would like very much to read some more information on this issue. Will you post some more?

  12. fuck mother incest Says:

    any changes coming ?

  13. rape sex hardcore sex Says:

    emm. good one..

  14. CrisBetewsky Says:

    I’m glad that after surfing the web for uch a long time I have found out this information. I’m really lucky.

  15. CrisBetewsky Says:

    Some of us even don’t realize the importance of this information. What a pity.

  16. KonstantinMiller Says:

    I think I will try to recommend this post to my friends and family, cuz it’s really helpful.