Neuigkeiten:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Hauptmenü
Advertisement:

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

Begonnen von karlbenson, Mai 01, 2008, 08:17:28 NACHMITTAGS

Vorheriges Thema - Nächstes Thema

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

Zitat von: forummaker in Mai 09, 2008, 11:03:34 NACHMITTAGS
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/


Zitat
<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


Phat^Trance

Zitat von: karlbenson in Mai 01, 2008, 08:17:28 NACHMITTAGS
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).

iosys

AAF [nofollow]

Arantor

Holder of controversial views, all of which my own.


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

Advertisement: