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?
  
User name:
Password:
Reply:
 

UserPost
Emptyeye
Posts: 35/2273
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.
Elric
Posts: 157/687
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
Posts: 22/2273
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
Posts: 156/687
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
Posts: 20/2273
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.
HyperLamer
Posts: 749/8210
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.
Emptyeye
Posts: 14/2273
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.
dormento
Posts: 21/99
(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
Posts: 11/2273
(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.
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.012 seconds.