You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 51 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Modifying Top Module [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Tokeda
Nuke Cadet
Nuke Cadet


Joined: May 25, 2005
Posts: 9


PostPosted: Fri Jun 17, 2005 8:37 pm Reply with quoteBack to top

Ok, I have been at this for over 36 hours now and I am stuck. I have tried everything I could think of and I know the answer I seek has got to be right underneath my nose. Hopefully one you of can assist me with this.

What I am attemptting to do, is to totally redo my Top module so that it displays the top earner in Credits. My site is based off a RPG that myself and a few friends are designing. Below is my coding so far.

Code:

/* Top 10 Characters - Gold */



$result8 = $db->sql_query("SELECT name, Credits FROM `nuke_registry` ORDER BY Credits DESC");

if ($db->sql_numrows($result8)>0) {

    echo "<table border=\"0\" cellpadding=\"10\" width=\"100%\"><tr><td align=\"left\">\n"

   ."<font class=\"option\"><b>$top "._CHARGOLD."</b></font><br><br><font class=\"content\">\n";

    $lugar = 1;

    $counter = 0;

    while($object = sql_fetch_object($result8, $dbi)) {

   $resultArray[$counter] = array($object->Credits, $object->mame);

   $counter++;

    }

    for ($count = 0; $count < count($resultArray); $count++) {

   $id = $resultArray[$count][0];

   $pollTitle = $resultArray[$count][1];

   $voters = $resultArray[$count][3];

   for($i = 0; $i < 12; $i++) {

       $object = sql_fetch_object($result8, $dbi);

       $optionCount = $object->optionCount;

       $sum = (int)$sum+$optionCount;

   }

   echo "<strong><big>&middot;</big></strong>&nbsp;$lugar: - ($sum "._CREDITS.")<br>\n";

   $lugar++;

   $sum = 0;

    }

    echo "</font></td></tr></table><br>\n";

}


I understand exactly whats going wrong here, its just I cant figure out how to fic it. Below is the output to the file the above script gives.

Code:

10 Richest Characters

· 1: - ( Credits Earned)
· 2: - ( Credits Earned)


Well, I hope I explained exactly what I am trying to accomplish and someone out there could kindly assist me here *is so exhausted he heads to bed!*

P.S. Hope this was the right area for this post, if not, sorry.

Edit:
The SQL query is completely correct, I just need to figure out how to get it to post the result to the web page to a maximum of 10 names and to automatically post a number before the name. Any and All help is appreciated.

Re-Edit:
YES!! Nevermind now. Took me a while but I was able to do it myself. Incase others need to do such in the future, I will include the coding I used below.

Code:

/* Top 10 Characters - Gold */

global $name, $Credits, $dbi;

    echo "<table border=\"0\" cellpadding=\"10\" width=\"100%\"><tr><td align=\"left\">\n"
   ."<font class=\"option\"><b>Top $top "._CHARGOLD."</b></font><br><br><font class=\"content\">\n";
$lugar=1;
 
    $result=sql_query("SELECT name, Credits FROM nuke_registry ORDER BY Credits DESC LIMIT 0,10", $dbi);
    while(list($name, $Credits) = sql_fetch_row($result, $dbi)) {
echo "<strong><big>&middot;</big></strong>&nbsp;$lugar: - &nbsp;<b>$name</b>&nbsp;&nbsp;Credits:&nbsp;$Credits&nbsp;<br>\n";
$lugar++;
}

echo "</font></td></tr></table><br>\n";
Find all posts by TokedaView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.213 Seconds - 487 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::