Advertise Here

Author Topic: [Code] Random Arcade Game  (Read 2703 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
[Code] Random Arcade Game
« on: August 21, 2007, 07:57:10 pm »
Headers or Footers
Code: [Select]
<script>
//Created by Agent Moose (smcodes.smfforfree3.com)
document.write("<a href='"+location.pathname+"?action=arcade;sa=play;game="+Math.floor(Math.random()*116)+"'>Random Game</a>")
</script>

This just creates a simple little link that brings you to a random arcade game.  You must have the arcade set up on your forum to use this.

You may put this code where ever you would like the link to appear.

EDIT:
Here is a code that adds a new tab just for the random arcade game thingy.
Footers:
Code: [Select]
<script>
function random_arcadeGame(){
//Created by Agent Moose
$(function() {
$(".maintab_back:contains(Logout) , .maintab_back:contains(Register)").after('<td class="maintab_last"> </td><td class="maintab_first"></td><td valign="top" class="maintab_back"><a href="'+location.pathname+'?action=arcade;sa=play;game='+Math.floor(Math.random()*116)+'">Random Game</a></td>');
});}
random_arcadeGame()
</script>
« Last Edit: August 27, 2007, 09:09:03 pm by simply sibyl »
Check out Revolution X's Brand new Code Index!

Offline lilbit_miers

  • SMF For Free Member
  • *
  • Posts: 43
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Code] Random Arcade Game
« Reply #1 on: December 06, 2007, 10:25:41 am »
Ok so how would I put that in the arcade?

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Random Arcade Game
« Reply #2 on: December 06, 2007, 11:19:26 am »
Ok so how would I put that in the arcade?


This cannot be put into the arcade.
The Portal, if you are using it, has a random game block (if you add it) so you wouldnt need this code at all.
If you are not using the Portal then read back to the first post, where Moose explains how to use the code.
Be sure you put the codes exactly where he says to put them.

This code gives you two different options.
You can use the first code to put a link someplace that will take you to a random game.
You could put that code in your header or your footer or even a board description.

The second code would add  a random game tab  (like the home, search, etc)  tabs.   

Most of Moose's codes require the following to also be in the header  (only need it there one time)
He didnt mention it for this one but you could try it if the code is not working for you:

Add this to the top of your headers if you don't have it:
Code: [Select]
<script src="/jquery.js"></script>
« Last Edit: May 02, 2008, 04:15:10 pm by simply sibyl »

 

Related Topics

  Subject / Started by Replies Last post
13 Replies
2658 Views
Last post November 08, 2007, 08:32:35 pm
by LaundryLady
42 Replies
9037 Views
Last post March 08, 2008, 09:42:22 am
by Stevie
3 Replies
1300 Views
Last post September 24, 2010, 09:20:42 pm
by zaHawk
4 Replies
1471 Views
Last post May 04, 2008, 05:33:10 pm
by Golden Glove
1 Replies
1131 Views
Last post February 02, 2009, 04:36:03 am
by outlaw16151