Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...
Author Message
Achaean
Regular
Regular



Joined: Mar 22, 2004
Posts: 64
Location: Missouri, USA

PostPosted: Tue Aug 03, 2004 7:17 am Reply with quote

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 [ Only registered users can see links on this board! Get registered or login! ] any suggestions would be greatly appriciated.
Achaean

_________________
[ Only registered users can see links on this board! Get registered or login! ] 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Achaean







PostPosted: Wed Aug 04, 2004 9:42 am Reply with quote

anyone? RavensScripts
 
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Wed Aug 04, 2004 10:14 am Reply with quote

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 
View user's profile Send private message
sixonetonoffun







PostPosted: Wed Aug 04, 2004 10:26 am Reply with quote

The same basic code could be used in a block to make a random block too. Would be pretty simple to do.
 
Achaean







PostPosted: Wed Aug 04, 2004 10:44 am Reply with quote

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







PostPosted: Wed Aug 04, 2004 1:43 pm Reply with quote

What theme is yours based on that would help as far as giving you a little more detailed how to.
 
Achaean







PostPosted: Wed Aug 04, 2004 2:22 pm Reply with quote

well mine is zonecopper, with the built in forums, its listed at [ Only registered users can see links on this board! Get registered or login! ]
 
sixonetonoffun







PostPosted: Wed Aug 04, 2004 6:01 pm Reply with quote

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. [ Only registered users can see links on this board! Get registered or login! ]
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







PostPosted: Wed Aug 04, 2004 7:58 pm Reply with quote

lol now I have images already, just want to make those randomly appear
 
Achaean







PostPosted: Wed Aug 04, 2004 8:04 pm Reply with quote

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







PostPosted: Wed Aug 04, 2004 9:37 pm Reply with quote

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







PostPosted: Wed Aug 04, 2004 10:10 pm Reply with quote

hmm Im still a bit confused on setting it up, do u have msn or aim that you can pm to me?
 
Achaean







PostPosted: Fri Aug 06, 2004 7:28 am Reply with quote

mhm hello?
 
Achaean







PostPosted: Sun Aug 08, 2004 8:13 am Reply with quote

hmm is there anyway you could help me with the install at all?
 
pentarix
New Member
New Member



Joined: May 02, 2006
Posts: 5

PostPosted: Thu May 04, 2006 5:56 pm Reply with quote

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?

_________________
[ Only registered users can see links on this board! Get registered or login! ] 
View user's profile Send private message
pentarix







PostPosted: Tue May 16, 2006 10:01 am Reply with quote

Can anyone please help me with this?
 
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Tue May 16, 2006 2:43 pm Reply with quote

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>

 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©