TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 291
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 173
  • Total: 173

Pulling in high scores from smfarcade into a block. Has anybody tried this?

Started by houston, November 08, 2005, 03:43:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

houston

Quote from: Ray on February 24, 2006, 05:20:03 AM
Quote from: houston on February 24, 2006, 04:12:34 AM
Thanks for this info Ray. Unfortunatly I am getting a parse error in my load.php file.

Parse error: parse error, unexpected '[' in /home/eaglebay/public_html/forum/Sources/Load.php(1607) : eval()'d code(34) : eval()'d code on line 1

I have looked at line 1607 and can not see a [ in that line. This is what I am seeing.

// Are we going to use eval?
   if (empty($modSettings['disableTemplateEval']))
   {
      $file_found = file_exists($filename) && eval('?' . '>' . rtrim(file_get_contents($filename))) !== false;
      $settings['current_include_filename'] = $filename;
   }
   else
   {
      $file_found = file_exists($filename);

      if ($once && $file_found)
         require_once($filename);
      elseif ($file_found)
         require($filename);
   }

   if ($file_found !== true)
   {
      ob_end_clean();
      if (!empty($modSettings['enableCompressedOutput']))
         @ob_start('ob_gzhandler');
      else
         ob_start();

      if (isset($_GET['debug']) && !WIRELESS)
         header('Content-Type: application/xhtml+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));

This is from line line 1604 to line 1626 line 1607 is red.

Does anybody have any thoughts on this error

Thanks
I havent had any errors with it - umm You are using a php box right??

Yes I am

borgBOB

Need link to site, sometimes a good mechanic needs to look under the hood. Admin test account would be cool also, but only PM that info.

houston

Quote from: borgBOB on February 24, 2006, 05:24:58 AM
Need link to site, sometimes a good mechanic needs to look under the hood. Admin test account would be cool also, but only PM that info.

I will set one up for you ASAP

borgBOB

May only need a copy of your load.php file. First attach one here.

houston


borgBOB

I can find zero differences between your load.php, and one that works on my sites houston. I think this is one of those cryptic errors, that is misleading us.
The only mod that changes load.php is TP, and those edits are no where near the error  you are getting.

houston

Quote from: borgBOB on February 24, 2006, 05:46:22 AM
I can find zero differences between your load.php, and one that works on my sites houston. I think this is one of those cryptic errors, that is misleading us.
The only mod that changes load.php is TP, and those edits are no where near the error  you are getting.

Thanks for having a look at it. As much as I would love to have this block running. It is not that important right now. I will keep it deactivated and have another look at it later.

And thanks again for your prompt reply.

borgBOB

houston, do you have a "  <?php "
in your php block? If yes, then remove it.

Ray

this is the code I am using
/*
|----------------------------------
      SMF ARCADE CHAMPS BLOCK
      by Eric Lawson
|----------------------------------
      Made for

      TinyPortal
      SMF SMF forum 1.1RC1/RC2
      SMF Arcade_1.2.4b (1.2.4 should be ok :) )
      And Works with Beta Arcade


*/


//Upload the arcade_block.gif (you can use you own gif - just name it arcade_block.gif)
//to your Themes/<themename>/images/ folder

// -- SETUP EDITS ---

$db_prefix = 'arcade_'; //edit this to your your database prefix - usually smf_
$no = 10; //number of top players to show

// --LANGUAGE EDITS --
$txtplay = "The Top Players"; // change "The Top Players" to your language
$txtwin = "Number Of Wins :";// change "Number Of Wins :" to your language
$txtlate = "Latest High Score by ";// change "Latest High Score set by" to your language
$txtwit = "with ";// change "with" to your language
$txton = "on ";// change "on" to your language

require('./Settings.php');


$link = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name, $link);

// --START BLOCK CODE --
$content = "";  //set blank for a start

//Get newest champ or die
$sql = "SELECT m.ID_MEMBER,m.realName,g.id, g.game, g.name,g.champion_score "
. "FROM {$db_prefix}members m , {$db_prefix}games g "
. "WHERE g.champion_score > 0 AND m.ID_MEMBER=g.champion_member "
. "ORDER BY g.champion_time DESC LIMIT 0,1";

if(!($result = mysql_query($sql,$link)))
{
die("Could not get the newest champ");
}
$row = mysql_fetch_assoc($result);
mysql_free_result($result);

//newest champ details
$playerid = $row['ID_MEMBER'];
$player = $row['realName'];
$game_id = $row['id'];
$game_name = $row['name'];
$score = $row['champion_score'];

//now get the pic for the game
$ext = array('gif','GIF','png','PNG','jpg','JPG',);
$game_pic = ""; // No thumbnail for default
foreach($ext as $ex)
{
if(file_exists($boarddir. "/Games/".$row['game'].".".$ex))
{
$game_pic = $boardurl."/Games/".$row['game'].".".$ex;
}
}


//Get the 10 best players or die
$sql = "SELECT m.ID_MEMBER, m.realName, count(g.id) As cnt"
. " FROM {$db_prefix}games g, {$db_prefix}members m"
. " WHERE m.ID_MEMBER=g.champion_member"
. " GROUP BY realName "
. " ORDER BY cnt DESC LIMIT 0,{$no}";
if(!($result = db_query($sql,__FILE__,__LINE__)))
{
die("Could not get the best players");
}

$row = mysql_fetch_assoc($result);

$score_poss=0; //players position

//make the block content
$content .= "<table width=\"100%\" ><tr>
</tr>";

$content .= "
<tr>
<td>
<marquee behavior='scroll' align='center' direction='up' height='160' scrollamount='1' scrolldelay='50' onmouseover='this.stop()' onmouseout='this.start()'>
<br />
<div align=\"center\"><a href=\"{$scripturl}?action=arcade;sa=play;game={$game_id}\"><img src=\"{$game_pic}\" border= \"0\" /></a>
<br />{$txtlate}<br />
<a href=\"{$scripturl}?action=profile;u=$playerid\">{$player}</a><br />{$txtwit} {$score} {$txton} {$game_name}
<br />------------------<br />{$txtplay}
<br /> ";
do
{
$score_poss++;
$content .= "
$score_poss -
<a href=\"{$scripturl}?action=profile;u=".$row['ID_MEMBER']."\"> ".$row['realName']."</a>
<br /> $txtwin ".$row['cnt']."
<br /><br />";
}  while ($row = mysql_fetch_assoc($result));

mysql_free_result($result);
$content .= "</marquee></div></td></tr></table>" ;

echo $content;

TwinsX2Dad

Quote from: Ray on February 24, 2006, 03:16:32 AM
am I safe? lol

Of course you are - I can see your picture! :D

Now to the problem at hand. I was careless on my first copy/paste and picked up a BB code error on Ray's site. The code starts with this:

[code/*
|----------------------------------
      SMF ARCADE CHAMPS BLOCK
      by Eric Lawson
|----------------------------------
      Made for

      TinyPortal
      SMF SMF forum 1.1RC1/RC2
      SMF Arcade_1.2.4b (1.2.4 should be ok :) )
      And Works with Beta Arcade


*/


Notice at the very beginning there is a "[code" that needs to be removed. When I returned to edit it, it was hidden up off the edit field, so it caused me about 3 minutes of frustration in not seeing it. It was my own stupidity, so I took me out back and kicked my tail.

It works perfectly now. Well, there are occasional scrolling hiccups, but I can live with those.

This website is proudly hosted on Crocweb Cloud Website Hosting.