vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Yet another Stats/Level Hack (https://vborg.vbsupport.ru/showthread.php?t=31775)

Knoman 11-01-2001 06:24 PM

i see no point in a limit break. neo, those are some great ideas that you have, but i will not code them. i only released my codes out of anger and to prove that mine was the original and the better of the hp/mp hacks. right now, i'm working on a fighting engine that will work with this code. do not expect me to release it to the public.

Neo 11-01-2001 07:44 PM

no prob, i was just asking what you think about it, cuz i am coding stuff and such, i do know i little about coding, and i am in the works of my own fighting engine;) but its cool man thanks for the code:D

and X put <smallfont> before the table and </smallfont> after the table end so for the font.. not to sure

Mr. X 11-01-2001 09:02 PM

Awesome thanks. I even figured out how to remove the border. I am so totally l33t. :)

Neo 11-01-2001 10:18 PM

Heh. No problem anytime

Palmer ofShinra 11-02-2001 08:32 AM

Quote:

Originally posted by Knoman

afterwards, i'm creating a money system where members are
awarded cash for allowances and for completing quests. this money can be used to buy upgrades in amor and weapons in the local shops in the Role Playing Forums.

We've been doing the virtual money thing for almost 11 months now.

Just last month I managed to automate it in PHP (we've only been on vB for 2 months)

Take a look if you want. http://130.194.171.148/board/store.php

I'm almost finished my basic points-giving script as well.

Neo 11-02-2001 03:27 PM

will you be posting in or selling it at all? cuz i know i want it

Palmer ofShinra 11-02-2001 05:26 PM

Just the points thing?

Free... it's too small and simple to charge for.

If all goes well I may have it up by tomorrow.

Neo 11-02-2001 05:47 PM

thats cool, are you going to post the store to use the points?

Palmer ofShinra 11-02-2001 06:58 PM

Uh, no.

It's easy to do if you know what to do...

But the Store is dependant on a half dozen other custom mini-hacks and tweaks spanning 5 different files I think maybe more).

Plus the code is VERY Shinra-specific, almost everything is hard-coded, and adapting it to general usage would take longer than to just rewrite the thing from scratch.

Besides... that's our forum's edge.

I've given the code to ONE other person, but he's done a lot for Shinra as well and runs a sister forum.

I gave him the code over a week ago... he still doesn't have it working in his forum.

Neo 11-02-2001 08:36 PM

wow that cool, it ok that you keep the store. umm may i ask what the mini hacks you added it to are you could pm if you dont want to post it here i am just very interested to see how you did this. i like the rent a forum part its cool;)

Mr. X 11-03-2001 06:52 PM

Ok ok, last question :)

Check out the attached shot.

How do I make it so that signatures stay on the bottom? theres way to much space cuz I guess the bars and stuff stretch out the table?

Here is the code I have:

PHP Code:

<smallfont><br>
                  <
p> <b>Level$showlevel<br>
                    
Member ID$post[userid]</b><br>
                    
HP$hp $maxhp 
                  
<table width="100" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
                    <
tr
                      <
td bgcolor="#9E9E9E"><img src="images/bar/bhg.gif" width="$hpf%" height="9"><img src="images/bar/bhb.gif" width="1" height="9"></td>
                    </
tr>
                  </
table>
                  
MP$mp $maxmp 
                  
<table width="100" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
                    <
tr
                      <
td bgcolor="#9E9E9E"><img src="images/bar/bmg.gif" width="$mpf%" height="9"><img src="images/bar/bmb.gif" width="1" height="9"></td>
                    </
tr>
                  </
table>
                  
Exp$ep
                  <
table width="100" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
                    <
tr
                      <
td bgcolor="#9E9E9E"><img src="images/bar/bxg.gif" width="$ep%" height="9"><img src="images/bar/bxb.gif" width="1" height="9"></td>
                    </
tr><smallfont></table

Here is how I put it in my postbit template:

PHP Code:

<table bgcolor="{pagebgcolor}" width="{tablewidth}" cellpadding="0" cellspacing="0" border="0"><tr><td width="10"><img width="10" height="1" src="{imagesfolder}/space.gif" alt=""></td><td width="100%"><!-- spacer -->

<
table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextrawidth="{contenttablewidth}" align="center"><tr><td>
<
table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextrawidth="100%">
<
tr>
    <
td bgcolor="$post[backcolor]width="175" valign="top" nowrap>
    <
a name="post$post[postid]"></a>
    
$post[firstnewinsert]
    <
normalfont><b>$post[username]</b></normalfont><br>
    <
smallfont>$post[usertitle]</smallfont><br>
    
$post[avatar]<p>
    <
smallfont><smallfont><br>
                  <
p> <b>Level$showlevel<br>
                    
Member ID$post[userid]</b><br>
                    
HP$hp $maxhp 
                  
<table width="100" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
                    <
tr
                      <
td bgcolor="#9E9E9E"><img src="images/bar/bhg.gif" width="$hpf%" height="9"><img src="images/bar/bhb.gif" width="1" height="9"></td>
                    </
tr>
                  </
table>
                  
MP$mp $maxmp 
                  
<table width="100" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
                    <
tr
                      <
td bgcolor="#9E9E9E"><img src="images/bar/bmg.gif" width="$mpf%" height="9"><img src="images/bar/bmb.gif" width="1" height="9"></td>
                    </
tr>
                  </
table>
                  
Exp$ep
                  <
table width="100" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
                    <
tr
                      <
td bgcolor="#9E9E9E"><img src="images/bar/bxg.gif" width="$ep%" height="9"><img src="images/bar/bxb.gif" width="1" height="9"></td>
                    </
tr><smallfont></table>Registered$post[joindate]<br>
    
Location$post[field2]<br>
    
Posts$post[posts]</smallfont></td>
    
    <
td bgcolor="$post[backcolor]width="100%" valign="top">
    <
smallfont>$post[icon] <b>$post[title]</b></smallfont>
    <
p><normalfont>$post[message]</normalfont></p>
    
$post[attachment]
    <
p>$post[signature]</p>
    <
p>$post[editedby]</p>
    <
p align="right"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged]</smallfont></p>
    </
td>
</
tr>
<
tr>
    <
td bgcolor="$post[backcolor]width="175" height="16" nowrap><smallfont>$post[foldericon]
    
$post[postdate] <font color="{timecolor}">$post[posttime]</font></smallfont></td>
    
    <
td bgcolor="$post[backcolor]width="100%" valign="middle" height="16">
        <
table width="100%" border="0" cellpadding="0" cellspacing="0">
        <
tr valign="bottom">
            <
td><smallfont>$onlinestatus
            $post
[profile$post[pmlink$post[useremail$post[homepage$post[search$post[buddy]
            <!-- $ 
post[icqicon] --> <!-- $ post[aimicon] --> <!-- $ post[yahooicon] --> 
            </
smallfont></td>
            <
td align="right" nowrap><smallfont>
            <
a href="editpost.php?s=$session[sessionhash]&action=editpost&postid=$post[postid]"><img src="{imagesfolder}/edit.gif" border="0" alt="Edit/Delete Message"></a>
            <
a href="newreply.php?s=$session[sessionhash]&action=newreply&postid=$post[postid]"><img src="{imagesfolder}/quote.gif" border="0" alt="Reply w/Quote"></a>
            </
smallfont></td>
        </
tr>
        </
table>
    </
td>
</
tr>
</
table>
</
td></tr></table>

<!-- 
spacer --></td><td width="10"><img width="10" height="1" src="{imagesfolder}/space.gif" alt=""></td></tr></table

Also one last thing then I'll shutup. Can I have the postnumber/location/register information on TOP of the stats instead of on the very bottom, while maintaining the signatures be at the very bottom as they were before the hack? Thanks for any help! :)

Mr. X 11-03-2001 07:03 PM

duh. forgot to attach

Neo 11-03-2001 07:36 PM

use valign tags... like valign="bottom" and such

fonzerelli_79 11-05-2001 09:31 PM

just a small note to say thanks for a great hack knoman

easy to understand and easy to install

all the best

trilOByte 11-07-2001 05:57 AM

Quote:

Originally posted by neo
use valign tags... like valign="bottom" and such
I have the same problem (see attachment), but I'm no coder and I can't figure out where to put the valign tags. At least when I try, I can't seem to get the message at the top of the cell and everything else at the bottom - I don't even know if this is possible without splitting the cell. If someone knows how to do this, I'd be very grateful :)

Neo 11-07-2001 06:22 AM

ok, i believe the sig thing is in the postbit template, so go into that and find where the sig code itself is, then see if there is a <tr> or <td> and put a valign="bottom" and if that does not work [post the code and i will try and fix it for yah

trilOByte 11-07-2001 11:30 AM

Thanks neo...
Here's the code ...

Code:

<td bgcolor="$post[backcolor]" width="100%" valign="top">
        <smallfont>$post[icon] <b>$post[title</b></smallfont>
        <p><normalfont>$post[message]</normalfont></p>
        $post[attachment]
        <p>$post[signature]</p>
        <p>$post[editedby]</p>

what I want to do is

valign="top" ---> $post[message]

but

valign="bottom" ---> $post[attachment] and everything else beneath. I don't know if this is possible or not, but everything I try ends up is screwy tables - no surprise to me cos I can't code worth squat :)

Any help would be gratefully appreciated :)

ta :)

Neo 11-07-2001 03:22 PM

[QUOTE]Originally posted by trilOByte
Thanks neo...
Here's the code ...

Code:

<td bgcolor="$post[backcolor]" width="100%" valign="top">
        <smallfont>$post[icon] <b>$post[title</b></smallfont>
        <p><normalfont>$post[message]</normalfont></p>
        $post[attachment]
        <p>$post[signature]</p>
        <p>$post[editedby]</p>


trilOByte 11-07-2001 06:51 PM

Yes I've tried that neo and not surprisingly, it does drop the message as well. What I want, is for the message to be aligned to the top, but the sig and everything beneath it in the code shown, to be aligned to the bottom (I thought I was pretty clear that this is what I am trying to do). This I do not know how to do. I don't code html - or any other language, so if anyone can advise - I'd be grateful :)

trilOByte 11-07-2001 07:14 PM

I tried replacing the above code with..

<td bgcolor="$post[backcolor]" width="100%" valign="top" height="233">
<smallfont>$post[icon] <b>$post[title]</b></smallfont>
<p><normalfont>$post[message]</normalfont></p>
$post[attachment]
<p><smallfont></smallfont></p>
</td>
</tr>
<tr>
<td bgcolor="$post[backcolor]" width="100%" valign="bottom">
<p>$post[signature]</p>
<p>$post[editedby]</p>
<p align="right"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report
this post to a moderator</a> | $post[iplogged]</smallfont></p>
</td>

But the tables get screwed up - any suggestions?

trilOByte 11-08-2001 12:43 AM

Quote:

Originally posted by Knoman


HP drops and rises according to the members activeness.
MP determins how long a user has been with the forums, and how active they are.
EXP determins how close a user is to reaching the next level.

Knoman - great hack - thanks.

Just a quickie though - I need to post something to explain all the ratios that appear and how the stats are calculated from thier (users) posts. Those users not familiar with RPG's might be especially confused at first.

Can you give me some info? Ta :)

Neo[THK] 11-08-2001 08:54 PM

that?s what i try to find out at the moment..

a good description for my members, so that everybody easily understands this thingy =)

cause even i have problems to fully understand this really great hack :)

so i would be very glad about a short description :)

thx

neo

trilOByte 11-10-2001 01:50 AM

Anything bud, just a brief description of what users have to do to affect the numbers and how they relate :)

tnx

Castel 11-11-2001 04:58 AM

Cool hack, the forum users are loving it. I've made it a user option however that can be turn on or off. Not all visitors like all those bell and whistles :)

Neo 11-11-2001 05:58 AM

and how did you do that

Castel 11-11-2001 11:31 AM

I'll document it properly within the next few days.

Knoman 11-13-2001 05:15 PM

just create two styles: one with the hacked template, and one without. then let your members chose the style they wish.

as for an explanation of the hack, look at the first page.

afterlab 11-23-2001 04:10 AM

Hey Knoman, anyway you can make this appear in a member's Profile?

fonzerelli_79 11-23-2001 03:42 PM

i dont know why but this hack is not working properly now for some reason

an example is at http://www.manutdchat.com/forums/sho...stid=15#post15


does anyone know what could be wrong

for administrators : i have purchased another vbulletin licsence for this site and i can verify the order no if required. thanks

fonzerelli_79 11-23-2001 04:08 PM

nevermind

im just going to remove the hack anyway

Logtenberg 11-23-2001 09:44 PM

What line(s) do I modify so that members require more posts to increase to a new level.

Some of my members have made 300+ posts and they are at level 16 with the current hack.

I would prefer if they would only be at say... level 8.

Once the levels start getting in the double digits, it looses it's appeal for me. So I would like it to be harder (require more posts) for members to get a new level.

Thanks!!

PS - I am also interested in having the stats (level specifically) on the members profile. Any idea what needs to be done there? :)

winston 11-24-2001 12:20 AM

It worked finein the 2.20 but now in 2.21 it displays all wierd like no exp on a 1100 post user
and the userlevel is like 1.112332243243
I copied andpasted it perfectly in admin/ functions.php

|DarkManX| 11-24-2001 03:21 AM

i think a breakdown of what HP, MP, and EXP are would be very good....


i have members wondering how it works exactly also :)

fonzerelli_79 11-24-2001 10:18 AM

i have removed this hack but when i did you it i had a link to my faq3 and i put

<p>You have probably noticed the coloured bars at the side of each post, just below the member's avatar. This is our graphical system which lets you see how active and experienced a member is.</p>
<p>The bars represent :
<ul><li><font color="red">The Red Bar </font>: Drops and rises according to the members activeness.</li>
<li><font color="green">The Green Bar </font>: Determines how long a user has been with the forums, and how active they are. </li>
<li><font color="blue">The Blue Bar</font> : Determines how close a user is to reaching the next level.</li></ul>
</p>

I hope this helps you out winston

trilOByte 11-24-2001 10:29 AM

Just look at the code for an explanation of how it's worked out. All the maths is in there and is reasonably easy to work out most of it, even if you are not a coder.

Code:

$level = pow (log10 ($post[posts]), 3);
$ep = floor (100 * ($level - floor ($level)));
$showlevel = floor ($level + 1);
$hpmulti =round ($postsperday / 6, 1);
if ($hpmulti > 1.5) {
$hpmulti = 1.5;
}
if ($hpmulti < 1) {
$hpmulti = 1;
}

$maxhp = $level * 25 * $hpmulti;
$hp= $postsperday / 10;
if ($hp >= 1) {
$hp= $maxhp;
} else {
$hp= floor ($hp * $maxhp);
}

etc...........................

Though I would appreciate an "english" explanation of it myself, as I can't follow all the maths in the code and don't understand why some of the variables have been set at the numbers they are at.

|DarkManX| 11-24-2001 03:38 PM

yea, i don't really get that either.....

plain english would be good :cool:

Knoman 11-30-2001 02:50 AM

Let's break it down to simple English, shall we?

$level = pow (log10 ($post[posts]), 3);
This is a simple logarithm that will calculate the how much post a member needs in order to get to the next level. This is the engine that will control all other calculations. Now, I've cubed it so leveling resembles Final Fantasy; where the max level is 99. If you are into D&D, squaring the formula would be best, requiring a lot of post before a user can reach level 20. In short, the higher the exponent, the quicker it is to level up.

$ep = floor (100 * ($level - floor ($level)));
This is the basis for the Experience system. What i did here, was take the remainder (or mod) from the Level logarithm and converted it to a percentage. I wasnt sure if PHP had a MOD function, so I did it the hard way.

$showlevel = floor ($level + 1);
I cant have a user with level zero, but i didnt want to affect the engine with a false number either. So, I created another variable $showlevel and added 1, which will only be used to show users, and wont affect the calculations.

$hpmulti =round ($postsperday / 6, 1);
if ($hpmulti > 1.5) {
$hpmulti = 1.5;
}
if ($hpmulti < 1) {
$hpmulti = 1;
}
This code here was to add to the randomness. This is my HP bonus multiplier. I took the post per day and divided by six and rounded it to the tenths decimal. I use a few IF functions to prevent it from being too high and too low.

$maxhp = $level * 25 * $hpmulti;
Determins the Max HP. Not much to be said here, 25 just seem to be a nice number.

$hp= $postsperday / 10;
If a person couldnt perform a ten post per day average, HP will drop.

if ($hp >= 1) {
$hp= $maxhp;
} else {
$hp= floor ($hp * $maxhp);
}
Sets the limit on how high your HP will go. Keeps it at or under the Max HP

$hp= floor ($hp);
$maxhp= floor ($maxhp);
HP calcualations are down. Rounding down for viewing sake.

if ($maxhp <= 0) {
$zhp = 1;
} else {
$zhp = $maxhp;
}
Debugs the Divide by Zero error.

$hpf= floor (100 * ($hp / $zhp)) - 1;
Is used in the templates.

$maxmp= ($jointime * $level) / 5;
Determins Max MP. Again, the 5 just seems right.

$mp= $post[posts] / 3;
Determins MP, not sure why I chose to do what I did, but it works. This is the reason why MP is still a mystery to my members and even to me.

if ($mp >= $maxmp) {
$mp = $maxmp;
}
Keeps MP from going above its max.

$maxmp = floor ($maxmp);
$mp = floor ($mp);
MP calculations done. Rounding down.

if ($maxmp <= 0) {
$zmp = 1;
} else {
$zmp = $maxmp;
}
Debugs the divide by zero error.

$mpf= floor (100 * ($mp / $zmp)) - 1;
Is used in the templates.

Meta 11-30-2001 09:34 AM

Thank you, Knoman ... lovely hack!


Afterlab ... i found a way to get it into the members profile. See how i did it in the member.php:

PHP Code:

  $userinfo[avatarurl]=getavatarurl($userinfo[userid]);
  if (
$userinfo[avatarurl]=="") {
    
$userinfo[avatarurl]="images/clear.gif";
  }

// start levelhack
$level pow (log10 ($userinfo[posts]), 3); 

But it also needs a little finetuning ... e.g. change variable-names like

PHP Code:

 $posts[posts

in

PHP Code:

 $userinfo[posts

and so on.


Maybe this helps you. If not and you encounter problems feel free to ask. But the hardest thing (for me) was to find the right place in member.php ... the finetuning isn't hard.


Nice hack, Knoman, did i mention it? Thank you!

afterlab 12-01-2001 07:37 AM

Thanks meta, that worked. I mixed it up a bit too in my profile. Cya around.

sctsnipe 12-01-2001 08:22 PM

I have 2.2.1, and i cant find that first line we need, the 'if ($post' thingy, any help? I looked in showthread.php!


All times are GMT. The time now is 05:10 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01704 seconds
  • Memory Usage 1,937KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (5)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete