Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: saw - syyskuu 15, 2011, 04:13:20 AP

Otsikko: Shrunk header & info center as default for guests
Kirjoitti: saw - syyskuu 15, 2011, 04:13:20 AP
As per subject heading. How do I do this? 2.0, using Curve (multi-color, if that matters).
Otsikko: Re: Shrunk header & info center as default for guests
Kirjoitti: Ricky. - syyskuu 15, 2011, 04:23:27 AP
Shrunk is not descriptive as we need, how much exactly you want to shrink it ?
Or like you want to give lesser info to guest ?

Some example as per your requirements would be good !
Otsikko: Re: Shrunk header & info center as default for guests
Kirjoitti: saw - syyskuu 15, 2011, 04:43:09 AP
Sorry, I meant shrunk as in unexpanded, or what happens when you toggle that little switch to the right (down or up arrow for the banner area, + or - button for the info center).
Otsikko: Re: Shrunk header & info center as default for guests
Kirjoitti: Ricky. - syyskuu 15, 2011, 07:44:37 AP
Never done before but looks like you can look for following in index.template.php
<script type="text/javascript"><!-- // --><![CDATA[
var oMainHeaderToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: false,
aSwappableContainers: [
'upper_section'
],
aSwapImages: [
{
sId: 'upshrink',
srcExpanded: smf_images_url + '/upshrink.png',
altExpanded: 'Shrink or expand the header.',
srcCollapsed: smf_images_url + '/upshrink2.png',
altCollapsed: 'Shrink or expand the header.'
}
],
oThemeOptions: {
bUseThemeSettings: true,
sOptionName: 'collapse_header',
sSessionVar: 'a2d3f9b4c',
sSessionId: '8aa67bc71f76b09e5801b11c493a27c7'
},
oCookieOptions: {
bUseCookie: false,
sCookieName: 'upshrink'
}
});
// ]]></script>


For guest , you can I think can change             bCurrentlyCollapsed: false, to true.

I am not good in Javascript, I give you little idea, may be someone else can help you precisely but hopefully now you know what you need to look !
Also, for every section, there is separate such javascript code,so whatever section you want to be shrink by default for guest, you have to modify each accordingly.
Otsikko: Re: Shrunk header & info center as default for guests
Kirjoitti: saw - syyskuu 15, 2011, 07:56:02 AP
Thanks for your reply. Unfortunately I'm not a coder at all!

What I see doesn't look quite like that. It's looks like this:

<script type="text/javascript"><!-- // --><![CDATA[
var oMainHeaderToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', empty($options['collapse_header']) ? 'false' : 'true', ',
aSwappableContainers: [
\'user_section\',
\'news_section\'
],
Otsikko: Re: Shrunk header & info center as default for guests
Kirjoitti: Hj Ahmad Rasyid Hj Ismail - syyskuu 16, 2011, 05:35:58 AP
Lainaus käyttäjältä: saw - syyskuu 15, 2011, 07:56:02 AP
Thanks for your reply. Unfortunately I'm not a coder at all!

What I see doesn't look quite like that. It's looks like this:

<script type="text/javascript"><!-- // --><![CDATA[
var oMainHeaderToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', empty($options['collapse_header']) ? 'false' : 'true', ',
aSwappableContainers: [
\'user_section\',
\'news_section\'
],

That is the right one and it is in BoardIndex.template.php. Try change it to 'true' : 'false'
Otsikko: Re: Shrunk header & info center as default for guests
Kirjoitti: Ricky. - syyskuu 16, 2011, 07:02:46 AP
I had copied it from here SMF itself :P
Otsikko: Re: Shrunk header & info center as default for guests
Kirjoitti: Hj Ahmad Rasyid Hj Ismail - syyskuu 16, 2011, 08:20:06 AP
I am not sure what you mean Ricky but the one that need to be changed is in the BoardIndex.template.php and not in index.template.php. My suggestion is not tested though.