Ok, lesson learnt... ;-p
I've done this:
// Function to get ALL results and put em in an array
$getDataPos = scoreViewPos();
foreach ($getDataPos as $key => $value) {
$i++;
// row-highlight
if ($i <= 10) {
if ($i % 2 != 0) # An odd row
$rowHighlight = "row-highlight";
$showTopScores .= "
<tr class=\"" . $rowHighlight . "\">
<td>" . $i . "</td>
<td>" . $value['name'] . "</td>
<td>" . $value['score'] . "</td>
</tr>";
$rowHighlight = "";
}
}
if (isset($_SESSION["getId"])) {
foreach ($getDataPos as $key => $value) {
$k++;
if ($foundUser1 != true) {
if ($k % 2 == 0) # IS a odd row
$rowHighlight = "row-highlight";
$showPosScores10 = $showPosScores9;
$showPosScores9 = $showPosScores8;
$showPosScores8 = $showPosScores7;
$showPosScores7 = $showPosScores6;
$showPosScores6 = "<tr class=\"" . $rowHighlight .
"\"><td>" . $k .
"</td><td>" . $value['name'] . "</td><td>" . $value['score'] .
"</td></tr>";
$rowHighlight = "";
}
if ((isset( $_SESSION["getId"])) && ($value['id'] ==
$_SESSION["getId"])) {
$foundUser1 = true;
}
}
foreach ($getDataPos as $key => $value) {
$j++;
if ($foundUser2 == true) {
$c++;
if ($c <= 5) {
if ($j % 2 == 0) # IS a odd row
$rowHighlight = "row-highlight";
$showPosScores5 = $showPosScores4;
$showPosScores4 = $showPosScores3;
$showPosScores3 = $showPosScores2;
$showPosScores2 = $showPosScores1;
$showPosScores1 = "<tr class=\"" .
$rowHighlight . "\"><td>" . $j
. "</td><td>" . $value['name'] . "</td><td>" . $value['score'] .
"</td></tr>";
$rowHighlight = "";
}
}
if ((isset($_SESSION["getId"])) && ($value['id'] !=
$_SESSION["getId"]) && ($foundUser2 != true)) {
continue;
} else {
$foundUser2 = true;
}
}
}
========================
VERY long winded, but it works...
I know it could be cleaner, but hey, I'm in a hurry ;-p
Rudy, your virtual beer count is in the 100's by now surely..!!!!
On 16/04/2008, r937 <[EMAIL PROTECTED]> wrote:
> > Rudy, I took 100 out of a hat.. it's more likey to be 100,000
> >
>
> todd, you really should stop doing that ;o)
>
> you ask a question, you get an answer, and then you change the question!!!
>
> no fair!!!
>
> it makes the guy who answered the question look silly
>
> and furthermore, it makes him RELUCTANT to answer any more of your
> questions
>
> ;o)
>
>
> > So I'll use Jure's suggestion for now...
> >
>
> great
>
> where will you be getting the rank from?
>
> good luck
>
>
> rudy
> http://r937.com/
>
> ____ • The WDVL Discussion List from WDVL.COM • ____
> To Join wdvltalk, Send An Email To:
> mailto:[EMAIL PROTECTED] or
> use the web interface
> http://e-newsletters.internet.com/discussionlists.html/
> Send Your Posts To: [email protected]
> To change subscription settings, add a password or view the web interface:
> http://intm-dl.sparklist.com/read/?forum=wdvltalk
>
> ________________ http://www.wdvl.com _______________________
>
> You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> [EMAIL PROTECTED]
>
> To unsubscribe via postal mail, please contact us at:
> Jupitermedia Corp.
> Attn: Discussion List Management
> 475 Park Avenue South
> New York, NY 10016
>
> Please include the email address which you have been contacted with.
>
--
"The only people who don't make mistakes are those who don't do anything"
Give a man a fish and he'll feed himself for a day.
Give a man a religion and he'll starve to death praying for a fish.
Anon
`We are what we pretend to be, so we must be careful what we pretend to be.`
Kurt Vonnegut
`When a person can no longer laugh at himself, it is time for others
to laugh at him.`
Thomas Szasz
____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.