Header logo
Select messages from # through # Forum FAQ
[/[Print]\]
Goto page 1, 2  Next  :| |:
HeadShot Extreme -> Nuke Blocks / Modules Support

#1: Note Header logo Author: airsteamLocation: Paris PostPosted: Mon Feb 05, 2018 4:50 am
    —
Hi Corpse, I will want to know how I can make more than one logo with my style.css

Thank you Corpse

#2: No icon Re: Header logo Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Feb 05, 2018 9:40 am
    —
What do you mean, "more than one logo"?

If your talking about having it randomly change on each page refresh, then there are several different ways, it really depends on your theme and how its set up and how you really want to go about it. You could do it with jquery, and CSS, or you can do it with PHP and CSS. Me personally, to make it easier on myself, I would just do PHP and an array. Then make the images and do it that way. But I can't say exactly how to do it because each theme is different and it really depends on your theme.

#3: No icon Re: Header logo Author: airsteamLocation: Paris PostPosted: Mon Feb 05, 2018 10:31 am
    —
Ok I will look if I find a tutorial!
This is a theme I bought on clantheme (bf4_xtreme)

#4: No icon Re: Header logo Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Feb 05, 2018 3:24 pm
    —
well, if you pack up the header file or the theme itself and send it to me, I can code it in for you.

The way I would do it is like this:

PHP:  [ Select all ]

  $ran_logo = array('logo_1.png''logo_2.png''logo_3.png''logo_4.png''logo_5.png' ); // array of filenames
 
 $i rand(0count($ran_logo)-1);
 
 $dispalyed_logo "$ran_logo[$i]"

 

then where the image is displayed, I would display the logo using the URL and $displayed_logo, sortof like this.

(HTML Version)

PHP:  [ Select all ]

<img src="./themes/Your_Theme/images/<?PHP echo $displayed_logo; ?>" width="500px" height="150px" alt=""

 
(PHP Version)

PHP:  [ Select all ]

echo '<img src="./themes/Your_Theme/images/'$displayed_logo .'" width="500px" height="150px" alt="">'

 

But each theme is different and the logo could be a background image instead, or, something else may be different where a slight rewrite of the header may need to be edited/changed.

Note:
But one thing to keep in mind is to make each image the same size in width and height.
Last edited by coRpSE on Mon Feb 05, 2018 9:02 pm; edited 1 time in total

#5: No icon Re: Header logo Author: airsteamLocation: Paris PostPosted: Mon Feb 05, 2018 5:56 pm
    —
MP send with file lachen

#6: No icon Re: Header logo Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Feb 05, 2018 9:44 pm
    —
Okay, Here is an example, let me know if this is what you were looking for.

My Testsite:
Please login to see this link
Get registered or Log in


In the left blocks, you will see a "Theme Changer" block. Just select the BF4_Multi, and once you have that theme selected, look at the logo image and hit refresh a few times, you will see it change randomly. I have Test Image 1 through Test Image 5. If thats what your looking for, then the way i did that is by editing 2 files.

Open you public_html/themes/BF4_Multi/style/style.css and find

Code: [ Select all ]

#headerlogo {
   background: url("../images/header/logo.png") no-repeat;
   width:968px;
   height: 180px;
   margin:0 auto;
}


Remove the background: url("../images/header/logo.png") no-repeat; line so it will look like:

Code: [ Select all ]

#headerlogo {
   width:968px;
   height: 180px;
   margin:0 auto;
}


Save & Close


Now, open up
public_html/themes/BF4_Multi/theme.php

Find:

PHP:  [ Select all ]

echo '<div class="headbg">'


On new line before, ADD:

PHP:  [ Select all ]

  $rl = array('logo1.png''logo2.png''logo3.png''logo4.png''logo5.png');
 
 shuffle($rl);
 
 $displayed_logo array_rand($rl1); 

 

Next, Find:

Code: [ Select all ]

<div id="headerlogo"></div>


Replace with:

Code: [ Select all ]

<div id="headerlogo" style="background: url("../images/header/'. $displayed_logo .'") no-repeat;"></div>



Save & Close

Now, what you want to do is upload all your logo images into the folder
public_html/themes/BF4_Multi/images/header/

Then, you will see in the edit above, a line that looks like this:
$rl = array('logo1.png', 'logo2.png', 'logo3.png', 'logo4.png', 'logo5.png');

In between each of the quotes, ('), you want to put in the name of the image and the file type. You really want all your images as .png images and keep them the same size as the default one, which is 968 x 200.

#7: No icon Re: Header logo Author: airsteamLocation: Paris PostPosted: Tue Feb 06, 2018 2:25 am
    —
Corpse, look at my capture we can put here the logo because several site put it here.

Thank you Corpse.

#8: No icon Re: Header logo Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Tue Feb 06, 2018 9:43 am
    —
What capture?

#9: No icon Re: Header logo Author: airsteamLocation: Paris PostPosted: Tue Feb 06, 2018 9:52 am
    —
Here sorry



Expand

#10: No icon Re: Header logo Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Tue Feb 06, 2018 11:15 am
    —
Clear your browser's cache and go back to here and check to see if that's what you're looking for.
Please login to see this link
Get registered or Log in


Again, make sure your on the BF4_Multi theme.



HeadShot Extreme -> Nuke Blocks / Modules Support


output generated using printer-friendly topic mod. All times are GMT - 7 Hours

Goto page 1, 2  Next  :| |:
Page 1 of 2