Hi there,
I'm working on a little project for a PHP-Nuke site. I'm building a Add-on module, well adapting one I've already made and copy righted.
What I'm try'n to add to it is a second query to find a rank image to go with a name in a "Top 10" block....
This is what I have so far... And works great : www.trsquad.com/index.php NOTE: The bottom right block!
Here's the script:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2003 by Shadow~tr~ (webmaster@trsquad.com) */
/* [url]http://www.trsquad.com[/url] */
/* */
/* This is beta test of a Top 10 players block for the PHP-Nuke / Bab.stats*/
/* Chronos port. */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Top-10-BHD.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $prefix, $db, $sitename;
$sql = "SELECT name, id, rating FROM chronos_players ORDER BY rating DESC LIMIT 10";
$result = $db->sql_query($sql);
$content = "<br>";
while ($row = $db->sql_fetchrow($result)) {
$rating = $row[rating];
$name = "".htmlspecialchars(base64_decode($row[name]))." ";
$id = $row[id];
//
$content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"> <a href=\"modules.php?name=Chronos&action=player_stats&id=$id\">$name</a><br>";
}
?>
Now I'm trying to add something like this:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2003 by Shadow~tr~ (webmaster@trsquad.com) */
/* [url]http://www.trsquad.com[/url] */
/* */
/* This is beta test of a Top 10 players block for the PHP-Nuke / Bab.stats*/
/* Chronos port. */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Top-10-BHD-1.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $prefix, $db, $sitename;
$sql = "SELECT name, id, rating FROM chronos_players ORDER BY rating DESC LIMIT 10";
$result = $db->sql_query($sql);
$content = "<br>";
while ($row = $db->sql_fetchrow($result)) {
$rating = $row[rating];
$name = "".htmlspecialchars(base64_decode($row[name]))." ";
$id = $row[id];
$sql2 = "SELECT thumbnail FROM chronos_ranks ORDER BY rating DESC LIMIT 10";
$result2 = $db->sql_query($sql2);
$content = "<br>";
while ($row2 = $db->sql_fetchrow($result2)) {
$thumbnail = $row2[thumbnail];
$content .= "<img src=\"modules/Chronos/$thumbnail\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"> <a href=\"modules.php?name=Chronos&action=player_stats&id=$id\">$name</a><br>";
}
?>
What am I doing wrong here? After I add this section:
$sql2 = "SELECT thumbnail FROM chronos_ranks ORDER BY rating DESC LIMIT 10";
$result2 = $db->sql_query($sql2);
$content = "<br>";
while ($row2 = $db->sql_fetchrow($result2)) {
$thumbnail = $row2[thumbnail];
$content .= "<img src=\"modules/Chronos/$thumbnail\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"> <a href=\"modules.php?name=Chronos&action=player_stats&id=$id\">$name</a><br>";
}PHP] I get a parse error, the error points to the line associated with the "?>" :confused: Please help!