Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: SaltedWeb - kesäkuu 14, 2014, 11:12:54 AP

Otsikko: Remove top right arrow forum collapse .
Kirjoitti: SaltedWeb - kesäkuu 14, 2014, 11:12:54 AP
 
Is there a way to Remove the top right arrow forum collapse ?
Like the one in this forum top upper right?

I want the whole area to show but remove the option to shrink it?

Did a search but didn't find anything on it.

Thanks. ;D
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: Matthew K. - kesäkuu 14, 2014, 11:29:20 AP
Sure, it's possible. Attach your themes index.template.php.
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: kat - kesäkuu 14, 2014, 11:30:37 AP
NINJAD! Still, I'll post, anyway... :P

This works with the default SMF theme...

In index.template.php, find this:

echo '
<img id="upshrink" src="', $settings['images_url'], '/upshrink.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />';


(They're the two lines after:    // the upshrink image, right-floated)

And replace that with this:

// echo '
// <img id="upshrink" src="', $settings['images_url'], '/upshrink.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />';


That comments those lines out, so you can put them back, if required. ;)
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: Matthew K. - kesäkuu 14, 2014, 11:34:06 AP
There's also a JavaScript object that is used that could be removed then too...
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: SaltedWeb - kesäkuu 14, 2014, 11:39:07 AP
Lainaus käyttäjältä: K@ - kesäkuu 14, 2014, 11:30:37 AP
NINJAD! Still, I'll post, anyway... :P

This works with the default SMF theme...

In index.template.php, find this:

echo '
<img id="upshrink" src="', $settings['images_url'], '/upshrink.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />';


(They're the two lines after:    // the upshrink image, right-floated)

And replace that with this:

// echo '
// <img id="upshrink" src="', $settings['images_url'], '/upshrink.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />';


That comments those lines out, so you can put them back, if required. ;)

That was the ticket , thank you very much, worked on my modded theme perfectly.  :-)

Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: kat - kesäkuu 14, 2014, 11:42:29 AP
WoOt! :)

Dunno the js bit, Lab. But, job done, so all's good. :)
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: Antes - kesäkuu 14, 2014, 11:55:16 AP
// Define the upper_section toggle in JavaScript.
echo '
<script type="text/javascript"><!-- // --><![CDATA[
var oMainHeaderToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', empty($options['collapse_header']) ? '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'] ? 'false' : 'true', ',
sOptionName: \'collapse_header\',
sSessionVar: ', JavaScriptEscape($context['session_var']), ',
sSessionId: ', JavaScriptEscape($context['session_id']), '
},
oCookieOptions: {
bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
sCookieName: \'upshrink\'
}
});
// ]]></script>';


that's the JS object, comment it out :)
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: kat - kesäkuu 14, 2014, 12:01:36 IP
Ta! I don't think it'll hurt, if he leaves that there, though, does it?
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: Matthew K. - kesäkuu 14, 2014, 12:02:58 IP
No, it won't hurt. If he had attached the file, I would've removed the JS though as well.
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: SaltedWeb - kesäkuu 14, 2014, 12:04:32 IP
I'm not seeing any issues , appears to be working fine .  Thanks again.
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: Antes - kesäkuu 14, 2014, 12:15:15 IP
Yeap it won't hurt but commenting (disabling) unused code shrink size of php gives small performance.
Otsikko: Re: Remove top right arrow forum collapse .
Kirjoitti: Matthew K. - kesäkuu 14, 2014, 12:23:54 IP
Yep. Antes is right. Although you would never notice a difference in performance. It's more being thorough than anything.