MyBB Community Forums

Full Version: Is there a plugin that allow a new logo per refresh?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is this possible? New logo/header image per refresh?
Not as I know, you could mess around with some basic HTML and JS.
Have a look at this http://stackoverflow.com/questions/97009...javascript
Create a logo.php on your public root directory
<?php 
$logos = Array();
if ($dir = opendir('images/custom_logos')){
	while (false !== ($file = readdir($dir))){
		if (!preg_match("/\.png$/i", $file)){
			continue;
		}
		$logos[] = $file;
	}
	closedir($dir);
}

if (count($logos) > 0){
	$rand = rand(0, count($logos)-1);
	$logo = $logos[$rand];
	header('Content-Type: image/png');
	echo file_get_contents("images/custom_logos/{$logo}");
}
?>

Then, in your .htacccess
RewriteEngine On
RewriteBase /
RewriteRule ^images\/logo\.png logo.php [L,QSA,NC]

You should save all your logos at "images/custom_logos" in png format.

Then point your forum logo to

http://YOURSITE.COM/images/logo.png