Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: halfflight on May 04, 2012, 11:25:24 PM

Title: News
Post by: halfflight on May 04, 2012, 11:25:24 PM
I have just changed themes from core back to curve. The only thing I miss about core is the News section. I like the fact that it is below the user menu and not stuck over to the right as in curve.

Is there anyway to replicate the news section from core in curve?

I hope that makes sense.

Smudger
Title: Re: News
Post by: TheListener on May 04, 2012, 11:32:23 PM
Is it the Newsfader you mean?

If so Admin > Configuration > Themes and settings > Theme >

Below Theme Options and Preferences look for Show news fader on board index:

Hope this helps.
Title: Re: News
Post by: Sir Osis of Liver on May 04, 2012, 11:35:16 PM
I think he wants to move it.

In index.template.php find this:



// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<h2>', $txt['news'], ': </h2>
<p>', $context['random_news_line'], '</p>';



Move it below this:



// Show the menu here, according to the menu sub template.
template_menu();

echo '
<br class="clear" />




Title: Re: News
Post by: TheListener on May 04, 2012, 11:36:50 PM
Jus t re read and I believe ya right  :-[
Title: Re: News
Post by: halfflight on May 04, 2012, 11:37:53 PM
Thanks guys I did want to move it, sorry for the confusion, I will have a crack at it now after backing up.

Smudger
Title: Re: News
Post by: TheListener on May 04, 2012, 11:39:29 PM
Can ya please mark the topic as solved once ya have sorted it.

:)
Title: Re: News
Post by: halfflight on May 04, 2012, 11:43:39 PM
Will do however when I try to move it I get this error;

Template Parse Error!
There was a problem loading the /Themes/default/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
syntax error, unexpected T_STRING, expecting ',' or ';'
Title: Re: News
Post by: halfflight on May 04, 2012, 11:53:11 PM
I sorted it by putting the code before;

Code: [Select]


   // Show the menu here, according to the menu sub template.
   template_menu();

   echo '
      <br class="clear" />

I do however have a new problem, how do I line it up so the actual news is on the same line. Here is an example og what I have now. I changed "news" to "On This Day"

On This Day:

May 5th, 1918. Italian Ace Sergente Giovanni Nicelli is killed in action.

Can I get it to read;

On This Day: May 5th, 1918. Italian Ace Sergente Giovanni Nicelli is killed in action.

Thanks for your help,

Smudger
Title: Re: News
Post by: Sir Osis of Liver on May 04, 2012, 11:53:26 PM



// Show the menu here, according to the menu sub template.
template_menu();

echo '
<br class="clear" />';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<h2>', $txt['news'], ': </h2>
<p>', $context['random_news_line'], '</p>

</div></div>';

// The main content should go here.



Title: Re: News
Post by: Sir Osis of Liver on May 05, 2012, 12:04:08 AM



<br>&nbsp&nbsp&nbsp<strong>On This Day: </strong>', $context['random_news_line'], '



Title: Re: News
Post by: halfflight on May 05, 2012, 12:06:56 AM
Sorry Crash do I replace;

<h2>', $txt['news'], ': </h2>
            <p>', $context['random_news_line'], '</p>

With the text you suggested.

Sorry I am an old fart trying to get his head around this.

Smudger
Title: Re: News
Post by: Sir Osis of Liver on May 05, 2012, 12:09:41 AM

You're probably not older than me.  (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.thekrashsite.com%2Fpics%2Frolleyes.gif&hash=ca10c185942636e0afc5cc09d07dded9f2b57aed)




// Show the menu here, according to the menu sub template.
template_menu();

echo '
<br class="clear" />';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '

<br>&nbsp&nbsp&nbsp<strong>On This Day: </strong>', $context['random_news_line'], '


</div></div>';

// The main content should go here.



Title: Re: News
Post by: TheListener on May 05, 2012, 12:11:17 AM
Oi you two .

/me is 39.
Title: Re: News
Post by: ApplianceJunk on May 05, 2012, 12:11:53 AM
Just trying to follow along too and trying it myself on a test forum.

What's with the &nbsp&nbsp&nbsp
Title: Re: News
Post by: halfflight on May 05, 2012, 12:15:36 AM
Quote from: Old Fossil on May 05, 2012, 12:11:17 AM
Oi you two .

/me is 39.

Smudger is 50++ you youngster
Title: Re: News
Post by: Sir Osis of Liver on May 05, 2012, 12:17:03 AM
Just a quickie left margin.

(Krash = 62 (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.thekrashsite.com%2Fpics%2Fbor.gif&hash=cba0817857a10dc1cd975d2b49a33ba2fc822800))

Title: Re: News
Post by: halfflight on May 05, 2012, 12:23:34 AM
Thanks mate that did the trick. You win the old fart stakes!!!

Smudger
Title: Re: News
Post by: Sir Osis of Liver on May 05, 2012, 12:30:45 AM
Quote from: halfflight on May 05, 2012, 12:23:34 AM
You win the old fart stakes!!!

<sigh>

Title: Re: News
Post by: halfflight on May 05, 2012, 01:09:24 AM
 Sorry there is just one cosmetic problem. I placed the On This Day above the menu but I have a rather large gap now between Login and the On This Day. Is there anyway I can close the gap, I have removed avatars from the welcome area. I would also like to have a space between the On This Day and the Menu.

Here is a link to the site to help you understand my ramblings;

http://www.greatwaraviation.com/forum/index.php

Smudger
Title: Re: News
Post by: Colin on May 05, 2012, 01:19:43 AM
Quote from: ApplianceJunk on May 05, 2012, 12:11:53 AM
Just trying to follow along too and trying it myself on a test forum.

What's with the &nbsp&nbsp&nbsp
&nbsp = Space in HTML
Title: Re: News
Post by: halfflight on May 05, 2012, 01:24:15 AM
They are there for a left margin, If I remove them it doesn't change the gap only buggers up the alignment.

Thanks for the help though.

Smudger
Title: Re: News
Post by: Sir Osis of Liver on May 05, 2012, 11:39:50 PM

Ok, here's a better way to do it using inline CSS -



/// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '

<div style="margin: 20px 0 20px 10px;"><span style="font-weight: bold;">On This Day:  </span>', $context['random_news_line'],'</div>

</div></div>';



The margins in margin: are top, right, bottom, left.