EzPortal - Portal Software for Forums

EzPortal - Made to Fit Your SMF Forum - Glad You Found Us!
+- +-

UserBox

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Recent Posts

Re: Forum name twice in breadcrumbs by EzPortal
August 12, 2019, 05:03:58 pm

Re: Forum name twice in breadcrumbs by kenmcneill
August 12, 2019, 03:15:26 pm

Re: Forum name twice in breadcrumbs by EzPortal
August 12, 2019, 12:28:01 pm

Re: Forum name twice in breadcrumbs by kenmcneill
August 12, 2019, 10:20:14 am

Re: Forum name twice in breadcrumbs by EzPortal
August 10, 2019, 06:33:57 pm

Re: Forum name twice in breadcrumbs by kenmcneill
August 10, 2019, 02:25:45 pm

Forum name twice in breadcrumbs by kenmcneill
August 10, 2019, 11:20:57 am

Re: Show/hide toggle by kenmcneill
August 03, 2019, 09:15:04 am

+- HTML Menu


Sample HTML Block Usage - You May Custom Code it, as needed!

Author Topic: Can we get this working for EZPortal?  (Read 10428 times)

0 Members and 1 Guest are viewing this topic.

Offline swampysc

  • Posts: 14
  • Karma: 0
Can we get this working for EZPortal?
« on: December 22, 2009, 07:47:22 am »
Can we get this working for EZPortal?



Code: [Select]

/******************************************************************************
* 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://www.tvgrapevine.com/smf/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');

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);

Function games3($no,$curr_position,$icons_per_row)
{
global $scripturl,$db_prefix,$gamesUrl;
//show the latest games
echo '<div align="center">Latest Games<br />
<table cellpadding="2" cellspacing="5">
<tr>';

$sql = "SELECT ID_GAME, game_name, thumbnail, game_directory
FROM {$db_prefix}arcade_games
ORDER BY ID_GAME DESC , game_name ASC LIMIT 0,{$no}";
$result = db_query($sql,__FILE__,__LINE__);
while($game = mysql_fetch_array($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++;
}
mysql_free_result($result);

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

Function games1($no,$curr_position,$icons_per_row)
{
//show most played games (one score version only)
global $scripturl,$db_prefix,$gamesUrl;

echo '<div align="center">Most Played<br />
<table cellpadding="2" cellspacing="5">
<tr>';

$sql = "SELECT ID_GAME, game_name, thumbnail, game_directory
FROM {$db_prefix}arcade_games
ORDER BY number_plays DESC , game_name ASC LIMIT 0,{$no}";
$result = db_query($sql,__FILE__,__LINE__);
while($game = mysql_fetch_array($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++;
}
mysql_free_result($result);

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


Function games4($no,$curr_position,$icons_per_row)
{
//show least played games (one score version only)
global $scripturl,$db_prefix,$gamesUrl;
echo '<div align="center">Least Played<br />
<table cellpadding="2" cellspacing="5">
<tr>';

$sql = "SELECT ID_GAME, game_name, thumbnail, game_directory
FROM {$db_prefix}arcade_games
ORDER BY number_plays ASC , game_name ASC LIMIT 0,{$no}";
$result = db_query($sql,__FILE__,__LINE__);
while($game = mysql_fetch_array($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++;
}
mysql_free_result($result);

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


Function games2($no,$curr_position,$icons_per_row)
{
//show best rated games
global $scripturl,$db_prefix,$gamesUrl;
echo '<div align="center">Top Rated<br />
<table cellpadding="2" cellspacing="5">
<tr>';

$sql = "SELECT ID_GAME, game_name, thumbnail, game_directory
FROM {$db_prefix}arcade_games
ORDER BY game_rating DESC , game_name ASC LIMIT 0,{$no}";
$result = db_query($sql,__FILE__,__LINE__);
while($game = mysql_fetch_array($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++;
}
mysql_free_result($result);

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


//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>'
;


Offline EzPortal

  • Administrator
  • *****
  • Posts: 1204
  • Karma: 66
Re: Can we get this working for EZPortal?
« Reply #1 on: December 22, 2009, 08:37:36 am »
That should work ok as an ezBlock
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline swampysc

  • Posts: 14
  • Karma: 0
Re: Can we get this working for EZPortal?
« Reply #2 on: December 22, 2009, 10:14:29 am »
It doesn't.  Using a php block all it does is kick back a blank.... just a heading.

Offline swampysc

  • Posts: 14
  • Karma: 0
Re: Can we get this working for EZPortal?
« Reply #3 on: December 22, 2009, 05:47:55 pm »
Matter of fact I am wondering if the php block actually functions.  Do you have a piece of php code I could test it with please?

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1204
  • Karma: 66
Re: Can we get this working for EZPortal?
« Reply #4 on: December 22, 2009, 06:10:53 pm »
You can do
Code: [Select]
echo 'Hello World';
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline swampysc

  • Posts: 14
  • Karma: 0
Re: Can we get this working for EZPortal?
« Reply #5 on: December 22, 2009, 06:24:48 pm »
You can do
Code: [Select]
echo 'Hello World';

Yep, that worked. :)

Offline swampysc

  • Posts: 14
  • Karma: 0
Re: Can we get this working for EZPortal?
« Reply #6 on: December 23, 2009, 12:59:45 pm »
When using the above with Tinyportal or PortaMX it works fine but with yours it kicks back "The database value you're trying to insert does not exist: no"


Offline EzPortal

  • Administrator
  • *****
  • Posts: 1204
  • Karma: 66
Re: Can we get this working for EZPortal?
« Reply #7 on: December 23, 2009, 06:04:48 pm »
When using the above with Tinyportal or PortaMX it works fine but with yours it kicks back "The database value you're trying to insert does not exist: no"


Are you using that code with SMF 2.0? or SMF 1.1.x?
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline swampysc

  • Posts: 14
  • Karma: 0
Re: Can we get this working for EZPortal?
« Reply #8 on: December 23, 2009, 06:36:13 pm »
smf2 rc2

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1204
  • Karma: 66
Re: Can we get this working for EZPortal?
« Reply #9 on: December 23, 2009, 06:42:09 pm »
Yeah that code up their will not work with SMF 2.0.x at all. It needs to be rewritten for SMF 2.0.x that code will only work with SMF 1.1.x
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline swampysc

  • Posts: 14
  • Karma: 0
Re: Can we get this working for EZPortal?
« Reply #10 on: December 23, 2009, 07:17:00 pm »
yikes!

Sorry for bothering you.

You go have a Merry Christmas and Seasons Greetings to you


Offline swampysc

  • Posts: 14
  • Karma: 0
Re: Can we get this working for EZPortal?
« Reply #11 on: December 23, 2009, 08:06:53 pm »
I found something that seems to be a good resource.

http://portamx.com/index.php?topic=349.0

Got some of it working, perhaps you can cobble together a block form the info


Season Greetings

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
8049 Views
Last post December 01, 2008, 10:59:09 pm
by petro
5 Replies
16204 Views
Last post April 18, 2011, 01:00:58 pm
by geogeo
2 Replies
6609 Views
Last post August 09, 2012, 10:39:23 am
by desi4um
10 Replies
10011 Views
Last post October 09, 2014, 10:49:33 am
by Maxx
2 Replies
3187 Views
Last post May 13, 2016, 07:45:51 am
by robomcd

+-SMF Gallery

Quick Menu








Members Online

14 Guests, 0 Users
Powered by EzPortal