UBB.Dev
Posted By: JoshPet Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 06/02/2003 7:46 AM
Mod Name / Version: Game Arcade 1.1
   Version 1.1 fixes some table bugs in IE on the PC and adds instructions to update the who's online location.

Description: This is an integrated Game Arcade for your forum with flash games from MiniClip.com. This mod includes 8 games an allows you to limit play to registered users if you desire.

Working Under: UBB.Threads 6.2-6.4

Mod Status: Beta

Any pre-requisites: none

Author(s): JoshPet

Date: 06/01/03

Credits: MiniClip.com for Free Game Content

Files Altered: none

New Files: A whole "games" directory which is placed inside your threads directory.

Database Altered: none

Info/Instructions: Upload all files to a /games directory inside your threads directory.

If you wish to limit play to registered users only, edit the variable at the top of the /games/index.php file.

Add a link to /games/gameindex.php somewhere on your site. You may wish to add this to your menu bar (ubbt_registerednav.tmpl & ubbt_unregisterednav.tmpl) or into your footer (ubbt_footer.tmpl).

Demo: At JoshuaPettit.com

See the AAAInstructions.txt file included for more instructions and instructions on having the who's online location update correctly when users are playing games. <img src="/forum/images/graemlins/smile.gif" alt="" />

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.




Attached File
82668-games.zip  (229 downloads)
Posted By: AllenAyres Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 2:35 PM
Wheeeeee!!
Posted By: Ian_W Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 4:39 PM
Nice idea

Time for another sub-domain
Posted By: BWilliams_dup1 Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 7:32 PM
Josh,

This is GREAT.

I know this is probably an easy one, but how do I code the "online" file to show "In Game Room"?

Thanks,

Bobby
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 8:09 PM
Let me ponder that and see if I can easily post instructions. I'm not sure if adding the script name to the online.php language file will work right because it's in a sub directory.... and thus may show up as private like all admin functions.
Posted By: BWilliams_dup1 Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 8:11 PM
Thanks
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 8:18 PM
Add this into the /languages/english/online.php file

$ubbt_lang['battleships'] = "Playing a Game - Battleships";
$ubbt_lang['crashdown'] = "Playing a Game - Creash Down";
$ubbt_lang['flashman'] = "Playing a Game - Flashman";
$ubbt_lang['paintball'] = "Playing a Game - Stress Relief Paintball";
$ubbt_lang['rigelianhotshots'] = "Playing a Game - Rigelian Hotshots";
$ubbt_lang['rocketman'] = "Playing a Game - Rocketman";
$ubbt_lang['sheepish'] = "Playing a Game - Sheepish";
$ubbt_lang['smashing'] = "Playing a Game - Smashing";

The only sticker - the game index is "index" but if you're using IIP you're already using that.... so without changing the name of the script you can't really show location on that script easily.
Posted By: BWilliams_dup1 Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 8:48 PM
So, if I understand you correctly, there isn't a way to make this work without major hacking?
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 8:57 PM
No do what I said above - the exception is the game index - index.php as if you have IIP you already have an 'index' file.

You'd have to rename the game index to something else - and change the links back to the game index in all the game scripts if you wanted the game index to show up on who's online - otherwise - right now - it'll show up as the "entrance page" because it's got the same name "index.php" as your IIP page.
Posted By: BWilliams_dup1 Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 9:01 PM
Oh, ok. I must have miss read your post, sorry
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 9:03 PM
I wouldn't be that hard to rename "index.php" to "games.php" then add an entry in the online language file for :

$ubbt_lang[games] = "Viewing the Game Arcade";


Then in each of the game scripts - there's a link back to index.php - you'd need to change that to games.php

But what I posted above will cover all except the index file. Didn't think about online when I was setting it up.
Posted By: BWilliams_dup1 Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 10:27 PM
Works PERFECT !!!

Thanks,

BWilliams
Posted By: omegatron Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 10:35 PM
One thing I noticed Josh since I use the tablewrappers and you would not see unless you validate the page is the HTML after the embed does not work. There is not links BACK TO THE GAME or anything.

http://www.reeftalk.com/ubbthreads/games/battleships.php
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 10:47 PM
Hmmmmm I wonder why that is.

Is that a PC thing - I see it.

Am I missing something HTML wise in the embed tag. I inserted the code that Miniclip said - but I wonder if it's not valid. LOL

Attached picture 82708-screen.gif
Posted By: omegatron Re: Beta-[6.2-6.3] Game Arcade - 06/02/2003 11:30 PM
Thats the weirdest thing ever. One mine it does not load the html after the embedded game.

Attached picture 82711-screen.jpg
Posted By: Ian_W Re: Beta-[6.2-6.3] Game Arcade - 06/03/2003 12:15 AM
Haven't looked at the code yet - but is it easy to add other games - there are a few UK games, that should keep my members hapy
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade - 06/03/2003 12:47 AM
Yes, you can use the game pages as templates - there are loads more at that Miniclip site - you just basicaly embed the swf file in the page. And add links to the game index of course.
Posted By: Storm_dup1 Re: Beta-[6.2-6.3] Game Arcade - 06/03/2003 2:15 AM
Oh man! That Josh thinks of everything..... Thanks Man!!!!
Posted By: AllenAyres Re: Beta-[6.2-6.3] Game Arcade - 06/03/2003 3:06 AM
I just like playing the games at josh's site
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/03/2003 4:01 AM
OK

Updated this - this fixes the issue with the HTML not appearing after the embeded SWF file. This also updates instructions to update the who's online page (including the game index).

Instructions to upgrade - upload all the new PHP files - and follow the enclosed instructiosn (AAAInstructions.txt) for the who's online steps.
Posted By: AllenAyres Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/03/2003 8:46 AM
ok, played the 'crashdown' game ~2 hours tonight
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/03/2003 9:08 AM
LOL
Posted By: omegatron Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/03/2003 12:01 PM
I uninstalled Flash and reinstalled it again just to see if that was the problem. Weirdest thing but the closing tags are not there. The UBBThreads footer is not even sent. Nothing after the embed tag is loaded.
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/03/2003 5:53 PM
Even with the update?

It was missing a closing tag.
Posted By: PhotoPost Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/03/2003 7:57 PM
Cool! I tried to do something similiar, but the games I found were only IE! (Lame, Java). This is much nicer. lol
Posted By: omegatron Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/03/2003 11:56 PM
Yes Josh I decided to look at it further after it peeved me and saw the missing OBJECT tag. That will do what was happening by blocking the rest of the HTML. Thanx for the update. I was going to comment and I saw ya found it. Now ya got to stop putting things out like this. I like Allen spent two hours last night playing FLASHMAN.
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/04/2003 2:02 AM
LOL

Well I used the code that the MiniClip site gave - which wasn't compliant. Then I didn't test it on the PC.

All my Mac browsers had no trobule recovering from the missing </object> tag - but the PC didn't like it.
Posted By: omegatron Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/04/2003 3:08 AM
I forgot you like that ole MAC. Yeah when I first looked at the code I did not think about looking for that closing OBJECT tag. I went and looked for the proper closing tr and especially tbclose variables. You had them there.

You don't expect the code to be valide do you They just slap the stuff together and go. They do not care about validity. The problem with that is that until browsers stop accepting outdated html everyone will not jump on the bandwagon.

<param name=quality value=high>

I mean come on should it not be

<param name="quality" value="high">
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/05/2003 7:38 AM
I think Allen is playing games at my site again.
Posted By: AllenAyres Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/05/2003 7:45 AM
forget the mod, I just scored 140,372 in crash down

Posted By: AKD96 Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/05/2003 2:30 PM
I've been hooked on Smashing. Level 40-something!!
Posted By: mi_trucker Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/05/2003 2:41 PM
Hmmm, I went a different route. Just loaded up Dreamweaver, copied some of the code from the main site page and inserted the games. Saved it as an html file and it works great that way too.
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/05/2003 7:44 PM
Well.... just don't serve the games off my $ite and bandwidth... make sure the large .swf files are on your site.
Posted By: coloradok5 Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/11/2003 12:23 AM
These games are served from the game site right? Otherwise looks like a major bandwidth hog.
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/11/2003 1:48 AM
Served from your own site.
Posted By: AllenAyres Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/11/2003 7:50 AM
Would be good to post an example .htaccess file to keep other sites from hot-linking to these files...
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/11/2003 7:55 AM
Yeah.

/me pokes someone who is much better at that than I.
Posted By: AKD96 Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/11/2003 10:41 PM
Try this...

Code
<br />RewriteEngine on<br />RewriteCond %{HTTP_REFERER} !^$<br />RewriteCond %{HTTP_REFERER} !^http://(www\.)?joshuapettit.com(/)?.*$     [NC]<br />RewriteRule .*\.(swf)$ - [F,NC]<br />
Posted By: msula Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/11/2003 11:00 PM
Installed this today, and the users love it Now we just need some games that allow multiplayer
Posted By: coloradok5 Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/12/2003 5:26 AM
I think serving them from your site Josh might be the way to go.
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/12/2003 5:27 AM
Doah.

htaccess file coming soon.
Posted By: Ian_W Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/12/2003 11:03 PM
Anyone know what sort of bandwidth these consume - are they light or heavy eaters?
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/12/2003 11:11 PM
They are SWF files which download then play in the person's browser. The largest one is 416 KB and the smallest is 108 KB.
Posted By: msula Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/12/2003 11:39 PM
aren't SWF files cached also, just like images?
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/12/2003 11:39 PM
Yeah, they load much faster when you go back to the game.
Posted By: Ian_W Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/12/2003 11:42 PM
Thanks - was interested to see if anyone had noticed their bandwidth shoot through the roof with these
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/12/2003 11:45 PM
I might need to hotlink protect mine before I give a real answer. LOL
Posted By: msula Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/13/2003 12:23 AM
most of my users aren't that bright, and since you have to be logged in, they would essentially need to figure out the URL to the SWF to pass on to people
Posted By: Turbosport Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/13/2003 3:18 PM
looks great installed and working

2 things though

Firstly should the player name fill in automatically as it dosnt on my install?

Secondly I wanted to put my games folder outside of the threads install I try and do this with all hacks as I find it neater.

So I created a paths.php file with the following in:
<?
$threadspath = "PATH TO THREADS";
$baseurl = "PATH TO WEB ROOT";
?>
==========
then I have removed this section of code in every game php file and gameindex.php:

// What is the PATH (not URL) to your threads install

and added this in its place:

// Require the Paths
require ("paths.php");

==========
and in gamesindex.php did a find and replace:
find: $config['phpurl']
replace with: $baseurl

==========
and index.php now looks like this:

require ("paths.php");
// Require the library
require ("$threadspath/main.inc.php");
header ("Location:$baseurl/games/gameindex.php");

HTH
Posted By: Slawek_L Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/14/2003 4:59 PM
Nice I just installed it
Posted By: Ian_W Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/14/2003 5:09 PM
Working fine at games.nonleague.com - if you add additional games, it is worth checking the swf size by doing a view source at the version on the miniclip site - I added Solitaire - as it means people can play slowly, and I can put ads beneath it

Posted By: Slawek_L Re: Beta-[6.2-6.3] Game Arcade 1.1 - 06/14/2003 5:12 PM
I installed only 4 games(from six), which swf size < 300KB
Posted By: Wando Re: Beta-[6.2-6.3] Game Arcade 1.1 - 07/06/2003 2:22 AM
Works great at audi-sport.net, I've set it for registered users only, think I got carried away as I've got 30 games installed
Posted By: Ian_W Re: Beta-[6.2-6.3] Game Arcade 1.1 - 07/06/2003 10:14 AM
I noticed

Great to see you around here again...
Posted By: Wando Re: Beta-[6.2-6.3] Game Arcade 1.1 - 07/06/2003 10:51 AM
I shall be around a fair bit more now, probably a bad thing as I'll be annoying you all with my dumba$$ questions
Posted By: Ian_W Re: Beta-[6.2-6.3] Game Arcade 1.1 - 07/06/2003 11:30 AM
We all have those questions from time to time

And beleive me I speak from experience
Is this confirmed to work under 6.4?

Can additional MiniClip games be added to this?
Posted By: omegatron Re: Beta-[6.2-6.3] Game Arcade 1.1 - 12/11/2003 6:54 AM
Yes and Yes
Posted By: donJulio Re: Beta-[6.2-6.3] Game Arcade 1.1 - 12/11/2003 6:54 AM
I haven't checked, but I'd be shocked if it didn't work for 6.4. How many other MiniClip games are there? I hadn't thought of the possibility of trying to add more.
Posted By: msula Re: Beta-[6.2-6.3] Game Arcade 1.1 - 12/11/2003 6:54 AM
Yes, it works just fine under 6.4

ANd yes, you can add different games if you wish.
[]donJulio said:
I haven't checked, but I'd be shocked if it didn't work for 6.4. How many other MiniClip games are there? I hadn't thought of the possibility of trying to add more. [/]

Rather a lot. I'm not sure if they're all free or not, but there appears to be over 50 games at Miniclip.com.

Of course, I'd have to make a point of "testing" those games to determine which ones would be worthwhile of my users' attention.
Posted By: JoshPet Re: Beta-[6.2-6.3] Game Arcade 1.1 - 12/14/2003 11:38 PM
Yes, it's really an "addon" and yes, you can follow the format and add additional games from mini-clip.
Posted By: smoknz28 Re: Beta-[6.2-6.3] Game Arcade 1.1 - 12/16/2003 12:50 AM
Working great under my 6.4 at www.f-bodyhideout.com

Thanks Josh!
Posted By: scroungr Re: Beta-[6.2-6.3] Game Arcade 1.1 - 12/16/2003 1:42 AM
Yeah and really easy to add games to also.. added Hangaroo
Posted By: Gregori Re: Beta-[6.2-6.3] Game Arcade 1.1 - 12/27/2003 8:26 PM
This is just great!

Anyone knows where to find some "adult oriented" games?
Posted By: ChAoS_dup1 Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 03/01/2004 2:52 AM
Now see what you've started?
SilentStalker User Acolyte 02/29/04 04:32 PM Playing a Game - Battleships
(I)DragonTears Moderator Queen of the Island 02/29/04 04:32 PM Playing a Game - Battleships
(I)HomeSlice User l33t 02/29/04 04:31 PM Playing a Game - Battleships
SoulMan Moderator Waaaaaa! 02/29/04 04:41 PM Viewing the Game Arcade
Frost User addict 02/29/04 04:41 PM Playing a Game - Sheepish
SoulMan Moderator Waaaaaa! 02/29/04 04:41 PM Viewing the Game Arcade
Frost User addict 02/29/04 04:41 PM Playing a Game - Sheepish

How do I go about adding other games from that site? How do you get the .swf files?
They love it..Thankyou

edit-There is a spelling error in the languages/*/online.php for Crashdown (Creashdown)
Posted By: ericgtr Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 03/01/2004 9:27 PM
Go here http://www.miniclip.com/download.htm and get the games, then take a look at the corresponding scripts in the directory and you can add them in there by copying and pasting existing lines. It's pretty easy once you see how it's done.
Posted By: ChAoS_dup1 Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 03/01/2004 11:08 PM
Yup I started on this last night. I have allready added Bush Shootout by copying and changing one of the scripts. Now I just need to change this

Code
// Games Page by Joshua Pettit <br />// aka JoshPet of www.joshuapettit.com <br />// UBB.Threads Elements ©Infopop.com and Rick Baker 


To this
Code
// Games Page by Joshua Pettit <br />// aka JoshPet of www.joshuapettit.com <br />// UBB.Threads Elements ©Infopop.com and Rick Baker <br />// Plagiarized by ChAoS <br />

Posted By: The Team Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 03/14/2004 7:09 PM
The registered users only setting isn't that effective.

http://www.f-bodyhideout.com/ubbthreads/games/gameindex.php

I went there, clicked a link and got this...

http://www.f-bodyhideout.com/ubbthreads/games/cryptraider.php?anonplay=1

I changed the 1 to 0

http://www.f-bodyhideout.com/ubbthreads/games/cryptraider.php?anonplay=0

And I can now play any of the games.
Posted By: JoshPet Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 03/14/2004 7:34 PM
Yeah, it's not high security - but fools most fools.
Posted By: smoknz28 Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 03/14/2004 9:29 PM
[]Ian Spence said:
The registered users only setting isn't that effective.

http://www.f-bodyhideout.com/ubbthreads/games/gameindex.php

I went there, clicked a link and got this...

http://www.f-bodyhideout.com/ubbthreads/games/cryptraider.php?anonplay=1

I changed the 1 to 0

http://www.f-bodyhideout.com/ubbthreads/games/cryptraider.php?anonplay=0

And I can now play any of the games. [/]

Ahh....said the wiseman.
Posted By: scroungr Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 03/14/2004 10:01 PM
yesh you could add the autheicate code to the mod. It would be easy to do. I say go for it
Posted By: scroungr Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 03/15/2004 5:10 AM

heres a tidbit I tried it and it locks it down

in all the games <insertgametitle>.php


#
#find
#

if (($anonplay) && (!$user['U_Username'])) {

#
#change to
#

if (($anonplay) && (!$user['U_Username']) || ($user['U_Username'] == '')) {


and in gameindex.php

#
#find
#
$html = new html;
$html -> send_header($pagetitle,$Cat,0,$user);

#
#and change to
#

$html = new html;
// ----------------------------------------------------------------------
// If we are not logged in, then present a log on form, otherwise present
// a menu of options.
if(($user['U_Username'] == ''))
{
$config['iip_call'] = 1;
$html -> not_right ("{$ubbt_lang['ADMOD_ONLY']}",$Cat);
}
$html -> send_header($pagetitle,$Cat,0,$user);

[b]the above code also works in the genericpage.php that is posted on this site and pretty much locaks them down in they aren't logged in
Posted By: smoknz28 Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 03/15/2004 5:18 AM
scroungr, thanks for sharing!
Posted By: Dragon Slayer Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 07/01/2004 7:49 PM
I haven't the foggiest idea, on how to add the "Games" link to the top of my forum page(s). Can someone tell me what file(s) to edit & what to put in it?
Posted By: ericgtr Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 07/01/2004 7:59 PM
Here is what you will want to add to your registerednav.tmpl, you will see how it's laid out and you can put it where you want accordingly.

Code
<br /><a href="{$config['phpurl']}/games/index.php?Cat=$Cat">Games</a><br />
Posted By: Dragon Slayer Re: Beta-[6.2-6.3-6.4] Game Arcade 1.1 - 07/01/2004 8:51 PM
Awesome! It Works! Thank You!
© UBB.Developers