TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 02:30:01 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 190
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 171
  • Total: 171

Gameplug-linked image block

Started by Polymath, December 20, 2009, 06:49:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Polymath

I don't know where to post this..here, SMF or SMFarcade but I think it is a block job.

I am trying to write up a block for in my arcade so I can do some game plugs exchanges using code i found at AV arcades, elsewhere and modified a little.

What I am trying to is create a manual game plug system for my site. Basically what I did was find a random image script on Dynamic Drive, stack them side by side in a table, and fill them with thumbs and links of my site's partners. But I have got things a little wrong.

I guess I don't need some things in it as I placed it in a php block(instead of hardcoded) and only show in arcade.
But I get an error:
Quote
Parse error: syntax error, unexpected '<' in /home/****/public_html/******/Load.php(1752) : eval()'d code(35) : eval()'d code on line 1

Now if I turn off eval I get where:

Parse error: syntax error, unexpected '<' in /home/****/public_html/*******/TPortalBlocks.template.php(35) : eval()'d code on line 1


I made a file called gameplug.php

<table align="center" width="590">
<tbody>
<tr>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/air-patrol_60x40.jpg"
  myimages[2]="thumbs/crystal-balls_60x40.jpg"
  myimages[3]="thumbs/lost-in-reefs_60x40.jpg"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="http://www.gamesocket.geek.nz/bigfish/play.php?id=6878"
  imagelinks[2]="http://www.gamesocket.geek.nz/bigfish/play.php?id=6879"
  imagelinks[3]="http://www.gamesocket.geek.nz/bigfish/play.php?id=6891"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/pigs-trip_60x40.jpg"
  myimages[2]="thumbs/pizza-pronto_60x40.jpg"
  myimages[3]="thumbs/tri-towers-solitaire_60x40.jpg"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="http://www.gamesocket.geek.nz/bigfish/play.php?id=6882"
  imagelinks[2]="http://www.gamesocket.geek.nz/bigfish/play.php?id=6880"
  imagelinks[3]="http://www.gamesocket.geek.nz/bigfish/play.php?id=4891"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/mahjongtowersetern_60x40.jpg"
  myimages[2]="thumbs/kelly-green-garden-queen_60x40.jpg"
  myimages[3]="thumbs/wordz_60x40.jpg"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="http://www.gamesocket.geek.nz/bigfish/play.php?id=1856"
  imagelinks[2]="http://www.gamesocket.geek.nz/bigfish/play.php?id=6863"
  imagelinks[3]="http://www.gamesocket.geek.nz/bigfish/play.php?id=2215"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

</tr>
</tbody>
</table>


uploaded and call it in a php block using:
<center> include ('./modules/gameplugs.php'); </center><br>



But I get those parse error mentioned earlier. Attached is TPortalBlocks.template.php, but I don't think it is that really but my code as all my other blocks work fine, and my gameplugs.php .

I have done away with the include function and put the code straight into the block but that still gave me the same error. I would just like it include function for ease of editing.

*I have added my own games and images just while I get thing to work.*

Do I make sense?

Polymath

But IN saying all that... is there one already made?? If so can you point me in the right direction because I can't find it with the words i used in search.

Thanks

ZarPrime

Polymath,

First of all, your gameplugs.php file doesn't have any php in it.  It looks like all html and javascript.  Also, the php code you are using in the php block is not php.  Those center tags are where the error is for that block of code.  I'm not a coder so you are going to have to wait for a response tomorrow from one of our coders but I have a question for you.  Why can't you just use the code in that file in an html/script block?

ZarPrime

Polymath

#3
Thanks. Never tried it. Orinally where I got it from was a php script.
the include function was php
<center><? include ('./modules/gameplugs.php'); ?></center><br>

But I don't need <? if using a php block. and gameplugs php is just called that I guess.
I wanted to use include so that I can edit it as a file instead of editing in a little box in my admin where I can't see the whole thing.

I'll try it in script block.
Thanks

Polymath

Woo hoo it worked.  :D  I had it in the wrong block type. Never thought.  :idiot2:
Thank you ZarPrime.
Now all I got to do is do some game plugs along with my play bigfish games ones for more traffic. Thanks so much.

Mine is only in arcade, but anyway:
In a script box add:

<table align="center" width="590">
<tbody>
<tr>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

<td>
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="thumbs/image.png"
  myimages[2]="thumbs/image.png"
  myimages[3]="thumbs/image.png"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="URL FOR IMAGE 1 GOES HERE"
  imagelinks[2]="URL FOR IMAGE 2 GOES HERE"
  imagelinks[3]="URL FOR IMAGE 3 GOES HERE"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<div id="gameplug"><a target="_blank" href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" width="60" height="60" border=0></a></div>')
}

  random_imglink()
//-->
</script>
</td>

</tr>
</tbody>
</table>


I also added style to the .css:

#gameplug {
padding:5px;
width:60px;
height:60px;
background:#40AADF;
}


Background is blue and size..change that to whatever you want.



I created a folder called thumbs and uploaded the images

edit the code appropriately
myimages[1]="thumbs/image.png" for your images

and

  imagelinks[1]="URL FOR IMAGE 1 GOES HERE" for the URL images link to.

Approximately 21 of them in the script.

I am going to use this for gameplugs in my arcade but it can be used for your own games, articles, link exchanges or anything of the sort you can think of.

My Strategy:

Step 1: Find a bunch of sites with 1:1 trade systems (approximately 21 of them). Some sites have 1:1 traffic trading systems, which means that every hit you send them, they will send back to you. If you don't know where to find them, just use the ones I link to in my plugs.

Step 2: Sign up for their traffic trade, and add a few of your games from your site.

None of this is going to be easy or fun, but hopefully it will increase traffic to your site.

I think I posted right what I had done. You can see demo in my arcade here:
http://www.gamesocket.geek.nz/index.php?action=arcade

If you see the red X I haven't finished yet.

Hope it works for you.

ZarPrime

Polymath,

Fantastic. :up: I'm glad it worked for you.

ZarPrime