SimplePortal
Customization => Custom Coding => Topic started by: mrtrc266 on December 12, 2008, 02:11:43 PM
-
E-Arcade Block for SP would be nice. It seems to be getting pretty popular
-
what do you mean e-arcade block?
-
what do you mean e-arcade block?
SP Currently has a block for SMF Arcade but E-Arcade is becoming very popular and it would be nice to have a block for E-Aracde as well.
You can check it out here on my site www.monsters-mansion.com and here is their site. http://www.ericsworld.eu/f2/index.php
-
thank you for enlightening me, I am really liking this e-arcade, the tournament feature is nice
-
thank you for enlightening me, I am really liking this e-arcade, the tournament feature is nice
NP...This site ( http://sleepy-arcade.ath.cx/ ) has some great mods for E-Arcade and he's (wdm2005 ) extremely helpful if you need assistance with anything. If you look at the raw E-Arcade vs. what I have on my site ( http://monsters-mansion.com/index.php?action=arcade ) you can see that it has some very nice features that I got from Sleepy Arcade.
-
thanks for the info!
-
I found a nice scrolling Arcade block on the E-arcade site, here:
http://www.ericsworld.eu/f2/index.php?topic=1802.msg6349#msg6349
But it throws this error:
Fatal error: Cannot redeclare games3() (previously declared in /home/xxxxxxx/public_html/Sources/Subs-SPortal1-1.php(567) : eval()'d code:66) in /home/xxxxxxx/public_html/Sources/SPortal1-1.php(2071) : eval()'d code on line 98
Has anyone else got this to work?
-
Upload attached file to your sourcedir. Then use these codes in a PHP block:
/******************************************************************************
* Tiny Portal/SMF Arcade - Combined Games and Scrolling Champ Block *
******************************************************************************* *
* File by: Eric Lawson - www.ericsworld.eu *
*******************************************************************************
* *
* To install: *
* Copy the entire contents (crtl+a)(ctrl+c) of this file into a phpblock *
* *
* Edits: *
* Change the txt strings to suit your language. *
* Set $no_topten = <number of top players to show> *
* Set $gamesUrl = <to the same as games url in arcade settings> *
* Set $no_games = <number of game icons to show at top of block> *
* Set $icons_per_row = <number of icons per row> *
* Set $gamesUrl = <to the same as games url in arcade settings> *
* *
* Uploads: *
* Upload a pic called arcade_block.gif *
* (you can use you own gif - just name it arcade_block.gif) to each: *
* Themes/<themename>/images/ *
* *
* This file is distributed in the hope that it is and will be useful, *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
******************************************************************************/
global $gamesUrl;
/*******EDITS*****************************************************************/
$no_games=8;
$icons_per_row = 4;
$no_topten = 10;
$gamesUrl = 'http://edit this to your path/Games/';
// --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
//******NOTHING TO EDIT BELOW HERE********************************************
global $scripturl,$sourcedir,$boardurl,$db_prefix,$modSettings,$settings;
require_once($sourcedir.'/ArcadeDbConnector.php');
require_once($sourcedir.'/ArcadeStats.php');
require_once($sourcedir.'/sp_get_games.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 />
</td>
</tr>
</table>';
$random_games_choice = rand(1,4);
$games_choice = 'games'.$random_games_choice;
$curr_position = 0;
$games_choice($no_games,$curr_position,$icons_per_row);
//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.realName,'') AS realName, 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(!($result = db_query($sql,__FILE__,__LINE__)))
{
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'];
$game_name = $row['game_name'];
$score = round($row['score'], 3);
$game_pic = !$row['game_directory'] ? $gamesUrl.$row['thumbnail'] : $gamesUrl.$row['game_directory']."/".$row['thumbnail'];
$bp=ArcadeStats_BestPlayers($no_topten);
$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 '<br />
<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>';
-
You are the man...works perfect! :thumbsup:
Thanks
-
My pleasure. Just so you know, SP silently parses your custom PHP block codes before really using them, to avoid any syntax errors totally breaking your forum.
-
Works perfectly! TYVM :)
-
This will not work with the SMF RC1, SP version 2.1.1 and the new arcade version E-Arcade Beta3-SMF2. I know I've been playing with it for an hour now..lol
-
Upload attached file to your sourcedir. Then use these codes in a PHP block:
/******************************************************************************
* Tiny Portal/SMF Arcade - Combined Games and Scrolling Champ Block *
******************************************************************************* *
* File by: Eric Lawson - www.ericsworld.eu *
*******************************************************************************
* *
* To install: *
* Copy the entire contents (crtl+a)(ctrl+c) of this file into a phpblock *
* *
* Edits: *
* Change the txt strings to suit your language. *
* Set $no_topten = <number of top players to show> *
* Set $gamesUrl = <to the same as games url in arcade settings> *
* Set $no_games = <number of game icons to show at top of block> *
* Set $icons_per_row = <number of icons per row> *
* Set $gamesUrl = <to the same as games url in arcade settings> *
* *
* Uploads: *
* Upload a pic called arcade_block.gif *
* (you can use you own gif - just name it arcade_block.gif) to each: *
* Themes/<themename>/images/ *
* *
* This file is distributed in the hope that it is and will be useful, *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
******************************************************************************/
global $gamesUrl;
/*******EDITS*****************************************************************/
$no_games=8;
$icons_per_row = 4;
$no_topten = 10;
$gamesUrl = 'http://edit this to your path/Games/';
// --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
//******NOTHING TO EDIT BELOW HERE********************************************
global $scripturl,$sourcedir,$boardurl,$db_prefix,$modSettings,$settings;
require_once($sourcedir.'/ArcadeDbConnector.php');
require_once($sourcedir.'/ArcadeStats.php');
require_once($sourcedir.'/sp_get_games.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 />
</td>
</tr>
</table>';
$random_games_choice = rand(1,4);
$games_choice = 'games'.$random_games_choice;
$curr_position = 0;
$games_choice($no_games,$curr_position,$icons_per_row);
//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.realName,'') AS realName, 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(!($result = db_query($sql,__FILE__,__LINE__)))
{
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'];
$game_name = $row['game_name'];
$score = round($row['score'], 3);
$game_pic = !$row['game_directory'] ? $gamesUrl.$row['thumbnail'] : $gamesUrl.$row['game_directory']."/".$row['thumbnail'];
$bp=ArcadeStats_BestPlayers($no_topten);
$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 '<br />
<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>';
Source Directory?
-
Upload attached file to your sourcedir. Then use these codes in a PHP block:
/******************************************************************************
* Tiny Portal/SMF Arcade - Combined Games and Scrolling Champ Block *
******************************************************************************* *
* File by: Eric Lawson - www.ericsworld.eu *
*******************************************************************************
* *
* To install: *
* Copy the entire contents (crtl+a)(ctrl+c) of this file into a phpblock *
* *
* Edits: *
* Change the txt strings to suit your language. *
* Set $no_topten = <number of top players to show> *
* Set $gamesUrl = <to the same as games url in arcade settings> *
* Set $no_games = <number of game icons to show at top of block> *
* Set $icons_per_row = <number of icons per row> *
* Set $gamesUrl = <to the same as games url in arcade settings> *
* *
* Uploads: *
* Upload a pic called arcade_block.gif *
* (you can use you own gif - just name it arcade_block.gif) to each: *
* Themes/<themename>/images/ *
* *
* This file is distributed in the hope that it is and will be useful, *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
******************************************************************************/
global $gamesUrl;
/*******EDITS*****************************************************************/
$no_games=8;
$icons_per_row = 4;
$no_topten = 10;
$gamesUrl = 'http://edit this to your path/Games/';
// --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
//******NOTHING TO EDIT BELOW HERE********************************************
global $scripturl,$sourcedir,$boardurl,$db_prefix,$modSettings,$settings;
require_once($sourcedir.'/ArcadeDbConnector.php');
require_once($sourcedir.'/ArcadeStats.php');
require_once($sourcedir.'/sp_get_games.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 />
</td>
</tr>
</table>';
$random_games_choice = rand(1,4);
$games_choice = 'games'.$random_games_choice;
$curr_position = 0;
$games_choice($no_games,$curr_position,$icons_per_row);
//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.realName,'') AS realName, 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(!($result = db_query($sql,__FILE__,__LINE__)))
{
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'];
$game_name = $row['game_name'];
$score = round($row['score'], 3);
$game_pic = !$row['game_directory'] ? $gamesUrl.$row['thumbnail'] : $gamesUrl.$row['game_directory']."/".$row['thumbnail'];
$bp=ArcadeStats_BestPlayers($no_topten);
$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 '<br />
<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>';
no go for me
-
@WBA Dude - you copy the content of the code tags to your PHP block and upload the file that is attached to Blue Dream's post to your /Sources/ directory.
@Jakki - The code came from the E-Arcade support site where it was being used with 2.0B4 and E-Arcade Beta3-SMF2
-
Should this still work in SP 2.2? I can't seem to get it going.
Thanks in advance for any help.
-
You don't need this anymore if you are using SP 2.2. Just create a block with Arcade option.
-
You don't need this anymore if you are using SP 2.2. Just create a block with Arcade option.
Yeah I saw those but to show 5 of each category it goes a mile long down the side of the portal. The smaller block with the scrolling info was much more suitable IMO
-
Mine is still working in 2.2. In fact I tried the Arcade block in 2.2 and got errors, so I'll stick with this one.
-
The custom code above still works on Sp 2.2? I can't get it going.
It would be nice to have all the categorys scroll in 1 block like this code provides.
-
Mine is still working in 2.2. In fact I tried the Arcade block in 2.2 and got errors, so I'll stick with this one.
What was the error you were getting? Would you help us identifying it?
The custom code above still works on Sp 2.2? I can't get it going.
It would be nice to have all the categorys scroll in 1 block like this code provides.
Sorry but "I can't get it going." doesn't help much. Any errors you are getting? Check your Forum Error Log too.
-
Sorry, yes when I use the code above in a PHP Block (exactly like I had it using SP 2.1) in a left block it wipes out all the blocks execpt for the left side.
And in the block itself it just shows this...pic attatched
No errors in error log
-
In the other topic you said that you have SMF 2.0 RC1 installed but the block codes in the first page are for SMF 1.1. Is this for another forums of yours?
-
Should this still work in SP 2.2? I can't seem to get it going.
Thanks in advance for any help.
Sorry for the confusion but above is what I said earlier in this thread....
-
Well, SP 2.2 support both SMF versions, SMF 1.1 and SMF 2.0. I'm not the author of the block code in question and don't know much about Arcade mods. I suggest making a request to the author to update his codes for SMF 2.0 versions.
-
K, will do...tyvm
-
In the preview mode I get this error.
Fatal error: Call to undefined function Arcade_Get_Array() in
/Sources/ArcadeStats.php on line 94
If I go ahead and add it, it wipes out all but the blocks on the side that I put it on. Basically if I put it on the left it causes all of the left side blocks to expand to full screen.
The E-Arcade block that you helped with earlier in this thread still works perfectly for me. That's the reason I didn't initially post the error I got.
-
Okay, would you try this for me?
Sources/SPortal1-1.php
Find:
require_once($sourcedir . '/Subs-Arcade.php');
Replace:
require_once($sourcedir . '/Subs-Arcade.php');
if (file_exists($sourcedir . '/ArcadeDbConnector.php'))
require_once($sourcedir . '/ArcadeDbConnector.php');
-
I'll be glad to try it, when I get home this evening. I'll let you know.
ETA: Sorry to take so long. I was at work today and didn't get a chance to make the change.
It worked perfectly!
-
Upload attached file to your sourcedir. Then use these codes in a PHP block:
/******************************************************************************
* Tiny Portal/SMF Arcade - Combined Games and Scrolling Champ Block *
******************************************************************************* *
* File by: Eric Lawson - www.ericsworld.eu *
*******************************************************************************
* *
* To install: *
* Copy the entire contents (crtl+a)(ctrl+c) of this file into a phpblock *
* *
* Edits: *
* Change the txt strings to suit your language. *
* Set $no_topten = <number of top players to show> *
* Set $gamesUrl = <to the same as games url in arcade settings> *
* Set $no_games = <number of game icons to show at top of block> *
* Set $icons_per_row = <number of icons per row> *
* Set $gamesUrl = <to the same as games url in arcade settings> *
* *
* Uploads: *
* Upload a pic called arcade_block.gif *
* (you can use you own gif - just name it arcade_block.gif) to each: *
* Themes/<themename>/images/ *
* *
* This file is distributed in the hope that it is and will be useful, *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
******************************************************************************/
global $gamesUrl;
/*******EDITS*****************************************************************/
$no_games=8;
$icons_per_row = 4;
$no_topten = 10;
$gamesUrl = 'http://edit this to your path/Games/';
// --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
//******NOTHING TO EDIT BELOW HERE********************************************
global $scripturl,$sourcedir,$boardurl,$db_prefix,$modSettings,$settings;
require_once($sourcedir.'/ArcadeDbConnector.php');
require_once($sourcedir.'/ArcadeStats.php');
require_once($sourcedir.'/sp_get_games.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 />
</td>
</tr>
</table>';
$random_games_choice = rand(1,4);
$games_choice = 'games'.$random_games_choice;
$curr_position = 0;
$games_choice($no_games,$curr_position,$icons_per_row);
//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.realName,'') AS realName, 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(!($result = db_query($sql,__FILE__,__LINE__)))
{
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'];
$game_name = $row['game_name'];
$score = round($row['score'], 3);
$game_pic = !$row['game_directory'] ? $gamesUrl.$row['thumbnail'] : $gamesUrl.$row['game_directory']."/".$row['thumbnail'];
$bp=ArcadeStats_BestPlayers($no_topten);
$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 '<br />
<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>';
What is the sourcedir. htdocs/forum?
Joe
-
Sources directory.
{forum_root}/Sources
-
Thanks. I installed this but none of the images show. Preview (http://www.colmoreband.byethost17.com/forum)
-
You need to edit this in the codes:
$gamesUrl = 'http://edit this to your path/Games/';
-
Any chance that all the correct codes for the latest RC3 and arcade can be put into a post for people please folks.
I want that arcade to scroll.
-
Any chance that all the correct codes for the latest RC3 and arcade can be put into a post for people please folks.
I want that arcade to scroll.
Any E-Arcade blocks for smf2 rc2 should also work with smf2 rc3.
The block you are requesting is here:
SMF 2.0 and E-Arcade Beta4 Scrolling Champs Block.
Download the attached file, unzip it and add its contents to: Themes / default / images / arc_icons
Add this to a PHP Portal Block:
/* Combined Games and Scrolling Champ Block
for use with E-Arcade and SMF2
File by: Eric Lawson - www.ericsworld.eu */
/* Configure settings at start of block
- Change the txt strings to suit your language.
- Set $no_topten = <number of top players to show>
- Set $gamesUrl = <to the same as games url in arcade settings> - should be ok to leave current settings
- Set $no_games = <number of game icons to show at top of block>
- Set $icons_per_row = <number of icons per row>
- Uploads:
- Upload a pic called arcade_block.gif
- (you can use you own gif - just name it arcade_block.gif) to each:
- Themes/default/images/ */
global $gamesUrl, $boardurl;
/* Configure your settings: */
$no_games=8;
$icons_per_row = 4;
$no_topten = 10;
$gamesUrl = $boardurl.'/Games/';
/* --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 */
/* NOTHING TO EDIT BELOW HERE */
global $scripturl,$sourcedir,$boardurl, $smcFunc,$modSettings,$settings;
$arc_icon1 = $boardurl . '/Themes/default/images/arc_icons/arcade_block.gif';
require_once($sourcedir.'/ArcadeStats.php');
echo '<table width="100%">
<tr>
<td align="center">
<br />
<a href="',$scripturl,'?action=arcade"><img src="',$arc_icon1,'" border= "0" alt="Arcade" /></a>
<br />
</td>
</tr>
</table>';
$random_games_choice = rand(1,4);
$games_choice = 'games'.$random_games_choice;
$curr_position = 0;
$games_choice($no_games,$curr_position,$icons_per_row);
Function games3($no,$curr_position,$icons_per_row)
{
global $smcFunc, $scripturl, $gamesUrl;
$result = array();
$game = array();
/* show the latest games */
echo '<div align="center">Latest Games<br />
<table cellpadding="2" cellspacing="5">
<tr>';
$result = $smcFunc['db_query']('', '
SELECT id_game, game_name, thumbnail, game_directory
FROM {db_prefix}arcade_games
ORDER BY id_game, game_name DESC
LIMIT 0,{int:no}',
array(
'no' => $no,
)
);
while ($game = $smcFunc['db_fetch_assoc']($result))
{
$game_thumb = !$game['game_directory'] ? $gamesUrl.$game['thumbnail'] : $gamesUrl.$game['game_directory']."/".$game['thumbnail'];
if($curr_position == $icons_per_row)
{
echo '</tr><tr>';
$curr_position=0;
}
echo'
<td>
<a href="'.$scripturl.'?action=arcade;sa=play;game='.$game['id_game'].'">
<img src="'.$game_thumb.'" border="0" alt="'.$game['game_name'].'" width="30" height="30" title="Play '.$game['game_name'].'"/></a>
</td>';
$curr_position++;
}
$smcFunc['db_free_result']($result);
echo '
</tr>
</table></div>';
}
Function games1($no,$curr_position,$icons_per_row)
{
/* show most played games (one score version only) */
global $smcFunc, $scripturl, $gamesUrl;
$result = array();
$game = array();
echo '<div align="center">Most Played<br />
<table cellpadding="2" cellspacing="5">
<tr>';
$result = $smcFunc['db_query']('', '
SELECT id_game, game_name, thumbnail, game_directory
FROM {db_prefix}arcade_games
ORDER BY number_plays DESC , game_name ASC
LIMIT 0,{int:no}',
array(
'no' => $no,
)
);
while ($game = $smcFunc['db_fetch_assoc']($result))
{
$game_thumb = !$game['game_directory'] ? $gamesUrl.$game['thumbnail'] : $gamesUrl.$game['game_directory']."/".$game['thumbnail'];
if($curr_position == $icons_per_row)
{
echo '</tr><tr>';
$curr_position=0;
}
echo'
<td>
<a href="'.$scripturl.'?action=arcade;sa=play;game='.$game['id_game'].'">
<img src="'.$game_thumb.'" border="0" alt="'.$game['game_name'].'" width="30" height="30" title="Play '.$game['game_name'].'"/></a>
</td>';
$curr_position++;
}
$smcFunc['db_free_result']($result);
echo '
</tr>
</table></div>';
}
Function games4($no,$curr_position,$icons_per_row)
{
/* show least played games (one score version only) */
global $smcFunc, $scripturl, $gamesUrl;
$result = array();
$game = array();
echo '<div align="center">Least Played<br />
<table cellpadding="2" cellspacing="5">
<tr>';
$result = $smcFunc['db_query']('', '
SELECT id_game, game_name, thumbnail, game_directory
FROM {db_prefix}arcade_games
ORDER BY number_plays ASC , game_name ASC
LIMIT 0,{int:no}',
array(
'no' => $no,
)
);
while ($game = $smcFunc['db_fetch_assoc']($result))
{
$game_thumb = !$game['game_directory'] ? $gamesUrl.$game['thumbnail'] : $gamesUrl.$game['game_directory']."/".$game['thumbnail'];
if($curr_position == $icons_per_row)
{
echo '</tr><tr>';
$curr_position=0;
}
echo'
<td>
<a href="'.$scripturl.'?action=arcade;sa=play;game='.$game['id_game'].'">
<img src="'.$game_thumb.'" border="0" alt="'.$game['game_name'].'" width="30" height="30" title="Play '.$game['game_name'].'"/></a>
</td>';
$curr_position++;
}
$smcFunc['db_free_result']($result);
echo '
</tr>
</table></div>';
}
Function games2($no,$curr_position,$icons_per_row)
{
/* show best rated games */
global $smcFunc, $scripturl, $gamesUrl, $boardurl;
$result = array();
$game = array();
echo '<div align="center">Top Rated<br />
<table cellpadding="2" cellspacing="5">
<tr>';
$result = $smcFunc['db_query']('', '
SELECT id_game, game_name, thumbnail, game_directory
FROM {db_prefix}arcade_games
ORDER BY game_rating DESC , game_name ASC
LIMIT 0,{int:no}',
array(
'no' => $no,
)
);
while ($game = $smcFunc['db_fetch_assoc']($result))
{
$game_thumb = !$game['game_directory'] ? $gamesUrl.$game['thumbnail'] : $gamesUrl.$game['game_directory']."/".$game['thumbnail'];
if($curr_position == $icons_per_row)
{
echo '</tr><tr>';
$curr_position=0;
}
echo'
<td>
<a href="'.$scripturl.'?action=arcade;sa=play;game='.$game['id_game'].'">
<img src="'.$game_thumb.'" border="0" alt="'.$game['game_name'].'" width="30" height="30" title="Play '.$game['game_name'].'"/></a>
</td>';
$curr_position++;
}
$smcFunc['db_free_result']($result);
echo '
</tr>
</table></div>';
}
/* Get newest champ or die */
$result = $smcFunc['db_query']('', '
SELECT game.id_game, game.game_name, game.thumbnail, game.game_directory,
mem.id_member, mem.member_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',
array(
)
);
$row = $smcFunc['db_fetch_row']($result);
$smcFunc['db_free_result']($result);
/* newest champ details */
$playerid = $row[4];
$player = $row[5];
$game_id = $row[0];
$game_name = $row[1];
$score = round($row[6], 3);
$game_pic = !$row[3] ? $gamesUrl.$row[2] : $gamesUrl.$row[3]."/".$row[2];
$bp=ArcadeStats_BestPlayers($no_topten);
$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 '<br />
<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++;
$score_poss_trophy = '<img src ="'.$boardurl.'/Themes/default/images/arc_icons/'.$score_poss.'.gif" width="36" height ="27" alt="'.$score_poss.'" title="'.$score_poss.'" />';
echo '<div align="center">',$score_poss_trophy,'</div><div align="center">',$out['link'],'</div>',$txtwin,' ',$out['champions'],'
<br /><br />';
};
echo '</div>
</div>
</div>';
-
Have this error in the log.
Apply Filter: Only show the error messages of this member BigEars
Apply Filter: Only show the error messages of this IP address 78.32.149.114
Reverse chronological order of list 1 minute ago
Apply Filter: Only show the error messages of this session 9d7fe8a4079b074d9b6edbf9e8052581
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URL
http://xxxxxxxxk/index.php?action=admin;area=portalblocks;sa=list;f5ecc4740=9d7fe8a4079b074d9b6edbf9e8052581
Apply Filter: Only show the errors with the same message
8: Undefined offset: 1
Apply Filter: Only show the errors from this file
File: /xxxxxxxxxxxxxxxxxx/Themes/default/Portal.template.php
Line: 32
if (!empty($modSettings['showleft']) && !empty($context['SPortal']['blocks'][1]))
30:
{
31:
echo '
==>32:
<td id="sp_left"', !empty($modSettings['leftwidth']) ? ' width="' . $modSettings['leftwidth'] . '"' : '', $context['SPortal']['sides'][1]['collapsed'] && empty($modSettings['sp_disable_side_collapse']) ? ' style="display: none;"' : '', '>';
33:
34:
foreach ($context['SPortal']['blocks'][1] as $block)
35:
template_block($block);
36:
37:
echo '
Looks good tho.
-
This block works fine for me without errors when I test it on smf 2 rc3 with E-Arcade and Simple portal (only these 2 mods) installed.
You are showing me an error after using the filter... how many do you have?? ;)
Also... I believe you may have uploaded the images I included into the wrong folder... or possibly didn't following my directions regarding unzipping it first?? The title image is not showing up.
Undefined offset ... it might be because of the image files not being there. Please put the images in the proper folder and check again.
(Unzip the attachment and add its contents to: Themes / default / images / arc_icons)
If it still doesn't scroll, temporarily disable your posts scroll block to see if it is interfering.
UD
-
Two errors only.
-
Copy the code again... There might have been a mistake because I posted that with my other pc which seems to have problems with code blocks on sites. It should be ok now.
-
Woohoo
Thanks UD
That looks great.
-
Love it...thank you muchly.
Cheers
Deez 8)
-
every so often i get this problem and none of the blocks show up beneath the arcade block...help????!!!!
-
every so often i get this problem and none of the blocks show up beneath the arcade block...help????!!!!
Me to.
-
stil have the problem.......
-
I hate to shake an old topic, but I would like to get this block to work for me as well. I have tried it on my live site and my backup test copy of the live site. In both cases, when I click preview, the block looks as it should with no errors. When I click Add Block, I get an error stating -
An Error Has Occurred!
Database error in block code. Please check the code.
I am using SMF 2.0RC3, SP 2.3.2 and Earcade Beta4 smf2
It seems really odd that the preview works with no errors, but I cannot save the block.
Any ideas?
I would prefer to make it work, the SP arcade block is just too limited and plain. :)
Edit- I got it. I had to disable php validation :)