<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — header image with each style]]></title>
		<link>https://punbb.informer.com/forums/topic/3618/header-image-with-each-style/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/3618/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in header image with each style.]]></description>
		<lastBuildDate>Wed, 19 Dec 2007 23:06:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/105553/#p105553</link>
			<description><![CDATA[<p>A better way to do this would be to simply make the background-image url point to the PHP file, which then echo&#039;s out the contents of the randomly selected image file</p>]]></description>
			<author><![CDATA[null@example.com (Smartys)]]></author>
			<pubDate>Wed, 19 Dec 2007 23:06:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/105553/#p105553</guid>
		</item>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/105552/#p105552</link>
			<description><![CDATA[<p>Thanks for this</p>]]></description>
			<author><![CDATA[null@example.com (dude07)]]></author>
			<pubDate>Wed, 19 Dec 2007 22:20:14 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/105552/#p105552</guid>
		</item>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/57430/#p57430</link>
			<description><![CDATA[<p>I found a solution! Feel so proud of myself hahaha.</p><p>This is how i do it in case some1 is interested:</p><p>a) create all the images (same height and width, any names) and put them in /img/headers/</p><p>b) Create this php file (random_image.php) and put in in my /style/ directory<br /></p><div class="codebox"><pre><code>&lt;?php
header(&#039;Content-type: text/css&#039;);
$dir=opendir(&quot;/data/4/0/51/132/214947/user/218384/htdocs/kadus/img/headers/&quot;); // actual path of the images to select
$pattern=&quot;\.(gif|jpg|jpeg|png|bmp|swf)$&quot;;
if(!$dir)
{
die(&quot;Failed to read directory&quot;);
}
$s=readdir($dir);
$count=&quot;0&quot;;
$image;
while($s)
{
if(ereg($pattern, $s))
{
$image[$count]=$s;
$count++;
}
$s=readdir($dir);
}
closedir($dir);

// make random number 

$limit=count($image);
$limit--;
$randNum=rand(0,$limit);
?&gt;

.pun #brdtitle h1 span{

/* remove slash and* for hidden title
font-size: 0;
text-indent: -1000px;
*/

/* use this if the title is not hidden */
padding-top: 40px;
padding-left: 5px;
padding-bottom:0px;
color: #FFF;
/*    */

display:block;
height: 160px;
/* change the height above to fit your actual header img height */

background-image: url(&lt;?=&quot;http://your forum.coc/img/headers/&quot;.$image[$randNum]; ?&gt;);
background-position: 50% 0;
background-repeat: no-repeat;

margin-left: -5px;
margin-right: -5px;
margin-bottom: -43px;
}</code></pre></div><p>In this case, I am using Blue_Lagon.cs. The style above are taken from the blue_lagon_cs.css in the /style/imports/ folder. Therefore, the original entry for the above in the blue_lagon_cs.css should be deleted.</p><p>c) open /style/blue_lagon.css and add this somewhere around the top, below the other @import statements<br /></p><div class="codebox"><pre><code>@import url(random_image.php);</code></pre></div><p>Thats&#039;s it! The same can be applied to all the other stylesheets that you are using.</p>]]></description>
			<author><![CDATA[null@example.com (af3)]]></author>
			<pubDate>Sat, 19 Nov 2005 22:37:25 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57430/#p57430</guid>
		</item>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/57397/#p57397</link>
			<description><![CDATA[<p>You can&#039;t use php in a stylesheet but you can serve a php script as a stylesheet which amounts to the same thing. <br /><a href="http://www.1976design.com/blog/archive/2004/02/03/php-dynamic-css/">http://www.1976design.com/blog/archive/ … namic-css/</a></p><p>Just google on &quot;dynamic css&quot;</p>]]></description>
			<author><![CDATA[null@example.com (Paul)]]></author>
			<pubDate>Sat, 19 Nov 2005 04:50:04 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57397/#p57397</guid>
		</item>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/57395/#p57395</link>
			<description><![CDATA[<p>unless i can make a separate &lt;style&gt; being echoed by php in header.php</p><p>&lt;?php <br />$file = &quot;all my randon images.txt&quot;;<br />$fp = file($file); <br />srand((double)microtime()*1000000); <br />$random_image = $fp[array_rand($fp)]; <br />echo &quot;&lt;style&gt;#brdtitle {background: url(&quot;;<br />echo $random_image;<br />echo &quot;) no-repeat; height:60px}&lt;/style&gt;&quot;;<br />?&gt; </p><p>and remove the #brdtitle ref in the css file..&nbsp; <br />will try..</p>]]></description>
			<author><![CDATA[null@example.com (af3)]]></author>
			<pubDate>Sat, 19 Nov 2005 04:26:35 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57395/#p57395</guid>
		</item>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/57392/#p57392</link>
			<description><![CDATA[<p>you cant use php in a css file. and i dont know how someone would go about doin that, anyone else?</p>]]></description>
			<author><![CDATA[null@example.com (Gizzmo)]]></author>
			<pubDate>Sat, 19 Nov 2005 03:04:42 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57392/#p57392</guid>
		</item>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/57390/#p57390</link>
			<description><![CDATA[<p>Gizzmo: How to make the header image changed randomly in the same style?<br />Can I make something like this?</p><p>#brdtitle {background: url(&lt;?php get_random_header_img_name(); ?&gt;) no-repeat; height:60px}</p>]]></description>
			<author><![CDATA[null@example.com (af3)]]></author>
			<pubDate>Sat, 19 Nov 2005 02:41:08 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57390/#p57390</guid>
		</item>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/57310/#p57310</link>
			<description><![CDATA[<p>this is the way i use headers in some of my styles, it basicly adds a background image to the header and makes the title and description not visible</p><p>just change the url to the header background and the height to match the image</p><div class="codebox"><pre><code>#brdtitle {background: url(../../img/&lt;image&gt;.jpg) no-repeat; height:60px}
#brdtitle P {display:none}
#brdtitle h1 {display:none}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Gizzmo)]]></author>
			<pubDate>Fri, 18 Nov 2005 07:07:18 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57310/#p57310</guid>
		</item>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/57307/#p57307</link>
			<description><![CDATA[<p>this is probably not strictly punbb related, but did any1 ever try to make random header images? i&#039;m trying to use this javascript to call for random image to be inserted in the header but cant figure out how to do this to be inserted to the css.</p><p>.. unles this can be inserted by the server i.e. using php? </p><div class="codebox"><pre><code>&lt;SCRIPT LANGUAGE=&quot;Javascript&quot;&gt;
&lt;!--

function image() {};

image = new image();
number = 0;

// imageArray
image[number++] = &quot;&lt;img src=&#039;../../images/furniture_banner.jpg&#039; border=&#039;0&#039;&gt;&quot;
image[number++] = &quot;&lt;img src=&#039;../../images/crafts_banner.jpg&#039; border=&#039;0&#039;&gt;&quot;
image[number++] = &quot;&lt;img src=&#039;../../images/custom_banner.jpg&#039; border=&#039;0&#039;&gt;&quot;
image[number++] = &quot;&lt;img src=&#039;../../images/gifts_banner.jpg&#039; border=&#039;0&#039;&gt;&quot;
// Additional immages can be added here

increment = Math.floor(Math.random() * number);

document.write(image[increment]);

//--&gt;
&lt;/SCRIPT&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (af3)]]></author>
			<pubDate>Fri, 18 Nov 2005 05:11:44 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57307/#p57307</guid>
		</item>
		<item>
			<title><![CDATA[Re: header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/12311/#p12311</link>
			<description><![CDATA[<p>Sure. Just add your own replacement tag to the templates (.e.g. &lt;my_logo&gt;) and then add some code to header.php to replace it with your image. Something like this maybe:<br /></p><div class="codebox"><pre><code>// START SUBST - &lt;my_logo&gt;
$tpl_main = str_replace(&#039;&lt;my_logo&gt;&#039;, &#039;&lt;img src=&quot;img/logo/&#039;.$style.&#039;.png&#039;&quot; alt=&quot;My cool logo&quot;&gt;&#039;, $tpl_main);
// END SUBST - &lt;my_logo&gt;</code></pre></div><p>If the current style is Oxygen, that code will try to display &quot;img/logo/Oxygen.png&quot;. Make sure you insert the code below the replacement for &lt;pun_head&gt; (as $style is defined in that piece of code).</p>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Thu, 15 Apr 2004 23:40:13 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/12311/#p12311</guid>
		</item>
		<item>
			<title><![CDATA[header image with each style]]></title>
			<link>https://punbb.informer.com/forums/post/12308/#p12308</link>
			<description><![CDATA[<p>Hello</p><p>I would like to put a header image that changes with the changing style.&nbsp; Right now I have one image in the main.tpl but it stays the same with each style change.&nbsp; I attempted to add the image to the <strong>TR.punhead {</strong> section of the .css files of each style, but it didn&#039;t work.</p><p>Is there a way to create seperate template file that attatches to each .css file so that I can use different images with each style?</p><p>Thanks!</p>]]></description>
			<author><![CDATA[null@example.com ([ s c a r l e t ])]]></author>
			<pubDate>Thu, 15 Apr 2004 22:51:21 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/12308/#p12308</guid>
		</item>
	</channel>
</rss>
