PkerMaster
b&
Does anyone know how to do add rotation in phpbb in templates/TEMPLATE/overall_header.tpl? Please help! And make it so it rotates after each page refresh!
Thankyou!
Thankyou!
Last edited:
<script type="text/javascript"><!--
var currentdate = 0;
var core = 0;
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
link = new initArray(
"LINK TO AD 1",
"LINK TO AD 2",
"LINK TO AD 3"
);
image = new initArray(
"IMAGE SOURCE FOR AD 1",
"IMAGE SOURCE FOR AD 2",
"IMAGE SOURCE FOR AD 3"
);
text = new initArray(
"ALT. TEXT FOR AD 1",
"ALT. TEXT FOR AD 2",
"ALT. TEXT FOR AD 3"
);
var currentdate = new Date();
var core = currentdate.getSeconds() % image.length;
var ranlink = link[core];
var ranimage = image[core];
var rantext = text[core];
document.write('<a href=\"' +ranlink+ '\" target=\"_blank\"><img src=\"'+ranimage+'\" border="0" alt=\"'+rantext+'\"></a>');
//-->
</SCRIPT>
<script type="text/javascript"><!--
var currentdate = 0;
var core = 0;
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
link = new initArray(
"LINK TO AD 1",
"LINK TO AD 2",
"LINK TO AD 3"
);
image = new initArray(
"IMAGE SOURCE FOR AD 1",
"IMAGE SOURCE FOR AD 2",
"IMAGE SOURCE FOR AD 3"
);
text = new initArray(
"ALT. TEXT FOR AD 1",
"ALT. TEXT FOR AD 2",
"ALT. TEXT FOR AD 3"
);
var currentdate = new Date();
var core = currentdate.getSeconds() % image.length;
var ranlink = link[core];
var ranimage = image[core];
var rantext = text[core];
document.write('<a href=\"' +ranlink+ '\" target=\"_blank\"><img src=\"'+ranimage+'\" border="0" alt=\"'+rantext+'\"></a>');
//-->
</script>
<?php
function randgif()
{
$path = "/home/robert/www/swedgamingportal/pathstobanners"; // full path to files on server
$handle = @opendir($path);
if($handle < 0)
exit;
$count = 0;
$files = array();
while(($file = @readdir($handle)) !== false) {
if($file != "." && $file != "..") {
if(substr($file, 0, 1) == ".")
continue;
if(@is_dir("$path/$file"))
continue;
$lastdot = strrpos($file, ".");
$ext = strtolower(substr($file, $lastdot+1));
if(!($ext == "swf"))
continue;
$files[$count++] = $file;
}
}
@closedir($handle);
return $files[rand(0, $count)];
}
?>
I looked and i saw no start tag...themoose said:his script was javascript, yours was php. he did specify the <script> start tag (look harder) and html does not have to be in a specific case.
edit// oh and that code you just showed is only for .swf files, and not for numorous codes.
Did you get that from my post or Tree_ncs post. I edited Trees post so that it does have a start tag btw.themoose said:look at the top,
that is the start code.Code:<script type="text/javascript">
<!-- Begin BidVertiser code -->
<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=9094&bid=18939"></SCRIPT>
<noscript><a href="http://www.bidvertiser.com">make money online</a></noscript>
<!-- End BidVertiser code -->
R4g1ng said:http://www.daydreamgraphics.com/d/tutorial/list/220/2
A tutorial I wrote for a randomizing script. You just place the include code where you want the ads to be.