Previous Thread
Next Thread
Print Thread
Rate Thread
#318663 11/19/2010 12:33 AM
Joined: Oct 2006
Posts: 18
Newbie
Newbie
Joined: Oct 2006
Posts: 18
Hej

I was wondering if it was possible to change my board logo when changing stylesheet. I want to use another logo when using dark stylesheets as ubbthreads_dark and DarkRounded. Here's my little modification done in /includes/header.php

HTML
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="margin-top:8px;margin-bottom:0px">
<tr>
<td>
PHP Code

<?php
$stylesheet
= "{$config['BASE_URL']}/styles/{$style_array['css']}";

$DarkRounded = "{$config['BASE_URL']}/styles/DarkRounded_12345678.css";

$ubbthreads_dark = "{$config['BASE_URL']}/styles/ubbthreads_dark_12345678.css";

if((
$stylesheet == $DarkRounded) || ($stylesheet == $ubbthreads_dark)) {

echo
"<img src="/images/lightlogo.gif" width="280px" height="190px" alt="lightlogo" onclick="location.href='/yourforum/ubbthreads.php'" />";
}
else {
echo
"<img src="/images/logo.gif" width="280px" height="190px" alt="logo" onclick="location.href='/yourforum/ubbthreads.php'" />";
}

?>


HTML
</td>
</tr>
</table>

the details about your stylesheets can be viewed by the 'view source' in your browser.

If you editing/updating your styles, the stylesheets timestamp are changed and you have to add the new timestamp. If you dont want to edit header.php when edit/update styles, you can remove the timestamp from the stylesheets in /admin/doupdatestyle.php:

edit:
PHP Code
$now = time();
$css_name = "{$_POST['style_name']}_{$now}.css";
to:
PHP Code
// remove timestamp
//$now = time();
//$css_name = "{$_POST['style_name']}_{$now}.css";
$css_name = "{$_POST['style_name']}.css";


Be aware that this can cause some mess, if using stylesheets with the same name!


trosfrihed.dk
Custom Ubb 7.5.2
Sponsored Links
Joined: Jan 2000
Posts: 5,835
Likes: 20
UBBDev Owner
Time Lord
UBBDev Owner
Time Lord
Joined: Jan 2000
Posts: 5,835
Likes: 20
It's easier than that...

Just set your image in your stylesheet as an extra class:
Code
.logo {
background: url('full_url');
background-repeat: no-repeat;
}

Then insert a div in your header include:
Code
<div class="logo"></div>


UBBDev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.threads: My UBB Themes, My UBB Scripts
Joined: Oct 2006
Posts: 18
Newbie
Newbie
Joined: Oct 2006
Posts: 18
Hej Gizmo

Thanks for your response. I'll give it a try


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,835
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)