News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

need little help changing this code to work with smf 2.0

Started by SA™, April 12, 2008, 03:15:40 AM

Previous topic - Next topic

metallica48423

can you look in the error logs and see if they provide more information about the errors?
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

SA™

here the error from the logs

http://waynesworld.kicks-ass.net/forum/index.php?http://waynesworld.kicks-ass.net/champs.php 
Database Error: Unknown column 'mem.realName' in 'field list'
File: C:/****/htdocs/champs.php
Line: 29 

   Guest   Today at 10:09:33 pm 
82.43.83.106     3cea2ca62c585027270d6fc870687531 
   Type of error: Database 
http://waynesworld.kicks-ass.net/forum/index.php?http://waynesworld.kicks-ass.net/champs.php 
Database Error: Unknown column 'mem.realName' in 'field list'
File: C:/****/htdocs/champs.php
Line: 29 

   wdm2005   April 14, 2008, 04:55:30 am 
82.43.83.106     6c447dc181614c525288757f6d6f053f 
   Type of error: Database 
http://waynesworld.kicks-ass.net/forum/index.php?http://waynesworld.kicks-ass.net/champs.php 
Database Error: 
File: C:/****/htdocs/champs.php
Line: 25 

   wdm2005   April 14, 2008, 04:50:17 am 
82.43.83.106     6c447dc181614c525288757f6d6f053f 
   Type of error: Database 
http://waynesworld.kicks-ass.net/forum/index.php?http://waynesworld.kicks-ass.net/champs.php 
Database Error: 
File: C:/****/htdocs/champs.php
Line: 25 

   wdm2005   April 14, 2008, 04:48:04 am 
82.43.83.106     6c447dc181614c525288757f6d6f053f 
   Type of error: Database 
http://waynesworld.kicks-ass.net/forum/index.php?http://waynesworld.kicks-ass.net/champs.php 
Database Error: 
File: C:/****/htdocs/champs.php
Line: 25 

   wdm2005   April 14, 2008, 04:48:02 am 
82.43.83.106     6c447dc181614c525288757f6d6f053f 
   Type of error: Database 
http://waynesworld.kicks-ass.net/forum/index.php?http://waynesworld.kicks-ass.net/champs.php 
Database Error: 
File: C:/****/htdocs/champs.php
Line: 25 

   wdm2005   April 14, 2008, 04:47:38 am 
82.43.83.106     6c447dc181614c525288757f6d6f053f 
   Type of error: Database 
http://waynesworld.kicks-ass.net/forum/index.php?http://waynesworld.kicks-ass.net/champs.php 
Database Error: 
File: C:/****/htdocs/champs.php
Line: 25 

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

metallica48423

Ahh... i neglected to actually rewrite the query part of the query... my apoligies :P

I'll look at it again and post again when i'm done
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

metallica48423

Okay, try this


<?php

function ArcadeStats_BestPlayers($count 10)
{
global 
$smcFunc;

$result $smcFunc['db_query'](''"
SELECT count(*) AS champions, IFNULL(mem.id_member, 0) AS id_member, IFNULL(mem.real_name, '') AS real_name, IFNULL(mem.avatar, '') AS avatar
FROM {db_prefix}arcade_games AS game
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = game.id_member_first)
WHERE id_score_first > 0
GROUP BY game.id_member_first
ORDER BY champions DESC 
LIMIT 0, {int:count}"
,
array(
'count' => $count,
)
 );

$top = array();
$max = -1;

while (
$score $smcFunc['db_fetch_assoc']($result))
{
if (
$max == -1)
$max $score['champions'];

$top[] = array(
'name' => $score['member_name'],
'avatar' => $score['avatar'],
'link' => !empty($score['member_name']) ? '<a href="' $scripturl '?action=profile;u=' $score['id_member'] . '">' .  $score['member_name'] . '</a>' $txt['arcade_guest'],
'champions' => $score['champions'],
//'precent' => ($score['champions'] / $max) * 100,
);
}

if (
count($top) == 0)
return 
false;
elseif (
$count 1)
return 
$top;
else
return 
$top[0];
}
$top_player ArcadeStats_BestPlayers(10);
$i=0//players position

//array for icons
$poz = array('/first.gif','/second.gif','/third.gif','/fourth.gif','/fifth.gif','/sixth.gif','/seventh.gif','/eigth.gif','/ninth.gif','/tenth.gif');

echo 
'
<table width="100%" border="0" cellpadding="1">
<tr>
<td class="titlebg" colspan="10"><div align="center"><b>Top 10 Arcade Champions</b></div></td></tr><tr></br></tr><tr>'
;
if(
$top_player != false)
{
foreach (
$top_player as $row)

echo 
'

<td><div align="center"><img src="http://waynesworld.kicks-ass.net/forum/Themes/default/images/arc_icons'
,$poz[$i] , '"/><br/><br/>
<img src="http://waynesworld.kicks-ass.net/forum/avatars/'
$row['avatar'],'"><br/>
'
,$row['link'],'<br/>
'
,$row['champions'],' </div></span></td>
'
;
$i++;
}

echo
'</tr><tr></br></tr><tr></br></tr><tr></br></tr><tr></br></tr></table></div>';

?>


Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

SA™

ok that got it but its not showing the nameit shows the avatar and ammount of wins but no name

see here

http://waynesworld.kicks-ass.net/champs.php
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

SA™

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

metallica48423

can I ask what you changed that fixed it? just for my own info :P
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

SA™

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Advertisement: