Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: laurieluvsliason on November 19, 2020, 04:30:51 PM

Title: News Collapsible Button
Post by: laurieluvsliason on November 19, 2020, 04:30:51 PM

I understand there is no option in SMF to control the collapsibility of the news fader? How then do I make it collapsible? Is it in the board templates? Oh and while we are it, can we take out the word NEWS as well? I find it totally redundant!

Thanks for any info!
Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 19, 2020, 04:59:47 PM
Why would you want to do that?  News fader is in BoardIndex.template.php, good luck making it collapsible.  $txt['news'] = 'News'; is in index.english.php.
Title: Re: News Collapsible Button
Post by: laurieluvsliason on November 19, 2020, 05:23:04 PM

No, I want to make it so that it CAN'T be collapsed. It already is collapsible. Sorry if I worded it wrong.  I have a feeling too many members are collapsing it and aren't reading it. Also, I want to take the word NEWS off the top. Can you tell me exactly how to do it, please?
Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 19, 2020, 05:34:07 PM
You can remove the upshrink button here -

BoardIndex.template.php



// Show the news fader?  (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<div id="newsfader">
<div class="cat_bar">
<h3 class="catbg">
<!--img id="newsupshrink" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" /-->
', $txt['news'], '
</h3>
</div>



Just comment it out as shown.

The News label is in index.english.php, change it to this -



$txt['news'] = '';



Title: Re: News Collapsible Button
Post by: laurieluvsliason on November 19, 2020, 05:53:51 PM


Ok, I changed it & got this

QuoteThe file you tried to save generated the following error:
Parse error: syntax error, unexpected '<' in BoardIndex.template.php on line 23

Here is the whole script, maybe you can see what is wrong:

   // Show the news fader?  (assuming there are things to show...)
   if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
   {
      echo '
   <div id="newsfader">
      <div class="cat_bar">
         <h3 class="catbg">
            <img id="newsupshrink" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" />
            ', $txt['news'] = '';
         </h3>
      </div>
      <ul class="reset" id="smfFadeScroller"', empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>';

         foreach ($context['news_lines'] as $news)
            echo '
         <li>', $news, '</li>';

Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 19, 2020, 06:33:23 PM
You just have to comment out one line -



<!--img id="newsupshrink" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" /-->



Start with a clean file, you did something wrong at the top of the file.
Title: Re: News Collapsible Button
Post by: laurieluvsliason on November 19, 2020, 06:39:59 PM
EEEk not sure what you mean. Was hoping you would just reprint the whole code for me with the errors fixed, so I can delete what's there and put it in properly? Please & thank you so much!
Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 19, 2020, 06:41:24 PM
Line 23 is nowhere near the target code.  Did you backup the file before you messed with it?
Title: Re: News Collapsible Button
Post by: laurieluvsliason on November 19, 2020, 06:48:26 PM


No. I was hoping you would give me the correct code so I could copy & paste it in and get rid of what's there...
Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 19, 2020, 06:53:15 PM
I gave you the correct code, you didn't apply it correctly.  Those who live in hope and don't do backups will die in despair.

Attach your BoardIndex.template.php, but do it quickly.  Going offline in a few minutes.
Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 19, 2020, 06:58:51 PM
No, don't post the code, attach the file.
Title: Re: News Collapsible Button
Post by: laurieluvsliason on November 19, 2020, 07:13:26 PM
My co-admin keeps the files and she is very sick right now. Don't want to bother her with this right now. Guess we can't fix it today. I was so hoping to surprise her with making this right myself...is this what yu are looking for?
Title: Re: News Collapsible Button
Post by: laurieluvsliason on November 20, 2020, 09:49:08 AM


So I am a newby at this stuff, have no idea what I am doing and apparently, I can't get a simple answer from simple machines about taking the collapsible button and word news out of the template code without hours and hours of run around files and being made to feel belittled and even more stupid than what I felt, to begin with. So much for it being simple to make my forum appear the way I want it to. I understand you guys are the experts.

Thanks, SMF for this particular brand of 'help'. If you can correct the code for me, I would be appreciative, if not I guess I will live with it. Sorry to trouble you.
Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 20, 2020, 11:46:50 AM
Hmm, no one picked up the ball on this after I got off last night, sorry about that.  You're asking for a simple modification that requires code edits, I incorrectly assumed you know enough to do it and have the necessary access.  I can do it for you if you can download and attach the file.  Let's have a look at the forum so we can see what you're running.  Link?
Title: Re: News Collapsible Button
Post by: laurieluvsliason on November 20, 2020, 12:33:28 PM

Ok thanks so much, I have emailed my co admin about the file and she should be posting the correct file here shortly as I have to head off to work. Yes just a code to get rid of the NEWS and collapsible button at the top, thanks!

The site is Liasonits Gathering. Online   main index page : https://www.liasonitesgathering.online/Forum/index.php (https://www.liasonitesgathering.online/Forum/index.php)

ribbon theme modified off the curve theme  2.0
Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 20, 2020, 12:51:14 PM
The file I need is /Themes/rIBBON1/BoardIndex.template.php.  The News label is in /Themes/default/languages/index.english.php, or I can just remove it from the template.  Going offline, will be on a while tonight (EST).
Title: Re: News Collapsible Button
Post by: Kindred on November 20, 2020, 12:54:12 PM
The code you posted above has a clearly missing comma and single quote to get back into the html of the echo...


If that code is your edit, it explains why its failing.

I'll show the correct edit when I get to a real machine rather than my mobile
Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 20, 2020, 01:11:30 PM
Yes, here -



            ', $txt['news'] = '';
         </h3>



Didn't see that last night (can only see code with one eye now, and poorly after couple hours).  Will do the mod when I have the file, believe I also have to fix it so members who have News collapsed will see it uncollapsed.
Title: Re: News Collapsible Button
Post by: slizzie1986 on November 20, 2020, 01:25:29 PM
Thanks so much. Here is the board index template file. 
Title: Re: News Collapsible Button
Post by: Kindred on November 20, 2020, 02:31:17 PM
try this
Title: Re: News Collapsible Button
Post by: Sir Osis of Liver on November 20, 2020, 09:34:38 PM
That works, removes upshrink button and forces uncollapse.  Thanks, Kindred.
Title: Re: News Collapsible Button
Post by: laurieluvsliason on November 21, 2020, 12:59:49 AM

Ok thanks. Works like a charm!---Beautiful. This has made my day. Thank you both so much! @SirOsisOfLiver & @Kindred