TinyPortal

Development => Block Codes => Topic started by: technodragon73 on February 06, 2006, 06:07:32 AM

Title: Arcade in a block
Post by: technodragon73 on February 06, 2006, 06:07:32 AM
Is it possible to make a block that shows a random game each time the page refreshes?  I have seen it on other forums using an arcade (not sure if it was this portal or another one)

If it is could someone please show me where to get it?
Title: Re: Arcade in a block
Post by: IchBin on February 06, 2006, 02:48:01 PM
You may want to ask over at the arcade site.
Title: Re: Arcade in a block
Post by: technodragon73 on February 06, 2006, 02:57:25 PM
lol...tried but they said to ask here
Title: Re: Arcade in a block
Post by: rdoggsv on February 06, 2006, 03:03:12 PM
can somebody give me the arcade address ?? it would be great if i could add some games to my site  8) , somebody told me that it was smfgames.com but the site looks down...

thanx  :D
Title: Re: Arcade in a block
Post by: IchBin on February 06, 2006, 03:04:52 PM
Quote from: technodragon73 on February 06, 2006, 02:57:25 PM
lol...tried but they said to ask here
Go give them a hard time. Tell them they have TP installed and they OWN the arcade. They are the ones with the arcade code. lol
Title: Re: Arcade in a block
Post by: G6Cad on February 06, 2006, 03:19:23 PM
The link to SMF arcade forum

http://www.smfarcade.net/index.php?action=forum
Title: Re: Arcade in a block
Post by: bloc on February 06, 2006, 08:33:19 PM
If you can get the sql code to fetch a game from the arcade datatable, then its simply a matter of adding a random to it, like...

"SELECT * from xxxx order by rand() limit 1"

....where xxxx is the arcade table.
Title: Re: Arcade in a block
Post by: houston on February 07, 2006, 02:21:51 AM
Have a look at this thread. The second post in the thread is what you want. It works great. http://www.tinyportal.net/smf/index.php?topic=1293.0 (http://www.tinyportal.net/smf/index.php?topic=1293.0)
Title: Re: Arcade in a block
Post by: technodragon73 on February 07, 2006, 04:00:40 AM
thanks for all your help...smf arcade people finally answered and gave me the code.
Title: Re: Arcade in a block
Post by: rebelrose on July 21, 2006, 05:33:03 PM
Quote from: TechnoDragon on February 07, 2006, 04:00:40 AM
thanks for all your help...smf arcade people finally answered and gave me the code.

Do you want to share it here
Title: Re: Arcade in a block
Post by: G6Cad on July 21, 2006, 05:43:42 PM
If it is the Arcade champions block you want i have the code and the image needed.
If you want i can add it here, or fetch it from my site (Mods And Addons)
Title: Re: Arcade in a block
Post by: rebelrose on July 21, 2006, 05:46:27 PM
thanks I will wait
Title: Re: Arcade in a block
Post by: ganteng on August 12, 2006, 02:47:53 PM
excuse me can anybody tell me how to add arcade to my forum??

thanks and where can i download that??
Title: Re: Arcade in a block
Post by: Nokonium on August 12, 2006, 02:58:47 PM
Go to
http://www.smfarcade.net/ you will need to register.

They have different versions of the Arcade Mod, support the mod and have games to install for the Arcade.
Title: Re: Arcade in a block
Post by: nikita on August 20, 2006, 10:59:14 AM
A lot of our members look for this code, I will give it below - the code is courtsey - Ray from smfarcade. Hope this helps all  :)

My friend who also uses TP & smf helped me in getting this code.


require('./Settings.php');


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


$game = random_game();


echo "<center><a href=\"index.php?action=arcade;do=play;game={$game['id']}\"><img src=\"{$game['thumbnail']}\" alt=\"{$game['name']}\" /></a><br />
<a href=\"index.php?action=arcade;do=play;game={$game['id']}\">{$game['name']}</a></center>";


// Functions begin
// All returns array

// random_game( [category id] )


function random_game($cat_id = ""){
global $link,$db_prefix,$boarddir,$boardurl;
if($cat_id == ""){
$query = "SELECT * FROM {$db_prefix}games ORDER BY rand() LIMIT 0,1";
}else{
$query = "SELECT * FROM {$db_prefix}games WHERE category='{$cat_id}' ORDER BY rand() LIMIT 0,1 ";
}

$game = mysql_fetch_array(mysql_query($query));
$ext = array('gif','GIF','png','PNG','jpg','JPG',); // Extensions to look for
$game['thumbnail'] = ""; // No thumbnail for default

foreach($ext as $ex){
if(file_exists($boarddir. "/Games/".$game['game'].".".$ex)){
$game['thumbnail'] = $boardurl."/Games/".$game['game'].".".$ex;
}
}

return $game;

}



You need to have arcade installed with games for this block to work. Just paste this in a php block and there you go.... :)
Title: Re: Arcade in a block
Post by: G6Cad on August 20, 2006, 11:09:01 AM
Also you need to put a global string to the code or els it will fill up the error log
Title: Re: Arcade in a block
Post by: Mz.Betoch on October 24, 2007, 12:58:02 AM
so what global string would i add? and where?
Title: Re: Arcade in a block
Post by: Aunt Clair on November 09, 2007, 04:34:54 AM
I have successfully installed the arcade to SMF 1.1.4 and Tiny Portal .98 but I need help installing the games . Can sks teach a newbie what to do next ? Thanks .
Title: Re: Arcade in a block
Post by: Dragooon on November 09, 2007, 05:01:07 AM
That Question can be better answered over the SMFArcade site.
Title: Re: Arcade in a block
Post by: qayyom on November 15, 2007, 07:14:18 AM
Quote from: Aunt Clair on November 09, 2007, 04:34:54 AM
I have successfully installed the arcade to SMF 1.1.4 and Tiny Portal .98 but I need help installing the games . Can sks teach a newbie what to do next ? Thanks .

download games from smfarcade.net's download section in Zip form, upzip all and upload to " /public_html/games/ "with any ftp uploader like CuteFTP etc.

go to arcade manager > games > install

it is very easy after uploading manually other than it's own opload option