Author |
Message |
Achaean
Regular


Joined: Mar 22, 2004
Posts: 64
Location: Missouri, USA
|
Posted:
Tue Aug 03, 2004 7:17 am |
|
Hey guys, I was wondering if any of you knew of a code that I could put into my header that would have it change eachtime you refreshed the page, the site is at www.1staxis.com any suggestions would be greatly appriciated.
Achaean |
_________________ http://www.1staxis.com |
|
 |
 |
Achaean

|
Posted:
Wed Aug 04, 2004 9:42 am |
|
anyone?  |
|
|
|
 |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Wed Aug 04, 2004 10:14 am |
|
You could randomize the header pretty easily if you used a theme that had seprate templates for the header. Make up all your different header styles and drop then into a sub directory like this theme/theme_name/rheader/
Here is a small script I modified to do the job. Don't remember where I got it just now but anyway.
Code:
See attachment farther down in this thread.
|
You can change tpl to whatever extension you need ect...
Then replace the the part of the theme.php with something like
include("./theme/theme_name/rheader/index.php");
Some themes like fiblue3d are a little different you might get by with changing:
$tmpl_file = "themes/fiblue3d/header.html";
to:
$tmpl_file = "theme/theme_name/rheader/index.php";
would have to play with your theme a little to achieve the desired result. |
_________________ [b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8
Last edited by sixonetonoffun on Thu Aug 05, 2004 7:38 am; edited 1 time in total |
|
|
 |
sixonetonoffun

|
Posted:
Wed Aug 04, 2004 10:26 am |
|
The same basic code could be used in a block to make a random block too. Would be pretty simple to do. |
|
|
|
 |
Achaean

|
Posted:
Wed Aug 04, 2004 10:44 am |
|
ah I see, yea Ive been lookin for a simple code for a while, im a bit of a noob at this so im kinda lookin for a install where it shows me how to do it kinda lol, anyway Ill give it a try although I have no idea what im doing but who cares lol |
|
|
|
 |
sixonetonoffun

|
Posted:
Wed Aug 04, 2004 1:43 pm |
|
What theme is yours based on that would help as far as giving you a little more detailed how to. |
|
|
|
 |
Achaean

|
Posted:
Wed Aug 04, 2004 2:22 pm |
|
well mine is zonecopper, with the built in forums, its listed at www.1staxis.com |
|
|
|
 |
sixonetonoffun

|
Posted:
Wed Aug 04, 2004 6:01 pm |
|
Ok well zonecopper kinda sux for doing this because much of the code I'd like to be able to make random is already brought into play before the html template. But any way here is what you need to make your header random.
http://www.netflake.com/files/rand_zoneCopper.zip
Edit the html templates in rheader add as many more as you like.
Now if you tell me all you wanted to do was load the header logo image randomly....
I might be inclined to get PO'd. |
|
|
|
 |
Achaean

|
Posted:
Wed Aug 04, 2004 7:58 pm |
|
lol now I have images already, just want to make those randomly appear |
|
|
|
 |
Achaean

|
Posted:
Wed Aug 04, 2004 8:04 pm |
|
ok im sorry to ask this, but where in the files do I edit the part where I can imput the image file names, again I appologise I am a bit of a noob at this |
|
|
|
 |
sixonetonoffun

|
Posted:
Wed Aug 04, 2004 9:37 pm |
|
In the /rheader/ there are a few tpl files which are just copies of the originals into any or all of those. Like I said add as many as you need. But if you are only trying to get a random logo there are easier ways to get that done. This truely randomly loads the whole header of the theme. |
|
|
|
 |
Achaean

|
Posted:
Wed Aug 04, 2004 10:10 pm |
|
hmm Im still a bit confused on setting it up, do u have msn or aim that you can pm to me? |
|
|
|
 |
Achaean

|
Posted:
Fri Aug 06, 2004 7:28 am |
|
|
|
 |
Achaean

|
Posted:
Sun Aug 08, 2004 8:13 am |
|
hmm is there anyway you could help me with the install at all? |
|
|
|
 |
pentarix
New Member


Joined: May 02, 2006
Posts: 5
|
Posted:
Thu May 04, 2006 5:56 pm |
|
I'm also interested in doing this. I have a multi-image header and I'm looking to get each group of images (each group is of a different game) to open together, randomly, each time I reload the page.
Any advice on how to do this? Is there a script that I can use? |
_________________ www.lifesupporters.com |
|
|
 |
pentarix

|
Posted:
Tue May 16, 2006 10:01 am |
|
Can anyone please help me with this? |
|
|
|
 |
hitwalker
Sells PC To Pay For Divorce

Joined:
Posts: 5661
|
Posted:
Tue May 16, 2006 2:43 pm |
|
ok ill try to help out on this....
keep in mind that im only explaining this and im not gonna support this..
its your job to put this in...
basically what this does is that if you point it to the header images you use it wil show them random when the page loads...
so this is not based to show a completely different html header or whatever but a header image...
put the following in the head.....
Code:
<scri pt language="JavaSc ript" type="text/javascript">
var theImages = new Array()
theImages[0] = 'images/header1.gif'
theImages[1] = 'images/header2.gif'
theImages[2] = 'images/header3.gif'
theImages[3] = 'images/header4.gif'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i > p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" alt="header image">');
}
</sc ript>
|
then put this where it should appear....
Code:
<sc ript language="Java Script" type="text/javascript">showImage()</sc ript>
|
|
|
|
|
 |
|