Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - Making an EXP bar? | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Emptyeye
I am a real American!
Real American
Level: 67

Posts: 11/2273
EXP: 2488421
For next: 104451

Since: 05-24-04
From: I DUNNOOOOOOOO!!

Since last post: 9 hours
Last activity: 4 hours
Posted on 05-24-04 09:51 PM Link | Quote
(And randomly, didn't there used to be a search function for the boards? Am I just retarded and can't find it? Am I having delusions and it was never there in the first place? Or am I correct in thinking it disappeared? )

What I need help with is, in a general sense, the coding for an experience bar for these boards. Looking at various sources, it looks like the general way is to use an image for the "filled" part of the bar. I'm wondering if there's another way, and more specifically, I'm wondering how I force it to "do the math" involved in a correct bar (As simply putting in the mathematical operators doesn't seem to work).

And for those of your who think you're experiencing deja vu: Yes, I did ask this during my first tenure here. I seem to have forgotten in my absence though.

EDIT: I'm an idiot. Still, is there a way to do math within HTML? It could be useful depending on what I come up with.


(edited by Emptyeye on 05-24-04 01:28 PM)
dormento

Shyguy
Level: 17

Posts: 21/99
EXP: 24075
For next: 668

Since: 03-15-04
From: Esteio - Brasil

Since last post: 182 days
Last activity: 161 days
Posted on 05-24-04 11:47 PM Link | Quote
(iirc the search function was taken out because it took too damn long and stressed the new server/board software beyond relief. I may be wrong though. (wheah ez teh acmlm?))

About the exp bar: you want to make it so the exp bar appears in your layout? Or you want a custom php module for an acmlm board? A quick n' dirty way to have one is to use standart html to magnify the small exp bar image that appears above the avatar. You could stretch it horizontally and have it shown on your layout, as the location doens't appear to change.

If you need to do math within html, you could use a small javascript function that calculates the exp and lenght of the bar then writes the html dinamically to the document.
Emptyeye
I am a real American!
Real American
Level: 67

Posts: 14/2273
EXP: 2488421
For next: 104451

Since: 05-24-04
From: I DUNNOOOOOOOO!!

Since last post: 9 hours
Last activity: 4 hours
Posted on 05-25-04 02:32 AM Link | Quote
Hey, so I'm not going completely nuts on the search thing. Hooray.

Perhaps a concrete example will help more. You'll notice in my signature that I have an HP bar. In spite of its name, it's actually designed to work off of the percentage variables in the acmlm boards, exppct and exppct2. I got this to work with a bit of thought.

Now, underneath it, I want to have another bar, labelled ENEMY (EDIT HERE: This is what accounts for the space between the end of HP and the beginning of the bar), working off of the relation to 5000 posts. The yellow segment would be based on the number I need to reach 5000, the red would be the present post count. It's this I'm having trouble with. Using just the 5000 and numposts variables (In a second table row)generates approximately the desired effect, save for the not-so-small detail that the width is now stretched out to 5000 pixels. So I'm looking for a way to convert those into percentages, in much the same way the experience variables are percentages.

It sounds like there's a way to do it in Javascript, from what you're telling me, though it'll take a bit of research on my part, as I'm less-than-well-versed in Javascript.


(edited by Emptyeye on 05-24-04 05:34 PM)
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 749/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 05-25-04 08:25 AM Link | Quote
You can't use Javascript (easily) here, so what you'll have to do is pass the variable to a PHP script which returns an image of the specified width.

FYI, here's proper code for an EXP bar:

<br><table width=100% height=35 border=0><tr><td width=32.0 bgcolor=007f00></td><td></td></tr></table><br>

That'll make an actual bar, but you might want to put it in another table with a border.


(edited by HyperHacker on 05-24-04 11:29 PM)
Emptyeye
I am a real American!
Real American
Level: 67

Posts: 20/2273
EXP: 2488421
For next: 104451

Since: 05-24-04
From: I DUNNOOOOOOOO!!

Since last post: 9 hours
Last activity: 4 hours
Posted on 05-25-04 08:30 AM Link | Quote
Yeah, I tried that code earlier, except I used 3 TDs (One for the "HP", one for the yellow, one for the red). For some reason, it left a huge space between the HP and the start of the yellow bar. I didn't get it either.
Elric

Chasupa


Currently Playing:
You Like A Lute.
Level: 40

Posts: 156/687
EXP: 440016
For next: 1293

Since: 03-15-04
From: Melniboné

Since last post: 6 hours
Last activity: 6 hours
Posted on 05-25-04 09:19 AM Link | Quote
Do you have access to a host that supports PHP? Because then you should be able to write a script that will turn the numbers into percentiles. Then just set the URL as something like <img src=http://www.server.com/monster.php?y=&numpost&&r=&5000&>.
Emptyeye
I am a real American!
Real American
Level: 67

Posts: 22/2273
EXP: 2488421
For next: 104451

Since: 05-24-04
From: I DUNNOOOOOOOO!!

Since last post: 9 hours
Last activity: 4 hours
Posted on 05-25-04 09:38 AM Link | Quote
While my first instinct was to laugh given that I use angelfire for hosting the images, I decided that would be a tactless and ungrateful thing to do.

So I checked out the Angelfire Plan Comparison Page, and it doesn't mention anything about PHP. So I'd have to guess "no", unless it's somehow related to perl, which I don't think it is.
Elric

Chasupa


Currently Playing:
You Like A Lute.
Level: 40

Posts: 157/687
EXP: 440016
For next: 1293

Since: 03-15-04
From: Melniboné

Since last post: 6 hours
Last activity: 6 hours
Posted on 05-26-04 09:48 AM Link | Quote
I didn't think so, but it never hurts to ask.

Here's a linklist of different PHP hosts. I don't know anything about it, since I haven't checked it out, do to having php.
Emptyeye
I am a real American!
Real American
Level: 67

Posts: 35/2273
EXP: 2488421
For next: 104451

Since: 05-24-04
From: I DUNNOOOOOOOO!!

Since last post: 9 hours
Last activity: 4 hours
Posted on 05-27-04 09:15 PM Link | Quote
Most of those pages seem to have some limitations on them.

I KNOW there's a way to do approximately what I'm talking about with the relationship to 5000 posts, as I had it during my first time here (Though in reverse of what I'm explaining now)...I just can't remember what it is.

Ah well.

EDIT: Figured it out. Or rather, mooched my old code off of Acmlm. A mod can do with this topic as they please.


(edited by Emptyeye on 05-29-04 12:49 AM)
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Programming - Making an EXP bar? | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.005 seconds.