PDA

View Full Version : Add Random Images to Kubrick Header


abcohen
08-11-2005, 04:26 PM
First lets make sure we all have the same files, the Kubrick skin that is being edited here is the one posted in the Skins section, found here...
http://www.subdreamer.org/sd_skins/p13_sec...2/p13_fileid/18 (http://www.subdreamer.org/sd_skins/p13_sectionid/2/p13_fileid/18)

Ok, now on with the show --

1) - Find your images...

2) - Use the header photoshop template and insert your images into the grouping called random images this will give you the correct rounded corners

3) - Save the images as JPGs, JPEGs, GIFs, or PNGs (thats up to you - the random script will read any of those files)

4) - Add the random.php to your kubrick folder ( it should be in the same directory as your install.php, kubrick1.php, kubrick2.php, categories.php, forumskin.php and style.css )

5) - Create a directory in the images folder called "randomheader" ( your directory structure should look like this skins\kubrick\images\randomheader\ )

6) - Upload your images in to the "randomheader" folder

7) - Edit your kubrick files...

In kubrick1.php & kubrick2.php goto line 31 which should be...
<td width="720" height="182" align="center" background="skins/kubrick/images/header.gif" /><?php echo $logo; ?></td>

and replace it with this line...

*<td width="720" height="182" align="center" style="background-image: url(skins/kubrick/random.php); background-position: top center; background-repeat: no-repeat;" /><?php echo $logo; ?></td>
In forumskin.php goto line 80 which should be...
* * * * * * * <td width="720" height="182" align="center" background="' . $sdpath . 'skins/kubrick/images/header.gif" style="padding: 0px;">' . $logo . '</td>

and replace it with...
<td width="720" height="182" align="center" style="background-image: url(' . $sdpath . 'skins/kubrick/random.php); background-position: top center; background-repeat: no-repeat; padding: 0px;">' . $logo . '</td>
Now save those files with the fixed code...

8) - Congrats you now have random header images...

Below you will find the following: the random.php script, and the random_demo.psd photoshop template.

daemon
10-14-2005, 06:26 PM
this is exactly what I was looking for, thanks abcohen.

I was just wondering what you'd think about modifying it to just take random jpeg's with a fixed name like "header1.jpg", "header2.jpg" ? Would that be a bit quicker and more efficient as it doesn't have to keep checking the directory. Just add a variable to set the # of headers available.

abcohen
10-14-2005, 06:59 PM
<div class='quotetop'>QUOTE(Daemon &#064; Oct 14 2005, 02&#58;26 PM) 1712</div>
this is exactly what I was looking for, thanks abcohen.

I was just wondering what you&#39;d think about modifying it to just take random jpeg&#39;s with a fixed name like "header1.jpg", "header2.jpg" ? Would that be a bit quicker and more efficient as it doesn&#39;t have to keep checking the directory. Just add a variable to set the # of headers available.
[/b]

If you ran the script its lighting quick.

daemon
10-14-2005, 07:16 PM
<div class='quotetop'>QUOTE(abcohen &#064; Oct 14 2005, 11&#58;59 AM) 1713</div>
If you ran the script its lighting quick.
[/b]

It is very quick, just wondering if fixed filenames would make a noticeable improvement, especially if the site were under load.

thanks again, looks great.

abcohen
10-14-2005, 07:20 PM
<div class='quotetop'>QUOTE(Daemon &#064; Oct 14 2005, 03&#58;16 PM) 1714</div>
It is very quick, just wondering if fixed filenames would make a noticeable improvement, especially if the site were under load.

thanks again, looks great.
[/b]
I would say it would be sooo minor that it wouldnt lighten any of the load of a server that was getting hit hard.

singsing123
10-23-2005, 10:55 AM
中文

kboy_16
11-03-2006, 02:44 AM
can i use this for any other skin?

abcohen
11-03-2006, 05:49 AM
yup the script works great just need to learn how to place it into different skins.

kboy_16
11-03-2006, 01:10 PM
ok.. thanks a bunch! ;)

Maxxius
07-17-2008, 10:10 AM
Thank you for this great, light on server resources method of having random headers turn like crazy! :)

Just tested it, works with EVERY skin. Even if edits are to be made in CSS. Awesome! :)

vynnus
07-17-2008, 04:01 PM
Nice method! I did something similar on the skins that I sell on my website (SDSkins2go.com (http://www.sdskins2go.com)) with these differences:

- The skins has a header banner in flash format that looks very cool. It randomize the images in 12 different transitions. If you prefer you can use only one transition of them.
- You have the ability to upload the images from inside Subdreamer Control Panel, to be more exactly from inside the Images Manager tab. This way you don't need to use any ftp software to upload or delete your images.
- No matter the name of the images you have uploaded, they will be read and showed on the front page.
- And for last, the script will read and show on the front page only the images that exists inside a previous sub-folder created inside the images directory (for example /flash_header).

If you want to see a demo take a look at:

demo.sdskins2go.com (http://demo.sdskins2go.com)

This is one my latest skins. I guess all the skins published on my site from now on will have a flash header as an option to dynamically show images.