News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members

Started by karlbenson, May 01, 2008, 08:17:28 PM

Previous topic - Next topic

karlbenson

For Guests
Themes/Default/index.template.php
FIND
       $options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);

      REPLACE
       $options['collapse_header'] = isset($_COOKIE['upshrink']) ? (int) $_COOKIE['upshrink'] : 1 ;
$options['collapse_header_ic'] = isset($_COOKIE['upshrinkIC']) ? (int) $_COOKIE['upshrinkIC'] : 1 ;


For Members
Themes/Default/index.template.php
FIND
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

ADD BEFORE
$options['collapse_header'] = isset($options['collapse_header']) ? $options['collapse_header'] : true ;
$options['collapse_header_ic'] = isset($options['collapse_header_ic']) ? $options['collapse_header_ic'] : true ;

mynewusername

Hi,

I cant seem to find:

$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']); in the Themes/Default/index.template.php

This is on 1.1.5 should it be the same as 1.1.4 ?

karlbenson

HMMMM.
It looks like collapsing the info center is in SMF 1.1.5 only.
1.1.4 uses a different method.
I have posted it for 2.x on the bug tracker.

If your on 1.1.4 you won't have the info center line.

forummaker

Question for ya. I can't get my collapse button to work at all as a member, but guests can collapse it. With the problem I'm already having, I don't dare change anything. Maybe you can shed some light on my problem? Thanks.
http://www.remedydog.com

karlbenson

Any javascript errors?  Those could prevent it working properly.

forummaker

I think the "ROG mod" changed something that effected the java script. Do you think that would also explain my problem with my "register" button not working for members to click when registering? I currently have the "agree to rules" turned of in the admin panel to allow members to register. If I enable "agree to rules" in the admin panel, the "register" button does not work. Suggestions? Thanks.

karlbenson


forummaker

I looked everywhere and tried everything to remove the "ROG" mod, I really think that was the cause of the problems. I just reinstalled smf. Everything is great, life is good. Thanks for the code change/mod.

Sarge

Quote from: forummaker on May 09, 2008, 11:03:34 PM
I looked everywhere and tried everything to remove the "ROG" mod, I really think that was the cause of the problems. I just reinstalled smf. Everything is great, life is good. Thanks for the code change/mod.

The "Rant on Guests" is known to cause Javascript issues. That's probably the reason why the mod has been removed from the Mod Site.

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

gianko82

this is what I found about the info center:
// the routine for the info center upshrink

echo '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';



function shrinkHeaderIC(mode)

{';



if ($context['user']['is_guest'])

echo '

document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';

else

echo '

smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';



echo '

document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");



document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";



current_header_ic = mode;

}

// ]]></script>


I want to make the Info Center collapsed by default for guests.
I have smf 1.1.5
What I have to edit? I can't find       $options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);

H

Sorry for the late response.

Do you still need assistance with this?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Deprecated

Quote from: gianko82 on August 31, 2008, 11:44:41 AM
I want to make the Info Center collapsed by default for guests.
I have smf 1.1.5

Perhaps you want to Hide Info Center From Your Guests (modification package).

Phat^Trance

Quote from: karlbenson on May 01, 2008, 08:17:28 PM
For Guests
Themes/Default/index.template.php
FIND
       $options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);

      REPLACE
       $options['collapse_header'] = isset($_COOKIE['upshrink']) ? (int) $_COOKIE['upshrink'] : 1 ;
$options['collapse_header_ic'] = isset($_COOKIE['upshrinkIC']) ? (int) $_COOKIE['upshrinkIC'] : 1 ;


For Members
Themes/Default/index.template.php
FIND
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

ADD BEFORE
$options['collapse_header'] = isset($options['collapse_header']) ? $options['collapse_header'] : true ;
$options['collapse_header_ic'] = isset($options['collapse_header_ic']) ? $options['collapse_header_ic'] : true ;




that worked GREAT! BUT is it possible to just hide the TOP section (above the board)? but still show the button section like the stats?
Daily Mobile Blog:  http://dailymobile.se/
Daily iPhone Blog: http://dailyiphoneblog.com/
Daily Mobile forum: http://forum.dailymobile.se/


greyknight17

Phat^Trance, did you try just using the following instead:

   $options['collapse_header'] = isset($options['collapse_header']) ? $options['collapse_header'] : true ;

Just use the first line of code instead of both (which includes both the top and bottom).


Arantor


Scratching my Head


MiY4Gi

Check out my new website, MyAnimeClub.net. I plan to create the largest anime community, and most fun and user-friendly anime forum in the world. It's still in the development stage though.

Mr_JimWest

Same here, actually I am just trying to find the files that the code of Info Center is in...  :o

biggbigg

For 2.02 you can simply change  the 'false'    'true'   options to be both  'true'     'true'   Bolded them below in the code.



<script type="text/javascript"><!-- // --><![CDATA[
var oMainHeaderToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', empty($options['collapse_header']) ? 'true' : 'true', ',                                    <-  TRUE TRUE HERE INSTEAD OF FALSE TRUE
aSwappableContainers: [
\'upper_section\'
],
aSwapImages: [
{
sId: \'upshrink\',
srcExpanded: smf_images_url + \'/upshrink.png\',
altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
srcCollapsed: smf_images_url + \'/upshrink2.png\',
altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
}
],
oThemeOptions: {
bUseThemeSettings: ', $context['user']['is_guest'] ? 'true' : 'true', ',                                          <-       <-  TRUE TRUE HERE INSTEAD OF FALSE TRUE
sOptionName: \'collapse_header\',
sSessionVar: ', JavaScriptEscape($context['session_var']), ',
sSessionId: ', JavaScriptEscape($context['session_id']), '
},







Realinfo

in 2.0.7

I want default "Shrink header for Guests" while "Expand Header for members"

Please guide

Kindred

1- do not double post - you resurrected this ancient thread AND posted in support.
2- Given that you have removed the SMF copyright (which is legally allowed) we basically have chosen to not provide support to such sites - since, by removing the copyright, you have essentially stated that you do not need support from us.

(and you have removed the simple portal copyright - which is typically NOT allowed)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: