Advertisement:

Author Topic: need little help changing this code to work with smf 2.0  (Read 11813 times)

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: need little help changing this code to work with smf 2.0
« Reply #20 on: April 20, 2008, 06:19:25 PM »
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

Quote
Microsoft 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
     

Offline SA™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,954
  • (T)ogether (E)veryone (A)chieves (M)ore
    • DenotsNiaga on Facebook
    • SAChatBar
Re: need little help changing this code to work with smf 2.0
« Reply #21 on: April 20, 2008, 06:36:35 PM »
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
Quote
My allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: need little help changing this code to work with smf 2.0
« Reply #22 on: April 20, 2008, 09:21:58 PM »
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

Quote
Microsoft 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
     

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: need little help changing this code to work with smf 2.0
« Reply #23 on: April 20, 2008, 09:24:53 PM »
Okay, try this

Code: [Select]
<?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

Quote
Microsoft 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
     

Offline SA™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,954
  • (T)ogether (E)veryone (A)chieves (M)ore
    • DenotsNiaga on Facebook
    • SAChatBar
Re: need little help changing this code to work with smf 2.0
« Reply #24 on: April 21, 2008, 12:26:46 AM »
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
Quote
My allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Offline SA™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,954
  • (T)ogether (E)veryone (A)chieves (M)ore
    • DenotsNiaga on Facebook
    • SAChatBar
Re: need little help changing this code to work with smf 2.0
« Reply #25 on: April 21, 2008, 12:32:41 AM »
topic solved thank you metalica
http://samods.github.io/SAChatBar/

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

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: need little help changing this code to work with smf 2.0
« Reply #26 on: April 21, 2008, 12:45:39 AM »
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

Quote
Microsoft 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
     

Offline SA™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,954
  • (T)ogether (E)veryone (A)chieves (M)ore
    • DenotsNiaga on Facebook
    • SAChatBar
Re: need little help changing this code to work with smf 2.0
« Reply #27 on: April 21, 2008, 12:49:57 AM »
i changed this

 
Code: [Select]
real_name
to

 
Code: [Select]
member_name
http://samods.github.io/SAChatBar/

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