Skocz do zawartości
Hosting webh.pl - 20%

Instalacja RPG Lavel Stats

Rekomendowane odpowiedzi

Opublikowano

Tytuł :: Instalacja RPG Lavel Stats

Autor :: Tomy

Kategoria :: Invision Power Board 2.1.x

Wymagania ::

  • Orginał materiału na:

  • http://mods.invisionize.com/db/index.php/f/6142


Opis ::

Ten mod dodaje pod avatar tabele: level, HP, MP, EXP.

Modyfikacja do IPB 2.1.x

1) Edytuj: /sources/action_public/topics.php

*******

Znajdzi

*******

if ( $member['id'] )

{

$member['addresscard'] = $this->ipsclass->compiled_templates['skin_topic']->member_icon_vcard( $member['id'] );

}

************

*Dodaj poniżej:*

************

//--------------------------------

// Define the Following Variables

//--------------------------------

// HP Initial

$hpini = "30";

// MP Initial

$mpini = "20";

// Level coefficient

$levelco = "5";

// HP increase

$hpco = "7.3";

// MP increase

$mpco = "5.6";

// Average Posts per Day (If you selected this option from above, it's the max needed for 100% HP/MP... less active forums may want lower numbers)

$ppdmax = "7";

// Percentage of total necessary to achieve 100% HP/MP (Depends on if you selected this for an option above. Use whole numbers. More active forums should have significantly lower maximum. This number should be between 1-100, which represents 1%-100%. High traffic forums recommend 5 or lower)

$percentmax = "10";

//MP cost for per post

$mpcostperpost = "2.5";

//MP restore per day

$mpregenperday = "10";

//-------------------------------

// DO NOT EDIT BELOW THIS POINT!

//-------------------------------

/*-------------------------------------------------------------------------*/

// Running function for posts per day

/*-------------------------------------------------------------------------*/

$percent = 0;

$stats = $this->ipsclass->cache['stats'];

$board_posts = $stats['total_replies'] + $stats['total_topics'];

if ($member['posts'] and $board_posts)

{

$info['posts_day'] = round( $member['posts'] / (((time() - $member['joined']) / 86400)), 2);

$info['posts_pct'] = round( 100 * $member['posts'] / $board_posts, 2 );

}

if ($info['posts_day'] > $member['posts'])

{

$info['posts_day'] = $member['posts'];

}

$postcount = $member['posts'];

$lvlini = (($levelco / 2) + sqrt(($levelco * $levelco / 4) + ($levelco * 2 * $postcount))) / $levelco;

$lvlfin = floor($lvlini);

/*-------------------------------------------------------------------------*/

// Determining total HP and MP

/*-------------------------------------------------------------------------*/

$hpmax = $hpini;

$mpmax = $mpini;

for ($lvlincb = 1; $lvlincb <= $lvlfin; $lvlincb++) {

$hpmax += $hpco * ($lvlincb - 1);

$mpmax += $mpco * ($lvlincb - 1);

}

$hpmax = floor($hpmax);

$mpmax = floor($mpmax);

/*-------------------------------------------------------------------------*/

// Running functions for posts per day

/*-------------------------------------------------------------------------*/

$ppdini = floor( 100 * $info['posts_day'] / $ppdmax );

if (!$ppdini || $ppdini <= 0) {

$ppdfin = 0;

$ppdbarcloser = "";

}

elseif (!$ppdini || $ppdini >= 99) {

$ppdfin = 100;

$ppdbarcloser = "";

}

else {

$ppdfin = $ppdini;

$ppdbarcloser = '<img src="style_images/rpgstats/h.gif" height="9" style="float: left" alt="Bar">';

}

/*-------------------------------------------------------------------------*/

// Defining Everything Involving XP and XP Bar

/*-------------------------------------------------------------------------*/

$levelpostmin = 0;

for ($lvlinc = 1; $lvlinc <= $lvlfin; $lvlinc++) {

$levelpostmin += $levelco * ($lvlinc - 1);

}

$xpratio = floor( 100 * ($postcount - $levelpostmin) / ($levelco * $lvlfin) );

if (!$xpratio || $xpratio <= 0) {

$xpbarcloser = "";

}

elseif (!$xpratio || $xpratio >= 100) {

$xpbarcloser = "";

}

else {

$xpbarcloser = '<img src="style_images/rpgstats/ex.gif" height="9" style="float: left" alt="Bar">';

}

$xpbar = $xpratio;

if ($xpbar >= 98) $xpbar = 98;

/*-------------------------------------------------------------------------*/

// Defining What Fills the HP Bar

/*-------------------------------------------------------------------------*/

$hpactual = floor( $hpmax * $ppdfin / 100 );

$hpbar = $ppdfin;

$hpbarcloser = $ppdbarcloser;

/*-------------------------------------------------------------------------*/

// Defining What Fills the MP Bar

/*-------------------------------------------------------------------------*/

$level_user_days = round( (time() - $member['joined']) / 86400, 0 );

$mpcost = $postcount * $mpcostperpost;

$mpregen = max( 1, $level_user_days * $mpregenperday );

$mpactual = floor( $mpmax - $mpcost + $mpregen );

$mpactual = max( 0, $mpactual );

$mpactual = min( $mpmax, $mpactual );

$mpbar = floor( $mpactual * 100 / $mpmax );

if (!$mpbar || $mpbar >= 98) $mpbarcloser = "";

else $mpbarcloser = '<img src="style_images/rpgstats/m.gif" height="9" style="float: left" alt="Bar">';

$member['stats'] = "<table class=\"level\" cellspacing=\"0\" cellpadding=\"0\">

<tr>

<td class=\"level\" height=\"20\" valign=\"top\">

<a style=\"font-family:Verdana, Arial, Helvetica; font-size:10px;\">Level: <b>$lvlfin</b></a><br>

</tr>

</table>

<a style=\"font-family:Verdana, Arial, Helvetica; font-size:9px;\"><b>HP:</b> $hpactual/$hpmax</a><br>

<table class=\"rpg\" height=\"9\" border=\"1\" style=\"border-collapse: collapse\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">

<tr>

<td class=\"rpg\">

<img src=\"style_images/rpgstats/hp.gif\" style=\"float: left\" width=\"$hpbar%\" height=\"9\" alt=\"HP\">$hpbarcloser</td>

</tr>

</table>

<a style=\"font-family:Verdana, Arial, Helvetica; font-size:9px;\"><b>MP:</b> $mpactual/$mpmax</a><br>

<table class=\"rpg\" height=\"9\" border=\"1\" style=\"border-collapse: collapse\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">

<tr>

<td class=\"rpg\">

<img src=\"style_images/rpgstats/mp.gif\" style=\"float: left\" width=\"$mpbar%\" height=\"9\" alt=\"MP\">$mpbarcloser</td>

</tr>

</table>

<a style=\"font-family:Verdana, Arial, Helvetica; font-size:9px;\"><b>EXP:</b> $xpbar%</a><br>

<table class=\"rpg\" height=\"9\" border=\"1\" style=\"border-collapse: collapse\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">

<tr>

<td class=\"rpg\">

<img src=\"style_images/rpgstats/exp.gif\" style=\"float: left\" width=\"$xpbar%\" height=\"9\" alt=\"EXP\">$xpbarcloser</td>

</tr>

</table>";

2) W panelu admina:

- Look & Feel -> Wybrany skin

- wybież Edit Template HTML -> Topic View -> RenderRow

*******

*Znajdzi:*

*******

<table class='ipbtable' cellspacing="1">

***************

*Podmień:*

***************

<table cellspacing="1">

*******

*Znajdzi:*

*******

{$author['member_number']}<br />

************

*Dodaj poniżej:*

************

{$author['stats']}<br />

3) Powruż do Menadzera skurek(Skin Manager).

- wybież "Edit Root Skin Stylesheet (CSS Advanced Mode)"

*****************

*Dadaj ten wpis na końcu:*

*****************

.rpg{ /* adjusts the stats bars so there's no padding or transparency */

padding: 0;

width: 140px;

}

.level{ /* adjusts the level bars so there's no padding */

padding: 0;

}

4) Wżuć folder "rpgstats" do style_images/rpgstats/.

5) Upload sources/action_public/topics.php!

Koniec!

Kopiowanie tego materiału bez zgody admina zabronione!

Zobacz artykuł

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Konto

Nawigacja

Szukaj

Szukaj

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.