• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How can I Change 'Forum' Background, Every 6 Hours?:

CritiKiL

Active member
#1
My site has a background in the "Style Properties / General/ 'Content' area. I will only get confused trying to use a similar customization which works only for the Header and etc. So can someone help me with the code which will allow this to change to 7 other backgrounds (8 different backgrounds total), every 6 hours or at any preset interval? Remember, these backgrounds reside in the 'Contents' area or inside of the Forum area, not the outside:

 

CritiKiL

Active member
#3
Actually I could use the one you have in the link. But can you give me the coding for the area of background I wish to manipulate? That example is using the Header background so how would I get it to work for the content background? Thanks Jake.
 

Jake Bunce

XenForo moderator
Staff member
#4
Admin CP -> Appearance -> Templates -> EXTRA.css

Specify your classes with the two background images by adding this block of code:

Code:
.backDay
{
	background-image: url('PATH/TO/DAY.GIF');
}

.backNight
{
	background-image: url('PATH/TO/NIGHT.GIF');
}
Then edit this template:

Admin CP -> Appearance -> Templates -> PAGE_CONTAINER

Replace the red code:

Code:
<div id="content" class="{$contentTemplate}">
	<div class="pageWidth">
		<div class="pageContent">
			<!-- main content area -->
			
			<xen:hook name="page_container_content_top" />
			
			<xen:if is="{$sidebar}">
				<div class="mainContainer">
Like so:

Code:
<div id="content" class="{$contentTemplate}">
	<div class="pageWidth">
		<xen:if is="{xen:time $serverTime, 'G'} >= 8 AND {xen:time $serverTime, 'G'} < 20">
			<div class="pageContent backDay">
		<xen:else />
			<div class="pageContent backNight">
		</xen:if>
			<!-- main content area -->
			
			<xen:hook name="page_container_content_top" />
			
			<xen:if is="{$sidebar}">
				<div class="mainContainer">