MyBB Community Forums

Full Version: Rotating Logo
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm trying to design a logo for my site that changes each the page is accessed or refreshed. A friend of mine has this installed on his IPB forums for his avatars and signatures...It's a PHP code but I'm not sure how to install it or make it work for the logo. Any help is appreciated.
Ok, I get what do to but what template do I edit? The theme I'm using uses "logo.png" for the logo. I need to change that to logo.php but I don't what to edit. I've looked at the header template and it doesn't say anything.
Bump.
Bumping has no effect.

You can edit it in the settings for the theme.
I found that out. :p

Anyways....This is the header code.

<!-- begin wrapper -->
<div id="wrapper">

	<!-- begin logo -->
	<div id="logo">
		<a href="{$mybb->settings['bburl']}/"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" class="logo" /></a>
		<a name="top" id="top"></a>
		<div id="panel">
			<div id="panelcontent">{$welcomeblock}</div>
		</div>
	</div>
	<!-- end logo -->

I'm pretty sure that's what I'm supposed to edit....
No, as I said, you don't need to edit templates, you just edit the path to the logo in the settings.... Undecided
Lol, here's a workaround since you don't know how to edit the headers apparently.

http://cutandpastescripts.com

Make an account there sign up log in and then click create random images script. You should get something like this (I believe you place each image on a separate line I didn't test it).
<!- Random Images Script, by Cut and Paste Scripts.  Hosted CGI, with NO adverts and FREE. http://www.cutandpastescripts.com -!>
<img src="http://www.cutandpastescripts.com/cgi-bin/randomimages/randomimages.pl?username=Existance0" alt="Random Images"><!- Copyright Cut and Paste Scripts -!>
Find the line that looks like this:
<img src="http://www.cutandpastescripts.com/cgi-bin/randomimages/randomimages.pl?username=Existance0" alt="Random Images">
And take out this:
http://www.cutandpastescripts.com/cgi-bin/randomimages/randomimages.pl?username=Existance0

Go to your ACP click the Templates and Styles tab and make sure Themes is selected on the left. Select the theme you want to apply the rotating logo for and paste in the above url as the boards logo.

And... that should do it. Hope this works for you oh if putting the images on separate lines doesn't work try separating them with commas.
Try this

<?php
// Make this the relative path to the images, like "../img" or "random/images/".
// If the images are in the same directory, leave it blank.

$folder = 'images/logo/';  // Image directory!

// Space seperated list of extensions, you probably won't have to change this.
$exts = 'jpg jpeg png gif';
$files = array(); $i = -1; // Initialize some variables
if ('' == $folder) $folder = './';
$handle = opendir($folder);
$exts = explode(' ', $exts);
while (false !== ($file = readdir($handle))) {
foreach($exts as $ext) { // for each extension check the extension
if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive
$files[] = $file; // it's good
++$i;
}
}
}
closedir($handle); // We're not using it anymore
mt_srand((double)microtime()*1000000); // seed for PHP < 4.2
$rand = mt_rand(0, $i); // $i was incremented as we went along
header('Location: '.$folder.$files[$rand]); // Voila!
?>
I feel so stupid Matt....I looked around and found what you were talking about...

@ Existance0: I do know how to edit headers, Matt just confused me.
OK, sorry if I offended you then. Toungue
Pages: 1 2