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
Entire Thread
Subject Posted By Posted
Another style and another logo arentzen 11/19/2010 7:33 AM
Re: Another style and another logo Gizmo 11/20/2010 2:00 AM
Re: Another style and another logo arentzen 11/20/2010 3:33 AM

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
isaac
isaac
California
Posts: 1,157
Joined: July 2001
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)