php forum
php mysql forum
php mysql smarty
 
Topic Options
#318663 - 11/18/10 11:33 PM Another style and another logo
arentzen Offline
Newbie

Registered: 10/05/06
Posts: 22
Loc: Denmark
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!
_________________________
www.trosfrihed.dk
Custom Ubb 7.5.2

Top
#318664 - 11/19/10 06:00 PM Re: Another style and another logo [Re: arentzen]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
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>
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318665 - 11/19/10 07:33 PM Re: Another style and another logo [Re: Gizmo]
arentzen Offline
Newbie

Registered: 10/05/06
Posts: 22
Loc: Denmark
Hej Gizmo

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

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks