Advertisement:

Author Topic: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members  (Read 42953 times)

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
For Guests
Themes/Default/index.template.php
FIND
      
Code: [Select]
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
      REPLACE
      
Code: [Select]
$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
Code: [Select]
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
ADD BEFORE
Code: [Select]
$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 ;
« Last Edit: May 02, 2008, 10:51:09 AM by karlbenson »

Offline mynewusername

  • Semi-Newbie
  • *
  • Posts: 58
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 ?

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
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.

Offline forummaker

  • Semi-Newbie
  • *
  • Posts: 95
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

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Any javascript errors?  Those could prevent it working properly.

Offline forummaker

  • Semi-Newbie
  • *
  • Posts: 95
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.

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
yes, that would probably be a javascript error.

Offline forummaker

  • Semi-Newbie
  • *
  • Posts: 95
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.

Offline Sarge

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,209
  • Gender: Male
    • Zëri YT!
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

Offline gianko82

  • Semi-Newbie
  • *
  • Posts: 58
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #9 on: August 31, 2008, 11:44:41 AM »
this is what I found about the info center:
Code: [Select]
// 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
Code: [Select]
      $options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);

Offline H

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,660
  • Gender: Male
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #10 on: October 05, 2008, 02:25:36 PM »
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)
                             

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #11 on: October 05, 2008, 02:28:50 PM »
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).

Offline Phat^Trance

  • Full Member
  • ***
  • Posts: 522
    • Daily Mobile
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #12 on: December 22, 2008, 11:17:16 AM »
For Guests
Themes/Default/index.template.php
FIND
      
Code: [Select]
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
      REPLACE
      
Code: [Select]
$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
Code: [Select]
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
ADD BEFORE
Code: [Select]
$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/

Offline Phat^Trance

  • Full Member
  • ***
  • Posts: 522
    • Daily Mobile
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #13 on: December 26, 2008, 04:10:00 PM »
anyone?
Daily Mobile Blog:  http://dailymobile.se/
Daily iPhone Blog: http://dailyiphoneblog.com/
Daily Mobile forum: http://forum.dailymobile.se/

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #14 on: February 03, 2009, 08:51:43 PM »
Phat^Trance, did you try just using the following instead:

Code: [Select]
   $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).

Offline iosys

  • Semi-Newbie
  • *
  • Posts: 20
    • AAF
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #15 on: October 07, 2009, 01:54:19 AM »
worked for me, thanks!
AAF [nofollow]

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,065
    • Arantor on GitHub
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #16 on: October 11, 2009, 05:47:06 AM »
This should also likely work in 1.1.10, for those concerned.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Scratching my Head

  • Jr. Member
  • **
  • Posts: 172
  • Yes. I see. Thanks.
Any work-around for 2.0 RC3?

Offline MiY4Gi

  • Full Member
  • ***
  • Posts: 523
  • Gender: Male
  • Mm...
    • MyAnimeClub.net
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #18 on: August 06, 2011, 08:51:06 PM »
I can't find the necessary code. I'm using 2.0 Gold. Help?
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.

Offline Mr_JimWest

  • Semi-Newbie
  • *
  • Posts: 71
  • Gender: Male
  • http://jw-renders.com
    • JW-Renders
Re: SMF 1.1.5 Collapse Header & InfoCenter By Default For Guests & Members
« Reply #19 on: September 21, 2011, 06:43:15 PM »
Same here, actually I am just trying to find the files that the code of Info Center is in...  :o