Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-18-2008, 08:50 AM   #1
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
how to do a random header with css

I use this for one of my sites, Thought I would share

css

#header {
height:140px;
background: #fff url('images/header.php') no-repeat;
padding:0 0 0 0px;
text-align: center;
}

html

<div id="header">
</div>

php code (rename to header.php)

http://alistapart.com/d/randomizer/rotate.txt

enjoy

__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2008, 09:00 AM   #2
Jens Van Assterdam
The Dupre Pimp
 
Jens Van Assterdam's Avatar
 
Join Date: Feb 2008
Location: Koh Samui
Posts: 6,677
How to hotlink a image

<a href="http://galleries.penthouse.com/g/0536/21/?gpid=g950494-pct"><img src="http://www.jensvanassterdam.com/posts/152/karl.jpg" alt="Karlie Montana" target="blank"/> </a>

Use this at one of my sites..
thought i would share
__________________
Read TOS for signature rules
Jens Van Assterdam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2008, 09:05 AM   #3
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Why not just have an array of images and use:

<?php
srand((float) microtime() * 1000000);
$images = array('image1', 'image2', 'image3', ....);
echo $images[array_rand($images)];
?>

Or you could use javascript.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2008, 09:16 AM   #4
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
Quote:
Originally Posted by mrkris View Post
Why not just have an array of images and use:

<?php
srand((float) microtime() * 1000000);
$images = array('image1', 'image2', 'image3', ....);
echo $images[array_rand($images)];
?>

Or you could use javascript.
I was using it in a wordpress theme where it required it to be in css and a div
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2008, 09:49 AM   #5
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,229
Quote:
Originally Posted by Fris View Post
I use this for one of my sites, Thought I would share

css

#header {
height:140px;
background: #fff url('images/header.php') no-repeat;
padding:0 0 0 0px;
text-align: center;
}

html

<div id="header">
</div>

php code (rename to header.php)

http://alistapart.com/d/randomizer/rotate.txt

enjoy

That could will cause high server load because its using GD. I would just do something like

<?php
Header("Content-Type: image/jpeg");
$images = array('img1.jpg','img2.jpg','img3.jpg');
shuffle($images);
$string = file_get_contents('headers/'.$images[0]);
echo $string;
exit();
?>
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2008, 09:54 AM   #6
payd2purv
Too lazy to set a custom title
 
payd2purv's Avatar
 
Join Date: Jan 2008
Location: Toronto
Posts: 2,727
Quote:
Originally Posted by k0nr4d View Post
That could will cause high server load because its using GD. I would just do something like

<?php
Header("Content-Type: image/jpeg");
$images = array('img1.jpg','img2.jpg','img3.jpg');
shuffle($images);
$string = file_get_contents('headers/'.$images[0]);
echo $string;
exit();
?>
sweet. *copy >paste >save*
__________________
payd2purv is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.