collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 353
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: SMF Arcade BLOCK  (Read 28713 times)

0 Members and 1 Guest are viewing this topic.

Offline SPARK

  • Semi Newbie
  • *
  • Posts: 16
  • Gender: Male
    • IDK GAMING
  • SMF Version: 2 RC1
  • SP Version: 2.2
SMF Arcade BLOCK
« on: May 03, 2009, 10:45:07 AM »
Hey can someone please make a block for SMF Arcade to show winners/high scores.

There is already a block made for TP here

http://www.smfarcade.info/forum/index.php/topic,2084.0.html

But tp is fail.


Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: SMF Arcade BLOCK
« Reply #1 on: May 03, 2009, 12:49:57 PM »
There is already a built-in arcade block available in SimplePortal 2.2. Also, a TP block code should be working with SP PHP block too.
And slowly, you come to realize... It's all as it should be...

Offline SPARK

  • Semi Newbie
  • *
  • Posts: 16
  • Gender: Male
    • IDK GAMING
  • SMF Version: 2 RC1
  • SP Version: 2.2
Re: SMF Arcade BLOCK
« Reply #2 on: May 03, 2009, 10:19:32 PM »
ty for your reply i know of the built in one but it has limited functions. The tp one dose not work and gives me this error.

Code: [Select]
Fatal error: Call to undefined function db_query() in /home/idkgamin/public_html/Sources/SPortal2.php(3133) : eval()'d code on line 35
The TP block includes some features like srolling and what not but i might be worth anyonetime.

Ty anyway.


Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: SMF Arcade BLOCK
« Reply #3 on: May 04, 2009, 12:54:30 AM »
The TP block is designed for SMF 1.1.x, it will work if you change the database query so that it works for SMF 2.

I have converted the code below for SMF 2, it should work, but I haven't tested it:
Code: [Select]
//-------START-------------
/*
|----------------------------------
SMF ARCADE SCROLLING CHAMPS BLOCK for SMFARCADE V2
by Eric Lawson
|----------------------------------
Made for TinyPortal and SMF forum

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

// -- SETUP EDITS ---

$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

global $scripturl,$sourcedir,$boardurl,$smcFunc,$modSettings;
require_once($sourcedir.'/ArcadeStats.php');

//Get newest champ or die
$sql = "SELECT  game.id_game, game.game_name, game.thumbnail, game.game_directory,
       IFNULL(mem.id_member, 0) AS id_member, IFNULL(mem.real_name,'') AS real_name, score.score
        FROM {db_prefix}arcade_scores AS score
        LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = score.id_member)
       JOIN {db_prefix}arcade_games AS game ON (game.id_game = score.id_game)
        ORDER BY `champion_from` DESC
        LIMIT 0,1";
if(!($request = $smcFunc['db_query']('', $sql)))
{
   die("Could not get the newest champ");
}
$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);

if(isset($row['game_directory']))
{
   $row['game_directory']=$row['game_directory']."/";
}

//newest champ details
$playerid = $row['id_member'];
$player = $row['real_name'];
$game_id = $row['id_game'];
$game_name = $row['game_name'];
$score = $row['score'];
$game_pic = $modSettings['games_url'].$row['game_irectory'].$row['thumbnail'];

$bp=ArcadeStats_BestPlayers($no);

$score_poss=0; //players position

?>

<script type="text/javascript">

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scrollx=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeedx=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseitx=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeedx=marqueespeedx
var pausespeedx=(pauseitx==0)? copyspeedx: 0
var actualheightx=''

function scrollmarqueex(){
if (parseInt(cross_marqueex.style.top)>(actualheightx*(-1)+8))
cross_marqueex.style.top=parseInt(cross_marqueex.style.top)-copyspeedx+"px"
else
cross_marqueex.style.top=parseInt(marqueeheightx)+8+"px"
}

function initializemarqueex(){
cross_marqueex=document.getElementById("vmarqueex")
cross_marqueex.style.top=0
marqueeheightx=document.getElementById("marqueecontainerx").offsetHeight
actualheightx=cross_marqueex.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marqueex.style.height=marqueeheightx+"px"
cross_marqueex.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarqueex()",30)', delayb4scrollx)
}

if (window.addEventListener)
window.addEventListener("load", initializemarqueex, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarqueex)
else if (document.getElementById)
window.onload=initializemarqueex

</script>
<?php
echo '<table width="100%">
         <tr>
            <td align="center">
               <br />
               <a href="'
,$scripturl,'?action=arcade"><img src="',$settings['images_url'],'/arcade_block.gif" border= "0" alt="Arcade" /></a>
               <br /><br/>
            </td>
         </tr>
      </table>
      <div id="marqueecontainerx" style="position: relative; width: 95%; height:200px; overflow: hidden; border: 0px; padding: 2px; padding-left: 4px;" onmouseover="copyspeedx=pausespeedx" onmouseout="copyspeedx=marqueespeedx">
         <div id="vmarqueex" style="position: absolute; width: 98%;">
            <div align="center">
               <a href="'
,$scripturl,'?action=arcade;sa=play;game=',$game_id,'"><img src="',$game_pic,'" border="0" alt="',$game_name,'" width="60" height="60"/></a>
               <br />'
,$txtlate,'<br />
               <a href="'
,$scripturl,'?action=profile;u=',$playerid,'">',$player,'</a>
               <br/>'
,$txtwit,' ',$score,' ',$txton,'<br />',$game_name,'
               <br />------------------<br />'
,$txtplay,'<br /><br />';
               foreach (
$bp as $out)
               {
                  
$score_poss++;
                  echo 
'',$score_poss,' - ',$out['link'],'<br />',$txtwin,' ',$out['champions'],'
                       <br /><br />'
;
               };
   echo 
'</div>
         </div>
      </div>'
;
      
//---------END--------------
« Last Edit: May 04, 2009, 11:55:17 AM by [SiNaN] »
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline SPARK

  • Semi Newbie
  • *
  • Posts: 16
  • Gender: Male
    • IDK GAMING
  • SMF Version: 2 RC1
  • SP Version: 2.2
Re: SMF Arcade BLOCK
« Reply #4 on: May 04, 2009, 08:14:20 AM »
Thanks for your time but it didn't work.

Code: [Select]
Parse error: syntax error, unexpected ']' in /home/idkgamin/public_html/Sources/SPortal2.php(3133) : eval()'d code on line 39


Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: SMF Arcade BLOCK
« Reply #5 on: May 04, 2009, 11:55:36 AM »
I've made a fix in the post above by LHVWB. Would you try again?
And slowly, you come to realize... It's all as it should be...

Offline aceflybye

  • Semi Newbie
  • *
  • Posts: 12
  • Gender: Male
  • Life is Art - Art is Life
    • AceFlyBye.com
  • SMF Version: None
  • SP Version: None
Re: SMF Arcade BLOCK
« Reply #6 on: May 04, 2009, 04:21:01 PM »
I just tryed it and woot it works ty so much!  :D

Offline SPARK

  • Semi Newbie
  • *
  • Posts: 16
  • Gender: Male
    • IDK GAMING
  • SMF Version: 2 RC1
  • SP Version: 2.2
Re: SMF Arcade BLOCK
« Reply #7 on: May 04, 2009, 09:38:42 PM »
It works! TYVM for your support guys.


Offline aceflybye

  • Semi Newbie
  • *
  • Posts: 12
  • Gender: Male
  • Life is Art - Art is Life
    • AceFlyBye.com
  • SMF Version: None
  • SP Version: None
Re: SMF Arcade BLOCK
« Reply #8 on: May 04, 2009, 10:16:06 PM »
I donno if others have this issue but my game images didn't appear so I changed it so its looking in /Games/ for the game images not the root. below is it fixed
Code: [Select]
//-------START-------------
/*
|----------------------------------
SMF ARCADE SCROLLING CHAMPS BLOCK for SMFARCADE V2
by Eric Lawson
|----------------------------------
Made for TinyPortal and SMF forum

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

// -- SETUP EDITS ---

$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

global $scripturl,$sourcedir,$boardurl,$smcFunc,$modSettings;
require_once($sourcedir.'/ArcadeStats.php');

//Get newest champ or die
$sql = "SELECT  game.id_game, game.game_name, game.thumbnail, game.game_directory,
        IFNULL(mem.id_member, 0) AS id_member, IFNULL(mem.real_name,'') AS real_name, score.score
        FROM {db_prefix}arcade_scores AS score
        LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = score.id_member)
        JOIN {db_prefix}arcade_games AS game ON (game.id_game = score.id_game)
        ORDER BY `champion_from` DESC
        LIMIT 0,1";
if(!($request = $smcFunc['db_query']('', $sql)))
{
   die("Could not get the newest champ");
}
$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);

if(isset($row['game_directory']))
{
   $row['game_directory']=$row['game_directory']."/";
}

//newest champ details
$playerid = $row['id_member'];
$player = $row['real_name'];
$game_id = $row['id_game'];
$game_name = $row['game_name'];
$score = $row['score'];
$game_pic = $modSettings['games_url'].$row['game_directory'].$row['thumbnail'];

$bp=ArcadeStats_BestPlayers($no);

$score_poss=0; //players position

?>

<script type="text/javascript">

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scrollx=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeedx=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseitx=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeedx=marqueespeedx
var pausespeedx=(pauseitx==0)? copyspeedx: 0
var actualheightx=''

function scrollmarqueex(){
if (parseInt(cross_marqueex.style.top)>(actualheightx*(-1)+8))
cross_marqueex.style.top=parseInt(cross_marqueex.style.top)-copyspeedx+"px"
else
cross_marqueex.style.top=parseInt(marqueeheightx)+8+"px"
}

function initializemarqueex(){
cross_marqueex=document.getElementById("vmarqueex")
cross_marqueex.style.top=0
marqueeheightx=document.getElementById("marqueecontainerx").offsetHeight
actualheightx=cross_marqueex.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marqueex.style.height=marqueeheightx+"px"
cross_marqueex.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarqueex()",30)', delayb4scrollx)
}

if (window.addEventListener)
window.addEventListener("load", initializemarqueex, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarqueex)
else if (document.getElementById)
window.onload=initializemarqueex

</script>
<?php
echo '<table width="100%">
         <tr>
            <td align="center">
               <br />
               <a href="'
,$scripturl,'?action=arcade"><img src="',$settings['images_url'],'/Games/arcade_block.gif" border= "0" alt="Arcade" /></a>
               <br /><br/>
            </td>
         </tr>
      </table>
      <div id="marqueecontainerx" style="position: relative; width: 95%; height:200px; overflow: hidden; border: 0px; padding: 2px; padding-left: 4px;" onmouseover="copyspeedx=pausespeedx" onmouseout="copyspeedx=marqueespeedx">
         <div id="vmarqueex" style="position: absolute; width: 98%;">
            <div align="center">
               <a href="'
,$scripturl,'?action=arcade;sa=play;game=',$game_id,'"><img src="/Games',$game_pic,'" border="0" alt="',$game_name,'" width="60" height="60"/></a>
               <br />'
,$txtlate,'<br />
               <a href="'
,$scripturl,'?action=profile;u=',$playerid,'">',$player,'</a>
               <br/>'
,$txtwit,' ',$score,' ',$txton,'<br />',$game_name,'
               <br />------------------<br />'
,$txtplay,'<br /><br />';
               foreach (
$bp as $out)
               {
                  
$score_poss++;
                  echo 
'',$score_poss,' - ',$out['link'],'<br />',$txtwin,' ',$out['champions'],'
                       <br /><br />'
;
               };
   echo 
'</div>
         </div>
      </div>'
;
      
//---------END--------------

Offline SPARK

  • Semi Newbie
  • *
  • Posts: 16
  • Gender: Male
    • IDK GAMING
  • SMF Version: 2 RC1
  • SP Version: 2.2
Re: SMF Arcade BLOCK
« Reply #9 on: May 18, 2009, 04:44:52 AM »
ahh nice tyvm i never noticed they were missing because i use Firefox.


Offline SPARK

  • Semi Newbie
  • *
  • Posts: 16
  • Gender: Male
    • IDK GAMING
  • SMF Version: 2 RC1
  • SP Version: 2.2
Re: SMF Arcade BLOCK
« Reply #10 on: May 18, 2009, 04:49:59 AM »
um just to let you know you missed a /. It should be "/Games/"

Quote
<a href="',$scripturl,'?action=arcade;sa=play;game=',$game_id,'"><img src="/Games',$game_pic,'" border="0" alt="',$game_name,'" width="60" height="60"/></a>

or that whats working for me.


Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 114
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: SMF Arcade BLOCK
« Reply #11 on: April 04, 2012, 06:00:52 PM »
Sorry for bumping another old thread... but this code is working AWESOME ...aside from the fact that it is throwing these two errors:

http://www.aha-forums.com/index.php?action=admin;area=portalblocks;sa=edit
8: Undefined variable: settings
File: /home/ahaforum/public_html/Sources/PortalBlocks.php(3562) : eval()'d code
Line: 112

http://www.aha-forums.com/index.php?action=admin;area=portalblocks;sa=edit
8: Undefined index: games_url
File: /home/ahaforum/public_html/Sources/PortalBlocks.php(3562) : eval()'d code
Line: 53

Both go away when I remove the block.  Any ideas on how I can fix/work around these issues?

THANKS!

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: SMF Arcade BLOCK
« Reply #12 on: April 04, 2012, 07:52:39 PM »
@FrizzleFried,

I think I updated & improved this block quite a while back.
Have a look at a bunch of arcade blocks and plugins located here: SMF Arcade Blocks and Plug-ins

For the arcade blocks look at : Block Codes ->  SMF 2.0 Rcx and SMF Arcade - High Scores Block
« Last Edit: April 04, 2012, 08:30:22 PM by Underdog »