Goto page 1, 2  Next

Header logo

527

Mon Feb 05, 2018 4:50 am
NOOB!!!
26 Posts
Hi Corpse, I will want to know how I can make more than one logo with my style.css

Thank you Corpse
Mon Feb 05, 2018 9:40 am
Clan Leader
Top Dog
2631 Posts
coRpSE
Online
Most Played:
This week: 81.4hrs.
Total Played: 161hrs.
  
There is life outside of the game.
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.


Expand
Mon Feb 05, 2018 10:31 am
Original Poster
NOOB!!!
26 Posts
Ok I will look if I find a tutorial!
This is a theme I bought on clantheme (bf4_xtreme)


 
Mon Feb 05, 2018 3:24 pm
Clan Leader
Top Dog
2631 Posts
coRpSE
Online
Most Played:
This week: 81.4hrs.
Total Played: 161hrs.
  
There is life outside of the game.
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.


 
Mon Feb 05, 2018 5:56 pm
Original Poster
NOOB!!!
26 Posts
MP send with file lachen


 
Mon Feb 05, 2018 9:44 pm
Clan Leader
Top Dog
2631 Posts
coRpSE
Online
Most Played:
This week: 81.4hrs.
Total Played: 161hrs.
  
There is life outside of the game.
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.


 
Tue Feb 06, 2018 2:25 am
Original Poster
NOOB!!!
26 Posts
Corpse, look at my capture we can put here the logo because several site put it here.

Thank you Corpse.


 
Tue Feb 06, 2018 9:43 am
Clan Leader
Top Dog
2631 Posts
coRpSE
Online
Most Played:
This week: 81.4hrs.
Total Played: 161hrs.
  
There is life outside of the game.
What capture?


 
Tue Feb 06, 2018 9:52 am
Original Poster
NOOB!!!
26 Posts
Here sorry



Expand


 
Tue Feb 06, 2018 11:15 am
Clan Leader
Top Dog
2631 Posts
coRpSE
Online
Most Played:
This week: 81.4hrs.
Total Played: 161hrs.
  
There is life outside of the game.
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.


 
Goto page 1, 2  Next
Forums ©